Skip to content

Commit

Permalink
WIP: qemu: Add aarch64 targets and config files
Browse files Browse the repository at this point in the history
This gives us a target to build. It does not work yet.

Signed-off-by: David Hendricks <[email protected]>
  • Loading branch information
dhendrix committed Jan 9, 2022
1 parent 25c2fd0 commit dd402fc
Show file tree
Hide file tree
Showing 4 changed files with 185 additions and 0 deletions.
14 changes: 14 additions & 0 deletions examples/qemu/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ else
CROSS_COMPILING := 0
endif

ifeq ($(ARCH), aarch64)
COREBOOT_TOOLCHAIN_ARCH := aarch64
LINUX_ARCH := arm64
LINUX_GCC_TUPLE := $(ARCH)-linux-
LINUX_IMAGE_RELATIVE_PATH := arch/arm64/boot/Image.gz
GOARCH := arm64
PLATFORM := qemu-$(ARCH)
QEMU_SYSTEM := qemu-system-$(ARCH)
endif
ifeq ($(ARCH), x86_64)
COREBOOT_TOOLCHAIN_ARCH := i386
LINUX_ARCH := $(ARCH)
Expand Down Expand Up @@ -38,6 +47,11 @@ QEMU_COMMON_OPTS := -bios $(OUT) $(QEMU_KVM_OPTS) \
-nographic

run:
ifeq ($(ARCH), aarch64)
$(QEMU_SYSTEM) $(QEMU_COMMON_OPTS) \
-M virt,secure=on,virtualization=on \
-cpu cortex-a53
endif
ifeq ($(ARCH), x86_64)
$(QEMU_SYSTEM) $(QEMU_COMMON_OPTS) \
-M q35
Expand Down
80 changes: 80 additions & 0 deletions examples/qemu/configs/config-qemu-aarch64.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
{
"initramfs": {
"untar": [
{
"label": "go",
"url": "https://golang.org/dl/go1.17.2.linux-arm64.tar.gz",
"hash": "sha256:a5a43c9cdabdb9f371d56951b14290eba8ce2f9b0db48fb5fc657943984fd4fc"
}
],
"goget": [
{
"label": "uroot",
"pkg": "https://github.com/u-root/u-root",
"branch": "master",
"hash": "ba3c4503673291183f54568dc0c0d0d7411302cd"
}
]
},
"kernel": {
"untar": [
{
"label": "kernel",
"url": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/snapshot/linux-5.14.14.tar.gz",
"hash": "sha256:7649f5496c34eae104fc391988d5dc4993082cf6195984303433bafa358fd7da",
"subdir": "linux-5.14.0"
}
]
},
"coreboot": {
"git": [
{
"label": "coreboot",
"url": "https://review.coreboot.org/coreboot",
"branch": "master",
"hash": "37a977dde945de15464925d4501d4b85e01c3a16"
},
{
"label": "vboot",
"url": "https://review.coreboot.org/vboot",
"dest": "3rdparty/vboot",
"branch": "master",
"hash": "48195e5878006ac2cf74cb7f02953ab06c68202d"
}
],
"files": {
"label": "crossgcc_tarballs",
"dest": "util/crossgcc/tarballs",
"filelist": [
{
"url": "https://ftpmirror.gnu.org/gmp/gmp-6.2.1.tar.xz",
"hash": "sha256:fd4829912cddd12f84181c3451cc752be224643e87fac497b69edddadc49b4f2"
},
{
"url": "https://ftpmirror.gnu.org/mpfr/mpfr-4.1.0.tar.xz",
"hash": "sha256:0c98a3f1732ff6ca4ea690552079da9c597872d30e96ec28414ee23c95558a7f"
},
{
"url": "https://ftpmirror.gnu.org/mpc/mpc-1.2.1.tar.gz",
"hash": "sha256:17503d2c395dfcf106b622dc142683c1199431d095367c6aacba6eec30340459"
},
{
"url": "https://ftpmirror.gnu.org/binutils/binutils-2.37.tar.xz",
"hash": "sha256:820d9724f020a3e69cb337893a0b63c2db161dadcb0e06fc11dc29eb1e84a32c"
},
{
"url": "https://ftpmirror.gnu.org/gcc/gcc-11.2.0/gcc-11.2.0.tar.xz",
"hash": "sha256:d08edc536b54c372a1010ff6619dd274c0f1603aa49212ba20f7aa2cda36fa8b"
},
{
"url": "https://www.nasm.us/pub/nasm/releasebuilds/2.15.05/nasm-2.15.05.tar.bz2",
"hash": "sha256:3c4b8339e5ab54b1bcb2316101f8985a5da50a3f9e504d43fa6f35668bee2fd0"
},
{
"url": "https://acpica.org/sites/acpica/files/acpica-unix2-20210331.tar.gz",
"hash": "sha256:3dab326c262d4f3eaf380bbbbd7aa8c2eb5f2697f7821659222cf898d8be28c1"
}
]
}
}
}
15 changes: 15 additions & 0 deletions examples/qemu/configs/coreboot.config-qemu-aarch64
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
CONFIG_VENDOR_EMULATION=y
CONFIG_COLLECT_TIMESTAMPS=y
CONFIG_TIMESTAMPS_ON_CONSOLE=y
CONFIG_MAINBOARD_VENDOR="Emulation"
CONFIG_CBFS_SIZE=0x1000000
CONFIG_BOARD_EMULATION_QEMU_AARCH64=y
CONFIG_COREBOOT_ROMSIZE_KB_16384=y
CONFIG_PAYLOAD_FIT_SUPPORT=y
CONFIG_PAYLOAD_LINUXBOOT
CONFIG_PAYLOAD_FILE="Image"
CONFIG_LINUXBOOT_KERNEL_PATH="Image"
CONFIG_LINUXBOOT_INITRAMFS_PATH=""
CONFIG_LINUXBOOT_INITRAMFS_COMPRESSION_XZ=y
CONFIG_LINUX_INITRD=""
CONFIG_LINUXBOOT_INITRAMFS_SUFFIX=".xz"
76 changes: 76 additions & 0 deletions examples/qemu/configs/kernel-aarch64.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
# Generic
CONFIG_KERNEL_XZ=y
CONFIG_DEFAULT_HOSTNAME="linuxboot"
CONFIG_HZ_PERIODIC=y
CONFIG_PREEMPT_NONE=y
CONFIG_BLK_DEV_INITRD=y
CONFIG_INITRAMFS_SOURCE=""
CONFIG_INITRAMFS_ROOT_UID=0
CONFIG_INITRAMFS_ROOT_GID=0
CONFIG_INITRAMFS_COMPRESSION_LZMA=y
CONFIG_INITRAMFS_COMPRESSION=".lzma"
CONFIG_CC_OPTIMIZE_FOR_SIZE=y
CONFIG_EXPERT=y
CONFIG_EMBEDDED=y
CONFIG_SLOB=y

# QEMU-related
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_NET=y
CONFIG_VIRTIO_PCI=y
CONFIG_HW_RANDOM=y
CONFIG_HW_RANDOM_VIRTIO=y
CONFIG_CRYPTO_DEV_VIRTIO=y

CONFIG_BLOCK=y
CONFIG_BLK_SCSI_REQUEST=y
CONFIG_SCSI_LOWLEVEL=y
CONFIG_SATA_AHCI_PLATFORM=y

# Firmware interfaces
CONFIG_DMI=y
CONFIG_DMIID=y
CONFIG_DMI_SYSFS=y
CONFIG_DMI_SCAN_MACHINE_NON_EFI_FALLBACK=y
CONFIG_FIRMWARE_MEMMAP=y
CONFIG_GOOGLE_FIRMWARE=y
CONFIG_GOOGLE_COREBOOT_TABLE=y
CONFIG_GOOGLE_MEMCONSOLE=y
CONFIG_GOOGLE_MEMCONSOLE_COREBOOT=y
CONFIG_GOOGLE_VPD=y

# Serial drivers
CONFIG_SERIAL_EARLYCON=y
CONFIG_SERIAL_8250=y
CONFIG_SERIAL_8250_DEPRECATED_OPTIONS=y
CONFIG_SERIAL_8250_PNP=y
CONFIG_SERIAL_8250_CONSOLE=y
CONFIG_SERIAL_8250_DMA=y
CONFIG_SERIAL_8250_PCI=y
CONFIG_SERIAL_8250_EXAR=y
CONFIG_SERIAL_8250_NR_UARTS=32
CONFIG_SERIAL_8250_RUNTIME_UARTS=4
CONFIG_SERIAL_8250_EXTENDED=y
CONFIG_SERIAL_8250_MANY_PORTS=y
CONFIG_SERIAL_8250_SHARE_IRQ=y
CONFIG_SERIAL_8250_DETECT_IRQ=y
CONFIG_SERIAL_8250_RSA=y
CONFIG_SERIAL_8250_LPSS=y
CONFIG_SERIAL_8250_MID=y
CONFIG_SERIAL_CORE=y
CONFIG_SERIAL_CORE_CONSOLE=y

# IPMI
CONFIG_IPMI_HANDLER=y
CONFIG_IPMI_DMI_DECODE=y
CONFIG_IPMI_PLAT_DATA=y
CONFIG_IPMI_DEVICE_INTERFACE=y
CONFIG_IPMI_SI=y

# TPM
CONFIG_TCG_TPM=y
CONFIG_HW_RANDOM_TPM=y
CONFIG_TCG_TIS_CORE=y
CONFIG_TCG_TIS=y
CONFIG_TCG_INFINEON=y
CONFIG_TCG_CRB=y

0 comments on commit dd402fc

Please sign in to comment.