mirror of
https://github.com/thead-yocto-mirror/meta-riscv
synced 2026-09-04 07:44:45 +02:00
machine: Add machines for riscv32 baremetal
- Organize the machines a bit better - Add baremetal machine configs for 32/64 bit so we can generate SDKs for zephyr and other RTOSes - Fixup tune files to match BSP layer norms Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
# RISCV Architecture definition
|
||||
|
||||
# DEFAULTTUNE ?= "riscv"
|
||||
|
||||
# TUNE_ARCH = "${TUNE_ARCH_tune-${DEFAULTTUNE}}"
|
||||
# TUNE_PKGARCH = "${TUNE_PKGARCH_tune-${DEFAULTTUNE}}"
|
||||
|
||||
# TUNE_CCARGS .= "${@bb.utils.contains("TUNE_FEATURES", d)}"
|
||||
7
conf/machine/include/arch-riscv.inc
Normal file
7
conf/machine/include/arch-riscv.inc
Normal file
@@ -0,0 +1,7 @@
|
||||
# RISCV Architecture definition
|
||||
|
||||
DEFAULTTUNE ?= "riscv64"
|
||||
|
||||
TUNE_ARCH = "${TUNE_ARCH_tune-${DEFAULTTUNE}}"
|
||||
TUNE_PKGARCH = "${TUNE_PKGARCH_tune-${DEFAULTTUNE}}"
|
||||
TUNE_CCARGS .= ""
|
||||
19
conf/machine/include/tune-riscv.inc
Normal file
19
conf/machine/include/tune-riscv.inc
Normal file
@@ -0,0 +1,19 @@
|
||||
require conf/machine/include/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 = ""
|
||||
|
||||
TUNE_FEATURES_tune-riscv32 = "riscv32 littleendian"
|
||||
TUNE_ARCH_tune-riscv32 = "riscv32"
|
||||
TUNE_PKGARCH_tune-riscv32 = "riscv32"
|
||||
PACKAGE_EXTRA_ARCHS_tune-riscv32 = ""
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#@DESCRIPTION: Machine configuration for running a generic riscv64
|
||||
|
||||
require conf/machine/include/qemu.inc
|
||||
require conf/machine/tune-riscv.inc
|
||||
require conf/machine/include/tune-riscv.inc
|
||||
|
||||
MACHINE_FEATURES = "screen keyboard ext2 ext3 serial"
|
||||
MACHINE_ARCH = "riscv64"
|
||||
@@ -19,7 +19,7 @@ PREFERRED_VERSION_nativesdk-qemu = "${QEMUVERSION}"
|
||||
GDBVERSION = "riscv"
|
||||
QEMUVERSION = "riscv"
|
||||
|
||||
SERIAL_CONSOLE = "38400 ttyS0"
|
||||
SERIAL_CONSOLES ?= "38400;ttyS0 38400;hvc0"
|
||||
USE_VT ?= "0"
|
||||
|
||||
MACHINE_EXTRA_RRECOMMENDS += " kernel-modules"
|
||||
|
||||
33
conf/machine/riscv32.conf
Normal file
33
conf/machine/riscv32.conf
Normal file
@@ -0,0 +1,33 @@
|
||||
#@TYPE: Machine
|
||||
#@NAME: generic riscv32 baremetal machine
|
||||
#@DESCRIPTION: Machine configuration for running a generic riscv32
|
||||
|
||||
DEFAULTTUNE = "riscv32"
|
||||
require conf/machine/include/qemu.inc
|
||||
require conf/machine/include/tune-riscv.inc
|
||||
|
||||
MACHINE_ARCH = "riscv32"
|
||||
|
||||
PREFERRED_VERSION_qemu = "${QEMUVERSION}"
|
||||
PREFERRED_VERSION_qemu-native = "${QEMUVERSION}"
|
||||
PREFERRED_VERSION_nativesdk-qemu = "${QEMUVERSION}"
|
||||
|
||||
GDBVERSION = "riscv"
|
||||
QEMUVERSION = "riscv"
|
||||
|
||||
# qemuboot options
|
||||
QB_MACHINE = "-machine virt"
|
||||
QB_DEFAULT_KERNEL = "bbl"
|
||||
QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
|
||||
QB_ROOTFS_OPT = "-drive file=@ROOTFS@,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
|
||||
QB_SLIRP_OPT = "-netdev user,id=net0,hostfwd=tcp::22222-:22"
|
||||
|
||||
# Prelink does not yet work
|
||||
|
||||
USER_CLASSES_remove = "image-prelink"
|
||||
# To support baremetal ld complains
|
||||
# /opt/riscv32/sysroots/x86_64-becsdk-linux/usr/libexec/riscv32-bec-elf/gcc/riscv32-bec-elf/7.3.0/real-ld: unrecognized option '--hash-style=gnu'
|
||||
#TARGET_LINK_HASH_STYLE = ""
|
||||
LINKER_HASH_STYLE = ""
|
||||
|
||||
TCLIBC = "baremetal"
|
||||
@@ -1,23 +1,33 @@
|
||||
#@TYPE: Machine
|
||||
#@NAME: riscv
|
||||
#@NAME: generic riscv64 baremetal machine
|
||||
#@DESCRIPTION: Machine configuration for running a generic riscv64
|
||||
|
||||
#@DESCRIPTION: Machine configuration for riscv systems
|
||||
DEFAULTTUNE = "riscv64"
|
||||
require conf/machine/include/qemu.inc
|
||||
require conf/machine/include/tune-riscv.inc
|
||||
|
||||
require conf/machine/tune-riscv.inc
|
||||
|
||||
MACHINE_FEATURES = "screen keyboard ext2 ext3 serial"
|
||||
MACHINE_ARCH = "riscv64"
|
||||
|
||||
KERNEL_IMAGETYPE = "vmlinux"
|
||||
#KERNEL_ALT_IMAGETYPE = "vmlinux.bin"
|
||||
KERNEL_IMAGE_STRIP_EXTRA_SECTIONS = ".comment"
|
||||
PREFERRED_VERSION_qemu = "${QEMUVERSION}"
|
||||
PREFERRED_VERSION_qemu-native = "${QEMUVERSION}"
|
||||
PREFERRED_VERSION_nativesdk-qemu = "${QEMUVERSION}"
|
||||
|
||||
PREFERRED_PROVIDER_virtual/kernel = "linux-riscv"
|
||||
GDBVERSION = "riscv"
|
||||
QEMUVERSION = "riscv"
|
||||
|
||||
SERIAL_CONSOLE = "38400 ttyHTIF0"
|
||||
USE_VT ?= "0"
|
||||
# qemuboot options
|
||||
QB_MACHINE = "-machine virt"
|
||||
QB_DEFAULT_KERNEL = "bbl"
|
||||
QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
|
||||
QB_ROOTFS_OPT = "-drive file=@ROOTFS@,format=raw,id=hd0 -device virtio-blk-device,drive=hd0"
|
||||
QB_SLIRP_OPT = "-netdev user,id=net0,hostfwd=tcp::22222-:22"
|
||||
|
||||
MACHINE_EXTRA_RRECOMMENDS = " kernel-modules"
|
||||
# Prelink does not yet work
|
||||
|
||||
IMAGE_FSTYPES ?= "jffs2 tar.bz2"
|
||||
JFFS2_ERASEBLOCK = "0x10000"
|
||||
USER_CLASSES_remove = "image-prelink"
|
||||
# To support baremetal ld complains
|
||||
# /opt/riscv32/sysroots/x86_64-becsdk-linux/usr/libexec/riscv32-bec-elf/gcc/riscv32-bec-elf/7.3.0/real-ld: unrecognized option '--hash-style=gnu'
|
||||
#TARGET_LINK_HASH_STYLE = ""
|
||||
LINKER_HASH_STYLE = ""
|
||||
|
||||
TCLIBC = "baremetal"
|
||||
|
||||
@@ -1,16 +0,0 @@
|
||||
TUNE_ARCH = "riscv64"
|
||||
|
||||
TUNE_PKGARCH = "riscv64"
|
||||
|
||||
DEFAULTTUNE ?= "riscv"
|
||||
|
||||
# require arch-riscv.inc
|
||||
|
||||
TUNEVALID[riscv] = "Enable RISCV optimizations"
|
||||
TUNE_CCARGS .= ""
|
||||
|
||||
AVAILTUNES += "riscv"
|
||||
TUNE_FEATURES_tune-riscv = "riscv"
|
||||
TUNE_ARCH_tune-riscv = "riscv"
|
||||
TUNE_PKGARCH_tune-riscv = "riscv"
|
||||
PACKAGE_EXTRA_ARCHS_tune-riscv = ""
|
||||
Reference in New Issue
Block a user