blob: 24d309a9ff15ec1299372e9b624087578f9fd4f1 [file] [log] [blame]
Udit Kumared92ede2023-05-11 14:47:48 +05301.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2.. sectionauthor:: Udit Kumar <u-kumar1@ti.com>
3
4J7200 Platforms
5===============
6
7Introduction:
8-------------
9The J7200 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 device is partitioned into three functional domains, each containing
16specific processing cores and peripherals:
17
181. Wake-up (WKUP) domain:
19 * Device Management and Security Controller (DMSC)
20
212. Microcontroller (MCU) domain:
22 * Dual Core ARM Cortex-R5F processor
23
243. MAIN domain:
25 * Dual core 64-bit ARM Cortex-A72
26
27More info can be found in TRM: https://www.ti.com/lit/pdf/spruiu1
28
29Boot Flow:
30----------
31Below is the pictorial representation of boot flow:
32
33.. code-block:: text
34
35 +------------------------------------------------------------------------+-----------------------+
36 | DMSC | MCU R5 | A72 | MAIN R5/C7x |
37 +------------------------------------------------------------------------+-----------------------+
38 | +--------+ | | | |
39 | | Reset | | | | |
40 | +--------+ | | | |
41 | : | | | |
42 | +--------+ | +-----------+ | | |
43 | | *ROM* |----------|-->| Reset rls | | | |
44 | +--------+ | +-----------+ | | |
45 | | | | : | | |
46 | | ROM | | : | | |
47 | |services| | : | | |
48 | | | | +-------------+ | | |
49 | | | | | *R5 ROM* | | | |
50 | | | | +-------------+ | | |
51 | | |<---------|---|Load and auth| | | |
52 | | | | | tiboot3.bin | | | |
53 | | Start | | +-------------+ | | |
54 | | TIFS |<---------|---| Start | | | |
55 | | | | | TIFS | | | |
56 | +--------+ | +-------------+ | | |
57 | : | | | | | |
58 | +---------+ | | Load | | | |
59 | | *TIFS* | | | system | | | |
60 | +---------+ | | Config data | | | |
61 | | |<--------|---| | | | |
62 | | | | +-------------+ | | |
63 | | | | : | | |
64 | | | | : | | |
65 | | | | : | | |
66 | | | | +-------------+ | | |
67 | | | | | *R5 SPL* | | | |
68 | | | | +-------------+ | | |
69 | | | | | DDR | | | |
70 | | | | | config | | | |
71 | | | | +-------------+ | | |
72 | | | | | Load | | | |
73 | | | | | tispl.bin | | | |
74 | | | | +-------------+ | | |
75 | | | | | Load R5 | | | |
76 | | | | | firmware | | | |
77 | | | | +-------------+ | | |
78 | | |<--------|---| Start A72 | | | |
79 | | | | | and jump to | | | |
80 | | | | | DM fw image | | | |
81 | | | | +-------------+ | | |
82 | | | | | +-----------+ | |
83 | | |---------|-----------------------|---->| Reset rls | | |
84 | | | | | +-----------+ | |
85 | | TIFS | | | : | |
Neha Malcom Francis507be122023-07-22 00:14:43 +053086 | |Services | | | +-------------+ | |
87 | | |<--------|-----------------------|---->|*TF-A/OP-TEE*| | |
88 | | | | | +-------------+ | |
Udit Kumared92ede2023-05-11 14:47:48 +053089 | | | | | : | |
90 | | | | | +-----------+ | |
91 | | |<--------|-----------------------|---->| *A72 SPL* | | |
92 | | | | | +-----------+ | |
93 | | | | | | Load | | |
94 | | | | | | u-boot.img| | |
95 | | | | | +-----------+ | |
96 | | | | | : | |
97 | | | | | +-----------+ | |
98 | | |<--------|-----------------------|---->| *U-Boot* | | |
99 | | | | | +-----------+ | |
100 | | | | | | prompt | | |
101 | | | | | +-----------+ | |
102 | | | | | | Load R5 | | |
103 | | | | | | Firmware | | |
104 | | | | | +-----------+ | |
105 | | |<--------|-----------------------|-----| Start R5 | | +-----------+ |
106 | | |---------|-----------------------|-----+-----------+-----|----->| R5 starts | |
107 | | | | | | Load C7 | | +-----------+ |
108 | | | | | | Firmware | | |
109 | | | | | +-----------+ | |
110 | | |<--------|-----------------------|-----| Start C7 | | +-----------+ |
111 | | |---------|-----------------------|-----+-----------+-----|----->| C7 starts | |
112 | | | | | | +-----------+ |
113 | | | | | | |
114 | +---------+ | | | |
115 | | | | |
116 +------------------------------------------------------------------------+-----------------------+
117
118- Here DMSC acts as master and provides all the critical services. R5/A72
119 requests DMSC to get these services done as shown in the above diagram.
120
121Sources:
122--------
Udit Kumared92ede2023-05-11 14:47:48 +0530123
Nishanth Menonee91e482023-07-27 13:58:44 -0500124.. include:: k3.rst
125 :start-after: .. k3_rst_include_start_boot_sources
126 :end-before: .. k3_rst_include_end_boot_sources
Udit Kumared92ede2023-05-11 14:47:48 +0530127
Udit Kumared92ede2023-05-11 14:47:48 +0530128Build procedure:
129----------------
Neha Malcom Francis507be122023-07-22 00:14:43 +05301301. Trusted Firmware-A:
Udit Kumared92ede2023-05-11 14:47:48 +0530131
132.. code-block:: bash
133
Neha Malcom Francis507be122023-07-22 00:14:43 +0530134 $ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed
Udit Kumared92ede2023-05-11 14:47:48 +0530135
Neha Malcom Francis507be122023-07-22 00:14:43 +05301362. OP-TEE:
Udit Kumared92ede2023-05-11 14:47:48 +0530137
138.. code-block:: bash
139
Neha Malcom Francis507be122023-07-22 00:14:43 +0530140 $ make PLATFORM=k3-j7200 CFG_ARM64_core=y
Udit Kumared92ede2023-05-11 14:47:48 +0530141
Neha Malcom Francis507be122023-07-22 00:14:43 +05301423. U-Boot:
Udit Kumared92ede2023-05-11 14:47:48 +0530143
144* 4.1 R5:
145
146.. code-block:: bash
147
Neha Malcom Francis507be122023-07-22 00:14:43 +0530148 $ make CROSS_COMPILE=arm-linux-gnueabihf- j7200_evm_r5_defconfig O=build/r5
149 $ make CROSS_COMPILE=arm-linux-gnueabihf- \
150 BINMAN_INDIRS=<path/to/ti-linux-firmware>
Udit Kumared92ede2023-05-11 14:47:48 +0530151
152* 4.2 A72:
153
154.. code-block:: bash
155
Neha Malcom Francis507be122023-07-22 00:14:43 +0530156 $ make CROSS_COMPILE=aarch64-linux-gnu- j7200_evm_a72_defconfig O=build/a72
157 $ make CROSS_COMPILE=aarch64-linux-gnu- \
158 BL31=<path/to/trusted-firmware-a/dir>/build/k3/generic/release/bl31.bin \
159 TEE=<path/to/optee_os/dir>/out/arm-plat-k3/core/tee-raw.bin \
160 BINMAN_INDIRS=<path/to/ti-linux-firmware>
Udit Kumared92ede2023-05-11 14:47:48 +0530161
162Target Images
163--------------
Tom Rinifdf45032023-07-25 12:44:16 -0400164In order to boot we need tiboot3.bin, tispl.bin and u-boot.img. Each SoC
165variant (GP, HS-FS, HS-SE) requires a different source for these files.
Neha Malcom Francis507be122023-07-22 00:14:43 +0530166
167 - GP
168
169 * tiboot3-j7200-gp-evm.bin from step 4.1
170 * tispl.bin_unsigned, u-boot.img_unsigned from step 4.2
171
172 - HS-FS
173
174 * tiboot3-j7200_sr2-hs-fs-evm.bin from step 4.1
175 * tispl.bin, u-boot.img from step 4.2
176
177 - HS-SE
178
179 * tiboot3-j7200_sr2-hs-evm.bin from step 4.1
180 * tispl.bin, u-boot.img from step 4.2
Udit Kumared92ede2023-05-11 14:47:48 +0530181
182Image formats:
183--------------
184
185- tiboot3.bin:
186
187.. code-block:: console
188
189 +-----------------------+
190 | X.509 |
191 | Certificate |
192 | +-------------------+ |
193 | | | |
194 | | R5 | |
195 | | u-boot-spl.bin | |
196 | | | |
197 | +-------------------+ |
198 | | | |
199 | | FIT header | |
200 | | +---------------+ | |
201 | | | | | |
202 | | | DTB 1...N | | |
203 | | +---------------+ | |
204 | +-------------------+ |
205 | | | |
206 | | FIT HEADER | |
207 | | +---------------+ | |
208 | | | | | |
209 | | | sysfw.bin | | |
210 | | +---------------+ | |
211 | | | | | |
212 | | | board config | | |
213 | | +---------------+ | |
214 | | | | | |
215 | | | PM config | | |
216 | | +---------------+ | |
217 | | | | | |
218 | | | RM config | | |
219 | | +---------------+ | |
220 | | | | | |
221 | | | Secure config | | |
222 | | +---------------+ | |
223 | +-------------------+ |
224 +-----------------------+
225
226- tispl.bin
227
228.. code-block:: console
229
230 +-----------------------+
231 | |
232 | FIT HEADER |
233 | +-------------------+ |
234 | | | |
Neha Malcom Francis507be122023-07-22 00:14:43 +0530235 | | A72 TF-A | |
Udit Kumared92ede2023-05-11 14:47:48 +0530236 | +-------------------+ |
237 | | | |
Neha Malcom Francis507be122023-07-22 00:14:43 +0530238 | | A72 OP-TEE | |
Udit Kumared92ede2023-05-11 14:47:48 +0530239 | +-------------------+ |
240 | | | |
241 | | R5 DM FW | |
242 | +-------------------+ |
243 | | | |
244 | | A72 SPL | |
245 | +-------------------+ |
246 | | | |
247 | | SPL DTB 1...N | |
248 | +-------------------+ |
249 +-----------------------+
250
251
252Switch Setting for Boot Mode
253----------------------------
254
255Boot Mode pins provide means to select the boot mode and options before the
256device is powered up. After every POR, they are the main source to populate
257the Boot Parameter Tables.
258
259The following table shows some common boot modes used on J7200 platform. More
260details can be found in the Technical Reference Manual:
261https://www.ti.com/lit/pdf/spruiu1 under the `Boot Mode Pins` section.
262
263
264*Boot Modes*
265
266============ ============= =============
267Switch Label SW9: 12345678 SW8: 12345678
268============ ============= =============
269SD 00000000 10000010
270EMMC 01000000 10000000
271OSPI 01000000 00000110
272UART 01110000 00000000
273USB DFU 00100000 10000000
274============ ============= =============
275
276For SW8 and SW9, the switch state in the "ON" position = 1.
277
278eMMC:
279-----
280ROM supports booting from eMMC raw read or UDA FS mode.
281
282Below is memory layout in case of booting from
283boot 0/1 partition in raw mode.
284
285Current allocated size for tiboot3 size is 1MB, tispl is 2MB.
286
287Size of u-boot.img is taken 4MB for refernece,
288But this is subject to change depending upon atf, optee size
289
290.. code-block:: console
291
292 boot0/1 partition (8 MB) user partition
293 0x0+----------------------------------+ 0x0+------------------------+
294 | tiboot3.bin (1 MB) | | |
295 0x800+----------------------------------+ | |
296 | tispl.bin (2 MB) | | |
297 0x1800+----------------------------------+ | |
298 | u-boot.img (4MB) | | |
299 0x3800+----------------------------------+ | |
300 | | | |
301 0x3900+ environment | | |
302 | | | |
303 0x3A00+----------------------------------+ +-------------------------+
304
305In case of UDA FS mode booting, following is layout.
306
307All boot images tiboot3.bin, tispl and u-boot should be written to
308fat formatted UDA FS as file.
309
310.. code-block:: console
311
312 boot0/1 partition (8 MB) user partition
313 0x0+---------------------------------+ 0x0+-------------------------+
314 | | | tiboot3.bin* |
315 0x800+----------------------------------+ | |
316 | | | tispl.bin |
317 0x1800+----------------------------------+ | |
318 | | | u-boot.img |
319 0x3800+----------------------------------+ | |
320 | | | |
321 0x3900+ | | environment |
322 | | | |
323 0x3A00+----------------------------------+ +-------------------------+
324
325
326
327In case of booting from eMMC, write above images into raw or UDA FS.
328and set mmc partconf accordingly.