diff options
Diffstat (limited to 'poky/meta/conf/machine')
-rw-r--r-- | poky/meta/conf/machine/include/riscv/arch-riscv.inc | 10 | ||||
-rw-r--r-- | poky/meta/conf/machine/include/riscv/qemuriscv.inc | 50 | ||||
-rw-r--r-- | poky/meta/conf/machine/include/riscv/tune-riscv.inc | 19 | ||||
-rw-r--r-- | poky/meta/conf/machine/include/tune-thunderx.inc | 2 | ||||
-rw-r--r-- | poky/meta/conf/machine/qemuarm64.conf | 1 | ||||
-rw-r--r-- | poky/meta/conf/machine/qemuriscv64.conf | 11 |
6 files changed, 92 insertions, 1 deletions
diff --git a/poky/meta/conf/machine/include/riscv/arch-riscv.inc b/poky/meta/conf/machine/include/riscv/arch-riscv.inc new file mode 100644 index 000000000..19f8f3e21 --- /dev/null +++ b/poky/meta/conf/machine/include/riscv/arch-riscv.inc @@ -0,0 +1,10 @@ +# RISCV Architecture definition + +DEFAULTTUNE ?= "riscv64" + +TUNE_ARCH = "${TUNE_ARCH_tune-${DEFAULTTUNE}}" +TUNE_PKGARCH = "${TUNE_PKGARCH_tune-${DEFAULTTUNE}}" +TUNE_CCARGS .= "" + +# QEMU usermode fails with invalid instruction error (For riscv32) +MACHINE_FEATURES_BACKFILL_CONSIDERED_append = "${@bb.utils.contains('TUNE_FEATURES', 'riscv32', ' qemu-usermode', '', d)}" diff --git a/poky/meta/conf/machine/include/riscv/qemuriscv.inc b/poky/meta/conf/machine/include/riscv/qemuriscv.inc new file mode 100644 index 000000000..84d09fa78 --- /dev/null +++ b/poky/meta/conf/machine/include/riscv/qemuriscv.inc @@ -0,0 +1,50 @@ +PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" + +require conf/machine/include/qemu.inc +require conf/machine/include/riscv/tune-riscv.inc + +MACHINE_FEATURES = "screen keyboard ext2 ext3 serial" + +KERNEL_IMAGETYPE = "Image" +KERNEL_IMAGETYPES += "uImage" +KEEPUIMAGE = "no" + +SERIAL_CONSOLES ?= "115200;ttyS0 115200;hvc0" + +IMAGE_FSTYPES_append = " ext4" + +MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" + +EXTRA_IMAGEDEPENDS += "opensbi" +RISCV_SBI_PLAT ?= "qemu/virt" +RISCV_SBI_PAYLOAD ?= "${KERNEL_IMAGETYPE}-${MACHINE}.bin" + +UBOOT_ENTRYPOINT_riscv32 = "0x80400000" +UBOOT_ENTRYPOINT_riscv64 = "0x80200000" + +# qemuboot options +QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi" +QB_MEM = "-m 512" +QB_MACHINE = "-machine virt" +QB_DEFAULT_KERNEL = "fw_jump.elf" +QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" +QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" +QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0" +QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon" +QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon" +# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy +QB_OPT_APPEND = " -object rng-random,filename=/dev/urandom,id=rng0 -device virtio-rng-device,rng=rng0" + +BAD_RECOMMENDATIONS += "\ + libcxx-dev \ + libcxx-staticdev \ + compiler-rt-dev \ + compiler-rt-staticdev \ +" + +ASSUME_PROVIDED += "\ + libcxx-dev \ + libcxx-staticdev \ + compiler-rt-dev \ + compiler-rt-staticdev \ +" diff --git a/poky/meta/conf/machine/include/riscv/tune-riscv.inc b/poky/meta/conf/machine/include/riscv/tune-riscv.inc new file mode 100644 index 000000000..1e3a1081e --- /dev/null +++ b/poky/meta/conf/machine/include/riscv/tune-riscv.inc @@ -0,0 +1,19 @@ +require conf/machine/include/riscv/arch-riscv.inc + +TUNEVALID[riscv64] = "Enable 64-bit RISC-V optimizations" +TUNEVALID[riscv32] = "Enable 32-bit RISC-V optimizations" + +TUNEVALID[littleendian] = "Little endian mode" + +AVAILTUNES += "riscv64 riscv32" + +TUNE_FEATURES_tune-riscv64 = "riscv64 littleendian" +TUNE_ARCH_tune-riscv64 = "riscv64" +TUNE_PKGARCH_tune-riscv64 = "riscv64" +PACKAGE_EXTRA_ARCHS_tune-riscv64 = "riscv64" + +TUNE_FEATURES_tune-riscv32 = "riscv32 littleendian" +TUNE_ARCH_tune-riscv32 = "riscv32" +TUNE_PKGARCH_tune-riscv32 = "riscv32" +PACKAGE_EXTRA_ARCHS_tune-riscv32 = "riscv32" + diff --git a/poky/meta/conf/machine/include/tune-thunderx.inc b/poky/meta/conf/machine/include/tune-thunderx.inc index 92adf2df1..aa4d0501d 100644 --- a/poky/meta/conf/machine/include/tune-thunderx.inc +++ b/poky/meta/conf/machine/include/tune-thunderx.inc @@ -15,5 +15,5 @@ TUNE_FEATURES_tune-thunderx_be = "${TUNE_FEATURES_tune-thunderx} bigendian" BASE_LIB_tune-thunderx = "lib64" BASE_LIB_tune-thunderx_be = "lib64" -PACKAGE_EXTRA_ARCHS_tune-thunderx = "armv8a-crc-crypto thunderx" +PACKAGE_EXTRA_ARCHS_tune-thunderx = "${PACKAGE_EXTRA_ARCHS_tune-armv8a-crc-crypto} thunderx" PACKAGE_EXTRA_ARCHS_tune-thunderx_be = "aarch64_be thunderx_be" diff --git a/poky/meta/conf/machine/qemuarm64.conf b/poky/meta/conf/machine/qemuarm64.conf index 5c8aac151..353ac927d 100644 --- a/poky/meta/conf/machine/qemuarm64.conf +++ b/poky/meta/conf/machine/qemuarm64.conf @@ -14,6 +14,7 @@ QB_SYSTEM_NAME = "qemu-system-aarch64" QB_MEM = "-m 512" QB_MACHINE = "-machine virt" QB_CPU = "-cpu cortex-a57" +QB_CPU_KVM = "-cpu host" # Standard Serial console QB_KERNEL_CMDLINE_APPEND = "console=ttyAMA0" # For graphics to work we need to define the VGA device as well as the necessary USB devices diff --git a/poky/meta/conf/machine/qemuriscv64.conf b/poky/meta/conf/machine/qemuriscv64.conf new file mode 100644 index 000000000..dba8f09e9 --- /dev/null +++ b/poky/meta/conf/machine/qemuriscv64.conf @@ -0,0 +1,11 @@ +#@TYPE: Machine +#@NAME: generic riscv64 machine +#@DESCRIPTION: Machine configuration for running a generic riscv64 + +require conf/machine/include/riscv/qemuriscv.inc + +QB_OPT_APPEND += "-show-cursor -monitor null -device loader,file=${DEPLOY_DIR_IMAGE}/${KERNEL_IMAGETYPE},addr=0x80200000" + +EXTRA_IMAGEDEPENDS += "u-boot" +UBOOT_MACHINE = "qemu-riscv64_defconfig" +UBOOT_ELF = "u-boot" |