3 The AM65x family of SoCs is the first device family from K3 Multicore
4 SoC architecture, targeted for broad market and industrial control with
5 aim to meet the complex processing needs of modern embedded products.
7 The device is built over three domains, each containing specific processing
8 cores, voltage domains and peripherals:
9 1. Wake-up (WKUP) domain:
10 - Device Management and Security Controller (DMSC)
11 2. Microcontroller (MCU) domain:
12 - Dual Core ARM Cortex-R5F processor
14 - Quad core 64-bit ARM Cortex-A53
16 More info can be found in TRM: http://www.ti.com/lit/pdf/spruid7
20 On AM65x family devices, ROM supports boot only via MCU(R5). This means that
21 bootloader has to run on R5 core. In order to meet this constraint, and for
22 the following reasons the boot flow is designed as mentioned:
23 1. Need to move away from R5 asap, so that we want to start *any*
24 firmware on the r5 cores like.... autosar can be loaded to receive CAN
25 response and other safety operations to be started. This operation is
26 very time critical and is applicable for all automotive use cases.
27 2. U-Boot on A53 should start other remotecores for various
28 applications. This should happen before running Linux.
29 3. In production boot flow, we might not like to use full u-boot,
30 instead use Flacon boot flow to reduce boot time.
32 +------------------------------------------------------------------------+
34 +------------------------------------------------------------------------+
39 | +--------+ | +-----------+ | |
40 | | *ROM* |----------|-->| Reset rls | | |
41 | +--------+ | +-----------+ | |
45 | | | | +-------------+ | |
46 | | | | | *R5 ROM* | | |
47 | | | | +-------------+ | |
48 | | |<---------|---|Load and auth| | |
49 | | | | | tiboot3.bin | | |
50 | | | | +-------------+ | |
54 | | | | +-------------+ | |
55 | | | | | *R5 SPL* | | |
56 | | | | +-------------+ | |
58 | | | | | sysfw.itb | | |
59 | | Start | | +-------------+ | |
60 | | System |<---------|---| Start | | |
61 | |Firmware| | | SYSFW | | |
62 | +--------+ | +-------------+ | |
64 | +---------+ | | Load | | |
65 | | *SYSFW* | | | system | | |
66 | +---------+ | | Config data | | |
67 | | |<--------|---| | | |
68 | | | | +-------------+ | |
71 | | | | | config | | |
72 | | | | +-------------+ | |
74 | | |<--------|---| Start A53 | | |
75 | | | | | and Reset | | |
76 | | | | +-------------+ | |
77 | | | | | +-----------+ |
78 | | |---------|-----------------------|---->| Reset rls | |
79 | | | | | +-----------+ |
81 | |Services | | | +-----------+ |
82 | | |<--------|-----------------------|---->|*ATF/OPTEE*| |
83 | | | | | +-----------+ |
85 | | | | | +-----------+ |
86 | | |<--------|-----------------------|---->| *A53 SPL* | |
87 | | | | | +-----------+ |
89 | | | | | | u-boot.img| |
90 | | | | | +-----------+ |
92 | | | | | +-----------+ |
93 | | |<--------|-----------------------|---->| *U-Boot* | |
94 | | | | | +-----------+ |
95 | | | | | | prompt | |
96 | | | | | +-----------+ |
99 +------------------------------------------------------------------------+
101 - Here DMSC acts as master and provides all the critical services. R5/A53
102 requests DMSC to get these services done as shown in the above diagram.
107 Tree: git://git.ti.com/processor-firmware/system-firmware-image-gen.git
111 Tree: https://github.com/ARM-software/arm-trusted-firmware.git
115 Tree: https://github.com/OP-TEE/optee_os.git
119 Tree: http://git.denx.de/u-boot.git
125 $ make CROSS_COMPILE=arm-linux-gnueabihf-
128 $ make CROSS_COMPILE=aarch64-linux-gnu- ARCH=aarch64 PLAT=k3 TARGET_BOARD=generic SPD=opteed
131 $ make PLATFORM=k3-am65x CFG_ARM64_core=y
136 $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- am65x_evm_r5_defconfig O=/tmp/r5
137 $ make ARCH=arm CROSS_COMPILE=arm-linux-gnueabihf- O=/tmp/r5
140 $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- am65x_evm_a53_defconfig O=/tmp/a53
141 $ make ARCH=arm CROSS_COMPILE=aarch64-linux-gnu- ATF=<path to ATF dir>/build/k3/generic/release/bl31.bin TEE=<path to OPTEE OS dir>/out/arm-plat-k3/core/tee-pager.bin O=/tmp/a53
145 Copy the below images to an SD card and boot:
146 - sysfw.itb from step 1
147 - tiboot3.bin from step 4.1
148 - tispl.bin, u-boot.img from 4.2
154 +-----------------------+
157 | +-------------------+ |
160 | | u-boot-spl.bin | |
162 | +-------------------+ |
165 | | +---------------+ | |
167 | | | DTB 1...N | | |
168 | | +---------------+ | |
169 | +-------------------+ |
170 +-----------------------+
173 +-----------------------+
176 | +-------------------+ |
179 | +-------------------+ |
182 | +-------------------+ |
185 | +-------------------+ |
187 | | SPL DTB 1...N | |
188 | +-------------------+ |
189 +-----------------------+
192 +-----------------------+
195 | +-------------------+ |
198 | +-------------------+ |
201 | +-------------------+ |
204 | +-------------------+ |
207 | +-------------------+ |
209 | | Secure config | |
210 | +-------------------+ |
211 +-----------------------+
215 ROM supports booting from eMMC from boot0 partition offset 0x0
217 Flashing images to eMMC:
219 The following commands can be used to download tiboot3.bin, tispl.bin,
220 u-boot.img, and sysfw.itb from an SD card and write them to the eMMC boot0
221 partition at respective addresses.
224 => fatload mmc 1 ${loadaddr} tiboot3.bin
225 => mmc write ${loadaddr} 0x0 0x400
226 => fatload mmc 1 ${loadaddr} tispl.bin
227 => mmc write ${loadaddr} 0x400 0x1000
228 => fatload mmc 1 ${loadaddr} u-boot.img
229 => mmc write ${loadaddr} 0x1400 0x2000
230 => fatload mmc 1 ${loadaddr} sysfw.itb
231 => mmc write ${loadaddr} 0x3600 0x800
233 To give the ROM access to the boot partition, the following commands must be
234 used for the first time:
235 => mmc partconf 0 1 1 1
236 => mmc bootbus 0 1 0 0
238 To create a software partition for the rootfs, the following command can be
240 => gpt write mmc 0 ${partitions}
244 boot0 partition (8 MB) user partition
245 0x0+----------------------------------+ 0x0+-------------------------+
246 | tiboot3.bin (512 KB) | | |
247 0x400+----------------------------------+ | |
248 | tispl.bin (2 MB) | | |
249 0x1400+----------------------------------+ | rootfs |
250 | u-boot.img (4 MB) | | |
251 0x3400+----------------------------------+ | |
252 | environment (128 KB) | | |
253 0x3500+----------------------------------+ | |
254 | backup environment (128 KB) | | |
255 0x3600+----------------------------------+ | |
257 0x3E00+----------------------------------+ +-------------------------+
259 Kernel image and DT are expected to be present in the /boot folder of rootfs.
260 To boot kernel from eMMC, use the following commands: