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 | |
| 30 | More info can be found in TRM: http://www.ti.com/lit/pdf/spruil1 |
| 31 | |
| 32 | Boot Flow: |
| 33 | ---------- |
| 34 | Boot flow is similar to that of AM65x SoC and extending it with remoteproc |
| 35 | support. Below is the pictorial representation of boot flow: |
| 36 | |
Nishanth Menon | 0a2d2ef | 2023-07-27 13:58:47 -0500 | [diff] [blame] | 37 | .. image:: img/boot_diagram_j721e.svg |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 38 | |
| 39 | - Here DMSC acts as master and provides all the critical services. R5/A72 |
| 40 | requests DMSC to get these services done as shown in the above diagram. |
| 41 | |
| 42 | Sources: |
| 43 | -------- |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 44 | |
Nishanth Menon | ee91e48 | 2023-07-27 13:58:44 -0500 | [diff] [blame] | 45 | .. include:: k3.rst |
| 46 | :start-after: .. k3_rst_include_start_boot_sources |
| 47 | :end-before: .. k3_rst_include_end_boot_sources |
Andrew Davis | 4bb0645 | 2022-11-09 11:30:00 -0600 | [diff] [blame] | 48 | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 49 | Build procedure: |
| 50 | ---------------- |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 51 | 0. Setup the environment variables: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 52 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 53 | .. include:: k3.rst |
| 54 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 55 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 56 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 57 | .. include:: k3.rst |
| 58 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 59 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 60 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 61 | Set the variables corresponding to this platform: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 62 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 63 | .. include:: k3.rst |
| 64 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 65 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
Andrew Davis | d8fcaa2 | 2022-11-09 11:30:01 -0600 | [diff] [blame] | 66 | .. code-block:: bash |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 67 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 68 | $ export UBOOT_CFG_CORTEXR=j721e_evm_r5_defconfig |
| 69 | $ export UBOOT_CFG_CORTEXA=j721e_evm_a72_defconfig |
| 70 | $ export TFA_BOARD=generic |
| 71 | $ # we dont use any extra TFA parameters |
| 72 | $ unset TFA_EXTRA_ARGS |
| 73 | $ export OPTEE_PLATFORM=k3-j721e |
| 74 | $ # we dont use any extra OP-TEE parameters |
| 75 | $ unset OPTEE_EXTRA_ARGS |
| 76 | |
| 77 | .. j721e_evm_rst_include_start_build_steps |
| 78 | |
| 79 | 1. Trusted Firmware-A: |
| 80 | |
| 81 | .. include:: k3.rst |
| 82 | :start-after: .. k3_rst_include_start_build_steps_tfa |
| 83 | :end-before: .. k3_rst_include_end_build_steps_tfa |
| 84 | |
| 85 | |
| 86 | 2. OP-TEE: |
| 87 | |
| 88 | .. include:: k3.rst |
| 89 | :start-after: .. k3_rst_include_start_build_steps_optee |
| 90 | :end-before: .. k3_rst_include_end_build_steps_optee |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 91 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 92 | 3. U-Boot: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 93 | |
| 94 | * 4.1 R5: |
| 95 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 96 | .. include:: k3.rst |
| 97 | :start-after: .. k3_rst_include_start_build_steps_spl_r5 |
| 98 | :end-before: .. k3_rst_include_end_build_steps_spl_r5 |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 99 | |
| 100 | * 4.2 A72: |
| 101 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 102 | .. include:: k3.rst |
| 103 | :start-after: .. k3_rst_include_start_build_steps_uboot |
| 104 | :end-before: .. k3_rst_include_end_build_steps_uboot |
| 105 | .. j721e_evm_rst_include_end_build_steps |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 106 | |
| 107 | Target Images |
| 108 | -------------- |
Tom Rini | fdf4503 | 2023-07-25 12:44:16 -0400 | [diff] [blame] | 109 | In order to boot we need tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img. |
| 110 | Each SoC variant (GP, HS-FS and HS-SE) requires a different source for these |
| 111 | files. |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 112 | |
| 113 | - GP |
| 114 | |
| 115 | * tiboot3-j721e-gp-evm.bin, sysfw-j721e-gp-evm.itb from step 4.1 |
| 116 | * tispl.bin_unsigned, u-boot.img_unsigned from step 4.2 |
| 117 | |
| 118 | - HS-FS |
| 119 | |
| 120 | * tiboot3-j721e_sr2-hs-fs-evm.bin, sysfw-j721e_sr2-hs-fs-evm.itb from step 4.1 |
| 121 | * tispl.bin, u-boot.img from step 4.2 |
| 122 | |
| 123 | - HS-SE |
| 124 | |
| 125 | * tiboot3-j721e_sr2-hs-evm.bin, sysfw-j721e_sr2-hs-evm.itb from step 4.1 |
| 126 | * tispl.bin, u-boot.img from step 4.2 |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 127 | |
| 128 | Image formats: |
| 129 | -------------- |
| 130 | |
| 131 | - tiboot3.bin: |
| 132 | |
| 133 | .. code-block:: text |
| 134 | |
| 135 | +-----------------------+ |
| 136 | | X.509 | |
| 137 | | Certificate | |
| 138 | | +-------------------+ | |
| 139 | | | | | |
| 140 | | | R5 | | |
| 141 | | | u-boot-spl.bin | | |
| 142 | | | | | |
| 143 | | +-------------------+ | |
| 144 | | | | | |
| 145 | | | FIT header | | |
| 146 | | | +---------------+ | | |
| 147 | | | | | | | |
| 148 | | | | DTB 1...N | | | |
| 149 | | | +---------------+ | | |
| 150 | | +-------------------+ | |
| 151 | +-----------------------+ |
| 152 | |
| 153 | - tispl.bin |
| 154 | |
| 155 | .. code-block:: text |
| 156 | |
| 157 | +-----------------------+ |
| 158 | | | |
| 159 | | FIT HEADER | |
| 160 | | +-------------------+ | |
| 161 | | | | | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 162 | | | A72 TF-A | | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 163 | | +-------------------+ | |
| 164 | | | | | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 165 | | | A72 OP-TEE | | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 166 | | +-------------------+ | |
| 167 | | | | | |
| 168 | | | R5 DM FW | | |
| 169 | | +-------------------+ | |
| 170 | | | | | |
| 171 | | | A72 SPL | | |
| 172 | | +-------------------+ | |
| 173 | | | | | |
| 174 | | | SPL DTB 1...N | | |
| 175 | | +-------------------+ | |
| 176 | +-----------------------+ |
| 177 | |
| 178 | - sysfw.itb |
| 179 | |
| 180 | .. code-block:: text |
| 181 | |
| 182 | +-----------------------+ |
| 183 | | | |
| 184 | | FIT HEADER | |
| 185 | | +-------------------+ | |
| 186 | | | | | |
| 187 | | | sysfw.bin | | |
| 188 | | +-------------------+ | |
| 189 | | | | | |
| 190 | | | board config | | |
| 191 | | +-------------------+ | |
| 192 | | | | | |
| 193 | | | PM config | | |
| 194 | | +-------------------+ | |
| 195 | | | | | |
| 196 | | | RM config | | |
| 197 | | +-------------------+ | |
| 198 | | | | | |
| 199 | | | Secure config | | |
| 200 | | +-------------------+ | |
| 201 | +-----------------------+ |
| 202 | |
Manorit Chawdhry | c4188b9 | 2023-05-16 10:24:36 +0530 | [diff] [blame] | 203 | R5 Memory Map: |
| 204 | -------------- |
| 205 | |
| 206 | .. list-table:: |
| 207 | :widths: 16 16 16 |
| 208 | :header-rows: 1 |
| 209 | |
| 210 | * - Region |
| 211 | - Start Address |
| 212 | - End Address |
| 213 | |
| 214 | * - SPL |
| 215 | - 0x41c00000 |
| 216 | - 0x41c40000 |
| 217 | |
| 218 | * - EMPTY |
| 219 | - 0x41c40000 |
| 220 | - 0x41c81920 |
| 221 | |
| 222 | * - STACK |
| 223 | - 0x41c85920 |
| 224 | - 0x41c81920 |
| 225 | |
| 226 | * - Global data |
| 227 | - 0x41c859f0 |
| 228 | - 0x41c85920 |
| 229 | |
| 230 | * - Heap |
| 231 | - 0x41c859f0 |
| 232 | - 0x41cf59f0 |
| 233 | |
| 234 | * - BSS |
| 235 | - 0x41cf59f0 |
| 236 | - 0x41cff9f0 |
| 237 | |
| 238 | * - MCU Scratchpad |
| 239 | - 0x41cff9fc |
| 240 | - 0x41cffbfc |
| 241 | |
| 242 | * - ROM DATA |
| 243 | - 0x41cffbfc |
| 244 | - 0x41cfffff |
| 245 | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 246 | OSPI: |
| 247 | ----- |
| 248 | ROM supports booting from OSPI from offset 0x0. |
| 249 | |
| 250 | Flashing images to OSPI: |
| 251 | |
| 252 | Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img, |
| 253 | and sysfw.itb over tftp and then flash those to OSPI at their respective |
| 254 | addresses. |
| 255 | |
| 256 | .. code-block:: text |
| 257 | |
| 258 | => sf probe |
| 259 | => tftp ${loadaddr} tiboot3.bin |
| 260 | => sf update $loadaddr 0x0 $filesize |
| 261 | => tftp ${loadaddr} tispl.bin |
| 262 | => sf update $loadaddr 0x80000 $filesize |
| 263 | => tftp ${loadaddr} u-boot.img |
| 264 | => sf update $loadaddr 0x280000 $filesize |
| 265 | => tftp ${loadaddr} sysfw.itb |
| 266 | => sf update $loadaddr 0x6C0000 $filesize |
| 267 | |
| 268 | Flash layout for OSPI: |
| 269 | |
| 270 | .. code-block:: text |
| 271 | |
| 272 | 0x0 +----------------------------+ |
| 273 | | ospi.tiboot3(512K) | |
| 274 | | | |
| 275 | 0x80000 +----------------------------+ |
| 276 | | ospi.tispl(2M) | |
| 277 | | | |
| 278 | 0x280000 +----------------------------+ |
| 279 | | ospi.u-boot(4M) | |
| 280 | | | |
| 281 | 0x680000 +----------------------------+ |
| 282 | | ospi.env(128K) | |
| 283 | | | |
| 284 | 0x6A0000 +----------------------------+ |
| 285 | | ospi.env.backup (128K) | |
| 286 | | | |
| 287 | 0x6C0000 +----------------------------+ |
| 288 | | ospi.sysfw(1M) | |
| 289 | | | |
| 290 | 0x7C0000 +----------------------------+ |
| 291 | | padding (256k) | |
| 292 | 0x800000 +----------------------------+ |
| 293 | | ospi.rootfs(UBIFS) | |
| 294 | | | |
| 295 | +----------------------------+ |
Kishon Vijay Abraham I | dd7f528 | 2021-07-21 21:28:49 +0530 | [diff] [blame] | 296 | |
| 297 | Firmwares: |
| 298 | ---------- |
| 299 | |
| 300 | The J721e u-boot allows firmware to be loaded for the Cortex-R5 subsystem. |
| 301 | The CPSW5G in J7200 and CPSW9G in J721E present in MAIN domain is configured |
| 302 | and controlled by the ethernet firmware that executes in the MAIN Cortex R5. |
| 303 | The default supported environment variables support loading these firmwares |
| 304 | from only MMC. "dorprocboot" env variable has to be set for the U-BOOT to load |
| 305 | and start the remote cores in the system. |
| 306 | |
| 307 | J721E common processor board can be attached to a Ethernet QSGMII card and the |
| 308 | PHY in the card has to be reset before it can be used for data transfer. |
| 309 | "do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to |
| 310 | configure this PHY. |