Udit Kumar | db7af51 | 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 | 08df746 | 2023-07-27 13:59:00 -0500 | [diff] [blame] | 29 | Platform information: |
| 30 | |
| 31 | * https://www.ti.com/tool/J7200XSOMXEVM |
| 32 | |
Udit Kumar | db7af51 | 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 | 68b3baa | 2023-07-27 13:58:45 -0500 | [diff] [blame] | 37 | .. image:: img/boot_diagram_k3_current.svg |
Udit Kumar | db7af51 | 2023-05-11 14:47: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 | -------- |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 44 | |
Nishanth Menon | cce3e7a | 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 |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 48 | |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 49 | Build procedure: |
| 50 | ---------------- |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 51 | 0. Setup the environment variables: |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 52 | |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 53 | .. include:: k3.rst |
| 54 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 55 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
| 56 | |
| 57 | .. include:: k3.rst |
| 58 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 59 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
| 60 | |
| 61 | Set the variables corresponding to this platform: |
| 62 | |
| 63 | .. include:: k3.rst |
| 64 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 65 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 66 | .. code-block:: bash |
| 67 | |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 68 | $ export UBOOT_CFG_CORTEXR=j7200_evm_r5_defconfig |
| 69 | $ export UBOOT_CFG_CORTEXA=j7200_evm_a72_defconfig |
| 70 | $ export TFA_BOARD=generic |
| 71 | $ # we dont use any extra TFA parameters |
| 72 | $ unset TFA_EXTRA_ARGS |
| 73 | $ export OPTEE_PLATFORM=k3-j7200 |
| 74 | $ # we dont use any extra OP-TEE parameters |
| 75 | $ unset OPTEE_EXTRA_ARGS |
| 76 | |
| 77 | .. j7200_evm_rst_include_start_build_steps |
| 78 | |
| 79 | 1. Trusted Firmware-A: |
| 80 | |
| 81 | .. include:: k3.rst |
| 82 | :start-after: .. k3_rst_include_start_build_steps_tfa |
| 83 | :end-before: .. k3_rst_include_end_build_steps_tfa |
| 84 | |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 85 | |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 86 | 2. OP-TEE: |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 87 | |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 88 | .. include:: k3.rst |
| 89 | :start-after: .. k3_rst_include_start_build_steps_optee |
| 90 | :end-before: .. k3_rst_include_end_build_steps_optee |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 91 | |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 92 | 3. U-Boot: |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 93 | |
| 94 | * 4.1 R5: |
| 95 | |
Nishanth Menon | c727b81 | 2023-07-27 13:58:48 -0500 | [diff] [blame] | 96 | .. include:: k3.rst |
| 97 | :start-after: .. k3_rst_include_start_build_steps_spl_r5 |
| 98 | :end-before: .. k3_rst_include_end_build_steps_spl_r5 |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 99 | |
| 100 | * 4.2 A72: |
| 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_uboot |
| 104 | :end-before: .. k3_rst_include_end_build_steps_uboot |
| 105 | .. j7200_evm_rst_include_end_build_steps |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 106 | |
| 107 | Target Images |
| 108 | -------------- |
Tom Rini | f687c8f | 2023-07-25 12:44:16 -0400 | [diff] [blame] | 109 | In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC |
| 110 | variant (GP, HS-FS, HS-SE) requires a different source for these files. |
Neha Malcom Francis | 1ee652a | 2023-07-22 00:14:43 +0530 | [diff] [blame] | 111 | |
| 112 | - GP |
| 113 | |
| 114 | * tiboot3-j7200-gp-evm.bin from step 4.1 |
| 115 | * tispl.bin_unsigned, u-boot.img_unsigned from step 4.2 |
| 116 | |
| 117 | - HS-FS |
| 118 | |
| 119 | * tiboot3-j7200_sr2-hs-fs-evm.bin from step 4.1 |
| 120 | * tispl.bin, u-boot.img from step 4.2 |
| 121 | |
| 122 | - HS-SE |
| 123 | |
| 124 | * tiboot3-j7200_sr2-hs-evm.bin from step 4.1 |
| 125 | * tispl.bin, u-boot.img from step 4.2 |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 126 | |
| 127 | Image formats: |
| 128 | -------------- |
| 129 | |
Nishanth Menon | f4ade09 | 2023-07-27 13:58:49 -0500 | [diff] [blame] | 130 | - tiboot3.bin |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 131 | |
Nishanth Menon | f4ade09 | 2023-07-27 13:58:49 -0500 | [diff] [blame] | 132 | .. image:: img/j7200_tiboot3.bin.svg |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 133 | |
| 134 | - tispl.bin |
| 135 | |
Nishanth Menon | f4ade09 | 2023-07-27 13:58:49 -0500 | [diff] [blame] | 136 | .. image:: img/dm_tispl.bin.svg |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 137 | |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 138 | |
| 139 | |
| 140 | Switch Setting for Boot Mode |
| 141 | ---------------------------- |
| 142 | |
| 143 | Boot Mode pins provide means to select the boot mode and options before the |
| 144 | device is powered up. After every POR, they are the main source to populate |
| 145 | the Boot Parameter Tables. |
| 146 | |
| 147 | The following table shows some common boot modes used on J7200 platform. More |
| 148 | details can be found in the Technical Reference Manual: |
| 149 | https://www.ti.com/lit/pdf/spruiu1 under the `Boot Mode Pins` section. |
| 150 | |
Nishanth Menon | f940ec2 | 2023-07-27 13:58:55 -0500 | [diff] [blame] | 151 | .. list-table:: Boot Modes |
| 152 | :widths: 16 16 16 |
| 153 | :header-rows: 1 |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 154 | |
Nishanth Menon | f940ec2 | 2023-07-27 13:58:55 -0500 | [diff] [blame] | 155 | * - Switch Label |
| 156 | - SW9: 12345678 |
| 157 | - SW8: 12345678 |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 158 | |
Nishanth Menon | f940ec2 | 2023-07-27 13:58:55 -0500 | [diff] [blame] | 159 | * - SD |
| 160 | - 00000000 |
| 161 | - 10000010 |
| 162 | |
| 163 | * - EMMC |
| 164 | - 01000000 |
| 165 | - 10000000 |
| 166 | |
| 167 | * - OSPI |
| 168 | - 01000000 |
| 169 | - 00000110 |
| 170 | |
| 171 | * - UART |
| 172 | - 01110000 |
| 173 | - 00000000 |
| 174 | |
| 175 | * - USB DFU |
| 176 | - 00100000 |
| 177 | - 10000000 |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 178 | |
| 179 | For SW8 and SW9, the switch state in the "ON" position = 1. |
| 180 | |
| 181 | eMMC: |
| 182 | ----- |
| 183 | ROM supports booting from eMMC raw read or UDA FS mode. |
| 184 | |
| 185 | Below is memory layout in case of booting from |
| 186 | boot 0/1 partition in raw mode. |
| 187 | |
| 188 | Current allocated size for tiboot3 size is 1MB, tispl is 2MB. |
| 189 | |
| 190 | Size of u-boot.img is taken 4MB for refernece, |
| 191 | But this is subject to change depending upon atf, optee size |
| 192 | |
Nishanth Menon | 93d90bf | 2023-07-27 13:58:59 -0500 | [diff] [blame] | 193 | .. image:: img/emmc_j7200_evm_boot01.svg |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 194 | |
| 195 | In case of UDA FS mode booting, following is layout. |
| 196 | |
| 197 | All boot images tiboot3.bin, tispl and u-boot should be written to |
| 198 | fat formatted UDA FS as file. |
| 199 | |
Nishanth Menon | 93d90bf | 2023-07-27 13:58:59 -0500 | [diff] [blame] | 200 | .. image:: img/emmc_j7200_evm_udafs.svg |
Udit Kumar | db7af51 | 2023-05-11 14:47:48 +0530 | [diff] [blame] | 201 | |
| 202 | In case of booting from eMMC, write above images into raw or UDA FS. |
| 203 | and set mmc partconf accordingly. |
Jason Kacines | effe508 | 2023-08-03 01:29:22 -0500 | [diff] [blame] | 204 | |
| 205 | Debugging U-Boot |
| 206 | ---------------- |
| 207 | |
| 208 | See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for |
| 209 | detailed setup information. |
| 210 | |
| 211 | .. warning:: |
| 212 | |
| 213 | **OpenOCD support since**: v0.12.0 |
| 214 | |
| 215 | If the default package version of OpenOCD in your development |
| 216 | environment's distribution needs to be updated, it might be necessary to |
| 217 | build OpenOCD from the source. |
| 218 | |
| 219 | .. include:: k3.rst |
| 220 | :start-after: .. k3_rst_include_start_openocd_connect_XDS110 |
| 221 | :end-before: .. k3_rst_include_end_openocd_connect_XDS110 |
| 222 | |
| 223 | To start OpenOCD and connect to the board |
| 224 | |
| 225 | .. code-block:: bash |
| 226 | |
| 227 | openocd -f board/ti_j7200evm.cfg |