Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
| 2 | .. sectionauthor:: Lokesh Vutla <lokeshvutla@ti.com> |
| 3 | |
Bryan Brattlof | 10d3f17 | 2022-12-19 14:29:49 -0600 | [diff] [blame] | 4 | J721E Platforms |
| 5 | =============== |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 6 | |
| 7 | Introduction: |
| 8 | ------------- |
| 9 | The J721e family of SoCs are part of K3 Multicore SoC architecture platform |
| 10 | targeting automotive applications. They are designed as a low power, high |
| 11 | performance and highly integrated device architecture, adding significant |
| 12 | enhancement on processing power, graphics capability, video and imaging |
| 13 | processing, virtualization and coherent memory support. |
| 14 | |
| 15 | The device is partitioned into three functional domains, each containing |
| 16 | specific processing cores and peripherals: |
| 17 | |
| 18 | 1. Wake-up (WKUP) domain: |
| 19 | * Device Management and Security Controller (DMSC) |
| 20 | |
| 21 | 2. Microcontroller (MCU) domain: |
| 22 | * Dual Core ARM Cortex-R5F processor |
| 23 | |
| 24 | 3. MAIN domain: |
| 25 | * Dual core 64-bit ARM Cortex-A72 |
| 26 | * 2 x Dual cortex ARM Cortex-R5 subsystem |
| 27 | * 2 x C66x Digital signal processor sub system |
| 28 | * C71x Digital signal processor sub-system with MMA. |
| 29 | |
Nishanth Menon | eaa39c6 | 2023-11-01 15:56:03 -0500 | [diff] [blame] | 30 | More info can be found in TRM: https://www.ti.com/lit/pdf/spruil1 |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 31 | |
Nishanth Menon | 4981d9a | 2023-07-27 13:59:00 -0500 | [diff] [blame] | 32 | Platform information: |
| 33 | |
| 34 | * https://www.ti.com/tool/J721EXSOMXEVM |
| 35 | * https://www.ti.com/tool/SK-TDA4VM |
| 36 | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 37 | Boot Flow: |
| 38 | ---------- |
| 39 | Boot flow is similar to that of AM65x SoC and extending it with remoteproc |
| 40 | support. Below is the pictorial representation of boot flow: |
| 41 | |
Nishanth Menon | 0a2d2ef | 2023-07-27 13:58:47 -0500 | [diff] [blame] | 42 | .. image:: img/boot_diagram_j721e.svg |
Nishanth Menon | e627a64 | 2023-08-22 11:41:01 -0500 | [diff] [blame] | 43 | :alt: Boot flow diagram |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 44 | |
| 45 | - Here DMSC acts as master and provides all the critical services. R5/A72 |
| 46 | requests DMSC to get these services done as shown in the above diagram. |
| 47 | |
| 48 | Sources: |
| 49 | -------- |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 50 | |
Nishanth Menon | 42e8a10 | 2023-11-04 02:21:50 -0500 | [diff] [blame] | 51 | .. include:: ../ti/k3.rst |
Nishanth Menon | ee91e48 | 2023-07-27 13:58:44 -0500 | [diff] [blame] | 52 | :start-after: .. k3_rst_include_start_boot_sources |
| 53 | :end-before: .. k3_rst_include_end_boot_sources |
Andrew Davis | 4bb0645 | 2022-11-09 11:30:00 -0600 | [diff] [blame] | 54 | |
Dhruva Gole | 26e0ddf | 2024-08-05 19:59:33 +0530 | [diff] [blame] | 55 | .. include:: ../ti/k3.rst |
| 56 | :start-after: .. k3_rst_include_start_boot_firmwares |
| 57 | :end-before: .. k3_rst_include_end_boot_firmwares |
| 58 | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 59 | Build procedure: |
| 60 | ---------------- |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 61 | 0. Setup the environment variables: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 62 | |
Nishanth Menon | 42e8a10 | 2023-11-04 02:21:50 -0500 | [diff] [blame] | 63 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 64 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 65 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 66 | |
Nishanth Menon | 42e8a10 | 2023-11-04 02:21:50 -0500 | [diff] [blame] | 67 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 68 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 69 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 70 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 71 | Set the variables corresponding to this platform: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 72 | |
Nishanth Menon | 42e8a10 | 2023-11-04 02:21:50 -0500 | [diff] [blame] | 73 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 74 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 75 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 76 | .. prompt:: bash $ |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 77 | |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 78 | export UBOOT_CFG_CORTEXR=j721e_evm_r5_defconfig |
| 79 | export UBOOT_CFG_CORTEXA=j721e_evm_a72_defconfig |
| 80 | export TFA_BOARD=generic |
| 81 | # we dont use any extra TFA parameters |
| 82 | unset TFA_EXTRA_ARGS |
| 83 | export OPTEE_PLATFORM=k3-j721e |
| 84 | # we dont use any extra OP-TEE parameters |
| 85 | unset OPTEE_EXTRA_ARGS |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 86 | |
| 87 | .. j721e_evm_rst_include_start_build_steps |
| 88 | |
| 89 | 1. Trusted Firmware-A: |
| 90 | |
Nishanth Menon | 42e8a10 | 2023-11-04 02:21:50 -0500 | [diff] [blame] | 91 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 92 | :start-after: .. k3_rst_include_start_build_steps_tfa |
| 93 | :end-before: .. k3_rst_include_end_build_steps_tfa |
| 94 | |
| 95 | |
| 96 | 2. OP-TEE: |
| 97 | |
Nishanth Menon | 42e8a10 | 2023-11-04 02:21:50 -0500 | [diff] [blame] | 98 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 99 | :start-after: .. k3_rst_include_start_build_steps_optee |
| 100 | :end-before: .. k3_rst_include_end_build_steps_optee |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 101 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 102 | 3. U-Boot: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 103 | |
Nishanth Menon | 818fd19 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 104 | * 3.1 R5: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 105 | |
Nishanth Menon | 42e8a10 | 2023-11-04 02:21:50 -0500 | [diff] [blame] | 106 | .. include:: ../ti/k3.rst |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 107 | :start-after: .. k3_rst_include_start_build_steps_spl_r5 |
| 108 | :end-before: .. k3_rst_include_end_build_steps_spl_r5 |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 109 | |
Nishanth Menon | 818fd19 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 110 | * 3.2 A72: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 111 | |
Nishanth Menon | 42e8a10 | 2023-11-04 02:21:50 -0500 | [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_uboot |
| 114 | :end-before: .. k3_rst_include_end_build_steps_uboot |
| 115 | .. j721e_evm_rst_include_end_build_steps |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 116 | |
| 117 | Target Images |
Heinrich Schuchardt | b72160b | 2023-10-28 11:59:32 +0200 | [diff] [blame] | 118 | ------------- |
| 119 | |
Tom Rini | fdf4503 | 2023-07-25 12:44:16 -0400 | [diff] [blame] | 120 | In order to boot we need tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img. |
| 121 | Each SoC variant (GP, HS-FS and HS-SE) requires a different source for these |
| 122 | files. |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 123 | |
| 124 | - GP |
| 125 | |
Nishanth Menon | 818fd19 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 126 | * tiboot3-j721e-gp-evm.bin, sysfw-j721e-gp-evm.itb from step 3.1 |
| 127 | * tispl.bin_unsigned, u-boot.img_unsigned from step 3.2 |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 128 | |
| 129 | - HS-FS |
| 130 | |
Nishanth Menon | 818fd19 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 131 | * tiboot3-j721e_sr2-hs-fs-evm.bin, sysfw-j721e_sr2-hs-fs-evm.itb from step 3.1 |
| 132 | * tispl.bin, u-boot.img from step 3.2 |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 133 | |
| 134 | - HS-SE |
| 135 | |
Nishanth Menon | 818fd19 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 136 | * tiboot3-j721e_sr2-hs-evm.bin, sysfw-j721e_sr2-hs-evm.itb from step 3.1 |
| 137 | * tispl.bin, u-boot.img from step 3.2 |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 138 | |
| 139 | Image formats: |
| 140 | -------------- |
| 141 | |
Nishanth Menon | 0495c4e | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 142 | - tiboot3.bin |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 143 | |
Nishanth Menon | 0495c4e | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 144 | .. image:: img/no_multi_cert_tiboot3.bin.svg |
Nishanth Menon | e627a64 | 2023-08-22 11:41:01 -0500 | [diff] [blame] | 145 | :alt: tiboot3.bin image format |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 146 | |
| 147 | - tispl.bin |
| 148 | |
Nishanth Menon | 0495c4e | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 149 | .. image:: img/dm_tispl.bin.svg |
Nishanth Menon | e627a64 | 2023-08-22 11:41:01 -0500 | [diff] [blame] | 150 | :alt: tispl.bin image format |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 151 | |
| 152 | - sysfw.itb |
| 153 | |
Nishanth Menon | 0495c4e | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 154 | .. image:: img/sysfw.itb.svg |
Nishanth Menon | e627a64 | 2023-08-22 11:41:01 -0500 | [diff] [blame] | 155 | :alt: sysfw.itb image format |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 156 | |
Jonathan Humphreys | aed0d63 | 2024-06-14 11:35:36 -0500 | [diff] [blame] | 157 | OSPI: |
| 158 | ----- |
| 159 | ROM supports booting from OSPI from offset 0x0. |
| 160 | |
| 161 | Flashing images to OSPI: |
| 162 | |
| 163 | Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img, |
| 164 | and sysfw.itb over tftp and then flash those to OSPI at their respective |
| 165 | addresses. |
| 166 | |
| 167 | .. prompt:: bash => |
| 168 | |
| 169 | sf probe |
| 170 | tftp ${loadaddr} tiboot3.bin |
| 171 | sf update $loadaddr 0x0 $filesize |
| 172 | tftp ${loadaddr} tispl.bin |
| 173 | sf update $loadaddr 0x80000 $filesize |
| 174 | tftp ${loadaddr} u-boot.img |
| 175 | sf update $loadaddr 0x280000 $filesize |
| 176 | tftp ${loadaddr} sysfw.itb |
| 177 | sf update $loadaddr 0x6C0000 $filesize |
| 178 | |
| 179 | Flash layout for OSPI: |
| 180 | |
| 181 | .. image:: img/ospi_sysfw.svg |
| 182 | :alt: OSPI flash partition layout |
| 183 | |
Manorit Chawdhry | c4188b9 | 2023-05-16 10:24:36 +0530 | [diff] [blame] | 184 | R5 Memory Map: |
| 185 | -------------- |
| 186 | |
| 187 | .. list-table:: |
| 188 | :widths: 16 16 16 |
| 189 | :header-rows: 1 |
| 190 | |
| 191 | * - Region |
| 192 | - Start Address |
| 193 | - End Address |
| 194 | |
| 195 | * - SPL |
| 196 | - 0x41c00000 |
| 197 | - 0x41c40000 |
| 198 | |
| 199 | * - EMPTY |
| 200 | - 0x41c40000 |
| 201 | - 0x41c81920 |
| 202 | |
| 203 | * - STACK |
| 204 | - 0x41c85920 |
| 205 | - 0x41c81920 |
| 206 | |
| 207 | * - Global data |
| 208 | - 0x41c859f0 |
| 209 | - 0x41c85920 |
| 210 | |
| 211 | * - Heap |
| 212 | - 0x41c859f0 |
| 213 | - 0x41cf59f0 |
| 214 | |
| 215 | * - BSS |
| 216 | - 0x41cf59f0 |
| 217 | - 0x41cff9f0 |
| 218 | |
| 219 | * - MCU Scratchpad |
| 220 | - 0x41cff9fc |
| 221 | - 0x41cffbfc |
| 222 | |
| 223 | * - ROM DATA |
| 224 | - 0x41cffbfc |
| 225 | - 0x41cfffff |
| 226 | |
Jonathan Humphreys | aed0d63 | 2024-06-14 11:35:36 -0500 | [diff] [blame] | 227 | Firmware: |
| 228 | --------- |
Kishon Vijay Abraham I | dd7f528 | 2021-07-21 21:28:49 +0530 | [diff] [blame] | 229 | |
| 230 | The J721e u-boot allows firmware to be loaded for the Cortex-R5 subsystem. |
| 231 | The CPSW5G in J7200 and CPSW9G in J721E present in MAIN domain is configured |
| 232 | and controlled by the ethernet firmware that executes in the MAIN Cortex R5. |
| 233 | The default supported environment variables support loading these firmwares |
| 234 | from only MMC. "dorprocboot" env variable has to be set for the U-BOOT to load |
| 235 | and start the remote cores in the system. |
| 236 | |
| 237 | J721E common processor board can be attached to a Ethernet QSGMII card and the |
| 238 | PHY in the card has to be reset before it can be used for data transfer. |
| 239 | "do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to |
| 240 | configure this PHY. |
Jason Kacines | b0fdee9 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 241 | |
| 242 | Debugging U-Boot |
| 243 | ---------------- |
| 244 | |
| 245 | See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for |
| 246 | detailed setup information. |
| 247 | |
| 248 | .. warning:: |
| 249 | |
| 250 | **OpenOCD support since**: v0.12.0 |
| 251 | |
| 252 | If the default package version of OpenOCD in your development |
| 253 | environment's distribution needs to be updated, it might be necessary to |
| 254 | build OpenOCD from the source. |
| 255 | |
Nishanth Menon | 42e8a10 | 2023-11-04 02:21:50 -0500 | [diff] [blame] | 256 | .. include:: ../ti/k3.rst |
Jason Kacines | b0fdee9 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 257 | :start-after: .. k3_rst_include_start_openocd_connect_XDS110 |
| 258 | :end-before: .. k3_rst_include_end_openocd_connect_XDS110 |
| 259 | |
| 260 | To start OpenOCD and connect to the board |
| 261 | |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 262 | .. prompt:: bash $ |
Jason Kacines | b0fdee9 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 263 | |
| 264 | openocd -f board/ti_j721eevm.cfg |