Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 1 | .. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause |
| 2 | .. sectionauthor:: Nishanth Menon <nm@ti.com> |
| 3 | |
| 4 | AM64 Platforms |
| 5 | ============== |
| 6 | |
| 7 | Introduction: |
| 8 | ------------- |
| 9 | The AM642 SoC belongs to the K3 Multicore SoC architecture platform, |
| 10 | providing advanced system integration to enable applications such as |
| 11 | Motor Drives, PLC, Remote IO and IoT Gateways. |
| 12 | |
| 13 | Some highlights of this SoC are: |
| 14 | |
| 15 | * Dual Cortex-A53s in a single cluster, two clusters of dual Cortex-R5F |
| 16 | MCUs, and a single Cortex-M4F. |
| 17 | * Two Gigabit Industrial Communication Subsystems (ICSSG). |
| 18 | * Integrated Ethernet switch supporting up to a total of two external |
| 19 | ports. |
| 20 | * PCIe-GEN2x1L, USB3/USB2, 2xCAN-FD, eMMC and SD, UFS, OSPI memory |
| 21 | controller, QSPI, I2C, eCAP/eQEP, ePWM, ADC, among other |
| 22 | peripherals. |
| 23 | * Centralized System Controller for Security, Power, and Resource |
| 24 | Management (DMSC). |
| 25 | |
| 26 | More details can be found in the Technical Reference Manual: |
| 27 | https://www.ti.com/lit/pdf/spruim2 |
| 28 | |
| 29 | Platform information: |
| 30 | |
| 31 | * AM64-EVM: https://www.ti.com/tool/TMDS64EVM |
| 32 | * AM64-SK: https://www.ti.com/tool/SK-AM64B |
| 33 | |
| 34 | Boot Flow: |
| 35 | ---------- |
| 36 | Below is the pictorial representation of boot flow: |
| 37 | |
| 38 | .. image:: img/boot_diagram_am64.svg |
Nishanth Menon | 4aacfff | 2023-08-22 11:40:58 -0500 | [diff] [blame] | 39 | :alt: Boot flow diagram |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 40 | |
| 41 | - Here TIFS acts as master and provides all the critical services. R5/A53 |
| 42 | requests TIFS to get these services done as shown in the above diagram. |
| 43 | |
| 44 | Sources: |
| 45 | -------- |
| 46 | |
| 47 | .. include:: k3.rst |
| 48 | :start-after: .. k3_rst_include_start_boot_sources |
| 49 | :end-before: .. k3_rst_include_end_boot_sources |
| 50 | |
Dhruva Gole | d7b23a0 | 2024-08-05 19:59:33 +0530 | [diff] [blame] | 51 | .. include:: k3.rst |
| 52 | :start-after: .. k3_rst_include_start_boot_firmwares_sysfw |
| 53 | :end-before: .. k3_rst_include_end_boot_firmwares_sysfw |
| 54 | |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 55 | Build procedure: |
| 56 | ---------------- |
| 57 | 0. Setup the environment variables: |
| 58 | |
| 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 |
Nishanth Menon | ca845d2 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 72 | .. prompt:: bash $ |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 73 | |
Nishanth Menon | ca845d2 | 2023-11-02 23:40:26 -0500 | [diff] [blame] | 74 | export UBOOT_CFG_CORTEXR=am64x_evm_r5_defconfig |
| 75 | export UBOOT_CFG_CORTEXA=am64x_evm_a53_defconfig |
| 76 | export TFA_BOARD=lite |
| 77 | # we dont use any extra TFA parameters |
| 78 | unset TFA_EXTRA_ARGS |
| 79 | export OPTEE_PLATFORM=k3-am64x |
| 80 | # we dont use any extra TFA parameters |
| 81 | unset OPTEE_EXTRA_ARGS |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 82 | |
| 83 | .. am64x_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 | |
| 91 | |
| 92 | 2. OP-TEE: |
| 93 | |
| 94 | .. include:: k3.rst |
| 95 | :start-after: .. k3_rst_include_start_build_steps_optee |
| 96 | :end-before: .. k3_rst_include_end_build_steps_optee |
| 97 | |
| 98 | 3. U-Boot: |
| 99 | |
Nishanth Menon | edd8149 | 2023-08-22 11:41:03 -0500 | [diff] [blame] | 100 | * 3.1 R5: |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 101 | |
| 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 |
| 105 | |
Nishanth Menon | edd8149 | 2023-08-22 11:41:03 -0500 | [diff] [blame] | 106 | * 3.2 A53: |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 107 | |
| 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 | .. am64x_evm_rst_include_end_build_steps |
| 112 | |
| 113 | Target Images |
Heinrich Schuchardt | b214e88 | 2023-10-28 11:59:32 +0200 | [diff] [blame] | 114 | ------------- |
| 115 | |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 116 | In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC |
| 117 | variant (GP, HS-FS, HS-SE) requires a different source for these files. |
| 118 | |
| 119 | - GP |
| 120 | |
| 121 | * tiboot3-am64x-gp-evm.bin from step 3.1 |
| 122 | * tispl.bin_unsigned, u-boot.img_unsigned from step 3.2 |
| 123 | |
| 124 | - HS-FS |
| 125 | |
| 126 | * tiboot3-am64x-hs-fs-evm.bin from step 3.1 |
| 127 | * tispl.bin, u-boot.img from step 3.2 |
| 128 | |
| 129 | - HS-SE |
| 130 | |
| 131 | * tiboot3-am64x-hs-evm.bin from step 3.1 |
| 132 | * tispl.bin, u-boot.img from step 3.2 |
| 133 | |
| 134 | Image formats: |
| 135 | -------------- |
| 136 | |
| 137 | - tiboot3.bin |
| 138 | |
| 139 | .. image:: img/multi_cert_tiboot3.bin.svg |
Nishanth Menon | 4aacfff | 2023-08-22 11:40:58 -0500 | [diff] [blame] | 140 | :alt: tiboot3.bin image format |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 141 | |
| 142 | - tispl.bin |
| 143 | |
| 144 | .. image:: img/nodm_tispl.bin.svg |
Nishanth Menon | 4aacfff | 2023-08-22 11:40:58 -0500 | [diff] [blame] | 145 | :alt: tispl.bin image format |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 146 | |
Jonathan Humphreys | 11c29ef | 2024-06-14 11:35:33 -0500 | [diff] [blame] | 147 | OSPI: |
| 148 | ----- |
| 149 | ROM supports booting from OSPI from offset 0x0. |
| 150 | |
| 151 | Flashing images to OSPI: |
| 152 | |
| 153 | Below commands can be used to download tiboot3.bin, tispl.bin, and u-boot.img, |
| 154 | over tftp and then flash those to OSPI at their respective addresses. |
| 155 | |
| 156 | .. prompt:: bash => |
| 157 | |
| 158 | sf probe |
| 159 | tftp ${loadaddr} tiboot3.bin |
| 160 | sf update $loadaddr 0x0 $filesize |
| 161 | tftp ${loadaddr} tispl.bin |
| 162 | sf update $loadaddr 0x100000 $filesize |
| 163 | tftp ${loadaddr} u-boot.img |
| 164 | sf update $loadaddr 0x300000 $filesize |
| 165 | |
| 166 | Flash layout for OSPI: |
| 167 | |
| 168 | .. image:: img/ospi_sysfw-am64.svg |
| 169 | :alt: OSPI flash partition layout |
| 170 | |
Roger Quadros | 4bf49ba | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 171 | Switch Setting for Boot Mode |
| 172 | ---------------------------- |
| 173 | |
| 174 | Boot Mode pins provide means to select the boot mode and options before the |
| 175 | device is powered up. After every POR, they are the main source to populate |
| 176 | the Boot Parameter Tables. |
| 177 | |
| 178 | The following table shows some common boot modes used on AM64 platform. More |
| 179 | details can be found in the Technical Reference Manual: |
| 180 | https://www.ti.com/lit/pdf/spruim2 under the `Boot Mode Pins` section. |
| 181 | |
| 182 | .. list-table:: Boot Modes for AM64x-EVM |
| 183 | :widths: 16 16 16 |
| 184 | :header-rows: 1 |
| 185 | |
| 186 | * - Switch Label |
| 187 | - SW2: 12345678 |
| 188 | - SW3: 12345678 |
| 189 | |
| 190 | * - SD/MMC |
| 191 | - 11000010 |
| 192 | - 01000000 |
| 193 | |
| 194 | * - xSPI/SFDP (OSPI) |
| 195 | - 11001110 |
| 196 | - 01000000 |
| 197 | |
| 198 | * - UART |
| 199 | - 11011100 |
| 200 | - 00000000 |
| 201 | |
| 202 | .. note :: |
| 203 | |
| 204 | For SW2 and SW3, the switch state in the "ON" position = 1. |
| 205 | |
| 206 | .. list-table:: Boot Modes for AM64x-SK |
| 207 | :widths: 16 16 16 |
| 208 | :header-rows: 1 |
| 209 | |
| 210 | * - Switch Label |
| 211 | - SW2: 12345678 |
| 212 | - SW3: 12345678 |
| 213 | |
| 214 | * - SD/MMC |
| 215 | - 00000010 |
| 216 | - 01000011 |
| 217 | |
| 218 | * - xSPI/SFDP (OSPI) |
| 219 | - 00000010 |
| 220 | - 01110011 |
| 221 | |
| 222 | * - UART |
| 223 | - 00000000 |
| 224 | - 00111011 |
| 225 | |
| 226 | .. note :: |
| 227 | |
| 228 | For SW2 and SW3, the switch state in the "ON" position = 1. |
| 229 | Boot bits on SK is reversed bits to the bootmode signals |