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 | |
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 |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 43 | |
| 44 | - Here DMSC acts as master and provides all the critical services. R5/A72 |
| 45 | requests DMSC to get these services done as shown in the above diagram. |
| 46 | |
| 47 | Sources: |
| 48 | -------- |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 49 | |
Nishanth Menon | ee91e48 | 2023-07-27 13:58:44 -0500 | [diff] [blame] | 50 | .. include:: k3.rst |
| 51 | :start-after: .. k3_rst_include_start_boot_sources |
| 52 | :end-before: .. k3_rst_include_end_boot_sources |
Andrew Davis | 4bb0645 | 2022-11-09 11:30:00 -0600 | [diff] [blame] | 53 | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 54 | Build procedure: |
| 55 | ---------------- |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 56 | 0. Setup the environment variables: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 57 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 58 | .. include:: k3.rst |
| 59 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 60 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 61 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 62 | .. include:: k3.rst |
| 63 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 64 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 65 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 66 | Set the variables corresponding to this platform: |
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 | .. include:: k3.rst |
| 69 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 70 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
Andrew Davis | d8fcaa2 | 2022-11-09 11:30:01 -0600 | [diff] [blame] | 71 | .. code-block:: bash |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 72 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 73 | $ export UBOOT_CFG_CORTEXR=j721e_evm_r5_defconfig |
| 74 | $ export UBOOT_CFG_CORTEXA=j721e_evm_a72_defconfig |
| 75 | $ export TFA_BOARD=generic |
| 76 | $ # we dont use any extra TFA parameters |
| 77 | $ unset TFA_EXTRA_ARGS |
| 78 | $ export OPTEE_PLATFORM=k3-j721e |
| 79 | $ # we dont use any extra OP-TEE parameters |
| 80 | $ unset OPTEE_EXTRA_ARGS |
| 81 | |
| 82 | .. j721e_evm_rst_include_start_build_steps |
| 83 | |
| 84 | 1. Trusted Firmware-A: |
| 85 | |
| 86 | .. include:: k3.rst |
| 87 | :start-after: .. k3_rst_include_start_build_steps_tfa |
| 88 | :end-before: .. k3_rst_include_end_build_steps_tfa |
| 89 | |
| 90 | |
| 91 | 2. OP-TEE: |
| 92 | |
| 93 | .. include:: k3.rst |
| 94 | :start-after: .. k3_rst_include_start_build_steps_optee |
| 95 | :end-before: .. k3_rst_include_end_build_steps_optee |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 96 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 97 | 3. U-Boot: |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 98 | |
| 99 | * 4.1 R5: |
| 100 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 101 | .. include:: k3.rst |
| 102 | :start-after: .. k3_rst_include_start_build_steps_spl_r5 |
| 103 | :end-before: .. k3_rst_include_end_build_steps_spl_r5 |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 104 | |
| 105 | * 4.2 A72: |
| 106 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 107 | .. include:: k3.rst |
| 108 | :start-after: .. k3_rst_include_start_build_steps_uboot |
| 109 | :end-before: .. k3_rst_include_end_build_steps_uboot |
| 110 | .. j721e_evm_rst_include_end_build_steps |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 111 | |
| 112 | Target Images |
| 113 | -------------- |
Tom Rini | fdf4503 | 2023-07-25 12:44:16 -0400 | [diff] [blame] | 114 | In order to boot we need tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img. |
| 115 | Each SoC variant (GP, HS-FS and HS-SE) requires a different source for these |
| 116 | files. |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 117 | |
| 118 | - GP |
| 119 | |
| 120 | * tiboot3-j721e-gp-evm.bin, sysfw-j721e-gp-evm.itb from step 4.1 |
| 121 | * tispl.bin_unsigned, u-boot.img_unsigned from step 4.2 |
| 122 | |
| 123 | - HS-FS |
| 124 | |
| 125 | * tiboot3-j721e_sr2-hs-fs-evm.bin, sysfw-j721e_sr2-hs-fs-evm.itb from step 4.1 |
| 126 | * tispl.bin, u-boot.img from step 4.2 |
| 127 | |
| 128 | - HS-SE |
| 129 | |
| 130 | * tiboot3-j721e_sr2-hs-evm.bin, sysfw-j721e_sr2-hs-evm.itb from step 4.1 |
| 131 | * tispl.bin, u-boot.img from step 4.2 |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 132 | |
| 133 | Image formats: |
| 134 | -------------- |
| 135 | |
Nishanth Menon | 0495c4e | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 136 | - tiboot3.bin |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 137 | |
Nishanth Menon | 0495c4e | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 138 | .. image:: img/no_multi_cert_tiboot3.bin.svg |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 139 | |
| 140 | - tispl.bin |
| 141 | |
Nishanth Menon | 0495c4e | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 142 | .. image:: img/dm_tispl.bin.svg |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 143 | |
| 144 | - sysfw.itb |
| 145 | |
Nishanth Menon | 0495c4e | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 146 | .. image:: img/sysfw.itb.svg |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 147 | |
Manorit Chawdhry | c4188b9 | 2023-05-16 10:24:36 +0530 | [diff] [blame] | 148 | R5 Memory Map: |
| 149 | -------------- |
| 150 | |
| 151 | .. list-table:: |
| 152 | :widths: 16 16 16 |
| 153 | :header-rows: 1 |
| 154 | |
| 155 | * - Region |
| 156 | - Start Address |
| 157 | - End Address |
| 158 | |
| 159 | * - SPL |
| 160 | - 0x41c00000 |
| 161 | - 0x41c40000 |
| 162 | |
| 163 | * - EMPTY |
| 164 | - 0x41c40000 |
| 165 | - 0x41c81920 |
| 166 | |
| 167 | * - STACK |
| 168 | - 0x41c85920 |
| 169 | - 0x41c81920 |
| 170 | |
| 171 | * - Global data |
| 172 | - 0x41c859f0 |
| 173 | - 0x41c85920 |
| 174 | |
| 175 | * - Heap |
| 176 | - 0x41c859f0 |
| 177 | - 0x41cf59f0 |
| 178 | |
| 179 | * - BSS |
| 180 | - 0x41cf59f0 |
| 181 | - 0x41cff9f0 |
| 182 | |
| 183 | * - MCU Scratchpad |
| 184 | - 0x41cff9fc |
| 185 | - 0x41cffbfc |
| 186 | |
| 187 | * - ROM DATA |
| 188 | - 0x41cffbfc |
| 189 | - 0x41cfffff |
| 190 | |
Kishon Vijay Abraham I | 78d13c9 | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 191 | OSPI: |
| 192 | ----- |
| 193 | ROM supports booting from OSPI from offset 0x0. |
| 194 | |
| 195 | Flashing images to OSPI: |
| 196 | |
| 197 | Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img, |
| 198 | and sysfw.itb over tftp and then flash those to OSPI at their respective |
| 199 | addresses. |
| 200 | |
| 201 | .. code-block:: text |
| 202 | |
| 203 | => sf probe |
| 204 | => tftp ${loadaddr} tiboot3.bin |
| 205 | => sf update $loadaddr 0x0 $filesize |
| 206 | => tftp ${loadaddr} tispl.bin |
| 207 | => sf update $loadaddr 0x80000 $filesize |
| 208 | => tftp ${loadaddr} u-boot.img |
| 209 | => sf update $loadaddr 0x280000 $filesize |
| 210 | => tftp ${loadaddr} sysfw.itb |
| 211 | => sf update $loadaddr 0x6C0000 $filesize |
| 212 | |
| 213 | Flash layout for OSPI: |
| 214 | |
Nishanth Menon | 2bb20e4 | 2023-07-27 13:58:57 -0500 | [diff] [blame] | 215 | .. image:: img/ospi_sysfw.svg |
Kishon Vijay Abraham I | dd7f528 | 2021-07-21 21:28:49 +0530 | [diff] [blame] | 216 | |
| 217 | Firmwares: |
| 218 | ---------- |
| 219 | |
| 220 | The J721e u-boot allows firmware to be loaded for the Cortex-R5 subsystem. |
| 221 | The CPSW5G in J7200 and CPSW9G in J721E present in MAIN domain is configured |
| 222 | and controlled by the ethernet firmware that executes in the MAIN Cortex R5. |
| 223 | The default supported environment variables support loading these firmwares |
| 224 | from only MMC. "dorprocboot" env variable has to be set for the U-BOOT to load |
| 225 | and start the remote cores in the system. |
| 226 | |
| 227 | J721E common processor board can be attached to a Ethernet QSGMII card and the |
| 228 | PHY in the card has to be reset before it can be used for data transfer. |
| 229 | "do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to |
| 230 | configure this PHY. |