blob: 16091ac44580b6c8bf66377a6513c80a509d75ff [file] [log] [blame]
Kishon Vijay Abraham I78d13c92021-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 Brattlof10d3f172022-12-19 14:29:49 -06004J721E Platforms
5===============
Kishon Vijay Abraham I78d13c92021-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 Menon0a2d2ef2023-07-27 13:58:47 -050037.. image:: img/boot_diagram_j721e.svg
Kishon Vijay Abraham I78d13c92021-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 I78d13c92021-07-21 21:28:48 +053044
Nishanth Menonee91e482023-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
Andrew Davis4bb06452022-11-09 11:30:00 -060048
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053049Build procedure:
50----------------
Neha Malcom Francis507be122023-07-22 00:14:43 +0530511. Trusted Firmware-A:
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053052
Andrew Davisd8fcaa22022-11-09 11:30:01 -060053.. code-block:: bash
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053054
Neha Malcom Francis507be122023-07-22 00:14:43 +053055 $ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 \
56 TARGET_BOARD=generic SPD=opteed
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053057
Neha Malcom Francis507be122023-07-22 00:14:43 +0530582. OP-TEE:
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053059
Andrew Davisd8fcaa22022-11-09 11:30:01 -060060.. code-block:: bash
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053061
Neha Malcom Francis507be122023-07-22 00:14:43 +053062 $ make PLATFORM=k3-j721e CFG_ARM64_core=y
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053063
Neha Malcom Francis507be122023-07-22 00:14:43 +0530643. U-Boot:
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053065
66* 4.1 R5:
67
Andrew Davisd8fcaa22022-11-09 11:30:01 -060068.. code-block:: bash
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053069
Neha Malcom Francis507be122023-07-22 00:14:43 +053070 $ make j721e_evm_r5_defconfig
71 $ make CROSS_COMPILE=arm-linux-gnueabihf- \
72 BINMAN_INDIRS=<path/to/ti-linux-firmware>
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053073
74* 4.2 A72:
75
Andrew Davisd8fcaa22022-11-09 11:30:01 -060076.. code-block:: bash
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053077
Neha Malcom Francis507be122023-07-22 00:14:43 +053078 $ make j721e_evm_a72_defconfig
79 $ make CROSS_COMPILE=aarch64-linux-gnu- \
80 BL31=<path/to/trusted-firmware-a/dir>/build/k3/generic/release/bl31.bin \
81 TEE=<path/to/optee_os/dir>/out/arm-plat-k3/core/tee-raw.bin \
82 BINMAN_INDIRS=<path/to/ti-linux-firmware>
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +053083
84Target Images
85--------------
Tom Rinifdf45032023-07-25 12:44:16 -040086In order to boot we need tiboot3.bin, sysfw.itb, tispl.bin and u-boot.img.
87Each SoC variant (GP, HS-FS and HS-SE) requires a different source for these
88files.
Neha Malcom Francis507be122023-07-22 00:14:43 +053089
90 - GP
91
92 * tiboot3-j721e-gp-evm.bin, sysfw-j721e-gp-evm.itb from step 4.1
93 * tispl.bin_unsigned, u-boot.img_unsigned from step 4.2
94
95 - HS-FS
96
97 * tiboot3-j721e_sr2-hs-fs-evm.bin, sysfw-j721e_sr2-hs-fs-evm.itb from step 4.1
98 * tispl.bin, u-boot.img from step 4.2
99
100 - HS-SE
101
102 * tiboot3-j721e_sr2-hs-evm.bin, sysfw-j721e_sr2-hs-evm.itb from step 4.1
103 * tispl.bin, u-boot.img from step 4.2
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +0530104
105Image formats:
106--------------
107
108- tiboot3.bin:
109
110.. code-block:: text
111
112 +-----------------------+
113 | X.509 |
114 | Certificate |
115 | +-------------------+ |
116 | | | |
117 | | R5 | |
118 | | u-boot-spl.bin | |
119 | | | |
120 | +-------------------+ |
121 | | | |
122 | | FIT header | |
123 | | +---------------+ | |
124 | | | | | |
125 | | | DTB 1...N | | |
126 | | +---------------+ | |
127 | +-------------------+ |
128 +-----------------------+
129
130- tispl.bin
131
132.. code-block:: text
133
134 +-----------------------+
135 | |
136 | FIT HEADER |
137 | +-------------------+ |
138 | | | |
Neha Malcom Francis507be122023-07-22 00:14:43 +0530139 | | A72 TF-A | |
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +0530140 | +-------------------+ |
141 | | | |
Neha Malcom Francis507be122023-07-22 00:14:43 +0530142 | | A72 OP-TEE | |
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +0530143 | +-------------------+ |
144 | | | |
145 | | R5 DM FW | |
146 | +-------------------+ |
147 | | | |
148 | | A72 SPL | |
149 | +-------------------+ |
150 | | | |
151 | | SPL DTB 1...N | |
152 | +-------------------+ |
153 +-----------------------+
154
155- sysfw.itb
156
157.. code-block:: text
158
159 +-----------------------+
160 | |
161 | FIT HEADER |
162 | +-------------------+ |
163 | | | |
164 | | sysfw.bin | |
165 | +-------------------+ |
166 | | | |
167 | | board config | |
168 | +-------------------+ |
169 | | | |
170 | | PM config | |
171 | +-------------------+ |
172 | | | |
173 | | RM config | |
174 | +-------------------+ |
175 | | | |
176 | | Secure config | |
177 | +-------------------+ |
178 +-----------------------+
179
Manorit Chawdhryc4188b92023-05-16 10:24:36 +0530180R5 Memory Map:
181--------------
182
183.. list-table::
184 :widths: 16 16 16
185 :header-rows: 1
186
187 * - Region
188 - Start Address
189 - End Address
190
191 * - SPL
192 - 0x41c00000
193 - 0x41c40000
194
195 * - EMPTY
196 - 0x41c40000
197 - 0x41c81920
198
199 * - STACK
200 - 0x41c85920
201 - 0x41c81920
202
203 * - Global data
204 - 0x41c859f0
205 - 0x41c85920
206
207 * - Heap
208 - 0x41c859f0
209 - 0x41cf59f0
210
211 * - BSS
212 - 0x41cf59f0
213 - 0x41cff9f0
214
215 * - MCU Scratchpad
216 - 0x41cff9fc
217 - 0x41cffbfc
218
219 * - ROM DATA
220 - 0x41cffbfc
221 - 0x41cfffff
222
Kishon Vijay Abraham I78d13c92021-07-21 21:28:48 +0530223OSPI:
224-----
225ROM supports booting from OSPI from offset 0x0.
226
227Flashing images to OSPI:
228
229Below commands can be used to download tiboot3.bin, tispl.bin, u-boot.img,
230and sysfw.itb over tftp and then flash those to OSPI at their respective
231addresses.
232
233.. code-block:: text
234
235 => sf probe
236 => tftp ${loadaddr} tiboot3.bin
237 => sf update $loadaddr 0x0 $filesize
238 => tftp ${loadaddr} tispl.bin
239 => sf update $loadaddr 0x80000 $filesize
240 => tftp ${loadaddr} u-boot.img
241 => sf update $loadaddr 0x280000 $filesize
242 => tftp ${loadaddr} sysfw.itb
243 => sf update $loadaddr 0x6C0000 $filesize
244
245Flash layout for OSPI:
246
247.. code-block:: text
248
249 0x0 +----------------------------+
250 | ospi.tiboot3(512K) |
251 | |
252 0x80000 +----------------------------+
253 | ospi.tispl(2M) |
254 | |
255 0x280000 +----------------------------+
256 | ospi.u-boot(4M) |
257 | |
258 0x680000 +----------------------------+
259 | ospi.env(128K) |
260 | |
261 0x6A0000 +----------------------------+
262 | ospi.env.backup (128K) |
263 | |
264 0x6C0000 +----------------------------+
265 | ospi.sysfw(1M) |
266 | |
267 0x7C0000 +----------------------------+
268 | padding (256k) |
269 0x800000 +----------------------------+
270 | ospi.rootfs(UBIFS) |
271 | |
272 +----------------------------+
Kishon Vijay Abraham Idd7f5282021-07-21 21:28:49 +0530273
274Firmwares:
275----------
276
277The J721e u-boot allows firmware to be loaded for the Cortex-R5 subsystem.
278The CPSW5G in J7200 and CPSW9G in J721E present in MAIN domain is configured
279and controlled by the ethernet firmware that executes in the MAIN Cortex R5.
280The default supported environment variables support loading these firmwares
281from only MMC. "dorprocboot" env variable has to be set for the U-BOOT to load
282and start the remote cores in the system.
283
284J721E common processor board can be attached to a Ethernet QSGMII card and the
285PHY in the card has to be reset before it can be used for data transfer.
286"do_main_cpsw0_qsgmii_phyinit" env variable has to be set for the U-BOOT to
287configure this PHY.