diff options
Diffstat (limited to 'poky/meta/conf/machine/include/riscv')
-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 |
3 files changed, 79 insertions, 0 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" + |