blob: 2ffec3dbd3bef45362d4cda29e0aea4ce1aad8cc [file] [log] [blame]
Apurva Nandan2b1c9ff2024-02-24 01:51:53 +05301.. SPDX-License-Identifier: GPL-2.0-or-later OR BSD-3-Clause
2.. sectionauthor:: Apurva Nandan <a-nandan@ti.com>
3
4J784S4 and AM69 Platforms
5=========================
6
7Introduction
8------------
9The J784S4 SoC belongs to the K3 Multicore SoC architecture
10platform, providing advanced system integration in automotive,
11ADAS and industrial applications requiring AI at the network edge.
12This SoC extends the K3 Jacinto 7 family of SoCs with focus on
13raising performance and integration while providing interfaces,
14memory architecture and compute performance for multi-sensor, high
15concurrency applications.
16
17The device is partitioned into three functional domains, each containing
18specific processing cores and peripherals:
19
201. Wake-up (WKUP) domain
21 * ARM Cortex-M4F processor, runs TI Foundational Security (TIFS)
22
232. Microcontroller (MCU) domain
24 * Dual core ARM Cortex-R5F processor, runs device management
25 and SoC early boot
26
273. MAIN domain
28 * Two clusters of quad core 64-bit ARM Cortex-A72, runs HLOS
29 * Dual core ARM Cortex-R5F processor used for RTOS applications
30 * Four C7x DSPs used for Machine Learning applications.
31
32
33More info can be found in TRM: http://www.ti.com/lit/zip/spruj52
34
35Platform information:
36
37* https://www.ti.com/tool/J784S4XEVM
38* https://www.ti.com/tool/SK-AM69
39
40Boot Flow
41---------
42Below is the pictorial representation of boot flow:
43
44.. image:: img/boot_diagram_k3_current.svg
45 :alt: K3 boot flow
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
63Build procedure
64---------------
650. Setup the environment variables:
66
67.. include:: k3.rst
68 :start-after: .. k3_rst_include_start_common_env_vars_desc
69 :end-before: .. k3_rst_include_end_common_env_vars_desc
70
71.. include:: k3.rst
72 :start-after: .. k3_rst_include_start_board_env_vars_desc
73 :end-before: .. k3_rst_include_end_board_env_vars_desc
74
75Set the variables corresponding to this platform:
76
77.. include:: k3.rst
78 :start-after: .. k3_rst_include_start_common_env_vars_defn
79 :end-before: .. k3_rst_include_end_common_env_vars_defn
80.. code-block:: bash
81
82 $ export UBOOT_CFG_CORTEXR=j784s4_evm_r5_defconfig
83 $ export UBOOT_CFG_CORTEXA=j784s4_evm_a72_defconfig
84 $ export TFA_BOARD=j784s4
85 $ export TFA_EXTRA_ARGS="K3_USART=0x8"
86 $ export OPTEE_PLATFORM=k3-j784s4
87 $ export OPTEE_EXTRA_ARGS="CFG_CONSOLE_UART=0x8"
88
89.. j784s4_evm_rst_include_start_build_steps
90
911. Trusted Firmware-A
92
93.. include:: k3.rst
94 :start-after: .. k3_rst_include_start_build_steps_tfa
95 :end-before: .. k3_rst_include_end_build_steps_tfa
96
97
982. OP-TEE
99
100.. include:: k3.rst
101 :start-after: .. k3_rst_include_start_build_steps_optee
102 :end-before: .. k3_rst_include_end_build_steps_optee
103
1043. U-Boot
105
106.. _j784s4_evm_rst_u_boot_r5:
107
108* 3.1 R5
109
110.. include:: k3.rst
111 :start-after: .. k3_rst_include_start_build_steps_spl_r5
112 :end-before: .. k3_rst_include_end_build_steps_spl_r5
113
114.. _j784s4_evm_rst_u_boot_a72:
115
116* 3.2 A72
117
118.. include:: k3.rst
119 :start-after: .. k3_rst_include_start_build_steps_uboot
120 :end-before: .. k3_rst_include_end_build_steps_uboot
121.. j784s4_evm_rst_include_end_build_steps
122
123Target Images
124-------------
125In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC
126variant (GP, HS-FS, HS-SE) requires a different source for these files.
127
128 - GP
129
130 * tiboot3-j784s4-gp-evm.bin from :ref:`step 3.1 <j784s4_evm_rst_u_boot_r5>`
131 * tispl.bin_unsigned, u-boot.img_unsigned from :ref:`step 3.2 <j784s4_evm_rst_u_boot_a72>`
132
133 - HS-FS
134
135 * tiboot3-j784s4-hs-fs-evm.bin from :ref:`step 3.1 <j784s4_evm_rst_u_boot_r5>`
136 * tispl.bin, u-boot.img from :ref:`step 3.2 <j784s4_evm_rst_u_boot_a72>`
137
138 - HS-SE
139
140 * tiboot3-j784s4-hs-evm.bin from :ref:`step 3.1 <j784s4_evm_rst_u_boot_r5>`
141 * tispl.bin, u-boot.img from :ref:`step 3.2 <j784s4_evm_rst_u_boot_a72>`
142
143Image formats
144-------------
145
146- tiboot3.bin
147
148.. image:: img/multi_cert_tiboot3.bin.svg
149 :alt: tiboot3.bin format
150
151- tispl.bin
152
153.. image:: img/dm_tispl.bin.svg
154 :alt: tispl.bin format
155
Jonathan Humphreysca670022024-06-14 11:35:51 -0500156OSPI:
157-----
158ROM supports booting from OSPI from offset 0x0.
159
160Flashing images to OSPI NOR:
161
162Below commands can be used to download tiboot3.bin, tispl.bin, and
163u-boot.img over tftp and then flash those to OSPI at their respective
164addresses.
165
166.. prompt:: bash =>
167
168 sf probe
169 tftp ${loadaddr} tiboot3.bin
170 sf update $loadaddr 0x0 $filesize
171 tftp ${loadaddr} tispl.bin
172 sf update $loadaddr 0x80000 $filesize
173 tftp ${loadaddr} u-boot.img
174 sf update $loadaddr 0x280000 $filesize
175
176Flash layout for OSPI NOR:
177
178.. image:: img/ospi_sysfw3.svg
179 :alt: OSPI NOR flash partition layout
180
Apurva Nandan2b1c9ff2024-02-24 01:51:53 +0530181R5 Memory Map
182-------------
183
184.. list-table::
185 :widths: 16 16 16
186 :header-rows: 1
187
188 * - Region
189 - Start Address
190 - End Address
191
192 * - SPL
193 - 0x41c00000
194 - 0x41c40000
195
196 * - EMPTY
197 - 0x41c40000
198 - 0x41c61f20
199
200 * - STACK
201 - 0x41c65f20
202 - 0x41c61f20
203
204 * - Global data
205 - 0x41c65f20
206 - 0x41c66000
207
208 * - Heap
209 - 0x41c66000
210 - 0x41c76000
211
212 * - BSS
213 - 0x41c76000
214 - 0x41c80000
215
216 * - DM DATA
217 - 0x41c80000
218 - 0x41c84130
219
220 * - EMPTY
221 - 0x41c84130
222 - 0x41cff9fc
223
224 * - MCU Scratchpad
225 - 0x41cff9fc
226 - 0x41cffbfc
227
228 * - ROM DATA
229 - 0x41cffbfc
230 - 0x41cfffff
231
232Switch Setting for Boot Mode
233----------------------------
234
235Boot Mode pins provide means to select the boot mode and options before the
236device is powered up. After every POR, they are the main source to populate
237the Boot Parameter Tables.
238
239Boot Mode Pins for J784S4-EVM
240^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
241
242The following tables show some common boot modes used on J784S4 EVM platform.
243More details can be found in the Technical Reference Manual:
244http://www.ti.com/lit/zip/spruj52 under the `Boot Mode Pins` section.
245
246.. list-table:: J784S4 EVM Boot Modes
247 :widths: 16 16 16
248 :header-rows: 1
249
250 * - Switch Label
251 - SW11: 12345678
252 - SW7: 12345678
253
254 * - SD
255 - 10000010
256 - 00000000
257
258 * - EMMC
259 - 10000000
260 - 01000000
261
262 * - OSPI
263 - 00000110
264 - 01000000
265
266 * - UART
267 - 00000000
268 - 01110000
269
270For SW7 and SW11, the switch state in the "ON" position = 1.
271
272Boot Mode Pins for AM69-SK
273^^^^^^^^^^^^^^^^^^^^^^^^^^
274
275The following table show some common boot modes used on AM69-SK platform.
276More details can be found in the User Guide for AM69-SK:
277https://www.ti.com/lit/ug/spruj70/spruj70.pdf under the `Bootmode Settings`
278section.
279
280.. list-table:: AM69 SK Boot Modes
281 :widths: 16 16
282 :header-rows: 1
283
284 * - Switch Label
285 - SW2: 1234
286
287 * - SD
288 - 0000
289
Jonathan Humphreysca670022024-06-14 11:35:51 -0500290 * - OSPI
291 - 0010
292
Apurva Nandan2b1c9ff2024-02-24 01:51:53 +0530293 * - EMMC
294 - 0110
295
296 * - UART
297 - 1010
298
299For SW2, the switch state in the "ON" position = 1.
300
301Debugging U-Boot
302----------------
303
304See :ref:`Common Debugging environment - OpenOCD<k3_rst_refer_openocd>`: for
305detailed setup information.
306
307.. warning::
308
309 **OpenOCD support since**: September 2023 (git master)
310
311 Until the next stable release of OpenOCD is available in your development
312 environment's distribution, it might be necessary to build OpenOCD `from the
313 source <https://github.com/openocd-org/openocd>`_.
314
315Debugging U-Boot on J784S4-EVM and AM69-SK
316^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
317
318.. include:: k3.rst
319 :start-after: .. k3_rst_include_start_openocd_connect_XDS110
320 :end-before: .. k3_rst_include_end_openocd_connect_XDS110
321
322To start OpenOCD and connect to J784S4-EVM or AM69-SK board, use the
323following.
324
325.. code-block:: bash
326
327 openocd -f board/ti_j784s4evm.cfg