Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
| 2 | .. sectionauthor:: Udit Kumar <u-kumar1@ti.com> |
| 3 | |
| 4 | J7200 Platforms |
| 5 | =============== |
| 6 | |
| 7 | Introduction: |
| 8 | ------------- |
| 9 | The J7200 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 | |
| 27 | More info can be found in TRM: https://www.ti.com/lit/pdf/spruiu1 |
| 28 | |
| 29 | Boot Flow: |
| 30 | ---------- |
| 31 | Below is the pictorial representation of boot flow: |
| 32 | |
Nishanth Menon | b47c9f7 | 2023-07-27 13:58:45 -0500 | [diff] [blame] | 33 | .. image:: img/boot_diagram_k3_current.svg |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 34 | |
| 35 | - Here DMSC acts as master and provides all the critical services. R5/A72 |
| 36 | requests DMSC to get these services done as shown in the above diagram. |
| 37 | |
| 38 | Sources: |
| 39 | -------- |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 40 | |
Nishanth Menon | ee91e48 | 2023-07-27 13:58:44 -0500 | [diff] [blame] | 41 | .. include:: k3.rst |
| 42 | :start-after: .. k3_rst_include_start_boot_sources |
| 43 | :end-before: .. k3_rst_include_end_boot_sources |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 44 | |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 45 | Build procedure: |
| 46 | ---------------- |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 47 | 0. Setup the environment variables: |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 48 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 49 | .. include:: k3.rst |
| 50 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 51 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
Udit Kumar | ed92ede | 2023-05-11 14:47: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_board_env_vars_desc |
| 55 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 56 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 57 | Set the variables corresponding to this platform: |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 58 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 59 | .. include:: k3.rst |
| 60 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 61 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 62 | .. code-block:: bash |
| 63 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 64 | $ export UBOOT_CFG_CORTEXR=j7200_evm_r5_defconfig |
| 65 | $ export UBOOT_CFG_CORTEXA=j7200_evm_a72_defconfig |
| 66 | $ export TFA_BOARD=generic |
| 67 | $ # we dont use any extra TFA parameters |
| 68 | $ unset TFA_EXTRA_ARGS |
| 69 | $ export OPTEE_PLATFORM=k3-j7200 |
| 70 | $ # we dont use any extra OP-TEE parameters |
| 71 | $ unset OPTEE_EXTRA_ARGS |
| 72 | |
| 73 | .. j7200_evm_rst_include_start_build_steps |
| 74 | |
| 75 | 1. Trusted Firmware-A: |
| 76 | |
| 77 | .. include:: k3.rst |
| 78 | :start-after: .. k3_rst_include_start_build_steps_tfa |
| 79 | :end-before: .. k3_rst_include_end_build_steps_tfa |
| 80 | |
| 81 | |
| 82 | 2. OP-TEE: |
| 83 | |
| 84 | .. include:: k3.rst |
| 85 | :start-after: .. k3_rst_include_start_build_steps_optee |
| 86 | :end-before: .. k3_rst_include_end_build_steps_optee |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 87 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 88 | 3. U-Boot: |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 89 | |
| 90 | * 4.1 R5: |
| 91 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 92 | .. include:: k3.rst |
| 93 | :start-after: .. k3_rst_include_start_build_steps_spl_r5 |
| 94 | :end-before: .. k3_rst_include_end_build_steps_spl_r5 |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 95 | |
| 96 | * 4.2 A72: |
| 97 | |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame^] | 98 | .. include:: k3.rst |
| 99 | :start-after: .. k3_rst_include_start_build_steps_uboot |
| 100 | :end-before: .. k3_rst_include_end_build_steps_uboot |
| 101 | .. j7200_evm_rst_include_end_build_steps |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 102 | |
| 103 | Target Images |
| 104 | -------------- |
Tom Rini | fdf4503 | 2023-07-25 12:44:16 -0400 | [diff] [blame] | 105 | In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC |
| 106 | variant (GP, HS-FS, HS-SE) requires a different source for these files. |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 107 | |
| 108 | - GP |
| 109 | |
| 110 | * tiboot3-j7200-gp-evm.bin from step 4.1 |
| 111 | * tispl.bin_unsigned, u-boot.img_unsigned from step 4.2 |
| 112 | |
| 113 | - HS-FS |
| 114 | |
| 115 | * tiboot3-j7200_sr2-hs-fs-evm.bin from step 4.1 |
| 116 | * tispl.bin, u-boot.img from step 4.2 |
| 117 | |
| 118 | - HS-SE |
| 119 | |
| 120 | * tiboot3-j7200_sr2-hs-evm.bin from step 4.1 |
| 121 | * tispl.bin, u-boot.img from step 4.2 |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 122 | |
| 123 | Image formats: |
| 124 | -------------- |
| 125 | |
| 126 | - tiboot3.bin: |
| 127 | |
| 128 | .. code-block:: console |
| 129 | |
| 130 | +-----------------------+ |
| 131 | | X.509 | |
| 132 | | Certificate | |
| 133 | | +-------------------+ | |
| 134 | | | | | |
| 135 | | | R5 | | |
| 136 | | | u-boot-spl.bin | | |
| 137 | | | | | |
| 138 | | +-------------------+ | |
| 139 | | | | | |
| 140 | | | FIT header | | |
| 141 | | | +---------------+ | | |
| 142 | | | | | | | |
| 143 | | | | DTB 1...N | | | |
| 144 | | | +---------------+ | | |
| 145 | | +-------------------+ | |
| 146 | | | | | |
| 147 | | | FIT HEADER | | |
| 148 | | | +---------------+ | | |
| 149 | | | | | | | |
| 150 | | | | sysfw.bin | | | |
| 151 | | | +---------------+ | | |
| 152 | | | | | | | |
| 153 | | | | board config | | | |
| 154 | | | +---------------+ | | |
| 155 | | | | | | | |
| 156 | | | | PM config | | | |
| 157 | | | +---------------+ | | |
| 158 | | | | | | | |
| 159 | | | | RM config | | | |
| 160 | | | +---------------+ | | |
| 161 | | | | | | | |
| 162 | | | | Secure config | | | |
| 163 | | | +---------------+ | | |
| 164 | | +-------------------+ | |
| 165 | +-----------------------+ |
| 166 | |
| 167 | - tispl.bin |
| 168 | |
| 169 | .. code-block:: console |
| 170 | |
| 171 | +-----------------------+ |
| 172 | | | |
| 173 | | FIT HEADER | |
| 174 | | +-------------------+ | |
| 175 | | | | | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 176 | | | A72 TF-A | | |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 177 | | +-------------------+ | |
| 178 | | | | | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 179 | | | A72 OP-TEE | | |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 180 | | +-------------------+ | |
| 181 | | | | | |
| 182 | | | R5 DM FW | | |
| 183 | | +-------------------+ | |
| 184 | | | | | |
| 185 | | | A72 SPL | | |
| 186 | | +-------------------+ | |
| 187 | | | | | |
| 188 | | | SPL DTB 1...N | | |
| 189 | | +-------------------+ | |
| 190 | +-----------------------+ |
| 191 | |
| 192 | |
| 193 | Switch Setting for Boot Mode |
| 194 | ---------------------------- |
| 195 | |
| 196 | Boot Mode pins provide means to select the boot mode and options before the |
| 197 | device is powered up. After every POR, they are the main source to populate |
| 198 | the Boot Parameter Tables. |
| 199 | |
| 200 | The following table shows some common boot modes used on J7200 platform. More |
| 201 | details can be found in the Technical Reference Manual: |
| 202 | https://www.ti.com/lit/pdf/spruiu1 under the `Boot Mode Pins` section. |
| 203 | |
| 204 | |
| 205 | *Boot Modes* |
| 206 | |
| 207 | ============ ============= ============= |
| 208 | Switch Label SW9: 12345678 SW8: 12345678 |
| 209 | ============ ============= ============= |
| 210 | SD 00000000 10000010 |
| 211 | EMMC 01000000 10000000 |
| 212 | OSPI 01000000 00000110 |
| 213 | UART 01110000 00000000 |
| 214 | USB DFU 00100000 10000000 |
| 215 | ============ ============= ============= |
| 216 | |
| 217 | For SW8 and SW9, the switch state in the "ON" position = 1. |
| 218 | |
| 219 | eMMC: |
| 220 | ----- |
| 221 | ROM supports booting from eMMC raw read or UDA FS mode. |
| 222 | |
| 223 | Below is memory layout in case of booting from |
| 224 | boot 0/1 partition in raw mode. |
| 225 | |
| 226 | Current allocated size for tiboot3 size is 1MB, tispl is 2MB. |
| 227 | |
| 228 | Size of u-boot.img is taken 4MB for refernece, |
| 229 | But this is subject to change depending upon atf, optee size |
| 230 | |
| 231 | .. code-block:: console |
| 232 | |
| 233 | boot0/1 partition (8 MB) user partition |
| 234 | 0x0+----------------------------------+ 0x0+------------------------+ |
| 235 | | tiboot3.bin (1 MB) | | | |
| 236 | 0x800+----------------------------------+ | | |
| 237 | | tispl.bin (2 MB) | | | |
| 238 | 0x1800+----------------------------------+ | | |
| 239 | | u-boot.img (4MB) | | | |
| 240 | 0x3800+----------------------------------+ | | |
| 241 | | | | | |
| 242 | 0x3900+ environment | | | |
| 243 | | | | | |
| 244 | 0x3A00+----------------------------------+ +-------------------------+ |
| 245 | |
| 246 | In case of UDA FS mode booting, following is layout. |
| 247 | |
| 248 | All boot images tiboot3.bin, tispl and u-boot should be written to |
| 249 | fat formatted UDA FS as file. |
| 250 | |
| 251 | .. code-block:: console |
| 252 | |
| 253 | boot0/1 partition (8 MB) user partition |
| 254 | 0x0+---------------------------------+ 0x0+-------------------------+ |
| 255 | | | | tiboot3.bin* | |
| 256 | 0x800+----------------------------------+ | | |
| 257 | | | | tispl.bin | |
| 258 | 0x1800+----------------------------------+ | | |
| 259 | | | | u-boot.img | |
| 260 | 0x3800+----------------------------------+ | | |
| 261 | | | | | |
| 262 | 0x3900+ | | environment | |
| 263 | | | | | |
| 264 | 0x3A00+----------------------------------+ +-------------------------+ |
| 265 | |
| 266 | |
| 267 | |
| 268 | In case of booting from eMMC, write above images into raw or UDA FS. |
| 269 | and set mmc partconf accordingly. |