Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
| 2 | .. sectionauthor:: Vignesh Raghavendra <vigneshr@ti.com> |
| 3 | |
Bryan Brattlof | 10d3f17 | 2022-12-19 14:29:49 -0600 | [diff] [blame] | 4 | AM62 Platforms |
Heinrich Schuchardt | b72160b | 2023-10-28 11:59:32 +0200 | [diff] [blame] | 5 | ============== |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 6 | |
| 7 | Introduction: |
| 8 | ------------- |
| 9 | The AM62 SoC family is the follow on AM335x built on the K3 Multicore |
| 10 | SoC architecture platform, providing ultra-low-power modes, dual |
| 11 | display, multi-sensor edge compute, security and other BOM-saving |
| 12 | integrations. The AM62 SoC targets a broad market to enable |
| 13 | applications such as Industrial HMI, PLC/CNC/Robot control, Medical |
| 14 | Equipment, Building Automation, Appliances and more. |
| 15 | |
| 16 | Some 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 | |
| 38 | More details can be found in the Technical Reference Manual: |
| 39 | https://www.ti.com/lit/pdf/spruiv7 |
| 40 | |
Nishanth Menon | 4981d9a | 2023-07-27 13:59:00 -0500 | [diff] [blame] | 41 | Platform information: |
| 42 | |
| 43 | * https://www.ti.com/tool/SK-AM62B |
| 44 | |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 45 | Boot Flow: |
| 46 | ---------- |
| 47 | Below is the pictorial representation of boot flow: |
| 48 | |
Dhruva Gole | c6bfa97 | 2024-08-05 19:59:34 +0530 | [diff] [blame] | 49 | .. image:: img/boot_diagram_am62.svg |
Heinrich Schuchardt | bcd233b | 2023-08-22 11:40:57 -0500 | [diff] [blame] | 50 | :alt: Boot flow diagram |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 51 | |
| 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 | |
| 55 | Sources: |
| 56 | -------- |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 57 | |
Marcel Ziswiler | 315deb3 | 2023-08-04 12:08:08 +0200 | [diff] [blame] | 58 | .. include:: ../ti/k3.rst |
Nishanth Menon | ee91e48 | 2023-07-27 13:58:44 -0500 | [diff] [blame] | 59 | :start-after: .. k3_rst_include_start_boot_sources |
| 60 | :end-before: .. k3_rst_include_end_boot_sources |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 61 | |
Dhruva Gole | 4a395e9 | 2024-08-05 19:59:32 +0530 | [diff] [blame] | 62 | .. include:: ../ti/k3.rst |
| 63 | :start-after: .. k3_rst_include_start_boot_firmwares |
| 64 | :end-before: .. k3_rst_include_end_tifsstub |
| 65 | |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 66 | Build procedure: |
| 67 | ---------------- |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 68 | 0. Setup the environment variables: |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 69 | |
Marcel Ziswiler | 315deb3 | 2023-08-04 12:08:08 +0200 | [diff] [blame] | 70 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 71 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 72 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 73 | |
Marcel Ziswiler | 315deb3 | 2023-08-04 12:08:08 +0200 | [diff] [blame] | 74 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 75 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 76 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 77 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 78 | Set the variables corresponding to this platform: |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 79 | |
Marcel Ziswiler | 315deb3 | 2023-08-04 12:08:08 +0200 | [diff] [blame] | 80 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 81 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 82 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 83 | .. prompt:: bash $ |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 84 | |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 85 | 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 Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 92 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 93 | .. am62x_evm_rst_include_start_build_steps |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 94 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 95 | 1. Trusted Firmware-A: |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 96 | |
Marcel Ziswiler | 315deb3 | 2023-08-04 12:08:08 +0200 | [diff] [blame] | 97 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 98 | :start-after: .. k3_rst_include_start_build_steps_tfa |
| 99 | :end-before: .. k3_rst_include_end_build_steps_tfa |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 100 | |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 101 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 102 | 2. OP-TEE: |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 103 | |
Marcel Ziswiler | 315deb3 | 2023-08-04 12:08:08 +0200 | [diff] [blame] | 104 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 105 | :start-after: .. k3_rst_include_start_build_steps_optee |
| 106 | :end-before: .. k3_rst_include_end_build_steps_optee |
| 107 | |
| 108 | 3. U-Boot: |
| 109 | |
Nishanth Menon | 4ef5f34 | 2023-08-22 11:41:02 -0500 | [diff] [blame] | 110 | * 3.1 R5: |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 111 | |
Marcel Ziswiler | 315deb3 | 2023-08-04 12:08:08 +0200 | [diff] [blame] | 112 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 113 | :start-after: .. k3_rst_include_start_build_steps_spl_r5 |
| 114 | :end-before: .. k3_rst_include_end_build_steps_spl_r5 |
| 115 | |
Sjoerd Simons | e71fea3 | 2024-05-06 15:38:46 +0100 | [diff] [blame] | 116 | * 3.1.1 Alternative build of R5 for DFU boot: |
| 117 | |
| 118 | As the SPL size can get too big when building with support for booting both |
| 119 | from local storage *and* DFU an extra config fragment should be used to enable |
| 120 | DFU 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 Menon | 4ef5f34 | 2023-08-22 11:41:02 -0500 | [diff] [blame] | 130 | * 3.2 A53: |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 131 | |
Marcel Ziswiler | 315deb3 | 2023-08-04 12:08:08 +0200 | [diff] [blame] | 132 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 133 | :start-after: .. k3_rst_include_start_build_steps_uboot |
| 134 | :end-before: .. k3_rst_include_end_build_steps_uboot |
| 135 | .. am62x_evm_rst_include_end_build_steps |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 136 | |
| 137 | Target Images |
Heinrich Schuchardt | b72160b | 2023-10-28 11:59:32 +0200 | [diff] [blame] | 138 | ------------- |
| 139 | |
Tom Rini | fdf4503 | 2023-07-25 12:44:16 -0400 | [diff] [blame] | 140 | In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC |
| 141 | variant (GP, HS-FS, HS-SE) requires a different source for these files. |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 142 | |
| 143 | - GP |
| 144 | |
| 145 | * tiboot3-am62x-gp-evm.bin from step 3.1 |
| 146 | * tispl.bin_unsigned, u-boot.img_unsigned from step 3.2 |
| 147 | |
| 148 | - HS-FS |
| 149 | |
| 150 | * tiboot3-am62x-hs-fs-evm.bin from step 3.1 |
| 151 | * tispl.bin, u-boot.img from step 3.2 |
| 152 | |
| 153 | - HS-SE |
| 154 | |
| 155 | * tiboot3-am62x-hs-evm.bin from step 3.1 |
| 156 | * tispl.bin, u-boot.img from step 3.2 |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 157 | |
| 158 | Image formats: |
| 159 | -------------- |
| 160 | |
Nishanth Menon | 96a5f18 | 2023-07-27 13:58:52 -0500 | [diff] [blame] | 161 | - tiboot3.bin |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 162 | |
Nishanth Menon | 96a5f18 | 2023-07-27 13:58:52 -0500 | [diff] [blame] | 163 | .. image:: img/multi_cert_tiboot3.bin.svg |
Heinrich Schuchardt | bcd233b | 2023-08-22 11:40:57 -0500 | [diff] [blame] | 164 | :alt: tiboot3.bin image format |
Vignesh Raghavendra | 2520546 | 2022-05-25 13:38:50 +0530 | [diff] [blame] | 165 | |
| 166 | - tispl.bin |
| 167 | |
Dhruva Gole | c6bfa97 | 2024-08-05 19:59:34 +0530 | [diff] [blame] | 168 | .. image:: img/tifsstub_dm_tispl.bin.svg |
Heinrich Schuchardt | bcd233b | 2023-08-22 11:40:57 -0500 | [diff] [blame] | 169 | :alt: tispl.bin image format |
Judith Mendez | 964f972 | 2023-03-31 15:36:15 -0500 | [diff] [blame] | 170 | |
Jonathan Humphreys | 3a50e4b | 2024-06-14 11:35:42 -0500 | [diff] [blame] | 171 | OSPI: |
| 172 | ----- |
| 173 | ROM supports booting from OSPI from offset 0x0. |
| 174 | |
| 175 | Flashing images to OSPI: |
| 176 | |
| 177 | Below commands can be used to download tiboot3.bin, tispl.bin, and u-boot.img, |
| 178 | over tftp and then flash those to OSPI at their respective addresses. |
| 179 | |
| 180 | .. prompt:: bash => |
| 181 | |
| 182 | sf probe |
| 183 | tftp ${loadaddr} tiboot3.bin |
| 184 | sf update $loadaddr 0x0 $filesize |
| 185 | tftp ${loadaddr} tispl.bin |
| 186 | sf update $loadaddr 0x80000 $filesize |
| 187 | tftp ${loadaddr} u-boot.img |
| 188 | sf update $loadaddr 0x280000 $filesize |
| 189 | |
| 190 | Flash layout for OSPI: |
| 191 | |
| 192 | .. image:: img/ospi_sysfw2.svg |
| 193 | :alt: OSPI flash partition layout |
| 194 | |
Nikhil M Jain | a9b1204 | 2023-07-18 14:27:35 +0530 | [diff] [blame] | 195 | A53 SPL DDR Memory Layout |
| 196 | ------------------------- |
| 197 | |
Nishanth Menon | 3dc51b9 | 2023-07-27 13:58:53 -0500 | [diff] [blame] | 198 | .. am62x_evm_rst_include_start_ddr_mem_layout |
| 199 | |
Nikhil M Jain | a9b1204 | 2023-07-18 14:27:35 +0530 | [diff] [blame] | 200 | This provides an overview memory usage in A53 SPL stage. |
| 201 | |
| 202 | .. list-table:: |
| 203 | :widths: 16 16 16 |
| 204 | :header-rows: 1 |
| 205 | |
| 206 | * - Region |
| 207 | - Start Address |
| 208 | - End Address |
| 209 | |
| 210 | * - EMPTY |
| 211 | - 0x80000000 |
| 212 | - 0x80080000 |
| 213 | |
| 214 | * - TEXT BASE |
| 215 | - 0x80080000 |
| 216 | - 0x800d8000 |
| 217 | |
| 218 | * - EMPTY |
| 219 | - 0x800d8000 |
| 220 | - 0x80200000 |
| 221 | |
| 222 | * - BMP IMAGE |
| 223 | - 0x80200000 |
| 224 | - 0x80b77660 |
| 225 | |
| 226 | * - STACK |
| 227 | - 0x80b77660 |
| 228 | - 0x80b77e60 |
| 229 | |
| 230 | * - GD |
| 231 | - 0x80b77e60 |
| 232 | - 0x80b78000 |
| 233 | |
| 234 | * - MALLOC |
| 235 | - 0x80b78000 |
| 236 | - 0x80b80000 |
| 237 | |
| 238 | * - EMPTY |
| 239 | - 0x80b80000 |
| 240 | - 0x80c80000 |
| 241 | |
| 242 | * - BSS |
| 243 | - 0x80c80000 |
| 244 | - 0x80d00000 |
| 245 | |
| 246 | * - BLOBS |
| 247 | - 0x80d00000 |
| 248 | - 0x80d00400 |
| 249 | |
| 250 | * - EMPTY |
| 251 | - 0x80d00400 |
| 252 | - 0x81000000 |
Nishanth Menon | 3dc51b9 | 2023-07-27 13:58:53 -0500 | [diff] [blame] | 253 | .. am62x_evm_rst_include_end_ddr_mem_layout |
Nikhil M Jain | a9b1204 | 2023-07-18 14:27:35 +0530 | [diff] [blame] | 254 | |
Judith Mendez | 964f972 | 2023-03-31 15:36:15 -0500 | [diff] [blame] | 255 | Switch Setting for Boot Mode |
| 256 | ---------------------------- |
| 257 | |
| 258 | Boot Mode pins provide means to select the boot mode and options before the |
| 259 | device is powered up. After every POR, they are the main source to populate |
| 260 | the Boot Parameter Tables. |
| 261 | |
| 262 | The following table shows some common boot modes used on AM62 platform. More |
| 263 | details can be found in the Technical Reference Manual: |
| 264 | https://www.ti.com/lit/pdf/spruiv7 under the `Boot Mode Pins` section. |
| 265 | |
Nishanth Menon | 5807ae8 | 2023-07-27 13:58:54 -0500 | [diff] [blame] | 266 | .. list-table:: Boot Modes |
| 267 | :widths: 16 16 16 |
| 268 | :header-rows: 1 |
| 269 | |
| 270 | * - Switch Label |
| 271 | - SW2: 12345678 |
| 272 | - SW3: 12345678 |
| 273 | |
| 274 | * - SD |
| 275 | - 01000000 |
| 276 | - 11000010 |
| 277 | |
| 278 | * - OSPI |
| 279 | - 00000000 |
| 280 | - 11001110 |
| 281 | |
| 282 | * - EMMC |
| 283 | - 00000000 |
| 284 | - 11010010 |
| 285 | |
| 286 | * - UART |
| 287 | - 00000000 |
| 288 | - 11011100 |
Judith Mendez | 964f972 | 2023-03-31 15:36:15 -0500 | [diff] [blame] | 289 | |
Nishanth Menon | 5807ae8 | 2023-07-27 13:58:54 -0500 | [diff] [blame] | 290 | * - USB DFU |
| 291 | - 00000000 |
| 292 | - 11001010 |
Judith Mendez | 964f972 | 2023-03-31 15:36:15 -0500 | [diff] [blame] | 293 | |
| 294 | For SW2 and SW1, the switch state in the "ON" position = 1. |
Jason Kacines | b0fdee9 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 295 | |
Sjoerd Simons | e71fea3 | 2024-05-06 15:38:46 +0100 | [diff] [blame] | 296 | DFU based boot |
| 297 | -------------- |
| 298 | |
| 299 | To boot the board over DFU, set the switches to DFU mode and connect to the |
| 300 | USB type C DRD port on the board. After power-on the build artifacts needs to be |
| 301 | uploaded one by one with a tool like dfu-util. |
| 302 | |
| 303 | .. am62x_evm_rst_include_start_dfu_boot |
| 304 | |
| 305 | The initial ROM will have a DFU alt named `bootloader` for the initial R5 spl |
| 306 | upload. The next stages as exposed by U-Boot have target alts matching the name |
| 307 | of the artifacts, for these a USB reset has to be done after each upload. |
| 308 | |
| 309 | When using dfu-util the following commands can be used to boot to a U-Boot shell: |
| 310 | |
| 311 | .. prompt:: bash $ |
| 312 | |
| 313 | dfu-util -a bootloader -D tiboot3.bin |
| 314 | dfu-util -R -a tispl -D tispl.bin |
| 315 | dfu-util -R -a u-boot.img -D u-boot.img |
| 316 | |
| 317 | .. am62x_evm_rst_include_end_dfu_boot |
| 318 | |
Jason Kacines | b0fdee9 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 319 | Debugging U-Boot |
| 320 | ---------------- |
| 321 | |
| 322 | See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for |
| 323 | detailed setup information. |
| 324 | |
| 325 | .. warning:: |
| 326 | |
| 327 | **OpenOCD support since**: v0.12.0 |
| 328 | |
| 329 | If the default package version of OpenOCD in your development |
| 330 | environment's distribution needs to be updated, it might be necessary to |
| 331 | build OpenOCD from the source. |
| 332 | |
| 333 | .. include:: k3.rst |
| 334 | :start-after: .. k3_rst_include_start_openocd_connect_XDS110 |
| 335 | :end-before: .. k3_rst_include_end_openocd_connect_XDS110 |
| 336 | |
| 337 | To start OpenOCD and connect to the board |
| 338 | |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 339 | .. prompt:: bash $ |
Jason Kacines | b0fdee9 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 340 | |
| 341 | openocd -f board/ti_am625evm.cfg |