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