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