blob: 0d3a526516cf2488cde949eee05de329728ba567 [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 | | | : | |
86 | |Services | | | +-----------+ | |
87 | | |<--------|-----------------------|---->|*ATF/OPTEE*| | |
88 | | | | | +-----------+ | |
89 | | | | | : | |
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--------
1231. SYSFW:
124 Tree: git://git.ti.com/k3-image-gen/k3-image-gen.git
125 Branch: master
126
1272. ATF:
128 Tree: https://github.com/ARM-software/arm-trusted-firmware.git
129 Branch: master
130
1313. OPTEE:
132 Tree: https://github.com/OP-TEE/optee_os.git
133 Branch: master
134
1354. DM Firmware:
136 Tree: git://git.ti.com/processor-firmware/ti-linux-firmware.git
137 Branch: ti-linux-firmware
138
1395. U-Boot:
140 Tree: https://source.denx.de/u-boot/u-boot
141 Branch: master
142
143Build procedure:
144----------------
1451. SYSFW:
146
147.. code-block:: bash
148
149 make ARCH=arm CROSS_COMPILE=arm-none-linux-gnueabihf- SOC=j7200 SBL=u-boot-spl.bin SYSFW_PATH=<path to sysfw>/ti-fs-firmware-j7200-gp.bin
150 u-boot-spl.bin is generated at step 4.
151
1522. ATF:
153
154.. code-block:: bash
155
156 make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed
157
1583. OPTEE:
159
160.. code-block:: bash
161
162 make PLATFORM=k3-j7200 CFG_ARM64_core=y
163
1644. U-Boot:
165
166* 4.1 R5:
167
168.. code-block:: bash
169
170 make CROSS_COMPILE=arm-linux-gnueabihf- j7200_evm_r5_defconfig O=build/r5
171 make CROSS_COMPILE=arm-linux-gnueabihf- O=build/r5
172
173* 4.2 A72:
174
175.. code-block:: bash
176
177 make CROSS_COMPILE=aarch64-linux-gnu- j7200_evm_a72_defconfig O=build/a72
178 make CROSS_COMPILE=aarch64-linux-gnu- ATF=<ATF dir>/build/k3/generic/release/bl31.bin TEE=<OPTEE OS dir>/out/arm-plat-k3/core/tee-pager_v2.bin DM=<DM firmware>/ti-dm/j7200/ipc_echo_testb_mcu1_0_release_strip.xer5f O=build/a72
179
180Target Images
181--------------
182Copy the below images to an SD card and boot:
183 - tiboot3.bin from step 1
184 - tispl.bin, u-boot.img from 4.2
185
186Image formats:
187--------------
188
189- tiboot3.bin:
190
191.. code-block:: console
192
193 +-----------------------+
194 | X.509 |
195 | Certificate |
196 | +-------------------+ |
197 | | | |
198 | | R5 | |
199 | | u-boot-spl.bin | |
200 | | | |
201 | +-------------------+ |
202 | | | |
203 | | FIT header | |
204 | | +---------------+ | |
205 | | | | | |
206 | | | DTB 1...N | | |
207 | | +---------------+ | |
208 | +-------------------+ |
209 | | | |
210 | | FIT HEADER | |
211 | | +---------------+ | |
212 | | | | | |
213 | | | sysfw.bin | | |
214 | | +---------------+ | |
215 | | | | | |
216 | | | board config | | |
217 | | +---------------+ | |
218 | | | | | |
219 | | | PM config | | |
220 | | +---------------+ | |
221 | | | | | |
222 | | | RM config | | |
223 | | +---------------+ | |
224 | | | | | |
225 | | | Secure config | | |
226 | | +---------------+ | |
227 | +-------------------+ |
228 +-----------------------+
229
230- tispl.bin
231
232.. code-block:: console
233
234 +-----------------------+
235 | |
236 | FIT HEADER |
237 | +-------------------+ |
238 | | | |
239 | | A72 ATF | |
240 | +-------------------+ |
241 | | | |
242 | | A72 OPTEE | |
243 | +-------------------+ |
244 | | | |
245 | | R5 DM FW | |
246 | +-------------------+ |
247 | | | |
248 | | A72 SPL | |
249 | +-------------------+ |
250 | | | |
251 | | SPL DTB 1...N | |
252 | +-------------------+ |
253 +-----------------------+
254
255
256Switch Setting for Boot Mode
257----------------------------
258
259Boot Mode pins provide means to select the boot mode and options before the
260device is powered up. After every POR, they are the main source to populate
261the Boot Parameter Tables.
262
263The following table shows some common boot modes used on J7200 platform. More
264details can be found in the Technical Reference Manual:
265https://www.ti.com/lit/pdf/spruiu1 under the `Boot Mode Pins` section.
266
267
268*Boot Modes*
269
270============ ============= =============
271Switch Label SW9: 12345678 SW8: 12345678
272============ ============= =============
273SD 00000000 10000010
274EMMC 01000000 10000000
275OSPI 01000000 00000110
276UART 01110000 00000000
277USB DFU 00100000 10000000
278============ ============= =============
279
280For SW8 and SW9, the switch state in the "ON" position = 1.
281
282eMMC:
283-----
284ROM supports booting from eMMC raw read or UDA FS mode.
285
286Below is memory layout in case of booting from
287boot 0/1 partition in raw mode.
288
289Current allocated size for tiboot3 size is 1MB, tispl is 2MB.
290
291Size of u-boot.img is taken 4MB for refernece,
292But this is subject to change depending upon atf, optee size
293
294.. code-block:: console
295
296 boot0/1 partition (8 MB) user partition
297 0x0+----------------------------------+ 0x0+------------------------+
298 | tiboot3.bin (1 MB) | | |
299 0x800+----------------------------------+ | |
300 | tispl.bin (2 MB) | | |
301 0x1800+----------------------------------+ | |
302 | u-boot.img (4MB) | | |
303 0x3800+----------------------------------+ | |
304 | | | |
305 0x3900+ environment | | |
306 | | | |
307 0x3A00+----------------------------------+ +-------------------------+
308
309In case of UDA FS mode booting, following is layout.
310
311All boot images tiboot3.bin, tispl and u-boot should be written to
312fat formatted UDA FS as file.
313
314.. code-block:: console
315
316 boot0/1 partition (8 MB) user partition
317 0x0+---------------------------------+ 0x0+-------------------------+
318 | | | tiboot3.bin* |
319 0x800+----------------------------------+ | |
320 | | | tispl.bin |
321 0x1800+----------------------------------+ | |
322 | | | u-boot.img |
323 0x3800+----------------------------------+ | |
324 | | | |
325 0x3900+ | | environment |
326 | | | |
327 0x3A00+----------------------------------+ +-------------------------+
328
329
330
331In case of booting from eMMC, write above images into raw or UDA FS.
332and set mmc partconf accordingly.