Update buildroot 2020.02.01 (#622)
* Update buildroot 2020.02.01 Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * Fix LN * Fix wpa Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * Fix lint Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * fix-network Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch> * Fix script Signed-off-by: Pascal Vizeli <pvizeli@syshack.ch>
This commit is contained in:
3
buildroot/board/qemu/arm-vexpress-tz/linux.fragment
Normal file
3
buildroot/board/qemu/arm-vexpress-tz/linux.fragment
Normal file
@@ -0,0 +1,3 @@
|
||||
### Enable OP-TEE
|
||||
CONFIG_TEE=y
|
||||
CONFIG_OPTEE=y
|
||||
10
buildroot/board/qemu/arm-vexpress-tz/post-build.sh
Executable file
10
buildroot/board/qemu/arm-vexpress-tz/post-build.sh
Executable file
@@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
set -e
|
||||
|
||||
# Rename boot images for the dear TF-A
|
||||
ln -sf u-boot.bin ${BINARIES_DIR}/bl33.bin
|
||||
ln -sf tee-header_v2.bin ${BINARIES_DIR}/bl32.bin
|
||||
ln -sf tee-pager_v2.bin ${BINARIES_DIR}/bl32_extra1.bin
|
||||
ln -sf tee-pageable_v2.bin ${BINARIES_DIR}/bl32_extra2.bin
|
||||
138
buildroot/board/qemu/arm-vexpress-tz/readme.txt
Normal file
138
buildroot/board/qemu/arm-vexpress-tz/readme.txt
Normal file
@@ -0,0 +1,138 @@
|
||||
Board qemu_arm_vexpress_tz builds a QEMU ARMv7-A target system with
|
||||
OP-TEE running in the TrustZone secure world and a Linux based
|
||||
OS running in the non-secure world. The board configuration enables
|
||||
builds of the QEMU host ARM target emulator.
|
||||
|
||||
make qemu_arm_vexpress_tz_defconfig
|
||||
make
|
||||
|
||||
The BIOS used in the QEMU host is the ARM Trusted Firmware-A (TF-A). TF-A
|
||||
uses QEMU semihosting file access to access boot image files. The
|
||||
QEMU platform is quite specific for that in TF-A and one needs to
|
||||
run the emulation from the image directory for TF-A to boot the
|
||||
secure and non-secure worlds.
|
||||
|
||||
cd output/images && ../host/bin/qemu-system-arm \
|
||||
-machine virt -machine secure=on -cpu cortex-a15 \
|
||||
-smp 1 -s -m 1024 -d unimp \
|
||||
-serial stdio \
|
||||
-netdev user,id=vmnic -device virtio-net-device,netdev=vmnic \
|
||||
-semihosting-config enable,target=native \
|
||||
-bios bl1.bin
|
||||
|
||||
The boot stage traces (if any) followed by the login prompt will appear
|
||||
in the terminal that started QEMU.
|
||||
|
||||
If you want to emulate more cores, use "-smp {1|2|3|4}" to select the
|
||||
number of cores.
|
||||
|
||||
Note: "-netdev user,id=vmnic -device virtio-net-device,netdev=vmnic"
|
||||
brings network support that is used i.e. in OP-TEE regression tests.
|
||||
|
||||
Tested with QEMU 2.12.0, and 3.1.0.
|
||||
|
||||
|
||||
-- Boot Details --
|
||||
|
||||
TF-A is used as QEMU BIOS. Its BL1 image boots and load its BL2 image. In turn,
|
||||
this image loads the OP-TEE secure world (ARMv7-A BL32 stage) and the U-boot as
|
||||
non-secure bootloader (BL33 stage).
|
||||
|
||||
QEMU natively hosts and loads in RAM the QEMU ARM target device tree. OP-TEE
|
||||
reads and modifies its content according to OP-TEE configuration.
|
||||
|
||||
Enable TF-A traces from LOG_LEVEL (I.e LOG_LEVEL=40) from
|
||||
BR2_TARGET_ARM_TRUSTED_FIRMWARE_ADDITIONAL_VARIABLES.
|
||||
|
||||
|
||||
-- OP-TEE Traces --
|
||||
|
||||
Secure boot stages and/or secure runtime services may use a serial link for
|
||||
their traces.
|
||||
|
||||
The ARM Trusted Firmware outputs its traces on the QEMU standard (first)
|
||||
serial interface.
|
||||
|
||||
The OP-TEE OS uses the QEMU second serial interface.
|
||||
|
||||
To get the OP-TEE OS traces, append a second -serial argument after
|
||||
-serial stdio in the QEMU command line. I.e, the following enables 2 serial
|
||||
consoles over telnet connections:
|
||||
|
||||
cd output/images && ../host/bin/qemu-system-arm \
|
||||
-machine virt -machine secure=on -cpu cortex-a15 \
|
||||
-smp 1 -s -m 1024 -d unimp \
|
||||
-serial telnet:127.0.0.1:1235,server \
|
||||
-serial telnet:127.0.0.1:1236,server \
|
||||
-netdev user,id=vmnic -device virtio-net-device,netdev=vmnic \
|
||||
-semihosting-config enable,target=native \
|
||||
-bios bl1.bin
|
||||
|
||||
QEMU is now waiting for the telnet connection. From another shell, open a
|
||||
telnet connection on the port for the U-boot and Linux consoles:
|
||||
|
||||
telnet 127.0.0.1 1235
|
||||
|
||||
and again for the secure console
|
||||
|
||||
telnet 127.0.0.1 1236
|
||||
|
||||
|
||||
-- Using gdb --
|
||||
|
||||
One can debug the OP-TEE secure world using GDB through the QEMU host.
|
||||
To do so, simply run the qemu-system-arm emulation, then run a GDB client
|
||||
and connect the QEMU internal GDB server.
|
||||
|
||||
The example below assumes we run QEMU and the GDB client from the same
|
||||
host computer. We use option -S of qemu-system-arm to make QEMU
|
||||
waiting for the GDB continue instruction before booting the images.
|
||||
|
||||
From a first shell:
|
||||
cd output/images && ../host/bin/qemu-system-arm \
|
||||
-machine virt -machine secure=on -cpu cortex-a15 \
|
||||
-smp 1 -s -m 1024 -d unimp \
|
||||
-serial stdio \
|
||||
-netdev user,id=vmnic -device virtio-net-device,netdev=vmnic \
|
||||
-semihosting-config enable,target=native \
|
||||
-bios bl1.bin \
|
||||
-S
|
||||
|
||||
From a second shell:
|
||||
./output/host/bin/arm-linux-gdb
|
||||
GNU gdb (GNU Toolchain for the A-profile Architecture 8.2-2018-08 (arm-rel-8.23)) 8.1.1.20180704-git
|
||||
Copyright (C) 2018 Free Software Foundation, Inc.
|
||||
...
|
||||
For help, type "help".
|
||||
Type "apropos word" to search for commands related to "word".
|
||||
(gdb)
|
||||
|
||||
From this GDB console, connect to the target, load the OP-TEE core symbols,
|
||||
set a breakpoint to its entry point (__text_start) and start emulation:
|
||||
|
||||
(gdb) target remote 127.0.0.1:1234
|
||||
(gdb) symbol-file ./output/build/optee-os-<reference>/out/arm/core/tee.elf
|
||||
(gdb) hbreak __text_start
|
||||
Hardware assisted breakpoint 1 at 0xe100000: file core/arch/arm/kernel/generic_entry_a32.S, line 246.
|
||||
(gdb) cont
|
||||
Continuing.
|
||||
|
||||
Thread 1 hit Breakpoint 1, _start () at core/arch/arm/kernel/generic_entry_a32.S:246
|
||||
246 bootargs_entry
|
||||
(gdb)
|
||||
|
||||
|
||||
Emulation has started, TF-A has loaded OP-TEE and U-boot images in memory and
|
||||
has booted OP-TEE. Emulation stopped at OP-TEE core entry.
|
||||
|
||||
Note: QEMU hosts a GDB service listening to TCP port 1234, as set through
|
||||
qemu-system-arm command line option -s.
|
||||
|
||||
Note: To build the GDB server, the following extra options have to be added to
|
||||
the Buildroot configuration:
|
||||
|
||||
BR2_ENABLE_DEBUG=y
|
||||
BR2_PACKAGE_GDB=y
|
||||
BR2_PACKAGE_HOST_GDB=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_CXX=y
|
||||
BR2_TOOLCHAIN_BUILDROOT_GLIBC=y
|
||||
7
buildroot/board/qemu/arm-vexpress-tz/u-boot.config
Normal file
7
buildroot/board/qemu/arm-vexpress-tz/u-boot.config
Normal file
@@ -0,0 +1,7 @@
|
||||
CONFIG_SYS_TEXT_BASE=0x60000000
|
||||
CONFIG_BOOTCOMMAND="fdt addr ${fdt_addr} && fdt resize 1000 && smhload zImage ${kernel_addr_r} && smhload rootfs.cpio.gz ${ramdisk_addr_r} ramdisk_addr_end && setenv bootargs console=ttyAMA0,115200 earlyprintk=serial,ttyAMA0,115200 && fdt chosen ${ramdisk_addr_r} ${ramdisk_addr_end} && bootz ${kernel_addr_r} - ${fdt_addr}"
|
||||
CONFIG_SEMIHOSTING=y
|
||||
# Drop flash accesses
|
||||
CONFIG_ENV_IS_IN_FLASH=n
|
||||
CONFIG_MTD=n
|
||||
CONFIG_MTD_NOR_FLASH=n
|
||||
6
buildroot/board/qemu/csky/linux-ck610.config.fragment
Normal file
6
buildroot/board/qemu/csky/linux-ck610.config.fragment
Normal file
@@ -0,0 +1,6 @@
|
||||
CONFIG_COMPILE_TEST=y
|
||||
CONFIG_CPU_CK610=y
|
||||
CONFIG_CPU_PM_WAIT=y
|
||||
CONFIG_RAM_BASE=0x10000000
|
||||
CONFIG_CSKY_APB_INTC=y
|
||||
CONFIG_GX6605S_TIMER=y
|
||||
5
buildroot/board/qemu/csky/linux-ck807.config.fragment
Normal file
5
buildroot/board/qemu/csky/linux-ck807.config.fragment
Normal file
@@ -0,0 +1,5 @@
|
||||
CONFIG_COMPILE_TEST=y
|
||||
CONFIG_CPU_CK807=y
|
||||
# CONFIG_CPU_HAS_FPU is not set
|
||||
CONFIG_CPU_PM_WAIT=y
|
||||
CONFIG_CSKY_APB_INTC=y
|
||||
5
buildroot/board/qemu/csky/linux-ck810.config.fragment
Normal file
5
buildroot/board/qemu/csky/linux-ck810.config.fragment
Normal file
@@ -0,0 +1,5 @@
|
||||
CONFIG_COMPILE_TEST=y
|
||||
CONFIG_CPU_CK810=y
|
||||
# CONFIG_CPU_HAS_FPU is not set
|
||||
CONFIG_CPU_PM_WAIT=y
|
||||
CONFIG_CSKY_APB_INTC=y
|
||||
9
buildroot/board/qemu/csky/linux-ck860.config.fragment
Normal file
9
buildroot/board/qemu/csky/linux-ck860.config.fragment
Normal file
@@ -0,0 +1,9 @@
|
||||
CONFIG_COMPILE_TEST=y
|
||||
CONFIG_CPU_CK860=y
|
||||
# CONFIG_CPU_HAS_FPU is not set
|
||||
CONFIG_CPU_PM_WAIT=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_HOTPLUG_CPU=y
|
||||
CONFIG_CSKY_APB_INTC=y
|
||||
CONFIG_CSKY_MPINTC=y
|
||||
CONFIG_CSKY_MP_TIMER=y
|
||||
12
buildroot/board/qemu/csky/readme.txt
Normal file
12
buildroot/board/qemu/csky/readme.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
Run with qemu:
|
||||
|
||||
For ck860 smp:
|
||||
qemu-system-cskyv2 -M virt -cpu ck860 -smp 2 -nographic -kernel vmlinux
|
||||
|
||||
For ck810/ck807:
|
||||
qemu-system-cskyv2 -M virt -nographic -kernel vmlinux
|
||||
|
||||
For ck610:
|
||||
qemu-system-cskyv1 -M virt -nographic -kernel vmlinux
|
||||
|
||||
The login prompt will appear in the terminal that started Qemu. Username is root and no password.
|
||||
3
buildroot/board/qemu/ppc-mac99/linux.fragment
Normal file
3
buildroot/board/qemu/ppc-mac99/linux.fragment
Normal file
@@ -0,0 +1,3 @@
|
||||
CONFIG_SERIAL_PMACZILOG=y
|
||||
CONFIG_SERIAL_PMACZILOG_TTYS=y
|
||||
CONFIG_SERIAL_PMACZILOG_CONSOLE=y
|
||||
5
buildroot/board/qemu/ppc-mac99/readme.txt
Normal file
5
buildroot/board/qemu/ppc-mac99/readme.txt
Normal file
@@ -0,0 +1,5 @@
|
||||
Run the emulation with:
|
||||
|
||||
qemu-system-ppc -nographic -vga none -M mac99 -cpu g4 -m 1G -kernel output/images/vmlinux -drive file=output/images/rootfs.ext2,format=raw -net nic,model=sungem -net user -append "root=/dev/sda"
|
||||
|
||||
Tested with QEMU 3.1.0
|
||||
@@ -1,23 +0,0 @@
|
||||
CONFIG_ARCH_RV32I=y
|
||||
CONFIG_SMP=y
|
||||
CONFIG_NR_CPUS=8
|
||||
CONFIG_PCI=y
|
||||
CONFIG_SYSVIPC=y
|
||||
CONFIG_NET=y
|
||||
CONFIG_PACKET=y
|
||||
CONFIG_UNIX=y
|
||||
CONFIG_INET=y
|
||||
# CONFIG_WIRELESS is not set
|
||||
CONFIG_VIRTIO_BLK=y
|
||||
CONFIG_NETDEVICES=y
|
||||
CONFIG_VIRTIO_NET=y
|
||||
# CONFIG_ETHERNET is not set
|
||||
# CONFIG_WLAN is not set
|
||||
CONFIG_SERIAL_8250=y
|
||||
CONFIG_SERIAL_8250_CONSOLE=y
|
||||
CONFIG_SERIAL_OF_PLATFORM=y
|
||||
CONFIG_VIRT_DRIVERS=y
|
||||
CONFIG_VIRTIO_MMIO=y
|
||||
CONFIG_EXT2_FS=y
|
||||
CONFIG_EXT4_FS=y
|
||||
CONFIG_TMPFS=y
|
||||
@@ -0,0 +1,66 @@
|
||||
From 15f62343916fcb3cae82e618da28eaa82bc8c007 Mon Sep 17 00:00:00 2001
|
||||
From: Alistair Francis <alistair.francis@wdc.com>
|
||||
Date: Tue, 16 Apr 2019 09:03:41 -0700
|
||||
Subject: [PATCH] Revert "riscv: Use latest system call ABI"
|
||||
|
||||
This reverts commit d4c08b9776b392e20efc6198ebe1bc8ec1911d9b.
|
||||
|
||||
The latest RISC-V 32bit glibc submission doesn't work with this patch,
|
||||
so let's revert it. This revert can be reverted when the glibc
|
||||
submission is updated to work on the 5.1 kernel.
|
||||
|
||||
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
|
||||
---
|
||||
arch/riscv/Kconfig | 1 +
|
||||
arch/riscv/include/uapi/asm/unistd.h | 5 ++++-
|
||||
arch/riscv/kernel/vdso/Makefile | 2 --
|
||||
3 files changed, 5 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
|
||||
index eb56c82d8aa1..43dd2680c696 100644
|
||||
--- a/arch/riscv/Kconfig
|
||||
+++ b/arch/riscv/Kconfig
|
||||
@@ -11,6 +11,7 @@ config 32BIT
|
||||
|
||||
config RISCV
|
||||
def_bool y
|
||||
+ select ARCH_32BIT_OFF_T if !64BIT
|
||||
# even on 32-bit, physical (and DMA) addresses are > 32-bits
|
||||
select PHYS_ADDR_T_64BIT
|
||||
select OF
|
||||
diff --git a/arch/riscv/include/uapi/asm/unistd.h b/arch/riscv/include/uapi/asm/unistd.h
|
||||
index 0e2eeeb1fd27..486a288b454c 100644
|
||||
--- a/arch/riscv/include/uapi/asm/unistd.h
|
||||
+++ b/arch/riscv/include/uapi/asm/unistd.h
|
||||
@@ -17,8 +17,11 @@
|
||||
|
||||
#ifdef __LP64__
|
||||
#define __ARCH_WANT_NEW_STAT
|
||||
-#define __ARCH_WANT_SET_GET_RLIMIT
|
||||
#endif /* __LP64__ */
|
||||
+#define __ARCH_WANT_SET_GET_RLIMIT
|
||||
+#ifndef __LP64__
|
||||
+#define __ARCH_WANT_TIME32_SYSCALLS
|
||||
+#endif
|
||||
|
||||
#include <asm-generic/unistd.h>
|
||||
|
||||
diff --git a/arch/riscv/kernel/vdso/Makefile b/arch/riscv/kernel/vdso/Makefile
|
||||
index fec62b24df89..eed1c137f618 100644
|
||||
--- a/arch/riscv/kernel/vdso/Makefile
|
||||
+++ b/arch/riscv/kernel/vdso/Makefile
|
||||
@@ -2,11 +2,9 @@
|
||||
|
||||
# Symbols present in the vdso
|
||||
vdso-syms = rt_sigreturn
|
||||
-ifdef CONFIG_64BIT
|
||||
vdso-syms += gettimeofday
|
||||
vdso-syms += clock_gettime
|
||||
vdso-syms += clock_getres
|
||||
-endif
|
||||
vdso-syms += getcpu
|
||||
vdso-syms += flush_icache
|
||||
|
||||
--
|
||||
2.21.0
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Run the emulation with:
|
||||
Run Linux in emulation with:
|
||||
|
||||
qemu-system-riscv32 -M virt -kernel output/images/bbl -append "rootwait root=/dev/vda ro console=ttyS0" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
|
||||
qemu-system-riscv32 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80400000 -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
|
||||
|
||||
The login prompt will appear in the terminal that started Qemu.
|
||||
|
||||
Tested with QEMU 2.12.1
|
||||
Tested with QEMU 3.1
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
Run the emulation with:
|
||||
Run Linux in emulation with:
|
||||
|
||||
qemu-system-riscv64 -M virt -kernel output/images/bbl -append "rootwait root=/dev/vda ro console=ttyS0" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
|
||||
qemu-system-riscv64 -M virt -kernel output/images/fw_jump.elf -device loader,file=output/images/Image,addr=0x80200000 -append "rootwait root=/dev/vda ro" -drive file=output/images/rootfs.ext2,format=raw,id=hd0 -device virtio-blk-device,drive=hd0 -netdev user,id=net0 -device virtio-net-device,netdev=net0 -nographic
|
||||
|
||||
The login prompt will appear in the terminal that started Qemu.
|
||||
|
||||
Tested with QEMU 2.12.1
|
||||
Tested with QEMU 3.1
|
||||
|
||||
11
buildroot/board/qemu/x86/post-build.sh
Executable file
11
buildroot/board/qemu/x86/post-build.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
set -e
|
||||
|
||||
# Add a console on tty1
|
||||
if [ -e ${TARGET_DIR}/etc/inittab ]; then
|
||||
grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
|
||||
sed -i '/GENERIC_SERIAL/a\
|
||||
tty1::respawn:/sbin/getty -L tty1 0 vt100 # QEMU graphical window' ${TARGET_DIR}/etc/inittab
|
||||
fi
|
||||
@@ -1,6 +1,6 @@
|
||||
Run the emulation with:
|
||||
|
||||
qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda" -net nic,model=virtio -net user
|
||||
qemu-system-i386 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda console=tty1 console=ttyS0" -serial stdio -net nic,model=virtio -net user
|
||||
|
||||
Optionally add -smp N to emulate a SMP system with N CPUs.
|
||||
|
||||
|
||||
11
buildroot/board/qemu/x86_64/post-build.sh
Executable file
11
buildroot/board/qemu/x86_64/post-build.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -u
|
||||
set -e
|
||||
|
||||
# Add a console on tty1
|
||||
if [ -e ${TARGET_DIR}/etc/inittab ]; then
|
||||
grep -qE '^tty1::' ${TARGET_DIR}/etc/inittab || \
|
||||
sed -i '/GENERIC_SERIAL/a\
|
||||
tty1::respawn:/sbin/getty -L tty1 0 vt100 # QEMU graphical window' ${TARGET_DIR}/etc/inittab
|
||||
fi
|
||||
@@ -1,6 +1,6 @@
|
||||
Run the emulation with:
|
||||
|
||||
qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda" -net nic,model=virtio -net user
|
||||
qemu-system-x86_64 -M pc -kernel output/images/bzImage -drive file=output/images/rootfs.ext2,if=virtio,format=raw -append "rootwait root=/dev/vda console=tty1 console=ttyS0" -serial stdio -net nic,model=virtio -net user
|
||||
|
||||
Optionally add -smp N to emulate a SMP system with N CPUs.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user