blob: 65c4c456528c4826090848c1720da7489294ed64 [file] [log] [blame]
Roger Quadros4bf49ba2023-08-05 11:14:39 +03001.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2.. sectionauthor:: Nishanth Menon <nm@ti.com>
3
4AM64 Platforms
5==============
6
7Introduction:
8-------------
9The AM642 SoC belongs to the K3 Multicore SoC architecture platform,
10providing advanced system integration to enable applications such as
11Motor Drives, PLC, Remote IO and IoT Gateways.
12
13Some 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
26More details can be found in the Technical Reference Manual:
27 https://www.ti.com/lit/pdf/spruim2
28
29Platform information:
30
31* AM64-EVM: https://www.ti.com/tool/TMDS64EVM
32* AM64-SK: https://www.ti.com/tool/SK-AM64B
33
34Boot Flow:
35----------
36Below is the pictorial representation of boot flow:
37
38.. image:: img/boot_diagram_am64.svg
Nishanth Menon4aacfff2023-08-22 11:40:58 -050039 :alt: Boot flow diagram
Roger Quadros4bf49ba2023-08-05 11:14:39 +030040
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
44Sources:
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 Goled7b23a02024-08-05 19:59:33 +053051.. 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 Quadros4bf49ba2023-08-05 11:14:39 +030055Build procedure:
56----------------
570. 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
67Set 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 Menonca845d22023-11-02 23:40:26 -050072.. prompt:: bash $
Roger Quadros4bf49ba2023-08-05 11:14:39 +030073
Nishanth Menonca845d22023-11-02 23:40:26 -050074 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 Quadros4bf49ba2023-08-05 11:14:39 +030082
83.. am64x_evm_rst_include_start_build_steps
84
851. 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
922. 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
983. U-Boot:
99
Nishanth Menonedd81492023-08-22 11:41:03 -0500100* 3.1 R5:
Roger Quadros4bf49ba2023-08-05 11:14:39 +0300101
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 Menonedd81492023-08-22 11:41:03 -0500106* 3.2 A53:
Roger Quadros4bf49ba2023-08-05 11:14:39 +0300107
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
113Target Images
Heinrich Schuchardtb214e882023-10-28 11:59:32 +0200114-------------
115
Roger Quadros4bf49ba2023-08-05 11:14:39 +0300116In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC
117variant (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
134Image formats:
135--------------
136
137- tiboot3.bin
138
139.. image:: img/multi_cert_tiboot3.bin.svg
Nishanth Menon4aacfff2023-08-22 11:40:58 -0500140 :alt: tiboot3.bin image format
Roger Quadros4bf49ba2023-08-05 11:14:39 +0300141
142- tispl.bin
143
144.. image:: img/nodm_tispl.bin.svg
Nishanth Menon4aacfff2023-08-22 11:40:58 -0500145 :alt: tispl.bin image format
Roger Quadros4bf49ba2023-08-05 11:14:39 +0300146
Jonathan Humphreys11c29ef2024-06-14 11:35:33 -0500147OSPI:
148-----
149ROM supports booting from OSPI from offset 0x0.
150
151Flashing images to OSPI:
152
153Below commands can be used to download tiboot3.bin, tispl.bin, and u-boot.img,
154over 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
166Flash layout for OSPI:
167
168.. image:: img/ospi_sysfw-am64.svg
169 :alt: OSPI flash partition layout
170
Roger Quadros4bf49ba2023-08-05 11:14:39 +0300171Switch Setting for Boot Mode
172----------------------------
173
174Boot Mode pins provide means to select the boot mode and options before the
175device is powered up. After every POR, they are the main source to populate
176the Boot Parameter Tables.
177
178The following table shows some common boot modes used on AM64 platform. More
179details can be found in the Technical Reference Manual:
180https://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