blob: 51dab839ddd98533674ecd6b7e1fcf98b995e229 [file] [log] [blame]
Vignesh Raghavendra25205462022-05-25 13:38:50 +05301.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2.. sectionauthor:: Vignesh Raghavendra <vigneshr@ti.com>
3
Bryan Brattlof10d3f172022-12-19 14:29:49 -06004AM62 Platforms
Heinrich Schuchardtb72160b2023-10-28 11:59:32 +02005==============
Vignesh Raghavendra25205462022-05-25 13:38:50 +05306
7Introduction:
8-------------
9The AM62 SoC family is the follow on AM335x built on the K3 Multicore
10SoC architecture platform, providing ultra-low-power modes, dual
11display, multi-sensor edge compute, security and other BOM-saving
12integrations. The AM62 SoC targets a broad market to enable
13applications such as Industrial HMI, PLC/CNC/Robot control, Medical
14Equipment, Building Automation, Appliances and more.
15
16Some highlights of this SoC are:
17
18* Quad-Cortex-A53s (running up to 1.4GHz) in a single cluster.
19 Pin-to-pin compatible options for single and quad core are available.
20* Cortex-M4F for general-purpose or safety usage.
21* Dual display support, providing 24-bit RBG parallel interface and
22 OLDI/LVDS-4 Lane x2, up to 200MHz pixel clock support for 2K display
23 resolution.
24* Selectable GPU support, up to 8GFLOPS, providing better user experience
25 in 3D graphic display case and Android.
26* PRU(Programmable Realtime Unit) support for customized programmable
27 interfaces/IOs.
28* Integrated Giga-bit Ethernet switch supporting up to a total of two
29 external ports (TSN capable).
30* 9xUARTs, 5xSPI, 6xI2C, 2xUSB2, 3xCAN-FD, 3x eMMC and SD, GPMC for
31 NAND/FPGA connection, OSPI memory controller, 3xMcASP for audio,
32 1x CSI-RX-4L for Camera, eCAP/eQEP, ePWM, among other peripherals.
33* Dedicated Centralized System Controller for Security, Power, and
34 Resource Management.
35* Multiple low power modes support, ex: Deep sleep, Standby, MCU-only,
36 enabling battery powered system design.
37
38More details can be found in the Technical Reference Manual:
39https://www.ti.com/lit/pdf/spruiv7
40
Nishanth Menon4981d9a2023-07-27 13:59:00 -050041Platform information:
42
43* https://www.ti.com/tool/SK-AM62B
44
Vignesh Raghavendra25205462022-05-25 13:38:50 +053045Boot Flow:
46----------
47Below is the pictorial representation of boot flow:
48
Dhruva Golec6bfa972024-08-05 19:59:34 +053049.. image:: img/boot_diagram_am62.svg
Heinrich Schuchardtbcd233b2023-08-22 11:40:57 -050050 :alt: Boot flow diagram
Vignesh Raghavendra25205462022-05-25 13:38:50 +053051
52- Here TIFS acts as master and provides all the critical services. R5/A53
53 requests TIFS to get these services done as shown in the above diagram.
54
55Sources:
56--------
Vignesh Raghavendra25205462022-05-25 13:38:50 +053057
Marcel Ziswiler315deb32023-08-04 12:08:08 +020058.. include:: ../ti/k3.rst
Nishanth Menonee91e482023-07-27 13:58:44 -050059 :start-after: .. k3_rst_include_start_boot_sources
60 :end-before: .. k3_rst_include_end_boot_sources
Vignesh Raghavendra25205462022-05-25 13:38:50 +053061
Dhruva Gole4a395e92024-08-05 19:59:32 +053062.. include:: ../ti/k3.rst
63 :start-after: .. k3_rst_include_start_boot_firmwares
64 :end-before: .. k3_rst_include_end_tifsstub
65
Vignesh Raghavendra25205462022-05-25 13:38:50 +053066Build procedure:
67----------------
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500680. Setup the environment variables:
Vignesh Raghavendra25205462022-05-25 13:38:50 +053069
Marcel Ziswiler315deb32023-08-04 12:08:08 +020070.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050071 :start-after: .. k3_rst_include_start_common_env_vars_desc
72 :end-before: .. k3_rst_include_end_common_env_vars_desc
Vignesh Raghavendra25205462022-05-25 13:38:50 +053073
Marcel Ziswiler315deb32023-08-04 12:08:08 +020074.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050075 :start-after: .. k3_rst_include_start_board_env_vars_desc
76 :end-before: .. k3_rst_include_end_board_env_vars_desc
Vignesh Raghavendra25205462022-05-25 13:38:50 +053077
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050078Set the variables corresponding to this platform:
Vignesh Raghavendra25205462022-05-25 13:38:50 +053079
Marcel Ziswiler315deb32023-08-04 12:08:08 +020080.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050081 :start-after: .. k3_rst_include_start_common_env_vars_defn
82 :end-before: .. k3_rst_include_end_common_env_vars_defn
Nishanth Menonfdd7cb72023-11-02 23:40:26 -050083.. prompt:: bash $
Vignesh Raghavendra25205462022-05-25 13:38:50 +053084
Nishanth Menonfdd7cb72023-11-02 23:40:26 -050085 export UBOOT_CFG_CORTEXR=am62x_evm_r5_defconfig
86 export UBOOT_CFG_CORTEXA=am62x_evm_a53_defconfig
87 export TFA_BOARD=lite
88 # we dont use any extra TFA parameters
89 unset TFA_EXTRA_ARGS
90 export OPTEE_PLATFORM=k3-am62x
91 export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
Vignesh Raghavendra25205462022-05-25 13:38:50 +053092
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050093.. am62x_evm_rst_include_start_build_steps
Vignesh Raghavendra25205462022-05-25 13:38:50 +053094
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500951. Trusted Firmware-A:
Vignesh Raghavendra25205462022-05-25 13:38:50 +053096
Marcel Ziswiler315deb32023-08-04 12:08:08 +020097.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050098 :start-after: .. k3_rst_include_start_build_steps_tfa
99 :end-before: .. k3_rst_include_end_build_steps_tfa
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530100
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530101
Nishanth Menonb7ee22f2023-07-27 13:58:48 -05001022. OP-TEE:
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530103
Marcel Ziswiler315deb32023-08-04 12:08:08 +0200104.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500105 :start-after: .. k3_rst_include_start_build_steps_optee
106 :end-before: .. k3_rst_include_end_build_steps_optee
107
1083. U-Boot:
109
Nishanth Menon4ef5f342023-08-22 11:41:02 -0500110* 3.1 R5:
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500111
Marcel Ziswiler315deb32023-08-04 12:08:08 +0200112.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500113 :start-after: .. k3_rst_include_start_build_steps_spl_r5
114 :end-before: .. k3_rst_include_end_build_steps_spl_r5
115
Sjoerd Simonse71fea32024-05-06 15:38:46 +0100116* 3.1.1 Alternative build of R5 for DFU boot:
117
118As the SPL size can get too big when building with support for booting both
119from local storage *and* DFU an extra config fragment should be used to enable
120DFU support (and disable storage support)
121
122.. prompt:: bash $
123
124 export UBOOT_CFG_CORTEXR="${UBOOT_CFG_CORTEXR} am62x_r5_usbdfu.config"
125
126.. include:: ../ti/k3.rst
127 :start-after: .. k3_rst_include_start_build_steps_spl_r5
128 :end-before: .. k3_rst_include_end_build_steps_spl_r5
129
Nishanth Menon4ef5f342023-08-22 11:41:02 -0500130* 3.2 A53:
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530131
Marcel Ziswiler315deb32023-08-04 12:08:08 +0200132.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500133 :start-after: .. k3_rst_include_start_build_steps_uboot
134 :end-before: .. k3_rst_include_end_build_steps_uboot
Guillaume La Roque2a4642b2024-09-12 09:29:57 +0200135
136* 3.2.1 Alternative build of A53 for Android bootflow:
137
138Since the Android requires many more dependencies, it is disabled by default.
139An extra config fragment should be used to enable Android bootflow support.
140
141.. prompt:: bash $
142
143 export UBOOT_CFG_CORTEXR="${UBOOT_CFG_CORTEXA} am62x_a53_android.config"
144
145.. include:: ../ti/k3.rst
146 :start-after: .. k3_rst_include_start_build_steps_uboot
147 :end-before: .. k3_rst_include_end_build_steps_uboot
148
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500149.. am62x_evm_rst_include_end_build_steps
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530150
151Target Images
Heinrich Schuchardtb72160b2023-10-28 11:59:32 +0200152-------------
153
Tom Rinifdf45032023-07-25 12:44:16 -0400154In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC
155variant (GP, HS-FS, HS-SE) requires a different source for these files.
Neha Malcom Francis507be122023-07-22 00:14:43 +0530156
157 - GP
158
159 * tiboot3-am62x-gp-evm.bin from step 3.1
160 * tispl.bin_unsigned, u-boot.img_unsigned from step 3.2
161
162 - HS-FS
163
164 * tiboot3-am62x-hs-fs-evm.bin from step 3.1
165 * tispl.bin, u-boot.img from step 3.2
166
167 - HS-SE
168
169 * tiboot3-am62x-hs-evm.bin from step 3.1
170 * tispl.bin, u-boot.img from step 3.2
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530171
172Image formats:
173--------------
174
Nishanth Menon96a5f182023-07-27 13:58:52 -0500175- tiboot3.bin
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530176
Nishanth Menon96a5f182023-07-27 13:58:52 -0500177.. image:: img/multi_cert_tiboot3.bin.svg
Heinrich Schuchardtbcd233b2023-08-22 11:40:57 -0500178 :alt: tiboot3.bin image format
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530179
180- tispl.bin
181
Dhruva Golec6bfa972024-08-05 19:59:34 +0530182.. image:: img/tifsstub_dm_tispl.bin.svg
Heinrich Schuchardtbcd233b2023-08-22 11:40:57 -0500183 :alt: tispl.bin image format
Judith Mendez964f9722023-03-31 15:36:15 -0500184
Jonathan Humphreys3a50e4b2024-06-14 11:35:42 -0500185OSPI:
186-----
187ROM supports booting from OSPI from offset 0x0.
188
189Flashing images to OSPI:
190
191Below commands can be used to download tiboot3.bin, tispl.bin, and u-boot.img,
192over tftp and then flash those to OSPI at their respective addresses.
193
194.. prompt:: bash =>
195
196 sf probe
197 tftp ${loadaddr} tiboot3.bin
198 sf update $loadaddr 0x0 $filesize
199 tftp ${loadaddr} tispl.bin
200 sf update $loadaddr 0x80000 $filesize
201 tftp ${loadaddr} u-boot.img
202 sf update $loadaddr 0x280000 $filesize
203
204Flash layout for OSPI:
205
206.. image:: img/ospi_sysfw2.svg
207 :alt: OSPI flash partition layout
208
Nikhil M Jaina9b12042023-07-18 14:27:35 +0530209A53 SPL DDR Memory Layout
210-------------------------
211
Nishanth Menon3dc51b92023-07-27 13:58:53 -0500212.. am62x_evm_rst_include_start_ddr_mem_layout
213
Nikhil M Jaina9b12042023-07-18 14:27:35 +0530214This provides an overview memory usage in A53 SPL stage.
215
216.. list-table::
217 :widths: 16 16 16
218 :header-rows: 1
219
220 * - Region
221 - Start Address
222 - End Address
223
224 * - EMPTY
225 - 0x80000000
226 - 0x80080000
227
228 * - TEXT BASE
229 - 0x80080000
230 - 0x800d8000
231
232 * - EMPTY
233 - 0x800d8000
234 - 0x80200000
235
236 * - BMP IMAGE
237 - 0x80200000
238 - 0x80b77660
239
240 * - STACK
241 - 0x80b77660
242 - 0x80b77e60
243
244 * - GD
245 - 0x80b77e60
246 - 0x80b78000
247
248 * - MALLOC
249 - 0x80b78000
250 - 0x80b80000
251
252 * - EMPTY
253 - 0x80b80000
254 - 0x80c80000
255
256 * - BSS
257 - 0x80c80000
258 - 0x80d00000
259
260 * - BLOBS
261 - 0x80d00000
262 - 0x80d00400
263
264 * - EMPTY
265 - 0x80d00400
266 - 0x81000000
Nishanth Menon3dc51b92023-07-27 13:58:53 -0500267.. am62x_evm_rst_include_end_ddr_mem_layout
Nikhil M Jaina9b12042023-07-18 14:27:35 +0530268
Judith Mendez964f9722023-03-31 15:36:15 -0500269Switch Setting for Boot Mode
270----------------------------
271
272Boot Mode pins provide means to select the boot mode and options before the
273device is powered up. After every POR, they are the main source to populate
274the Boot Parameter Tables.
275
276The following table shows some common boot modes used on AM62 platform. More
277details can be found in the Technical Reference Manual:
278https://www.ti.com/lit/pdf/spruiv7 under the `Boot Mode Pins` section.
279
Nishanth Menon5807ae82023-07-27 13:58:54 -0500280.. list-table:: Boot Modes
281 :widths: 16 16 16
282 :header-rows: 1
283
284 * - Switch Label
285 - SW2: 12345678
286 - SW3: 12345678
287
288 * - SD
289 - 01000000
290 - 11000010
291
292 * - OSPI
293 - 00000000
294 - 11001110
295
296 * - EMMC
297 - 00000000
298 - 11010010
299
300 * - UART
301 - 00000000
302 - 11011100
Judith Mendez964f9722023-03-31 15:36:15 -0500303
Nishanth Menon5807ae82023-07-27 13:58:54 -0500304 * - USB DFU
305 - 00000000
306 - 11001010
Judith Mendez964f9722023-03-31 15:36:15 -0500307
308For SW2 and SW1, the switch state in the "ON" position = 1.
Jason Kacinesb0fdee92023-08-03 01:29:22 -0500309
Sjoerd Simonse71fea32024-05-06 15:38:46 +0100310DFU based boot
311--------------
312
313To boot the board over DFU, set the switches to DFU mode and connect to the
314USB type C DRD port on the board. After power-on the build artifacts needs to be
315uploaded one by one with a tool like dfu-util.
316
317.. am62x_evm_rst_include_start_dfu_boot
318
319The initial ROM will have a DFU alt named `bootloader` for the initial R5 spl
320upload. The next stages as exposed by U-Boot have target alts matching the name
321of the artifacts, for these a USB reset has to be done after each upload.
322
323When using dfu-util the following commands can be used to boot to a U-Boot shell:
324
325.. prompt:: bash $
326
327 dfu-util -a bootloader -D tiboot3.bin
328 dfu-util -R -a tispl -D tispl.bin
329 dfu-util -R -a u-boot.img -D u-boot.img
330
331.. am62x_evm_rst_include_end_dfu_boot
332
Jason Kacinesb0fdee92023-08-03 01:29:22 -0500333Debugging U-Boot
334----------------
335
336See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
337detailed setup information.
338
339.. warning::
340
341 **OpenOCD support since**: v0.12.0
342
343 If the default package version of OpenOCD in your development
344 environment's distribution needs to be updated, it might be necessary to
345 build OpenOCD from the source.
346
347.. include:: k3.rst
348 :start-after: .. k3_rst_include_start_openocd_connect_XDS110
349 :end-before: .. k3_rst_include_end_openocd_connect_XDS110
350
351To start OpenOCD and connect to the board
352
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500353.. prompt:: bash $
Jason Kacinesb0fdee92023-08-03 01:29:22 -0500354
355 openocd -f board/ti_am625evm.cfg