blob: 21683b90b1a81bebd6890e38ebb9736cd75f74b2 [file] [log] [blame]
Manorit Chawdhry2b313262023-10-06 10:16:00 +05301.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2.. sectionauthor:: Manorit Chawdhry <m-chawdhry@ti.com>
3
4J721S2 and AM68 Platforms
5=========================
6
7Introduction:
8-------------
Heinrich Schuchardtb214e882023-10-28 11:59:32 +02009
Manorit Chawdhry2b313262023-10-06 10:16:00 +053010The J721S2 family of SoCs are part of K3 Multicore SoC architecture platform
11targeting automotive applications. They are designed as a low power, high
12performance and highly integrated device architecture, adding significant
13enhancement on processing power, graphics capability, video and imaging
14processing, virtualization and coherent memory support.
15
16The AM68 Starter Kit/Evaluation Module (EVM) is based on the J721S2 family
17of SoCs. They are designed for machine vision, traffic monitoring, retail
18automation, and factory automation.
19
20The device is partitioned into three functional domains, each containing
21specific processing cores and peripherals:
22
231. Wake-up (WKUP) domain:
24 * ARM Cortex-M4F processor, runs TI Foundational Security (TIFS)
25
262. Microcontroller (MCU) domain:
27 * Dual core ARM Cortex-R5F processor, runs device management
28 and SoC early boot
29
303. MAIN domain:
31 * Dual core 64-bit ARM Cortex-A72, runs HLOS
32
33More info can be found in TRM: https://www.ti.com/lit/pdf/spruj28
34
35Platform information:
36
37* https://www.ti.com/tool/J721S2XSOMXEVM
38* https://www.ti.com/tool/SK-AM68
39
40Boot Flow:
41----------
Heinrich Schuchardtb214e882023-10-28 11:59:32 +020042
Manorit Chawdhry2b313262023-10-06 10:16:00 +053043Below is the pictorial representation of boot flow:
44
45.. image:: img/boot_diagram_k3_current.svg
46
47- On this platform, "TI Foundational Security" (TIFS) functions as the
48 security enclave master while "Device Manager" (DM), also known as the
49 "TISCI server" in TI terminology, offers all the essential services.
50
51- As illustrated in the diagram above, R5 SPL manages power and clock
52 services independently before handing over control to "DM". The A72 or
53 the C7x (Aux core) software components request TIFS/DM to handle
54 security or device management services.
55
56Sources:
57--------
58
59.. include:: k3.rst
60 :start-after: .. k3_rst_include_start_boot_sources
61 :end-before: .. k3_rst_include_end_boot_sources
62
Dhruva Goled7b23a02024-08-05 19:59:33 +053063.. include:: k3.rst
64 :start-after: .. k3_rst_include_start_boot_firmwares
65 :end-before: .. k3_rst_include_end_boot_firmwares
66
Manorit Chawdhry2b313262023-10-06 10:16:00 +053067Build procedure:
68----------------
Heinrich Schuchardtb214e882023-10-28 11:59:32 +020069
Manorit Chawdhry2b313262023-10-06 10:16:00 +0530700. Setup the environment variables:
71
72.. include:: k3.rst
73 :start-after: .. k3_rst_include_start_common_env_vars_desc
74 :end-before: .. k3_rst_include_end_common_env_vars_desc
75
76.. include:: k3.rst
77 :start-after: .. k3_rst_include_start_board_env_vars_desc
78 :end-before: .. k3_rst_include_end_board_env_vars_desc
79
80Set the variables corresponding to this platform:
81
82.. include:: k3.rst
83 :start-after: .. k3_rst_include_start_common_env_vars_defn
84 :end-before: .. k3_rst_include_end_common_env_vars_defn
Nishanth Menonca845d22023-11-02 23:40:26 -050085.. prompt:: bash $
Manorit Chawdhry2b313262023-10-06 10:16:00 +053086
Nishanth Menonca845d22023-11-02 23:40:26 -050087 export UBOOT_CFG_CORTEXR=j721s2_evm_r5_defconfig
88 export UBOOT_CFG_CORTEXA=j721s2_evm_a72_defconfig
89 export TFA_BOARD=generic
90 export TFA_EXTRA_ARGS="K3_USART=0x8"
91 # The following is not a typo, j784s4 is the OP-TEE platform for j721s2
92 export OPTEE_PLATFORM=k3-j784s4
93 export OPTEE_EXTRA_ARGS="CFG_CONSOLE_UART=0x8"
Manorit Chawdhry2b313262023-10-06 10:16:00 +053094
95.. j721s2_evm_rst_include_start_build_steps
96
971. Trusted Firmware-A:
98
99.. include:: k3.rst
100 :start-after: .. k3_rst_include_start_build_steps_tfa
101 :end-before: .. k3_rst_include_end_build_steps_tfa
102
103
1042. OP-TEE:
105
106.. include:: k3.rst
107 :start-after: .. k3_rst_include_start_build_steps_optee
108 :end-before: .. k3_rst_include_end_build_steps_optee
109
1103. U-Boot:
111
112.. _j721s2_evm_rst_u_boot_r5:
113
114* 3.1 R5:
115
116.. include:: k3.rst
117 :start-after: .. k3_rst_include_start_build_steps_spl_r5
118 :end-before: .. k3_rst_include_end_build_steps_spl_r5
119
120.. _j721s2_evm_rst_u_boot_a72:
121
122* 3.2 A72:
123
124.. include:: k3.rst
125 :start-after: .. k3_rst_include_start_build_steps_uboot
126 :end-before: .. k3_rst_include_end_build_steps_uboot
127.. j721s2_evm_rst_include_end_build_steps
128
129Target Images
Heinrich Schuchardtb214e882023-10-28 11:59:32 +0200130-------------
131
Manorit Chawdhry2b313262023-10-06 10:16:00 +0530132In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC
133variant (GP, HS-FS, HS-SE) requires a different source for these files.
134
135 - GP
136
137 * tiboot3-j721s2-gp-evm.bin from :ref:`step 3.1 <j721s2_evm_rst_u_boot_r5>`
138 * tispl.bin_unsigned, u-boot.img_unsigned from :ref:`step 3.2 <j721s2_evm_rst_u_boot_a72>`
139
140 - HS-FS
141
142 * tiboot3-j721s2-hs-fs-evm.bin from :ref:`step 3.1 <j721s2_evm_rst_u_boot_r5>`
143 * tispl.bin, u-boot.img from :ref:`step 3.2 <j721s2_evm_rst_u_boot_a72>`
144
145 - HS-SE
146
147 * tiboot3-j721s2-hs-evm.bin from :ref:`step 3.1 <j721s2_evm_rst_u_boot_r5>`
148 * tispl.bin, u-boot.img from :ref:`step 3.2 <j721s2_evm_rst_u_boot_a72>`
149
150Image formats:
151--------------
152
153- tiboot3.bin
154
155.. image:: img/multi_cert_tiboot3.bin.svg
156
157- tispl.bin
158
159.. image:: img/dm_tispl.bin.svg
160
161R5 Memory Map:
162--------------
163
164.. list-table::
165 :widths: 16 16 16
166 :header-rows: 1
167
168 * - Region
169 - Start Address
170 - End Address
171
172 * - SPL
173 - 0x41c00000
174 - 0x41c40000
175
176 * - EMPTY
177 - 0x41c40000
178 - 0x41c61f20
179
180 * - STACK
181 - 0x41c65f20
182 - 0x41c61f20
183
184 * - Global data
185 - 0x41c65f20
186 - 0x41c66000
187
188 * - Heap
189 - 0x41c66000
190 - 0x41c76000
191
192 * - BSS
193 - 0x41c76000
194 - 0x41c80000
195
196 * - DM DATA
197 - 0x41c80000
198 - 0x41c84130
199
200 * - EMPTY
201 - 0x41c84130
202 - 0x41cff9fc
203
204 * - MCU Scratchpad
205 - 0x41cff9fc
206 - 0x41cffbfc
207
208 * - ROM DATA
209 - 0x41cffbfc
210 - 0x41cfffff
211
212Switch Setting for Boot Mode
213----------------------------
214
215Boot Mode pins provide means to select the boot mode and options before the
216device is powered up. After every POR, they are the main source to populate
217the Boot Parameter Tables.
218
219Boot Mode Pins for J721S2-EVM
220^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
221
222The following table shows some common boot modes used on J721S2 platform.
223More details can be found in the Technical Reference Manual:
224https://www.ti.com/lit/pdf/spruj28 under the `Boot Mode Pins` section.
225
226.. list-table:: Boot Modes
227 :widths: 16 16 16
228 :header-rows: 1
229
230 * - Switch Label
231 - SW9: 12345678
232 - SW8: 12345678
233
234 * - SD
235 - 00000000
236 - 10000010
237
238 * - EMMC
239 - 01000000
240 - 10000000
241
242 * - OSPI
243 - 01000000
244 - 00000110
245
246 * - UART
247 - 01110000
248 - 00000000
249
250 * - USB DFU
251 - 00100000
252 - 10000000
253
254For SW8 and SW9, the switch state in the "ON" position = 1.
255
256Boot Mode Pins for SK-AM68
257^^^^^^^^^^^^^^^^^^^^^^^^^^
258
259The following table shows some common boot modes used on AM68-SK platform.
260More details can be found in the User Guide for AM68-SK:
261https://www.ti.com/lit/pdf/spruj68 under the `Bootmode Settings` section.
262
263.. list-table:: Boot Modes
264 :widths: 16 16
265 :header-rows: 1
266
267 * - Switch Label
268 - SW1: 1234
269
270 * - SD
271 - 0000
272
273 * - xSPI
274 - 0010
275
276 * - UART
277 - 1010
278
279 * - Ethernet
280 - 0100
281
282For SW1, the switch state in the "ON" position = 1.
283
284Debugging U-Boot
285----------------
286
287See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
288detailed setup information.
289
290.. warning::
291
292 **OpenOCD support since**: v0.12.0
293
294 If the default package version of OpenOCD in your development
295 environment's distribution needs to be updated, it might be necessary to
296 build OpenOCD from the source.
297
298Debugging U-Boot on J721S2-EVM
299^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
300
301.. include:: k3.rst
302 :start-after: .. k3_rst_include_start_openocd_connect_XDS110
303 :end-before: .. k3_rst_include_end_openocd_connect_XDS110
304
305To start OpenOCD and connect to the board
306
Nishanth Menonca845d22023-11-02 23:40:26 -0500307.. prompt:: bash $
Manorit Chawdhry2b313262023-10-06 10:16:00 +0530308
309 openocd -f board/ti_j721s2evm.cfg
310
311Debugging U-Boot on SK-AM68
312^^^^^^^^^^^^^^^^^^^^^^^^^^^
313
314.. include:: k3.rst
315 :start-after: .. k3_rst_include_start_openocd_connect_cti20
316 :end-before: .. k3_rst_include_end_openocd_connect_cti20
317
318.. include:: k3.rst
319 :start-after: .. k3_rst_include_start_openocd_cfg_external_intro
320 :end-before: .. k3_rst_include_end_openocd_cfg_external_intro
321
322For SK-AM68, the openocd_connect.cfg is as follows:
323
324.. code-block:: tcl
325
326 # TUMPA example:
327 # http://www.tiaowiki.com/w/TIAO_USB_Multi_Protocol_Adapter_User's_Manual
328 source [find interface/ftdi/tumpa.cfg]
329
330 transport select jtag
331
332 # default JTAG configuration has only SRST and no TRST
333 reset_config srst_only srst_push_pull
334
335 # delay after SRST goes inactive
336 adapter srst delay 20
337
338 if { ![info exists SOC] } {
339 # Set the SoC of interest
340 set SOC j721s2
341 }
342
343 source [find target/ti_k3.cfg]
344
345 ftdi tdo_sample_edge falling
346
347 # Speeds for FT2232H are in multiples of 2, and 32MHz is tops
348 # max speed we seem to achieve is ~20MHz.. so we pick 16MHz
349 adapter speed 16000