blob: 5acf7302c00131d799dd603c59897af33333c8f3 [file] [log] [blame]
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +05301.. SPDX-License-Identifier: GPL-2.0+ OR BSD-3-Clause
2.. sectionauthor:: Lokesh Vutla <lokeshvutla@ti.com>
3
Bryan Brattlof0820e112022-12-19 14:29:49 -06004J721E Platforms
5===============
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +05306
7Introduction:
8-------------
9The J721e 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 * 2 x Dual cortex ARM Cortex-R5 subsystem
27 * 2 x C66x Digital signal processor sub system
28 * C71x Digital signal processor sub-system with MMA.
29
30More info can be found in TRM: http://www.ti.com/lit/pdf/spruil1
31
32Boot Flow:
33----------
34Boot flow is similar to that of AM65x SoC and extending it with remoteproc
35support. Below is the pictorial representation of boot flow:
36
Nishanth Menon9e30ebc2023-07-27 13:58:47 -050037.. image:: img/boot_diagram_j721e.svg
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053038
39- Here DMSC acts as master and provides all the critical services. R5/A72
40 requests DMSC to get these services done as shown in the above diagram.
41
42Sources:
43--------
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053044
Nishanth Menoncce3e7a2023-07-27 13:58:44 -050045.. include:: k3.rst
46 :start-after: .. k3_rst_include_start_boot_sources
47 :end-before: .. k3_rst_include_end_boot_sources
Neha Malcom Francis1ee652a2023-07-22 00:14:43 +053048
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053049Build procedure:
50----------------
Nishanth Menonc727b812023-07-27 13:58:48 -0500510. Setup the environment variables:
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053052
Nishanth Menonc727b812023-07-27 13:58:48 -050053.. include:: k3.rst
54 :start-after: .. k3_rst_include_start_common_env_vars_desc
55 :end-before: .. k3_rst_include_end_common_env_vars_desc
56
57.. include:: k3.rst
58 :start-after: .. k3_rst_include_start_board_env_vars_desc
59 :end-before: .. k3_rst_include_end_board_env_vars_desc
60
61Set the variables corresponding to this platform:
62
63.. include:: k3.rst
64 :start-after: .. k3_rst_include_start_common_env_vars_defn
65 :end-before: .. k3_rst_include_end_common_env_vars_defn
Andrew Davis4bc50972022-11-09 11:30:01 -060066.. code-block:: bash
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053067
Nishanth Menonc727b812023-07-27 13:58:48 -050068 $ export UBOOT_CFG_CORTEXR=j721e_evm_r5_defconfig
69 $ export UBOOT_CFG_CORTEXA=j721e_evm_a72_defconfig
70 $ export TFA_BOARD=generic
71 $ # we dont use any extra TFA parameters
72 $ unset TFA_EXTRA_ARGS
73 $ export OPTEE_PLATFORM=k3-j721e
74 $ # we dont use any extra OP-TEE parameters
75 $ unset OPTEE_EXTRA_ARGS
76
77.. j721e_evm_rst_include_start_build_steps
78
791. Trusted Firmware-A:
80
81.. include:: k3.rst
82 :start-after: .. k3_rst_include_start_build_steps_tfa
83 :end-before: .. k3_rst_include_end_build_steps_tfa
84
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053085
Neha Malcom Francis1ee652a2023-07-22 00:14:43 +0530862. OP-TEE:
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053087
Nishanth Menonc727b812023-07-27 13:58:48 -050088.. include:: k3.rst
89 :start-after: .. k3_rst_include_start_build_steps_optee
90 :end-before: .. k3_rst_include_end_build_steps_optee
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053091
Neha Malcom Francis1ee652a2023-07-22 00:14:43 +0530923. U-Boot:
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053093
94* 4.1 R5:
95
Nishanth Menonc727b812023-07-27 13:58:48 -050096.. include:: k3.rst
97 :start-after: .. k3_rst_include_start_build_steps_spl_r5
98 :end-before: .. k3_rst_include_end_build_steps_spl_r5
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +053099
100* 4.2 A72:
101
Nishanth Menonc727b812023-07-27 13:58:48 -0500102.. include:: k3.rst
103 :start-after: .. k3_rst_include_start_build_steps_uboot
104 :end-before: .. k3_rst_include_end_build_steps_uboot
105.. j721e_evm_rst_include_end_build_steps
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +0530106
107Target Images
108--------------
Tom Rinif687c8f2023-07-25 12:44:16 -0400109In order to boot we need tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img.
110Each SoC variant (GP, HS-FS and HS-SE) requires a different source for these
111files.
Neha Malcom Francis1ee652a2023-07-22 00:14:43 +0530112
113 - GP
114
115 * tiboot3-j721e-gp-evm.bin, sysfw-j721e-gp-evm.itb from step 4.1
116 * tispl.bin_unsigned, u-boot.img_unsigned from step 4.2
117
118 - HS-FS
119
120 * tiboot3-j721e_sr2-hs-fs-evm.bin, sysfw-j721e_sr2-hs-fs-evm.itb from step 4.1
121 * tispl.bin, u-boot.img from step 4.2
122
123 - HS-SE
124
125 * tiboot3-j721e_sr2-hs-evm.bin, sysfw-j721e_sr2-hs-evm.itb from step 4.1
126 * tispl.bin, u-boot.img from step 4.2
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +0530127
128Image formats:
129--------------
130
131- tiboot3.bin:
132
133.. code-block:: text
134
135 +-----------------------+
136 | X.509 |
137 | Certificate |
138 | +-------------------+ |
139 | | | |
140 | | R5 | |
141 | | u-boot-spl.bin | |
142 | | | |
143 | +-------------------+ |
144 | | | |
145 | | FIT header | |
146 | | +---------------+ | |
147 | | | | | |
148 | | | DTB 1...N | | |
149 | | +---------------+ | |
150 | +-------------------+ |
151 +-----------------------+
152
153- tispl.bin
154
155.. code-block:: text
156
157 +-----------------------+
158 | |
159 | FIT HEADER |
160 | +-------------------+ |
161 | | | |
Neha Malcom Francis1ee652a2023-07-22 00:14:43 +0530162 | | A72 TF-A | |
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +0530163 | +-------------------+ |
164 | | | |
Neha Malcom Francis1ee652a2023-07-22 00:14:43 +0530165 | | A72 OP-TEE | |
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +0530166 | +-------------------+ |
167 | | | |
168 | | R5 DM FW | |
169 | +-------------------+ |
170 | | | |
171 | | A72 SPL | |
172 | +-------------------+ |
173 | | | |
174 | | SPL DTB 1...N | |
175 | +-------------------+ |
176 +-----------------------+
177
178- sysfw.itb
179
180.. code-block:: text
181
182 +-----------------------+
183 | |
184 | FIT HEADER |
185 | +-------------------+ |
186 | | | |
187 | | sysfw.bin | |
188 | +-------------------+ |
189 | | | |
190 | | board config | |
191 | +-------------------+ |
192 | | | |
193 | | PM config | |
194 | +-------------------+ |
195 | | | |
196 | | RM config | |
197 | +-------------------+ |
198 | | | |
199 | | Secure config | |
200 | +-------------------+ |
201 +-----------------------+
202
Manorit Chawdhry6cfdf822023-05-16 10:24:36 +0530203R5 Memory Map:
204--------------
205
206.. list-table::
207 :widths: 16 16 16
208 :header-rows: 1
209
210 * - Region
211 - Start Address
212 - End Address
213
214 * - SPL
215 - 0x41c00000
216 - 0x41c40000
217
218 * - EMPTY
219 - 0x41c40000
220 - 0x41c81920
221
222 * - STACK
223 - 0x41c85920
224 - 0x41c81920
225
226 * - Global data
227 - 0x41c859f0
228 - 0x41c85920
229
230 * - Heap
231 - 0x41c859f0
232 - 0x41cf59f0
233
234 * - BSS
235 - 0x41cf59f0
236 - 0x41cff9f0
237
238 * - MCU Scratchpad
239 - 0x41cff9fc
240 - 0x41cffbfc
241
242 * - ROM DATA
243 - 0x41cffbfc
244 - 0x41cfffff
245
Kishon Vijay Abraham I8baeeec2021-07-21 21:28:48 +0530246OSPI:
247-----
248ROM supports booting from OSPI from offset 0x0.
249
250Flashing images to OSPI:
251
252Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img,
253and sysfw.itb over tftp and then flash those to OSPI at their respective
254addresses.
255
256.. code-block:: text
257
258 => sf probe
259 => tftp ${loadaddr} tiboot3.bin
260 => sf update $loadaddr 0x0 $filesize
261 => tftp ${loadaddr} tispl.bin
262 => sf update $loadaddr 0x80000 $filesize
263 => tftp ${loadaddr} u-boot.img
264 => sf update $loadaddr 0x280000 $filesize
265 => tftp ${loadaddr} sysfw.itb
266 => sf update $loadaddr 0x6C0000 $filesize
267
268Flash layout for OSPI:
269
270.. code-block:: text
271
272 0x0 +----------------------------+
273 | ospi.tiboot3(512K) |
274 | |
275 0x80000 +----------------------------+
276 | ospi.tispl(2M) |
277 | |
278 0x280000 +----------------------------+
279 | ospi.u-boot(4M) |
280 | |
281 0x680000 +----------------------------+
282 | ospi.env(128K) |
283 | |
284 0x6A0000 +----------------------------+
285 | ospi.env.backup (128K) |
286 | |
287 0x6C0000 +----------------------------+
288 | ospi.sysfw(1M) |
289 | |
290 0x7C0000 +----------------------------+
291 | padding (256k) |
292 0x800000 +----------------------------+
293 | ospi.rootfs(UBIFS) |
294 | |
295 +----------------------------+
Kishon Vijay Abraham I4689aab2021-07-21 21:28:49 +0530296
297Firmwares:
298----------
299
300The J721e u-boot allows firmware to be loaded for the Cortex-R5 subsystem.
301The CPSW5G in J7200 and CPSW9G in J721E present in MAIN domain is configured
302and controlled by the ethernet firmware that executes in the MAIN Cortex R5.
303The default supported environment variables support loading these firmwares
304from only MMC. "dorprocboot" env variable has to be set for the U-BOOT to load
305and start the remote cores in the system.
306
307J721E common processor board can be attached to a Ethernet QSGMII card and the
308PHY in the card has to be reset before it can be used for data transfer.
309"do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to
310configure this PHY.