Kishon Vijay Abraham I | 8baeeec | 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 | 0820e11 | 2022-12-19 14:29:49 -0600 | [diff] [blame] | 4 | J721E Platforms |
| 5 | =============== |
Kishon Vijay Abraham I | 8baeeec | 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 | 08df746 | 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 | 8baeeec | 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 | 9e30ebc | 2023-07-27 13:58:47 -0500 | [diff] [blame] | 42 | .. image:: img/boot_diagram_j721e.svg |
Nishanth Menon | e21a2ed | 2023-08-22 11:41:01 -0500 | [diff] [blame] | 43 | :alt: Boot flow diagram |
Kishon Vijay Abraham I | 8baeeec | 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 | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 50 | |
Nishanth Menon | cce3e7a | 2023-07-27 13:58:44 -0500 | [diff] [blame] | 51 | .. include:: k3.rst |
| 52 | :start-after: .. k3_rst_include_start_boot_sources |
| 53 | :end-before: .. k3_rst_include_end_boot_sources |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 54 | |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 55 | Build procedure: |
| 56 | ---------------- |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 57 | 0. Setup the environment variables: |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 58 | |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 59 | .. include:: k3.rst |
| 60 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 61 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
| 62 | |
| 63 | .. include:: k3.rst |
| 64 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 65 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
| 66 | |
| 67 | Set the variables corresponding to this platform: |
| 68 | |
| 69 | .. include:: k3.rst |
| 70 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 71 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
Andrew Davis | 4bc5097 | 2022-11-09 11:30:01 -0600 | [diff] [blame] | 72 | .. code-block:: bash |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 73 | |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 74 | $ export UBOOT_CFG_CORTEXR=j721e_evm_r5_defconfig |
| 75 | $ export UBOOT_CFG_CORTEXA=j721e_evm_a72_defconfig |
| 76 | $ export TFA_BOARD=generic |
| 77 | $ # we dont use any extra TFA parameters |
| 78 | $ unset TFA_EXTRA_ARGS |
| 79 | $ export OPTEE_PLATFORM=k3-j721e |
| 80 | $ # we dont use any extra OP-TEE parameters |
| 81 | $ unset OPTEE_EXTRA_ARGS |
| 82 | |
| 83 | .. j721e_evm_rst_include_start_build_steps |
| 84 | |
| 85 | 1. Trusted Firmware-A: |
| 86 | |
| 87 | .. include:: k3.rst |
| 88 | :start-after: .. k3_rst_include_start_build_steps_tfa |
| 89 | :end-before: .. k3_rst_include_end_build_steps_tfa |
| 90 | |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 91 | |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 92 | 2. OP-TEE: |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 93 | |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 94 | .. include:: k3.rst |
| 95 | :start-after: .. k3_rst_include_start_build_steps_optee |
| 96 | :end-before: .. k3_rst_include_end_build_steps_optee |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 97 | |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 98 | 3. U-Boot: |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 99 | |
Nishanth Menon | f340a16 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 100 | * 3.1 R5: |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 101 | |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 102 | .. include:: k3.rst |
| 103 | :start-after: .. k3_rst_include_start_build_steps_spl_r5 |
| 104 | :end-before: .. k3_rst_include_end_build_steps_spl_r5 |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 105 | |
Nishanth Menon | f340a16 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 106 | * 3.2 A72: |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 107 | |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 108 | .. include:: k3.rst |
| 109 | :start-after: .. k3_rst_include_start_build_steps_uboot |
| 110 | :end-before: .. k3_rst_include_end_build_steps_uboot |
| 111 | .. j721e_evm_rst_include_end_build_steps |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 112 | |
| 113 | Target Images |
| 114 | -------------- |
Tom Rini | f687c8f | 2023-07-25 12:44:16 -0400 | [diff] [blame] | 115 | In order to boot we need tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img. |
| 116 | Each SoC variant (GP, HS-FS and HS-SE) requires a different source for these |
| 117 | files. |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 118 | |
| 119 | - GP |
| 120 | |
Nishanth Menon | f340a16 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 121 | * tiboot3-j721e-gp-evm.bin, sysfw-j721e-gp-evm.itb from step 3.1 |
| 122 | * tispl.bin_unsigned, u-boot.img_unsigned from step 3.2 |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 123 | |
| 124 | - HS-FS |
| 125 | |
Nishanth Menon | f340a16 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 126 | * tiboot3-j721e_sr2-hs-fs-evm.bin, sysfw-j721e_sr2-hs-fs-evm.itb from step 3.1 |
| 127 | * tispl.bin, u-boot.img from step 3.2 |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 128 | |
| 129 | - HS-SE |
| 130 | |
Nishanth Menon | f340a16 | 2023-08-22 11:41:06 -0500 | [diff] [blame] | 131 | * tiboot3-j721e_sr2-hs-evm.bin, sysfw-j721e_sr2-hs-evm.itb from step 3.1 |
| 132 | * tispl.bin, u-boot.img from step 3.2 |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 133 | |
| 134 | Image formats: |
| 135 | -------------- |
| 136 | |
Nishanth Menon | 3b83dff | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 137 | - tiboot3.bin |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 138 | |
Nishanth Menon | 3b83dff | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 139 | .. image:: img/no_multi_cert_tiboot3.bin.svg |
Nishanth Menon | e21a2ed | 2023-08-22 11:41:01 -0500 | [diff] [blame] | 140 | :alt: tiboot3.bin image format |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 141 | |
| 142 | - tispl.bin |
| 143 | |
Nishanth Menon | 3b83dff | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 144 | .. image:: img/dm_tispl.bin.svg |
Nishanth Menon | e21a2ed | 2023-08-22 11:41:01 -0500 | [diff] [blame] | 145 | :alt: tispl.bin image format |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 146 | |
| 147 | - sysfw.itb |
| 148 | |
Nishanth Menon | 3b83dff | 2023-07-27 13:58:50 -0500 | [diff] [blame] | 149 | .. image:: img/sysfw.itb.svg |
Nishanth Menon | e21a2ed | 2023-08-22 11:41:01 -0500 | [diff] [blame] | 150 | :alt: sysfw.itb image format |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 151 | |
Manorit Chawdhry | 6cfdf82 | 2023-05-16 10:24:36 +0530 | [diff] [blame] | 152 | R5 Memory Map: |
| 153 | -------------- |
| 154 | |
| 155 | .. list-table:: |
| 156 | :widths: 16 16 16 |
| 157 | :header-rows: 1 |
| 158 | |
| 159 | * - Region |
| 160 | - Start Address |
| 161 | - End Address |
| 162 | |
| 163 | * - SPL |
| 164 | - 0x41c00000 |
| 165 | - 0x41c40000 |
| 166 | |
| 167 | * - EMPTY |
| 168 | - 0x41c40000 |
| 169 | - 0x41c81920 |
| 170 | |
| 171 | * - STACK |
| 172 | - 0x41c85920 |
| 173 | - 0x41c81920 |
| 174 | |
| 175 | * - Global data |
| 176 | - 0x41c859f0 |
| 177 | - 0x41c85920 |
| 178 | |
| 179 | * - Heap |
| 180 | - 0x41c859f0 |
| 181 | - 0x41cf59f0 |
| 182 | |
| 183 | * - BSS |
| 184 | - 0x41cf59f0 |
| 185 | - 0x41cff9f0 |
| 186 | |
| 187 | * - MCU Scratchpad |
| 188 | - 0x41cff9fc |
| 189 | - 0x41cffbfc |
| 190 | |
| 191 | * - ROM DATA |
| 192 | - 0x41cffbfc |
| 193 | - 0x41cfffff |
| 194 | |
Kishon Vijay Abraham I | 8baeeec | 2021-07-21 21:28:48 +0530 | [diff] [blame] | 195 | OSPI: |
| 196 | ----- |
| 197 | ROM supports booting from OSPI from offset 0x0. |
| 198 | |
| 199 | Flashing images to OSPI: |
| 200 | |
| 201 | Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img, |
| 202 | and sysfw.itb over tftp and then flash those to OSPI at their respective |
| 203 | addresses. |
| 204 | |
| 205 | .. code-block:: text |
| 206 | |
| 207 | => sf probe |
| 208 | => tftp ${loadaddr} tiboot3.bin |
| 209 | => sf update $loadaddr 0x0 $filesize |
| 210 | => tftp ${loadaddr} tispl.bin |
| 211 | => sf update $loadaddr 0x80000 $filesize |
| 212 | => tftp ${loadaddr} u-boot.img |
| 213 | => sf update $loadaddr 0x280000 $filesize |
| 214 | => tftp ${loadaddr} sysfw.itb |
| 215 | => sf update $loadaddr 0x6C0000 $filesize |
| 216 | |
| 217 | Flash layout for OSPI: |
| 218 | |
Nishanth Menon | 757836d | 2023-07-27 13:58:57 -0500 | [diff] [blame] | 219 | .. image:: img/ospi_sysfw.svg |
Nishanth Menon | e21a2ed | 2023-08-22 11:41:01 -0500 | [diff] [blame] | 220 | :alt: OSPI flash partition layout |
Kishon Vijay Abraham I | 4689aab | 2021-07-21 21:28:49 +0530 | [diff] [blame] | 221 | |
| 222 | Firmwares: |
| 223 | ---------- |
| 224 | |
| 225 | The J721e u-boot allows firmware to be loaded for the Cortex-R5 subsystem. |
| 226 | The CPSW5G in J7200 and CPSW9G in J721E present in MAIN domain is configured |
| 227 | and controlled by the ethernet firmware that executes in the MAIN Cortex R5. |
| 228 | The default supported environment variables support loading these firmwares |
| 229 | from only MMC. "dorprocboot" env variable has to be set for the U-BOOT to load |
| 230 | and start the remote cores in the system. |
| 231 | |
| 232 | J721E common processor board can be attached to a Ethernet QSGMII card and the |
| 233 | PHY in the card has to be reset before it can be used for data transfer. |
| 234 | "do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to |
| 235 | configure this PHY. |
Jason Kacines | effe508 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 236 | |
| 237 | Debugging U-Boot |
| 238 | ---------------- |
| 239 | |
| 240 | See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for |
| 241 | detailed setup information. |
| 242 | |
| 243 | .. warning:: |
| 244 | |
| 245 | **OpenOCD support since**: v0.12.0 |
| 246 | |
| 247 | If the default package version of OpenOCD in your development |
| 248 | environment's distribution needs to be updated, it might be necessary to |
| 249 | build OpenOCD from the source. |
| 250 | |
| 251 | .. include:: k3.rst |
| 252 | :start-after: .. k3_rst_include_start_openocd_connect_XDS110 |
| 253 | :end-before: .. k3_rst_include_end_openocd_connect_XDS110 |
| 254 | |
| 255 | To start OpenOCD and connect to the board |
| 256 | |
| 257 | .. code-block:: bash |
| 258 | |
| 259 | openocd -f board/ti_j721eevm.cfg |