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 | |
Nishanth Menon | 4981d9a | 2023-07-27 13:59:00 -0500 | [diff] [blame] | 29 | Platform information: |
| 30 | |
| 31 | * https://www.ti.com/tool/J7200XSOMXEVM |
| 32 | |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 33 | Boot Flow: |
| 34 | ---------- |
| 35 | Below is the pictorial representation of boot flow: |
| 36 | |
Nishanth Menon | b47c9f7 | 2023-07-27 13:58:45 -0500 | [diff] [blame] | 37 | .. image:: img/boot_diagram_k3_current.svg |
Nishanth Menon | 5539eaf | 2023-08-22 11:41:00 -0500 | [diff] [blame] | 38 | :alt: Boot flow diagram |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 39 | |
| 40 | - Here DMSC acts as master and provides all the critical services. R5/A72 |
| 41 | requests DMSC to get these services done as shown in the above diagram. |
| 42 | |
| 43 | Sources: |
| 44 | -------- |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 45 | |
Nishanth Menon | ee91e48 | 2023-07-27 13:58:44 -0500 | [diff] [blame] | 46 | .. include:: k3.rst |
| 47 | :start-after: .. k3_rst_include_start_boot_sources |
| 48 | :end-before: .. k3_rst_include_end_boot_sources |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 49 | |
Dhruva Gole | 26e0ddf | 2024-08-05 19:59:33 +0530 | [diff] [blame] | 50 | .. include:: k3.rst |
| 51 | :start-after: .. k3_rst_include_start_boot_firmwares |
| 52 | :end-before: .. k3_rst_include_end_boot_firmwares |
| 53 | |
Udit Kumar | ed92ede | 2023-05-11 14:47: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: |
Udit Kumar | ed92ede | 2023-05-11 14:47: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 |
Udit Kumar | ed92ede | 2023-05-11 14:47: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 |
Udit Kumar | ed92ede | 2023-05-11 14:47: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: |
Udit Kumar | ed92ede | 2023-05-11 14:47: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 |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 71 | .. prompt:: bash $ |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 72 | |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 73 | export UBOOT_CFG_CORTEXR=j7200_evm_r5_defconfig |
| 74 | export UBOOT_CFG_CORTEXA=j7200_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-j7200 |
| 79 | # we dont use any extra OP-TEE parameters |
| 80 | unset OPTEE_EXTRA_ARGS |
Nishanth Menon | b7ee22f | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 81 | |
| 82 | .. j7200_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 |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 96 | |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 97 | 3. U-Boot: |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 98 | |
Nishanth Menon | daed6db | 2023-08-22 11:41:05 -0500 | [diff] [blame] | 99 | * 3.1 R5: |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 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 |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 104 | |
Nishanth Menon | daed6db | 2023-08-22 11:41:05 -0500 | [diff] [blame] | 105 | * 3.2 A72: |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 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 | .. j7200_evm_rst_include_end_build_steps |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 111 | |
| 112 | Target Images |
Heinrich Schuchardt | b72160b | 2023-10-28 11:59:32 +0200 | [diff] [blame] | 113 | ------------- |
| 114 | |
Tom Rini | fdf4503 | 2023-07-25 12:44:16 -0400 | [diff] [blame] | 115 | In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC |
| 116 | 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] | 117 | |
| 118 | - GP |
| 119 | |
Nishanth Menon | daed6db | 2023-08-22 11:41:05 -0500 | [diff] [blame] | 120 | * tiboot3-j7200-gp-evm.bin from step 3.1 |
| 121 | * tispl.bin_unsigned, u-boot.img_unsigned from step 3.2 |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 122 | |
| 123 | - HS-FS |
| 124 | |
Nishanth Menon | daed6db | 2023-08-22 11:41:05 -0500 | [diff] [blame] | 125 | * tiboot3-j7200_sr2-hs-fs-evm.bin from step 3.1 |
| 126 | * tispl.bin, u-boot.img from step 3.2 |
Neha Malcom Francis | 507be12 | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 127 | |
| 128 | - HS-SE |
| 129 | |
Nishanth Menon | daed6db | 2023-08-22 11:41:05 -0500 | [diff] [blame] | 130 | * tiboot3-j7200_sr2-hs-evm.bin from step 3.1 |
| 131 | * tispl.bin, u-boot.img from step 3.2 |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 132 | |
| 133 | Image formats: |
| 134 | -------------- |
| 135 | |
Nishanth Menon | b1e1c3b | 2023-07-27 13:58:49 -0500 | [diff] [blame] | 136 | - tiboot3.bin |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 137 | |
Nishanth Menon | b1e1c3b | 2023-07-27 13:58:49 -0500 | [diff] [blame] | 138 | .. image:: img/j7200_tiboot3.bin.svg |
Nishanth Menon | 5539eaf | 2023-08-22 11:41:00 -0500 | [diff] [blame] | 139 | :alt: tiboot3.bin image format |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 140 | |
| 141 | - tispl.bin |
| 142 | |
Nishanth Menon | b1e1c3b | 2023-07-27 13:58:49 -0500 | [diff] [blame] | 143 | .. image:: img/dm_tispl.bin.svg |
Nishanth Menon | 5539eaf | 2023-08-22 11:41:00 -0500 | [diff] [blame] | 144 | :alt: tispl.bin image format |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 145 | |
| 146 | Switch Setting for Boot Mode |
| 147 | ---------------------------- |
| 148 | |
| 149 | Boot Mode pins provide means to select the boot mode and options before the |
| 150 | device is powered up. After every POR, they are the main source to populate |
| 151 | the Boot Parameter Tables. |
| 152 | |
| 153 | The following table shows some common boot modes used on J7200 platform. More |
| 154 | details can be found in the Technical Reference Manual: |
| 155 | https://www.ti.com/lit/pdf/spruiu1 under the `Boot Mode Pins` section. |
| 156 | |
Nishanth Menon | 2fd774e | 2023-07-27 13:58:55 -0500 | [diff] [blame] | 157 | .. list-table:: Boot Modes |
| 158 | :widths: 16 16 16 |
| 159 | :header-rows: 1 |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 160 | |
Nishanth Menon | 2fd774e | 2023-07-27 13:58:55 -0500 | [diff] [blame] | 161 | * - Switch Label |
| 162 | - SW9: 12345678 |
| 163 | - SW8: 12345678 |
| 164 | |
| 165 | * - SD |
| 166 | - 00000000 |
| 167 | - 10000010 |
| 168 | |
| 169 | * - EMMC |
| 170 | - 01000000 |
| 171 | - 10000000 |
| 172 | |
| 173 | * - OSPI |
| 174 | - 01000000 |
| 175 | - 00000110 |
| 176 | |
| 177 | * - UART |
| 178 | - 01110000 |
| 179 | - 00000000 |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 180 | |
Nishanth Menon | 2fd774e | 2023-07-27 13:58:55 -0500 | [diff] [blame] | 181 | * - USB DFU |
| 182 | - 00100000 |
| 183 | - 10000000 |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 184 | |
| 185 | For SW8 and SW9, the switch state in the "ON" position = 1. |
| 186 | |
| 187 | eMMC: |
| 188 | ----- |
| 189 | ROM supports booting from eMMC raw read or UDA FS mode. |
| 190 | |
| 191 | Below is memory layout in case of booting from |
| 192 | boot 0/1 partition in raw mode. |
| 193 | |
| 194 | Current allocated size for tiboot3 size is 1MB, tispl is 2MB. |
| 195 | |
| 196 | Size of u-boot.img is taken 4MB for refernece, |
| 197 | But this is subject to change depending upon atf, optee size |
| 198 | |
Nishanth Menon | 03f27e5 | 2023-07-27 13:58:59 -0500 | [diff] [blame] | 199 | .. image:: img/emmc_j7200_evm_boot01.svg |
Nishanth Menon | 5539eaf | 2023-08-22 11:41:00 -0500 | [diff] [blame] | 200 | :alt: Traditional eMMC boot partition layout |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 201 | |
| 202 | In case of UDA FS mode booting, following is layout. |
| 203 | |
| 204 | All boot images tiboot3.bin, tispl and u-boot should be written to |
| 205 | fat formatted UDA FS as file. |
| 206 | |
Nishanth Menon | 03f27e5 | 2023-07-27 13:58:59 -0500 | [diff] [blame] | 207 | .. image:: img/emmc_j7200_evm_udafs.svg |
Nishanth Menon | 5539eaf | 2023-08-22 11:41:00 -0500 | [diff] [blame] | 208 | :alt: eMMC UDA boot partition layout |
Udit Kumar | ed92ede | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 209 | |
| 210 | In case of booting from eMMC, write above images into raw or UDA FS. |
| 211 | and set mmc partconf accordingly. |
Jason Kacines | b0fdee9 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 212 | |
| 213 | Debugging U-Boot |
| 214 | ---------------- |
| 215 | |
| 216 | See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for |
| 217 | detailed setup information. |
| 218 | |
| 219 | .. warning:: |
| 220 | |
| 221 | **OpenOCD support since**: v0.12.0 |
| 222 | |
| 223 | If the default package version of OpenOCD in your development |
| 224 | environment's distribution needs to be updated, it might be necessary to |
| 225 | build OpenOCD from the source. |
| 226 | |
| 227 | .. include:: k3.rst |
| 228 | :start-after: .. k3_rst_include_start_openocd_connect_XDS110 |
| 229 | :end-before: .. k3_rst_include_end_openocd_connect_XDS110 |
| 230 | |
| 231 | To start OpenOCD and connect to the board |
| 232 | |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 233 | .. prompt:: bash $ |
Jason Kacines | b0fdee9 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 234 | |
| 235 | openocd -f board/ti_j7200evm.cfg |