blob: 01f04beb55aac9d7259c88ee33746ba2be275b92 [file] [log] [blame]
Nishanth Menonbe5a99d2023-08-25 13:03:05 -05001.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2.. sectionauthor:: Nishanth Menon <nm@ti.com>
3
4AM62x Beagleboard.org Beagleplay
5================================
6
7Introduction:
8-------------
9
10BeagleBoard.org BeaglePlay is an easy to use, affordable open source
11hardware single board computer based on the Texas Instruments AM625
12SoC that allows you to create connected devices that work even at long
13distances using IEEE 802.15.4g LR-WPAN and IEEE 802.3cg 10Base-T1L.
14Expansion is provided over open standards based mikroBUS, Grove and
15QWIIC headers among other interfaces.
16
17Further information can be found at:
18
19* Product Page: https://beagleplay.org/
20* Hardware documentation: https://git.beagleboard.org/beagleplay/beagleplay
21
22Boot Flow:
23----------
24Below is the pictorial representation of boot flow:
25
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050026.. image:: ../ti/img/boot_diagram_k3_current.svg
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050027 :alt: Boot flow diagram
28
29- On this platform, 'TI Foundational Security' (TIFS) functions as the
30 security enclave master while 'Device Manager' (DM), also known as the
31 'TISCI server' in "TI terminology", offers all the essential services.
32 The A53 or M4F (Aux core) sends requests to TIFS/DM to accomplish these
33 services, as illustrated in the diagram above.
34
35Sources:
36--------
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050037.. include:: ../ti/k3.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050038 :start-after: .. k3_rst_include_start_boot_sources
39 :end-before: .. k3_rst_include_end_boot_sources
40
41Build procedure:
42----------------
430. Setup the environment variables:
44
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050045.. include:: ../ti/k3.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050046 :start-after: .. k3_rst_include_start_common_env_vars_desc
47 :end-before: .. k3_rst_include_end_common_env_vars_desc
48
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050049.. include:: ../ti/k3.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050050 :start-after: .. k3_rst_include_start_board_env_vars_desc
51 :end-before: .. k3_rst_include_end_board_env_vars_desc
52
53Set the variables corresponding to this platform:
54
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050055.. include:: ../ti/k3.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050056 :start-after: .. k3_rst_include_start_common_env_vars_defn
57 :end-before: .. k3_rst_include_end_common_env_vars_defn
Nishanth Menonfdd7cb72023-11-02 23:40:26 -050058.. prompt:: bash $
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050059
Nishanth Menon3a64e932023-11-04 03:01:34 -050060 export UBOOT_CFG_CORTEXR=am62x_beagleplay_r5_defconfig
61 export UBOOT_CFG_CORTEXA=am62x_beagleplay_a53_defconfig
Nishanth Menonfdd7cb72023-11-02 23:40:26 -050062 export TFA_BOARD=lite
63 # we dont use any extra TFA parameters
64 unset TFA_EXTRA_ARGS
65 export OPTEE_PLATFORM=k3-am62x
66 export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050067
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050068.. include:: ../ti/am62x_sk.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050069 :start-after: .. am62x_evm_rst_include_start_build_steps
70 :end-before: .. am62x_evm_rst_include_end_build_steps
71
72Target Images
Heinrich Schuchardtb72160b2023-10-28 11:59:32 +020073-------------
Dhruva Golecf630f12024-06-18 10:19:46 +053074Copy these images to an SD card and boot:
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050075
Dhruva Golecf630f12024-06-18 10:19:46 +053076* tiboot3.bin from Cortex-R5 build.
77* tispl.bin and u-boot.img from Cortex-A build
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050078
79Image formats
80-------------
81
82- tiboot3.bin
83
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050084.. image:: ../ti/img/multi_cert_tiboot3.bin.svg
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050085 :alt: tiboot3.bin image format
86
87- tispl.bin
88
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050089.. image:: ../ti/img/dm_tispl.bin.svg
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050090 :alt: tispl.bin image format
91
92Additional hardware for U-Boot development
93------------------------------------------
94
95* Serial Console is critical for U-Boot development on BeaglePlay. See
96 `BeaglePlay serial console documentation
97 <https://docs.beagleboard.org/latest/boards/beagleplay/demos-and-tutorials/using-serial-console.html>`_.
98* uSD is preferred option over eMMC, and a SD/MMC reader will be needed.
99* (optionally) JTAG is useful when working with very early stages of boot.
100
101Default storage options
102-----------------------
103
104There are multiple storage media options on BeaglePlay, but primarily:
105
106* Onboard eMMC (default) - reliable, fast and meant for deployment use.
107* SD/MMC card interface (hold 'USR' switch and power on) - Entirely
108 depends on the SD card quality.
109
110Flash to uSD card or how to deal with "bricked" Board
Heinrich Schuchardtb72160b2023-10-28 11:59:32 +0200111-----------------------------------------------------
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500112
113When deploying or working on Linux, it's common to use the onboard
114eMMC. However, avoiding the eMMC and using the uSD card is safer when
115working with U-Boot.
116
117If you choose to hand format your own bootable uSD card, be
118aware that it can be difficult. The following information
119may be helpful, but remember that it is only sometimes
120reliable, and partition options can cause issues. These
121can potentially help:
122
123* https://git.ti.com/cgit/arago-project/tisdk-setup-scripts/tree/create-sdcard.sh
124* https://elinux.org/Beagleboard:Expanding_File_System_Partition_On_A_microSD
125
126The simplest option is to start with a standard distribution
127image like those in `BeagleBoard.org Distros Page
128<https://www.beagleboard.org/distros>`_ and download a disk image for
129BeaglePlay. Pick a 16GB+ uSD card to be on the safer side.
130
131With an SD/MMC Card reader and `Balena Etcher
132<https://etcher.balena.io/>`_, having a functional setup in minutes is
133a trivial matter, and it works on almost all Host Operating Systems.
134Yes Windows users, Windows Subsystem for Linux(WSL) based development
135with U-Boot and update uSD card is practical.
136
137Updating U-Boot is a matter of copying the tiboot3.bin, tispl.bin and
138u-boot.img to the "BOOT" partition of the uSD card. Remember to sync
139and unmount (or Eject - depending on the Operating System) the uSD
140card prior to physically removing from SD card reader.
141
142Also see following section on switch setting used for booting using
143uSD card.
144
145.. note::
146 Great news! If the board has not been damaged physically, there's no
147 need to worry about it being "bricked" on this platform. You only have
148 to flash an uSD card, plug it in, and reinstall the image on eMMC. This
149 means that even if you make a mistake, you can quickly fix it and rest
150 easy.
151
152 If you are frequently working with uSD cards, you might find the
153 following useful:
154
155 * `USB-SD-Mux <https://www.linux-automation.com/en/products/usb-sd-mux.html>`_
156 * `SD-Wire <https://wiki.tizen.org/SDWire>`_
157
158Flash to eMMC
159-------------
160
161The eMMC layout selected is user-friendly for developers. The
162boot hardware partition of the eMMC only contains the fixed-size
163tiboot3.bin image. This is because the contents of the boot partitions
164need to run from the SoC's internal SRAM, which remains a fixed size
165constant. The other components of the boot sequence, such as tispl.bin
166and u-boot.img, are located in the /BOOT partition in the User Defined
167Area (UDA) hardware partition of the eMMC. These components can vary
168significantly in size. The choice of keeping tiboot3.bin in boot0 or
169boot1 partition depends on A/B update requirements.
170
171.. image:: img/beagleplay_emmc.svg
172 :alt: eMMC partitions and boot file organization for BeaglePlay
173
174The following are the steps from Linux shell to program eMMC:
175
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500176.. prompt:: bash #
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500177
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500178 # Enable Boot0 boot
179 mmc bootpart enable 1 2 /dev/mmcblk0
180 mmc bootbus set single_backward x1 x8 /dev/mmcblk0
181 mmc hwreset enable /dev/mmcblk0
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500182
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500183 # Clear eMMC boot0
184 echo '0' >> /sys/class/block/mmcblk0boot0/force_ro
185 dd if=/dev/zero of=/dev/mmcblk0boot0 count=32 bs=128k
186 # Write tiboot3.bin
187 dd if=tiboot3.bin of=/dev/mmcblk0boot0 bs=128k
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500188
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500189 # Copy the rest of the boot binaries
190 mount /dev/mmcblk0p1 /boot/firmware
191 cp tispl.bin /boot/firmware
192 cp u-boot.img /boot/firmware
193 sync
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500194
195.. warning ::
196
197 U-Boot is configured to prioritize booting from an SD card if it
198 detects a valid boot partition and boot files on it, even if the
199 system initially booted from eMMC. The boot order is set as follows:
200
201 * SD/MMC
202 * eMMC
203 * USB
204 * PXE
205
206LED patterns during boot
207------------------------
208
209.. list-table:: USR LED status indication
210 :widths: 16 16
211 :header-rows: 1
212
213 * - USR LEDs (012345)
214 - Indicates
215
216 * - 00000
217 - Boot failure or R5 image not started up
218
219 * - 11111
220 - A53 SPL/U-boot has started up
221
222 * - 10101
223 - OS boot process has been initiated
224
225 * - 01010
226 - OS boot process failed and drops to U-Boot shell
227
228.. note ::
229
230 In the table above, 0 indicates LED switched off and 1 indicates LED
231 switched ON.
232
233.. warning ::
234
235 If the "red" power LED is not glowing, the system power supply is not
236 functional. Please refer to `BeaglePlay documentation
237 <https://beagleplay.org/>`_ for further information.
238
239A53 SPL DDR Memory Layout
240-------------------------
241
Nishanth Menon1f2b6f92023-11-04 03:01:36 -0500242.. include:: ../ti/am62x_sk.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500243 :start-after: .. am62x_evm_rst_include_start_ddr_mem_layout
244 :end-before: .. am62x_evm_rst_include_end_ddr_mem_layout
245
246Switch Setting for Boot Mode
247----------------------------
248
249The boot time option is configured via "USR" button on the board.
250See `Beagleplay Schematics <https://git.beagleboard.org/beagleplay/beagleplay/-/blob/main/BeaglePlay_sch.pdf>`_
251for details.
252
253.. list-table:: Boot Modes
254 :widths: 16 16 16
255 :header-rows: 1
256
257 * - USR Switch Position
258 - Primary Boot
259 - Secondary Boot
260
261 * - Not Pressed
262 - eMMC
263 - UART
264
265 * - Pressed
266 - SD/MMC File System (FS) mode
267 - USB Device Firmware Upgrade (DFU) mode
268
269To switch to SD card boot mode, hold the USR button while powering on
Sjoerd Simonse71fea32024-05-06 15:38:46 +0100270with a USB type C power supply, then release when power LED lights up.
271
272DFU based boot
273--------------
274
275To boot the board over DFU, ensure there is no SD card inserted with a
276bootloader. Hold the USR switch while plugging into the type C to boot into DFU
277mode. After power-on the build artifacts needs to be uploaded one by one with a
278tool like dfu-util.
279
280.. include:: ../ti/am62x_sk.rst
281 :start-after: .. am62x_evm_rst_include_start_dfu_boot
282 :end-before: .. am62x_evm_rst_include_end_dfu_boot
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500283
284Debugging U-Boot
285----------------
286
287See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
288detailed setup and debugging information.
289
290.. warning::
291
292 **OpenOCD support since**: v0.12.0
293
294 If the default package version of OpenOCD in your development
295 environment's distribution needs to be updated, it might be necessary to
296 build OpenOCD from the source.
297
Nishanth Menon1f2b6f92023-11-04 03:01:36 -0500298.. include:: ../ti/k3.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500299 :start-after: .. k3_rst_include_start_openocd_connect_tag_connect
300 :end-before: .. k3_rst_include_end_openocd_connect_tag_connect
301
Nishanth Menon1f2b6f92023-11-04 03:01:36 -0500302.. include:: ../ti/k3.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500303 :start-after: .. k3_rst_include_start_openocd_cfg_external_intro
304 :end-before: .. k3_rst_include_end_openocd_cfg_external_intro
305
306For example, with BeaglePlay (AM62X platform), the openocd_connect.cfg:
307
308.. code-block:: tcl
309
310 # TUMPA example:
311 # http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User's_Manual
312 source [find interface/ftdi/tumpa.cfg]
313
314 transport select jtag
315
316 # default JTAG configuration has only SRST and no TRST
317 reset_config srst_only srst_push_pull
318
319 # delay after SRST goes inactive
320 adapter srst delay 20
321
322 if { ![info exists SOC] } {
323 # Set the SoC of interest
324 set SOC am625
325 }
326
327 source [find target/ti_k3.cfg]
328
329 ftdi tdo_sample_edge falling
330
331 # Speeds for FT2232H are in multiples of 2, and 32MHz is tops
332 # max speed we seem to achieve is ~20MHz.. so we pick 16MHz
333 adapter speed 16000