reference site
-
ATF (arm-trusted-firmware), can be called Trusted Firmware-A (TF-A), which is TF-A
environment
-
Use qemu, you don't need a board
-
win10 64位 VMware Workstation Pro 16
-
ubuntu 20.04
-
qemu (virtual ARM development board), qemu
aarch64
platform -
ATF (TF-A) version: 2.9
-
gcc cross-compilation toolchain: gcc version 12.2.1 20230401
Download ATF
-
git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git
-
It can also be downloaded from github: https://github.com/ARM-software/arm-trusted-firmware
compile method
-
Configure the gcc cross-compilation toolchain, use it here
gcc version 12.2.1 20230401
, download address: https://snapshots.linaro.org/gnu-toolchain/12.2-2023.04-1/aarch64-linux-gnu/ -
Configure the environment variables of the cross-compilation toolchain
-
Compile command:
make ARCH=aarch64 CROSS_COMPILE=aarch64-linux-gnu- PLAT=qemu all DEBUG=1
-
【Note】The new version of ATF,
ARCH=aarch64
instead ofARCH=arm64
compiled product
- Mainly:
bl1.bin bl2.bin bl31.bin
qemu boot verification
-
There is currently no u-boot, and it seems that it cannot be guided correctly. The initial information is as follows
-
qemu.sh script
#!/bin/bash
qemu-system-aarch64 \
-nographic \
-machine virt,secure=on \
-cpu cortex-a53 \
-smp 2 \
-m 1024 \
-bios bl1.bin \
-semihosting-config enable,target=native
-
Note:
-semihosting-config enable,target=native
this is required -
For a normal board, each bin file should be written to the partition on the Flash. Here, qemu is used for simulation, which requires the support of local files.
-
chmod +x qemu.sh
,implement./qemu.sh
summary
- Get a preliminary understanding of the ATF compilation method based on the qemu aarch64 platform, and then continue to study how to cooperate with u-boot to guide the entire Linux system