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 | ---------------- |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 51 | 1. Trusted Firmware-A: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 52 | |
Andrew Davis | d8fcaa2 | 2022-11-09 11:30:01 -0600 | [diff] [blame] | 53 | .. code-block:: bash |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 54 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 55 | $ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 \ |
| 56 | TARGET_BOARD=generic SPD=opteed |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 57 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 58 | 2. OP-TEE: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 59 | |
Andrew Davis | d8fcaa2 | 2022-11-09 11:30:01 -0600 | [diff] [blame] | 60 | .. code-block:: bash |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 61 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 62 | $ make PLATFORM=k3-j721e CFG_ARM64_core=y |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 63 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 64 | 3. U-Boot: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 65 | |
| 66 | * 4.1 R5: |
| 67 | |
Andrew Davis | d8fcaa2 | 2022-11-09 11:30:01 -0600 | [diff] [blame] | 68 | .. code-block:: bash |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 69 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 70 | $ make j721e_evm_r5_defconfig |
| 71 | $ make CROSS_COMPILE=arm-linux-gnueabihf- \ |
| 72 | BINMAN_INDIRS=<path/to/ti-linux-firmware> |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 73 | |
| 74 | * 4.2 A72: |
| 75 | |
Andrew Davis | d8fcaa2 | 2022-11-09 11:30:01 -0600 | [diff] [blame] | 76 | .. code-block:: bash |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 77 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 78 | $ make j721e_evm_a72_defconfig |
| 79 | $ make CROSS_COMPILE=aarch64-linux-gnu- \ |
| 80 | BL31=<path/to/trusted-firmware-a/dir>/build/k3/generic/release/bl31.bin \ |
| 81 | TEE=<path/to/optee_os/dir>/out/arm-plat-k3/core/tee-raw.bin \ |
| 82 | BINMAN_INDIRS=<path/to/ti-linux-firmware> |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 83 | |
| 84 | Target Images |
| 85 | -------------- |
Tom Rini | fdf4503 | 2023-07-25 12:44:16 -0400 | [diff] [blame] | 86 | In order to boot we need tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img. |
| 87 | Each SoC variant (GP, HS-FS and HS-SE) requires a different source for these |
| 88 | files. |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 89 | |
| 90 | - GP |
| 91 | |
| 92 | * tiboot3-j721e-gp-evm.bin, sysfw-j721e-gp-evm.itb from step 4.1 |
| 93 | * tispl.bin_unsigned, u-boot.img_unsigned from step 4.2 |
| 94 | |
| 95 | - HS-FS |
| 96 | |
| 97 | * tiboot3-j721e_sr2-hs-fs-evm.bin, sysfw-j721e_sr2-hs-fs-evm.itb from step 4.1 |
| 98 | * tispl.bin, u-boot.img from step 4.2 |
| 99 | |
| 100 | - HS-SE |
| 101 | |
| 102 | * tiboot3-j721e_sr2-hs-evm.bin, sysfw-j721e_sr2-hs-evm.itb from step 4.1 |
| 103 | * tispl.bin, u-boot.img from step 4.2 |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 104 | |
| 105 | Image formats: |
| 106 | -------------- |
| 107 | |
| 108 | - tiboot3.bin: |
| 109 | |
| 110 | .. code-block:: text |
| 111 | |
| 112 | +-----------------------+ |
| 113 | | X.509 | |
| 114 | | Certificate | |
| 115 | | +-------------------+ | |
| 116 | | | | | |
| 117 | | | R5 | | |
| 118 | | | u-boot-spl.bin | | |
| 119 | | | | | |
| 120 | | +-------------------+ | |
| 121 | | | | | |
| 122 | | | FIT header | | |
| 123 | | | +---------------+ | | |
| 124 | | | | | | | |
| 125 | | | | DTB 1...N | | | |
| 126 | | | +---------------+ | | |
| 127 | | +-------------------+ | |
| 128 | +-----------------------+ |
| 129 | |
| 130 | - tispl.bin |
| 131 | |
| 132 | .. code-block:: text |
| 133 | |
| 134 | +-----------------------+ |
| 135 | | | |
| 136 | | FIT HEADER | |
| 137 | | +-------------------+ | |
| 138 | | | | | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 139 | | | A72 TF-A | | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 140 | | +-------------------+ | |
| 141 | | | | | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 142 | | | A72 OP-TEE | | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 143 | | +-------------------+ | |
| 144 | | | | | |
| 145 | | | R5 DM FW | | |
| 146 | | +-------------------+ | |
| 147 | | | | | |
| 148 | | | A72 SPL | | |
| 149 | | +-------------------+ | |
| 150 | | | | | |
| 151 | | | SPL DTB 1...N | | |
| 152 | | +-------------------+ | |
| 153 | +-----------------------+ |
| 154 | |
| 155 | - sysfw.itb |
| 156 | |
| 157 | .. code-block:: text |
| 158 | |
| 159 | +-----------------------+ |
| 160 | | | |
| 161 | | FIT HEADER | |
| 162 | | +-------------------+ | |
| 163 | | | | | |
| 164 | | | sysfw.bin | | |
| 165 | | +-------------------+ | |
| 166 | | | | | |
| 167 | | | board config | | |
| 168 | | +-------------------+ | |
| 169 | | | | | |
| 170 | | | PM config | | |
| 171 | | +-------------------+ | |
| 172 | | | | | |
| 173 | | | RM config | | |
| 174 | | +-------------------+ | |
| 175 | | | | | |
| 176 | | | Secure config | | |
| 177 | | +-------------------+ | |
| 178 | +-----------------------+ |
| 179 | |
Manorit Chawdhry | c4188b9 | 2023-05-16 10:24:36 +0530 | [diff] [blame] | 180 | R5 Memory Map: |
| 181 | -------------- |
| 182 | |
| 183 | .. list-table:: |
| 184 | :widths: 16 16 16 |
| 185 | :header-rows: 1 |
| 186 | |
| 187 | * - Region |
| 188 | - Start Address |
| 189 | - End Address |
| 190 | |
| 191 | * - SPL |
| 192 | - 0x41c00000 |
| 193 | - 0x41c40000 |
| 194 | |
| 195 | * - EMPTY |
| 196 | - 0x41c40000 |
| 197 | - 0x41c81920 |
| 198 | |
| 199 | * - STACK |
| 200 | - 0x41c85920 |
| 201 | - 0x41c81920 |
| 202 | |
| 203 | * - Global data |
| 204 | - 0x41c859f0 |
| 205 | - 0x41c85920 |
| 206 | |
| 207 | * - Heap |
| 208 | - 0x41c859f0 |
| 209 | - 0x41cf59f0 |
| 210 | |
| 211 | * - BSS |
| 212 | - 0x41cf59f0 |
| 213 | - 0x41cff9f0 |
| 214 | |
| 215 | * - MCU Scratchpad |
| 216 | - 0x41cff9fc |
| 217 | - 0x41cffbfc |
| 218 | |
| 219 | * - ROM DATA |
| 220 | - 0x41cffbfc |
| 221 | - 0x41cfffff |
| 222 | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 223 | OSPI: |
| 224 | ----- |
| 225 | ROM supports booting from OSPI from offset 0x0. |
| 226 | |
| 227 | Flashing images to OSPI: |
| 228 | |
| 229 | Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img, |
| 230 | and sysfw.itb over tftp and then flash those to OSPI at their respective |
| 231 | addresses. |
| 232 | |
| 233 | .. code-block:: text |
| 234 | |
| 235 | => sf probe |
| 236 | => tftp ${loadaddr} tiboot3.bin |
| 237 | => sf update $loadaddr 0x0 $filesize |
| 238 | => tftp ${loadaddr} tispl.bin |
| 239 | => sf update $loadaddr 0x80000 $filesize |
| 240 | => tftp ${loadaddr} u-boot.img |
| 241 | => sf update $loadaddr 0x280000 $filesize |
| 242 | => tftp ${loadaddr} sysfw.itb |
| 243 | => sf update $loadaddr 0x6C0000 $filesize |
| 244 | |
| 245 | Flash layout for OSPI: |
| 246 | |
| 247 | .. code-block:: text |
| 248 | |
| 249 | 0x0 +----------------------------+ |
| 250 | | ospi.tiboot3(512K) | |
| 251 | | | |
| 252 | 0x80000 +----------------------------+ |
| 253 | | ospi.tispl(2M) | |
| 254 | | | |
| 255 | 0x280000 +----------------------------+ |
| 256 | | ospi.u-boot(4M) | |
| 257 | | | |
| 258 | 0x680000 +----------------------------+ |
| 259 | | ospi.env(128K) | |
| 260 | | | |
| 261 | 0x6A0000 +----------------------------+ |
| 262 | | ospi.env.backup (128K) | |
| 263 | | | |
| 264 | 0x6C0000 +----------------------------+ |
| 265 | | ospi.sysfw(1M) | |
| 266 | | | |
| 267 | 0x7C0000 +----------------------------+ |
| 268 | | padding (256k) | |
| 269 | 0x800000 +----------------------------+ |
| 270 | | ospi.rootfs(UBIFS) | |
| 271 | | | |
| 272 | +----------------------------+ |
Kishon Vijay Abraham I | dd7f528 | 2021-07-21 21:28:49 +0530 | [diff] [blame] | 273 | |
| 274 | Firmwares: |
| 275 | ---------- |
| 276 | |
| 277 | The J721e u-boot allows firmware to be loaded for the Cortex-R5 subsystem. |
| 278 | The CPSW5G in J7200 and CPSW9G in J721E present in MAIN domain is configured |
| 279 | and controlled by the ethernet firmware that executes in the MAIN Cortex R5. |
| 280 | The default supported environment variables support loading these firmwares |
| 281 | from only MMC. "dorprocboot" env variable has to be set for the U-BOOT to load |
| 282 | and start the remote cores in the system. |
| 283 | |
| 284 | J721E common processor board can be attached to a Ethernet QSGMII card and the |
| 285 | PHY in the card has to be reset before it can be used for data transfer. |
| 286 | "do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to |
| 287 | configure this PHY. |