Roger Quadros | cd87b1e | 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 | 5a53648 | 2023-08-22 11:40:58 -0500 | [diff] [blame] | 39 | :alt: Boot flow diagram |
Roger Quadros | cd87b1e | 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 | |
| 51 | Build procedure: |
| 52 | ---------------- |
| 53 | 0. Setup the environment variables: |
| 54 | |
| 55 | .. include:: k3.rst |
| 56 | :start-after: .. k3_rst_include_start_common_env_vars_desc |
| 57 | :end-before: .. k3_rst_include_end_common_env_vars_desc |
| 58 | |
| 59 | .. include:: k3.rst |
| 60 | :start-after: .. k3_rst_include_start_board_env_vars_desc |
| 61 | :end-before: .. k3_rst_include_end_board_env_vars_desc |
| 62 | |
| 63 | Set the variables corresponding to this platform: |
| 64 | |
| 65 | .. include:: k3.rst |
| 66 | :start-after: .. k3_rst_include_start_common_env_vars_defn |
| 67 | :end-before: .. k3_rst_include_end_common_env_vars_defn |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame^] | 68 | .. prompt:: bash $ |
Roger Quadros | cd87b1e | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 69 | |
Nishanth Menon | fdd7cb7 | 2023-11-02 23:40:26 -0500 | [diff] [blame^] | 70 | export UBOOT_CFG_CORTEXR=am64x_evm_r5_defconfig |
| 71 | export UBOOT_CFG_CORTEXA=am64x_evm_a53_defconfig |
| 72 | export TFA_BOARD=lite |
| 73 | # we dont use any extra TFA parameters |
| 74 | unset TFA_EXTRA_ARGS |
| 75 | export OPTEE_PLATFORM=k3-am64x |
| 76 | # we dont use any extra TFA parameters |
| 77 | unset OPTEE_EXTRA_ARGS |
Roger Quadros | cd87b1e | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 78 | |
| 79 | .. am64x_evm_rst_include_start_build_steps |
| 80 | |
| 81 | 1. Trusted Firmware-A: |
| 82 | |
| 83 | .. include:: k3.rst |
| 84 | :start-after: .. k3_rst_include_start_build_steps_tfa |
| 85 | :end-before: .. k3_rst_include_end_build_steps_tfa |
| 86 | |
| 87 | |
| 88 | 2. OP-TEE: |
| 89 | |
| 90 | .. include:: k3.rst |
| 91 | :start-after: .. k3_rst_include_start_build_steps_optee |
| 92 | :end-before: .. k3_rst_include_end_build_steps_optee |
| 93 | |
| 94 | 3. U-Boot: |
| 95 | |
Nishanth Menon | 1330ef1 | 2023-08-22 11:41:03 -0500 | [diff] [blame] | 96 | * 3.1 R5: |
Roger Quadros | cd87b1e | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 97 | |
| 98 | .. include:: k3.rst |
| 99 | :start-after: .. k3_rst_include_start_build_steps_spl_r5 |
| 100 | :end-before: .. k3_rst_include_end_build_steps_spl_r5 |
| 101 | |
Nishanth Menon | 1330ef1 | 2023-08-22 11:41:03 -0500 | [diff] [blame] | 102 | * 3.2 A53: |
Roger Quadros | cd87b1e | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 103 | |
| 104 | .. include:: k3.rst |
| 105 | :start-after: .. k3_rst_include_start_build_steps_uboot |
| 106 | :end-before: .. k3_rst_include_end_build_steps_uboot |
| 107 | .. am64x_evm_rst_include_end_build_steps |
| 108 | |
| 109 | Target Images |
Heinrich Schuchardt | b72160b | 2023-10-28 11:59:32 +0200 | [diff] [blame] | 110 | ------------- |
| 111 | |
Roger Quadros | cd87b1e | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 112 | In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC |
| 113 | variant (GP, HS-FS, HS-SE) requires a different source for these files. |
| 114 | |
| 115 | - GP |
| 116 | |
| 117 | * tiboot3-am64x-gp-evm.bin from step 3.1 |
| 118 | * tispl.bin_unsigned, u-boot.img_unsigned from step 3.2 |
| 119 | |
| 120 | - HS-FS |
| 121 | |
| 122 | * tiboot3-am64x-hs-fs-evm.bin from step 3.1 |
| 123 | * tispl.bin, u-boot.img from step 3.2 |
| 124 | |
| 125 | - HS-SE |
| 126 | |
| 127 | * tiboot3-am64x-hs-evm.bin from step 3.1 |
| 128 | * tispl.bin, u-boot.img from step 3.2 |
| 129 | |
| 130 | Image formats: |
| 131 | -------------- |
| 132 | |
| 133 | - tiboot3.bin |
| 134 | |
| 135 | .. image:: img/multi_cert_tiboot3.bin.svg |
Nishanth Menon | 5a53648 | 2023-08-22 11:40:58 -0500 | [diff] [blame] | 136 | :alt: tiboot3.bin image format |
Roger Quadros | cd87b1e | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 137 | |
| 138 | - tispl.bin |
| 139 | |
| 140 | .. image:: img/nodm_tispl.bin.svg |
Nishanth Menon | 5a53648 | 2023-08-22 11:40:58 -0500 | [diff] [blame] | 141 | :alt: tispl.bin image format |
Roger Quadros | cd87b1e | 2023-08-05 11:14:39 +0300 | [diff] [blame] | 142 | |
| 143 | Switch Setting for Boot Mode |
| 144 | ---------------------------- |
| 145 | |
| 146 | Boot Mode pins provide means to select the boot mode and options before the |
| 147 | device is powered up. After every POR, they are the main source to populate |
| 148 | the Boot Parameter Tables. |
| 149 | |
| 150 | The following table shows some common boot modes used on AM64 platform. More |
| 151 | details can be found in the Technical Reference Manual: |
| 152 | https://www.ti.com/lit/pdf/spruim2 under the `Boot Mode Pins` section. |
| 153 | |
| 154 | .. list-table:: Boot Modes for AM64x-EVM |
| 155 | :widths: 16 16 16 |
| 156 | :header-rows: 1 |
| 157 | |
| 158 | * - Switch Label |
| 159 | - SW2: 12345678 |
| 160 | - SW3: 12345678 |
| 161 | |
| 162 | * - SD/MMC |
| 163 | - 11000010 |
| 164 | - 01000000 |
| 165 | |
| 166 | * - xSPI/SFDP (OSPI) |
| 167 | - 11001110 |
| 168 | - 01000000 |
| 169 | |
| 170 | * - UART |
| 171 | - 11011100 |
| 172 | - 00000000 |
| 173 | |
| 174 | .. note :: |
| 175 | |
| 176 | For SW2 and SW3, the switch state in the "ON" position = 1. |
| 177 | |
| 178 | .. list-table:: Boot Modes for AM64x-SK |
| 179 | :widths: 16 16 16 |
| 180 | :header-rows: 1 |
| 181 | |
| 182 | * - Switch Label |
| 183 | - SW2: 12345678 |
| 184 | - SW3: 12345678 |
| 185 | |
| 186 | * - SD/MMC |
| 187 | - 00000010 |
| 188 | - 01000011 |
| 189 | |
| 190 | * - xSPI/SFDP (OSPI) |
| 191 | - 00000010 |
| 192 | - 01110011 |
| 193 | |
| 194 | * - UART |
| 195 | - 00000000 |
| 196 | - 00111011 |
| 197 | |
| 198 | .. note :: |
| 199 | |
| 200 | For SW2 and SW3, the switch state in the "ON" position = 1. |
| 201 | Boot bits on SK is reversed bits to the bootmode signals |