Apurva Nandan | 2b1c9ff | 2024-02-24 01:51:53 +0530 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause |
| 2 | .. sectionauthor:: Apurva Nandan <a-nandan@ti.com> |
| 3 | |
| 4 | J784S4 and AM69 Platforms |
| 5 | ========================= |
| 6 | |
| 7 | Introduction |
| 8 | ------------ |
| 9 | The J784S4 SoC belongs to the K3 Multicore SoC architecture |
| 10 | platform, providing advanced system integration in automotive, |
| 11 | ADAS and industrial applications requiring AI at the network edge. |
| 12 | This SoC extends the K3 Jacinto 7 family of SoCs with focus on |
| 13 | raising performance and integration while providing interfaces, |
| 14 | memory architecture and compute performance for multi-sensor, high |
| 15 | concurrency applications. |
| 16 | |
| 17 | The device is partitioned into three functional domains, each containing |
| 18 | specific processing cores and peripherals: |
| 19 | |
| 20 | 1. Wake-up (WKUP) domain |
| 21 | * ARM Cortex-M4F processor, runs TI Foundational Security (TIFS) |
| 22 | |
| 23 | 2. Microcontroller (MCU) domain |
| 24 | * Dual core ARM Cortex-R5F processor, runs device management |
| 25 | and SoC early boot |
| 26 | |
| 27 | 3. MAIN domain |
| 28 | * Two clusters of quad core 64-bit ARM Cortex-A72, runs HLOS |
| 29 | * Dual core ARM Cortex-R5F processor used for RTOS applications |
| 30 | * Four C7x DSPs used for Machine Learning applications. |
| 31 | |
| 32 | |
| 33 | More info can be found in TRM: http://www.ti.com/lit/zip/spruj52 |
| 34 | |
| 35 | Platform information: |
| 36 | |
| 37 | * https://www.ti.com/tool/J784S4XEVM |
| 38 | * https://www.ti.com/tool/SK-AM69 |
| 39 | |
| 40 | Boot Flow |
| 41 | --------- |
| 42 | Below is the pictorial representation of boot flow: |
| 43 | |
| 44 | .. image:: img/boot_diagram_k3_current.svg |
| 45 | :alt: K3 boot flow |
| 46 | |
| 47 | - On this platform, "TI Foundational Security" (TIFS) functions as the |
| 48 | security enclave master. While "Device Manager" (DM), also known as the |
| 49 | "TISCI server" in TI terminology, offers all the essential services. |
| 50 | |
| 51 | - As illustrated in the diagram above, R5 SPL manages power and clock |
| 52 | services independently before handing over control to DM. The A72 or |
| 53 | the C7x (Aux core) software components request TIFS/DM to handle |
| 54 | security or device management services. |
| 55 | |
| 56 | Sources |
| 57 | ------- |
| 58 | |
| 59 | .. include:: k3.rst |
| 60 | :start-after: .. k3_rst_include_start_boot_sources |
| 61 | :end-before: .. k3_rst_include_end_boot_sources |
| 62 | |
Dhruva Gole | 26e0ddf | 2024-08-05 19:59:33 +0530 | [diff] [blame] | 63 | .. include:: k3.rst |
| 64 | :start-after: .. k3_rst_include_start_boot_firmwares |
| 65 | :end-before: .. k3_rst_include_end_boot_firmwares |
| 66 | |
Apurva Nandan | 2b1c9ff | 2024-02-24 01:51:53 +0530 | [diff] [blame] | 67 | Build procedure |
| 68 | --------------- |
| 69 | 0. Setup the environment variables: |
| 70 | |
| 71 | .. include:: k3.rst |
| 72 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 73 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
| 74 | |
| 75 | .. include:: k3.rst |
| 76 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 77 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
| 78 | |
| 79 | Set the variables corresponding to this platform: |
| 80 | |
| 81 | .. include:: k3.rst |
| 82 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 83 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
| 84 | .. code-block:: bash |
| 85 | |
| 86 | $ export UBOOT_CFG_CORTEXR=j784s4_evm_r5_defconfig |
| 87 | $ export UBOOT_CFG_CORTEXA=j784s4_evm_a72_defconfig |
| 88 | $ export TFA_BOARD=j784s4 |
| 89 | $ export TFA_EXTRA_ARGS="K3_USART=0x8" |
| 90 | $ export OPTEE_PLATFORM=k3-j784s4 |
| 91 | $ export OPTEE_EXTRA_ARGS="CFG_CONSOLE_UART=0x8" |
| 92 | |
| 93 | .. j784s4_evm_rst_include_start_build_steps |
| 94 | |
| 95 | 1. Trusted Firmware-A |
| 96 | |
| 97 | .. include:: k3.rst |
| 98 | :start-after: .. k3_rst_include_start_build_steps_tfa |
| 99 | :end-before: .. k3_rst_include_end_build_steps_tfa |
| 100 | |
| 101 | |
| 102 | 2. OP-TEE |
| 103 | |
| 104 | .. include:: k3.rst |
| 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 | |
| 110 | .. _j784s4_evm_rst_u_boot_r5: |
| 111 | |
| 112 | * 3.1 R5 |
| 113 | |
| 114 | .. include:: k3.rst |
| 115 | :start-after: .. k3_rst_include_start_build_steps_spl_r5 |
| 116 | :end-before: .. k3_rst_include_end_build_steps_spl_r5 |
| 117 | |
| 118 | .. _j784s4_evm_rst_u_boot_a72: |
| 119 | |
| 120 | * 3.2 A72 |
| 121 | |
| 122 | .. include:: k3.rst |
| 123 | :start-after: .. k3_rst_include_start_build_steps_uboot |
| 124 | :end-before: .. k3_rst_include_end_build_steps_uboot |
| 125 | .. j784s4_evm_rst_include_end_build_steps |
| 126 | |
| 127 | Target Images |
| 128 | ------------- |
| 129 | In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC |
| 130 | variant (GP, HS-FS, HS-SE) requires a different source for these files. |
| 131 | |
| 132 | - GP |
| 133 | |
| 134 | * tiboot3-j784s4-gp-evm.bin from :ref:`step 3.1 <j784s4_evm_rst_u_boot_r5>` |
| 135 | * tispl.bin_unsigned, u-boot.img_unsigned from :ref:`step 3.2 <j784s4_evm_rst_u_boot_a72>` |
| 136 | |
| 137 | - HS-FS |
| 138 | |
| 139 | * tiboot3-j784s4-hs-fs-evm.bin from :ref:`step 3.1 <j784s4_evm_rst_u_boot_r5>` |
| 140 | * tispl.bin, u-boot.img from :ref:`step 3.2 <j784s4_evm_rst_u_boot_a72>` |
| 141 | |
| 142 | - HS-SE |
| 143 | |
| 144 | * tiboot3-j784s4-hs-evm.bin from :ref:`step 3.1 <j784s4_evm_rst_u_boot_r5>` |
| 145 | * tispl.bin, u-boot.img from :ref:`step 3.2 <j784s4_evm_rst_u_boot_a72>` |
| 146 | |
| 147 | Image formats |
| 148 | ------------- |
| 149 | |
| 150 | - tiboot3.bin |
| 151 | |
| 152 | .. image:: img/multi_cert_tiboot3.bin.svg |
| 153 | :alt: tiboot3.bin format |
| 154 | |
| 155 | - tispl.bin |
| 156 | |
| 157 | .. image:: img/dm_tispl.bin.svg |
| 158 | :alt: tispl.bin format |
| 159 | |
Jonathan Humphreys | ca67002 | 2024-06-14 11:35:51 -0500 | [diff] [blame] | 160 | OSPI: |
| 161 | ----- |
| 162 | ROM supports booting from OSPI from offset 0x0. |
| 163 | |
| 164 | Flashing images to OSPI NOR: |
| 165 | |
| 166 | Below commands can be used to download tiboot3.bin, tispl.bin, and |
| 167 | u-boot.img over tftp and then flash those to OSPI at their respective |
| 168 | addresses. |
| 169 | |
| 170 | .. prompt:: bash => |
| 171 | |
| 172 | sf probe |
| 173 | tftp ${loadaddr} tiboot3.bin |
| 174 | sf update $loadaddr 0x0 $filesize |
| 175 | tftp ${loadaddr} tispl.bin |
| 176 | sf update $loadaddr 0x80000 $filesize |
| 177 | tftp ${loadaddr} u-boot.img |
| 178 | sf update $loadaddr 0x280000 $filesize |
| 179 | |
| 180 | Flash layout for OSPI NOR: |
| 181 | |
| 182 | .. image:: img/ospi_sysfw3.svg |
| 183 | :alt: OSPI NOR flash partition layout |
| 184 | |
Apurva Nandan | 2b1c9ff | 2024-02-24 01:51:53 +0530 | [diff] [blame] | 185 | R5 Memory Map |
| 186 | ------------- |
| 187 | |
| 188 | .. list-table:: |
| 189 | :widths: 16 16 16 |
| 190 | :header-rows: 1 |
| 191 | |
| 192 | * - Region |
| 193 | - Start Address |
| 194 | - End Address |
| 195 | |
| 196 | * - SPL |
| 197 | - 0x41c00000 |
| 198 | - 0x41c40000 |
| 199 | |
| 200 | * - EMPTY |
| 201 | - 0x41c40000 |
| 202 | - 0x41c61f20 |
| 203 | |
| 204 | * - STACK |
| 205 | - 0x41c65f20 |
| 206 | - 0x41c61f20 |
| 207 | |
| 208 | * - Global data |
| 209 | - 0x41c65f20 |
| 210 | - 0x41c66000 |
| 211 | |
| 212 | * - Heap |
| 213 | - 0x41c66000 |
| 214 | - 0x41c76000 |
| 215 | |
| 216 | * - BSS |
| 217 | - 0x41c76000 |
| 218 | - 0x41c80000 |
| 219 | |
| 220 | * - DM DATA |
| 221 | - 0x41c80000 |
| 222 | - 0x41c84130 |
| 223 | |
| 224 | * - EMPTY |
| 225 | - 0x41c84130 |
| 226 | - 0x41cff9fc |
| 227 | |
| 228 | * - MCU Scratchpad |
| 229 | - 0x41cff9fc |
| 230 | - 0x41cffbfc |
| 231 | |
| 232 | * - ROM DATA |
| 233 | - 0x41cffbfc |
| 234 | - 0x41cfffff |
| 235 | |
| 236 | Switch Setting for Boot Mode |
| 237 | ---------------------------- |
| 238 | |
| 239 | Boot Mode pins provide means to select the boot mode and options before the |
| 240 | device is powered up. After every POR, they are the main source to populate |
| 241 | the Boot Parameter Tables. |
| 242 | |
| 243 | Boot Mode Pins for J784S4-EVM |
| 244 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 245 | |
| 246 | The following tables show some common boot modes used on J784S4 EVM platform. |
| 247 | More details can be found in the Technical Reference Manual: |
| 248 | http://www.ti.com/lit/zip/spruj52 under the `Boot Mode Pins` section. |
| 249 | |
| 250 | .. list-table:: J784S4 EVM Boot Modes |
| 251 | :widths: 16 16 16 |
| 252 | :header-rows: 1 |
| 253 | |
| 254 | * - Switch Label |
| 255 | - SW11: 12345678 |
| 256 | - SW7: 12345678 |
| 257 | |
| 258 | * - SD |
| 259 | - 10000010 |
| 260 | - 00000000 |
| 261 | |
| 262 | * - EMMC |
| 263 | - 10000000 |
| 264 | - 01000000 |
| 265 | |
| 266 | * - OSPI |
| 267 | - 00000110 |
| 268 | - 01000000 |
| 269 | |
| 270 | * - UART |
| 271 | - 00000000 |
| 272 | - 01110000 |
| 273 | |
| 274 | For SW7 and SW11, the switch state in the "ON" position = 1. |
| 275 | |
| 276 | Boot Mode Pins for AM69-SK |
| 277 | ^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 278 | |
| 279 | The following table show some common boot modes used on AM69-SK platform. |
| 280 | More details can be found in the User Guide for AM69-SK: |
| 281 | https://www.ti.com/lit/ug/spruj70/spruj70.pdf under the `Bootmode Settings` |
| 282 | section. |
| 283 | |
| 284 | .. list-table:: AM69 SK Boot Modes |
| 285 | :widths: 16 16 |
| 286 | :header-rows: 1 |
| 287 | |
| 288 | * - Switch Label |
| 289 | - SW2: 1234 |
| 290 | |
| 291 | * - SD |
| 292 | - 0000 |
| 293 | |
Jonathan Humphreys | ca67002 | 2024-06-14 11:35:51 -0500 | [diff] [blame] | 294 | * - OSPI |
| 295 | - 0010 |
| 296 | |
Apurva Nandan | 2b1c9ff | 2024-02-24 01:51:53 +0530 | [diff] [blame] | 297 | * - EMMC |
| 298 | - 0110 |
| 299 | |
| 300 | * - UART |
| 301 | - 1010 |
| 302 | |
| 303 | For SW2, the switch state in the "ON" position = 1. |
| 304 | |
| 305 | Debugging U-Boot |
| 306 | ---------------- |
| 307 | |
| 308 | See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for |
| 309 | detailed setup information. |
| 310 | |
| 311 | .. warning:: |
| 312 | |
| 313 | **OpenOCD support since**: September 2023 (git master) |
| 314 | |
| 315 | Until the next stable release of OpenOCD is available in your development |
| 316 | environment's distribution, it might be necessary to build OpenOCD `from the |
| 317 | source <https://github.com/openocd-org/openocd>`_. |
| 318 | |
| 319 | Debugging U-Boot on J784S4-EVM and AM69-SK |
| 320 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 321 | |
| 322 | .. include:: k3.rst |
| 323 | :start-after: .. k3_rst_include_start_openocd_connect_XDS110 |
| 324 | :end-before: .. k3_rst_include_end_openocd_connect_XDS110 |
| 325 | |
| 326 | To start OpenOCD and connect to J784S4-EVM or AM69-SK board, use the |
| 327 | following. |
| 328 | |
| 329 | .. code-block:: bash |
| 330 | |
| 331 | openocd -f board/ti_j784s4evm.cfg |