blob: cdc610264e151e114d375e4fd60d137754e73249 [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-------------
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050074Copy the below images to an SD card and boot:
75
76* tiboot3-am62x-gp-evm.bin from R5 build as tiboot3.bin
77* tispl.bin_unsigned from Cortex-A build as tispl.bin
78* u-boot.img_unsigned from Cortex-A build as u-boot.img
79
80Image formats
81-------------
82
83- tiboot3.bin
84
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050085.. image:: ../ti/img/multi_cert_tiboot3.bin.svg
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050086 :alt: tiboot3.bin image format
87
88- tispl.bin
89
Nishanth Menon1f2b6f92023-11-04 03:01:36 -050090.. image:: ../ti/img/dm_tispl.bin.svg
Nishanth Menonbe5a99d2023-08-25 13:03:05 -050091 :alt: tispl.bin image format
92
93Additional hardware for U-Boot development
94------------------------------------------
95
96* Serial Console is critical for U-Boot development on BeaglePlay. See
97 `BeaglePlay serial console documentation
98 <https://docs.beagleboard.org/latest/boards/beagleplay/demos-and-tutorials/using-serial-console.html>`_.
99* uSD is preferred option over eMMC, and a SD/MMC reader will be needed.
100* (optionally) JTAG is useful when working with very early stages of boot.
101
102Default storage options
103-----------------------
104
105There are multiple storage media options on BeaglePlay, but primarily:
106
107* Onboard eMMC (default) - reliable, fast and meant for deployment use.
108* SD/MMC card interface (hold 'USR' switch and power on) - Entirely
109 depends on the SD card quality.
110
111Flash to uSD card or how to deal with "bricked" Board
Heinrich Schuchardtb72160b2023-10-28 11:59:32 +0200112-----------------------------------------------------
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500113
114When deploying or working on Linux, it's common to use the onboard
115eMMC. However, avoiding the eMMC and using the uSD card is safer when
116working with U-Boot.
117
118If you choose to hand format your own bootable uSD card, be
119aware that it can be difficult. The following information
120may be helpful, but remember that it is only sometimes
121reliable, and partition options can cause issues. These
122can potentially help:
123
124* https://git.ti.com/cgit/arago-project/tisdk-setup-scripts/tree/create-sdcard.sh
125* https://elinux.org/Beagleboard:Expanding_File_System_Partition_On_A_microSD
126
127The simplest option is to start with a standard distribution
128image like those in `BeagleBoard.org Distros Page
129<https://www.beagleboard.org/distros>`_ and download a disk image for
130BeaglePlay. Pick a 16GB+ uSD card to be on the safer side.
131
132With an SD/MMC Card reader and `Balena Etcher
133<https://etcher.balena.io/>`_, having a functional setup in minutes is
134a trivial matter, and it works on almost all Host Operating Systems.
135Yes Windows users, Windows Subsystem for Linux(WSL) based development
136with U-Boot and update uSD card is practical.
137
138Updating U-Boot is a matter of copying the tiboot3.bin, tispl.bin and
139u-boot.img to the "BOOT" partition of the uSD card. Remember to sync
140and unmount (or Eject - depending on the Operating System) the uSD
141card prior to physically removing from SD card reader.
142
143Also see following section on switch setting used for booting using
144uSD card.
145
146.. note::
147 Great news! If the board has not been damaged physically, there's no
148 need to worry about it being "bricked" on this platform. You only have
149 to flash an uSD card, plug it in, and reinstall the image on eMMC. This
150 means that even if you make a mistake, you can quickly fix it and rest
151 easy.
152
153 If you are frequently working with uSD cards, you might find the
154 following useful:
155
156 * `USB-SD-Mux <https://www.linux-automation.com/en/products/usb-sd-mux.html>`_
157 * `SD-Wire <https://wiki.tizen.org/SDWire>`_
158
159Flash to eMMC
160-------------
161
162The eMMC layout selected is user-friendly for developers. The
163boot hardware partition of the eMMC only contains the fixed-size
164tiboot3.bin image. This is because the contents of the boot partitions
165need to run from the SoC's internal SRAM, which remains a fixed size
166constant. The other components of the boot sequence, such as tispl.bin
167and u-boot.img, are located in the /BOOT partition in the User Defined
168Area (UDA) hardware partition of the eMMC. These components can vary
169significantly in size. The choice of keeping tiboot3.bin in boot0 or
170boot1 partition depends on A/B update requirements.
171
172.. image:: img/beagleplay_emmc.svg
173 :alt: eMMC partitions and boot file organization for BeaglePlay
174
175The following are the steps from Linux shell to program eMMC:
176
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500177.. prompt:: bash #
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500178
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500179 # Enable Boot0 boot
180 mmc bootpart enable 1 2 /dev/mmcblk0
181 mmc bootbus set single_backward x1 x8 /dev/mmcblk0
182 mmc hwreset enable /dev/mmcblk0
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500183
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500184 # Clear eMMC boot0
185 echo '0' >> /sys/class/block/mmcblk0boot0/force_ro
186 dd if=/dev/zero of=/dev/mmcblk0boot0 count=32 bs=128k
187 # Write tiboot3.bin
188 dd if=tiboot3.bin of=/dev/mmcblk0boot0 bs=128k
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500189
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500190 # Copy the rest of the boot binaries
191 mount /dev/mmcblk0p1 /boot/firmware
192 cp tispl.bin /boot/firmware
193 cp u-boot.img /boot/firmware
194 sync
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500195
196.. warning ::
197
198 U-Boot is configured to prioritize booting from an SD card if it
199 detects a valid boot partition and boot files on it, even if the
200 system initially booted from eMMC. The boot order is set as follows:
201
202 * SD/MMC
203 * eMMC
204 * USB
205 * PXE
206
207LED patterns during boot
208------------------------
209
210.. list-table:: USR LED status indication
211 :widths: 16 16
212 :header-rows: 1
213
214 * - USR LEDs (012345)
215 - Indicates
216
217 * - 00000
218 - Boot failure or R5 image not started up
219
220 * - 11111
221 - A53 SPL/U-boot has started up
222
223 * - 10101
224 - OS boot process has been initiated
225
226 * - 01010
227 - OS boot process failed and drops to U-Boot shell
228
229.. note ::
230
231 In the table above, 0 indicates LED switched off and 1 indicates LED
232 switched ON.
233
234.. warning ::
235
236 If the "red" power LED is not glowing, the system power supply is not
237 functional. Please refer to `BeaglePlay documentation
238 <https://beagleplay.org/>`_ for further information.
239
240A53 SPL DDR Memory Layout
241-------------------------
242
Nishanth Menon1f2b6f92023-11-04 03:01:36 -0500243.. include:: ../ti/am62x_sk.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500244 :start-after: .. am62x_evm_rst_include_start_ddr_mem_layout
245 :end-before: .. am62x_evm_rst_include_end_ddr_mem_layout
246
247Switch Setting for Boot Mode
248----------------------------
249
250The boot time option is configured via "USR" button on the board.
251See `Beagleplay Schematics <https://git.beagleboard.org/beagleplay/beagleplay/-/blob/main/BeaglePlay_sch.pdf>`_
252for details.
253
254.. list-table:: Boot Modes
255 :widths: 16 16 16
256 :header-rows: 1
257
258 * - USR Switch Position
259 - Primary Boot
260 - Secondary Boot
261
262 * - Not Pressed
263 - eMMC
264 - UART
265
266 * - Pressed
267 - SD/MMC File System (FS) mode
268 - USB Device Firmware Upgrade (DFU) mode
269
270To switch to SD card boot mode, hold the USR button while powering on
Sjoerd Simonse71fea32024-05-06 15:38:46 +0100271with a USB type C power supply, then release when power LED lights up.
272
273DFU based boot
274--------------
275
276To boot the board over DFU, ensure there is no SD card inserted with a
277bootloader. Hold the USR switch while plugging into the type C to boot into DFU
278mode. After power-on the build artifacts needs to be uploaded one by one with a
279tool like dfu-util.
280
281.. include:: ../ti/am62x_sk.rst
282 :start-after: .. am62x_evm_rst_include_start_dfu_boot
283 :end-before: .. am62x_evm_rst_include_end_dfu_boot
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500284
285Debugging U-Boot
286----------------
287
288See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
289detailed setup and debugging information.
290
291.. warning::
292
293 **OpenOCD support since**: v0.12.0
294
295 If the default package version of OpenOCD in your development
296 environment's distribution needs to be updated, it might be necessary to
297 build OpenOCD from the source.
298
Nishanth Menon1f2b6f92023-11-04 03:01:36 -0500299.. include:: ../ti/k3.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500300 :start-after: .. k3_rst_include_start_openocd_connect_tag_connect
301 :end-before: .. k3_rst_include_end_openocd_connect_tag_connect
302
Nishanth Menon1f2b6f92023-11-04 03:01:36 -0500303.. include:: ../ti/k3.rst
Nishanth Menonbe5a99d2023-08-25 13:03:05 -0500304 :start-after: .. k3_rst_include_start_openocd_cfg_external_intro
305 :end-before: .. k3_rst_include_end_openocd_cfg_external_intro
306
307For example, with BeaglePlay (AM62X platform), the openocd_connect.cfg:
308
309.. code-block:: tcl
310
311 # TUMPA example:
312 # http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User's_Manual
313 source [find interface/ftdi/tumpa.cfg]
314
315 transport select jtag
316
317 # default JTAG configuration has only SRST and no TRST
318 reset_config srst_only srst_push_pull
319
320 # delay after SRST goes inactive
321 adapter srst delay 20
322
323 if { ![info exists SOC] } {
324 # Set the SoC of interest
325 set SOC am625
326 }
327
328 source [find target/ti_k3.cfg]
329
330 ftdi tdo_sample_edge falling
331
332 # Speeds for FT2232H are in multiples of 2, and 32MHz is tops
333 # max speed we seem to achieve is ~20MHz.. so we pick 16MHz
334 adapter speed 16000