arm-tf a53 compiler
---------------------------------------------------
Cross Compiler:
https://releases.linaro.org/components/toolchain/binaries/
https://github.com/linaro-swg/arm-trusted-firmware
step1:
install toolchains: gcc-linaro-7.5.0-2019.12-x86_64_aarch64-elf gcc-linaro-7.5.0-2019.12-x86_64_aarch64-linux-gnu
step2:
git clone https://github.com/linaro-swg/arm-trusted-firmware.git
step3:
compiler
make CROSS_COMPILE=aarch64-elf- PLAT=qemu
services/std_svc/psci/psci_common.c: In function ‘psci_do_state_coordination’:
services/std_svc/psci/psci_common.c:220:27: error: array subscript is above array bounds [-Werror=array-bounds]
psci_req_local_pwr_states[pwrlvl - 1][cpu_idx] = req_pwr_state;
~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~
modify to:
assert(pwrlvl > PSCI_CPU_PWR_LVL);
assert(pwrlvl <= PLAT_MAX_PWR_LVL)
// psci_req_local_pwr_states[pwrlvl - 1][cpu_idx] = req_pwr_state;
if(cpu_idx < PLATFORM_CORE_COUNT)
psci_req_local_pwr_states[pwrlvl - 1u][cpu_idx] = req_pwr_state;
Done.
---------------------------------------------------
(一) qemu install:
https://blog.csdn.net/FinicsWang/article/details/101347380
git clone https://git.qemu.org/git/qemu.git
git check v4.2.0
1) update python to 3.6
2) apt-get install ninja-build
3)update gcc update to 7.5
gcc update: (download site: http://ftp.gnu.org/gnu/gcc/gcc-7.5.0/)
https://www.freesion.com/article/2692881267/
./contrib/download_prerequisites //该脚本会自动帮我们下载所需要的依赖文件和库
./configure -enable-checking=release -enable-languages=c,c++ -disable-multilib
make && make install //编译时间很长
gcc --version
sudo apt-get install build-essential pkg-config zlib1g-dev
sudo apt-get install libglib2.0-0 libglib2.0-dev
sudo apt-get install libsdl1.2-dev
sudo apt-get install libpixman-1-dev libfdt-dev
sudo apt-get install autoconf automake libtool
sudo apt-get install librbd-dev
sudo apt-get install libaio-dev
sudo apt-get install flex bison
./configure --target-list=aarch64-softmmu
Make
download uboot:
git clone git://git.denx.de/u-boot.git
git checkout 504bf790da08db9b4a443566cf6ef577f9c7996a
make mrproper
export CROSS_COMPILE=aarch64-linux-gnu-
make qemu_arm64_defconfig
make menuconfig
#ARM architectureàGenerate position-independent pre-relocation code
将POSITION_INDEPENDENT项设置为yes
2. /u-boot/common/board_r.c 文件注释 initr_flash 否则u-boot crash)
Make
-------------------------
arm-tf compiler
export ARCH=arm64
export CROSS_COMPILE=aarch64-linux-gnu-
make PLAT=qemu BL33=/home/xxx/git/u-boot//u-boot.bin all fip DEBUG=1
/home/xxx/install/bin/qemu-system-aarch64 -nographic -smp 2 -machine virt,secure=on -cpu cortex-a53 -d unimp -semihosting-config enable,target=native -m 1057 -bios ./bl1.bin

浙公网安备 33010602011771号