Compilation of qemu arm-trusted-firmware atf

reference site

environment

  • Use qemu, you don't need a board

  • win10 64位 VMware Workstation Pro 16

  • ubuntu 20.04

  • qemu (virtual ARM development board), qemu aarch64platform

  • ATF (TF-A) version: 2.9

  • gcc cross-compilation toolchain: gcc version 12.2.1 20230401

Download ATF

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=aarch64instead ofARCH=arm64

insert image description here

compiled product

  • Mainly:bl1.bin bl2.bin bl31.bin

insert image description here

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=nativethis 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

insert image description here

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

Guess you like

Origin blog.csdn.net/tcjy1000/article/details/131364490