blob: 2a25e84f6c97f8e41588d9f98440041efbcde7f9 [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
Nishanth Menonb47c9f72023-07-27 13:58:45 -050049.. image:: img/boot_diagram_k3_current.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
62Build procedure:
63----------------
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500640. Setup the environment variables:
Vignesh Raghavendra25205462022-05-25 13:38:50 +053065
Marcel Ziswiler315deb32023-08-04 12:08:08 +020066.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050067 :start-after: .. k3_rst_include_start_common_env_vars_desc
68 :end-before: .. k3_rst_include_end_common_env_vars_desc
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_board_env_vars_desc
72 :end-before: .. k3_rst_include_end_board_env_vars_desc
Vignesh Raghavendra25205462022-05-25 13:38:50 +053073
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050074Set the variables corresponding to this platform:
Vignesh Raghavendra25205462022-05-25 13:38:50 +053075
Marcel Ziswiler315deb32023-08-04 12:08:08 +020076.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050077 :start-after: .. k3_rst_include_start_common_env_vars_defn
78 :end-before: .. k3_rst_include_end_common_env_vars_defn
Nishanth Menonfdd7cb72023-11-02 23:40:26 -050079.. prompt:: bash $
Vignesh Raghavendra25205462022-05-25 13:38:50 +053080
Nishanth Menonfdd7cb72023-11-02 23:40:26 -050081 export UBOOT_CFG_CORTEXR=am62x_evm_r5_defconfig
82 export UBOOT_CFG_CORTEXA=am62x_evm_a53_defconfig
83 export TFA_BOARD=lite
84 # we dont use any extra TFA parameters
85 unset TFA_EXTRA_ARGS
86 export OPTEE_PLATFORM=k3-am62x
87 export OPTEE_EXTRA_ARGS="CFG_WITH_SOFTWARE_PRNG=y"
Vignesh Raghavendra25205462022-05-25 13:38:50 +053088
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050089.. am62x_evm_rst_include_start_build_steps
Vignesh Raghavendra25205462022-05-25 13:38:50 +053090
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500911. Trusted Firmware-A:
Vignesh Raghavendra25205462022-05-25 13:38:50 +053092
Marcel Ziswiler315deb32023-08-04 12:08:08 +020093.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -050094 :start-after: .. k3_rst_include_start_build_steps_tfa
95 :end-before: .. k3_rst_include_end_build_steps_tfa
Vignesh Raghavendra25205462022-05-25 13:38:50 +053096
Vignesh Raghavendra25205462022-05-25 13:38:50 +053097
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500982. OP-TEE:
Vignesh Raghavendra25205462022-05-25 13:38:50 +053099
Marcel Ziswiler315deb32023-08-04 12:08:08 +0200100.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500101 :start-after: .. k3_rst_include_start_build_steps_optee
102 :end-before: .. k3_rst_include_end_build_steps_optee
103
1043. U-Boot:
105
Nishanth Menon4ef5f342023-08-22 11:41:02 -0500106* 3.1 R5:
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500107
Marcel Ziswiler315deb32023-08-04 12:08:08 +0200108.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500109 :start-after: .. k3_rst_include_start_build_steps_spl_r5
110 :end-before: .. k3_rst_include_end_build_steps_spl_r5
111
Sjoerd Simonse71fea32024-05-06 15:38:46 +0100112* 3.1.1 Alternative build of R5 for DFU boot:
113
114As the SPL size can get too big when building with support for booting both
115from local storage *and* DFU an extra config fragment should be used to enable
116DFU support (and disable storage support)
117
118.. prompt:: bash $
119
120 export UBOOT_CFG_CORTEXR="${UBOOT_CFG_CORTEXR} am62x_r5_usbdfu.config"
121
122.. include:: ../ti/k3.rst
123 :start-after: .. k3_rst_include_start_build_steps_spl_r5
124 :end-before: .. k3_rst_include_end_build_steps_spl_r5
125
Nishanth Menon4ef5f342023-08-22 11:41:02 -0500126* 3.2 A53:
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530127
Marcel Ziswiler315deb32023-08-04 12:08:08 +0200128.. include:: ../ti/k3.rst
Nishanth Menonb7ee22f2023-07-27 13:58:48 -0500129 :start-after: .. k3_rst_include_start_build_steps_uboot
130 :end-before: .. k3_rst_include_end_build_steps_uboot
131.. am62x_evm_rst_include_end_build_steps
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530132
133Target Images
Heinrich Schuchardtb72160b2023-10-28 11:59:32 +0200134-------------
135
Tom Rinifdf45032023-07-25 12:44:16 -0400136In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC
137variant (GP, HS-FS, HS-SE) requires a different source for these files.
Neha Malcom Francis507be122023-07-22 00:14:43 +0530138
139 - GP
140
141 * tiboot3-am62x-gp-evm.bin from step 3.1
142 * tispl.bin_unsigned, u-boot.img_unsigned from step 3.2
143
144 - HS-FS
145
146 * tiboot3-am62x-hs-fs-evm.bin from step 3.1
147 * tispl.bin, u-boot.img from step 3.2
148
149 - HS-SE
150
151 * tiboot3-am62x-hs-evm.bin from step 3.1
152 * tispl.bin, u-boot.img from step 3.2
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530153
154Image formats:
155--------------
156
Nishanth Menon96a5f182023-07-27 13:58:52 -0500157- tiboot3.bin
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530158
Nishanth Menon96a5f182023-07-27 13:58:52 -0500159.. image:: img/multi_cert_tiboot3.bin.svg
Heinrich Schuchardtbcd233b2023-08-22 11:40:57 -0500160 :alt: tiboot3.bin image format
Vignesh Raghavendra25205462022-05-25 13:38:50 +0530161
162- tispl.bin
163
Nishanth Menon96a5f182023-07-27 13:58:52 -0500164.. image:: img/dm_tispl.bin.svg
Heinrich Schuchardtbcd233b2023-08-22 11:40:57 -0500165 :alt: tispl.bin image format
Judith Mendez964f9722023-03-31 15:36:15 -0500166
Jonathan Humphreys3a50e4b2024-06-14 11:35:42 -0500167OSPI:
168-----
169ROM supports booting from OSPI from offset 0x0.
170
171Flashing images to OSPI:
172
173Below commands can be used to download tiboot3.bin, tispl.bin, and u-boot.img,
174over tftp and then flash those to OSPI at their respective addresses.
175
176.. prompt:: bash =>
177
178 sf probe
179 tftp ${loadaddr} tiboot3.bin
180 sf update $loadaddr 0x0 $filesize
181 tftp ${loadaddr} tispl.bin
182 sf update $loadaddr 0x80000 $filesize
183 tftp ${loadaddr} u-boot.img
184 sf update $loadaddr 0x280000 $filesize
185
186Flash layout for OSPI:
187
188.. image:: img/ospi_sysfw2.svg
189 :alt: OSPI flash partition layout
190
Nikhil M Jaina9b12042023-07-18 14:27:35 +0530191A53 SPL DDR Memory Layout
192-------------------------
193
Nishanth Menon3dc51b92023-07-27 13:58:53 -0500194.. am62x_evm_rst_include_start_ddr_mem_layout
195
Nikhil M Jaina9b12042023-07-18 14:27:35 +0530196This provides an overview memory usage in A53 SPL stage.
197
198.. list-table::
199 :widths: 16 16 16
200 :header-rows: 1
201
202 * - Region
203 - Start Address
204 - End Address
205
206 * - EMPTY
207 - 0x80000000
208 - 0x80080000
209
210 * - TEXT BASE
211 - 0x80080000
212 - 0x800d8000
213
214 * - EMPTY
215 - 0x800d8000
216 - 0x80200000
217
218 * - BMP IMAGE
219 - 0x80200000
220 - 0x80b77660
221
222 * - STACK
223 - 0x80b77660
224 - 0x80b77e60
225
226 * - GD
227 - 0x80b77e60
228 - 0x80b78000
229
230 * - MALLOC
231 - 0x80b78000
232 - 0x80b80000
233
234 * - EMPTY
235 - 0x80b80000
236 - 0x80c80000
237
238 * - BSS
239 - 0x80c80000
240 - 0x80d00000
241
242 * - BLOBS
243 - 0x80d00000
244 - 0x80d00400
245
246 * - EMPTY
247 - 0x80d00400
248 - 0x81000000
Nishanth Menon3dc51b92023-07-27 13:58:53 -0500249.. am62x_evm_rst_include_end_ddr_mem_layout
Nikhil M Jaina9b12042023-07-18 14:27:35 +0530250
Judith Mendez964f9722023-03-31 15:36:15 -0500251Switch Setting for Boot Mode
252----------------------------
253
254Boot Mode pins provide means to select the boot mode and options before the
255device is powered up. After every POR, they are the main source to populate
256the Boot Parameter Tables.
257
258The following table shows some common boot modes used on AM62 platform. More
259details can be found in the Technical Reference Manual:
260https://www.ti.com/lit/pdf/spruiv7 under the `Boot Mode Pins` section.
261
Nishanth Menon5807ae82023-07-27 13:58:54 -0500262.. list-table:: Boot Modes
263 :widths: 16 16 16
264 :header-rows: 1
265
266 * - Switch Label
267 - SW2: 12345678
268 - SW3: 12345678
269
270 * - SD
271 - 01000000
272 - 11000010
273
274 * - OSPI
275 - 00000000
276 - 11001110
277
278 * - EMMC
279 - 00000000
280 - 11010010
281
282 * - UART
283 - 00000000
284 - 11011100
Judith Mendez964f9722023-03-31 15:36:15 -0500285
Nishanth Menon5807ae82023-07-27 13:58:54 -0500286 * - USB DFU
287 - 00000000
288 - 11001010
Judith Mendez964f9722023-03-31 15:36:15 -0500289
290For SW2 and SW1, the switch state in the "ON" position = 1.
Jason Kacinesb0fdee92023-08-03 01:29:22 -0500291
Sjoerd Simonse71fea32024-05-06 15:38:46 +0100292DFU based boot
293--------------
294
295To boot the board over DFU, set the switches to DFU mode and connect to the
296USB type C DRD port on the board. After power-on the build artifacts needs to be
297uploaded one by one with a tool like dfu-util.
298
299.. am62x_evm_rst_include_start_dfu_boot
300
301The initial ROM will have a DFU alt named `bootloader` for the initial R5 spl
302upload. The next stages as exposed by U-Boot have target alts matching the name
303of the artifacts, for these a USB reset has to be done after each upload.
304
305When using dfu-util the following commands can be used to boot to a U-Boot shell:
306
307.. prompt:: bash $
308
309 dfu-util -a bootloader -D tiboot3.bin
310 dfu-util -R -a tispl -D tispl.bin
311 dfu-util -R -a u-boot.img -D u-boot.img
312
313.. am62x_evm_rst_include_end_dfu_boot
314
Jason Kacinesb0fdee92023-08-03 01:29:22 -0500315Debugging U-Boot
316----------------
317
318See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
319detailed setup information.
320
321.. warning::
322
323 **OpenOCD support since**: v0.12.0
324
325 If the default package version of OpenOCD in your development
326 environment's distribution needs to be updated, it might be necessary to
327 build OpenOCD from the source.
328
329.. include:: k3.rst
330 :start-after: .. k3_rst_include_start_openocd_connect_XDS110
331 :end-before: .. k3_rst_include_end_openocd_connect_XDS110
332
333To start OpenOCD and connect to the board
334
Nishanth Menonfdd7cb72023-11-02 23:40:26 -0500335.. prompt:: bash $
Jason Kacinesb0fdee92023-08-03 01:29:22 -0500336
337 openocd -f board/ti_am625evm.cfg