diff options
author | Xiaotian Wu <wuxiaotian@loongson.cn> | 2023-02-03 07:16:12 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2023-02-04 11:40:51 +0000 |
commit | 759baaceb4dd623d5da12ba0d01540fa080154ba (patch) | |
tree | 5781f3b18c221b77e8ff8fc905cd22265aa74dab /meta/conf/machine/include | |
parent | 55ab1bf20e6893088acb6460e9004dac8e205559 (diff) | |
download | openembedded-core-759baaceb4dd623d5da12ba0d01540fa080154ba.tar.gz |
base: add support for loongarch64
Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf/machine/include')
-rw-r--r-- | meta/conf/machine/include/loongarch/arch-loongarch.inc | 7 | ||||
-rw-r--r-- | meta/conf/machine/include/loongarch/qemuloongarch.inc | 35 | ||||
-rw-r--r-- | meta/conf/machine/include/loongarch/tune-loongarch.inc | 13 |
3 files changed, 55 insertions, 0 deletions
diff --git a/meta/conf/machine/include/loongarch/arch-loongarch.inc b/meta/conf/machine/include/loongarch/arch-loongarch.inc new file mode 100644 index 0000000000..4b44614035 --- /dev/null +++ b/meta/conf/machine/include/loongarch/arch-loongarch.inc @@ -0,0 +1,7 @@ +# LoongArch Architecture definition + +DEFAULTTUNE ?= "loongarch64" + +TUNE_ARCH = "${TUNE_ARCH:tune-${DEFAULTTUNE}}" +TUNE_PKGARCH = "${TUNE_PKGARCH:tune-${DEFAULTTUNE}}" +TUNE_CCARGS:append = "${@bb.utils.contains('TUNE_FEATURES', 'loongarch64', ' -march=la464 -mabi=lp64d', ' ', d)}" diff --git a/meta/conf/machine/include/loongarch/qemuloongarch.inc b/meta/conf/machine/include/loongarch/qemuloongarch.inc new file mode 100644 index 0000000000..77245ff85d --- /dev/null +++ b/meta/conf/machine/include/loongarch/qemuloongarch.inc @@ -0,0 +1,35 @@ +PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" + +require conf/machine/include/qemu.inc +require conf/machine/include/loongarch/tune-loongarch.inc + +MACHINE_FEATURES = "screen keyboard ext2 ext3 serial" + +KERNEL_IMAGETYPE = "vmlinuz" +KERNEL_IMAGETYPES += "vmlinuz" +KEEPUIMAGE = "no" + +SERIAL_CONSOLES ?= "115200;ttyS0 115200;hvc0" + +IMAGE_FSTYPES += "ext4 wic.qcow2" + +WKS_FILE ?= "qemuloongarch.wks" + +MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" + +#EXTRA_IMAGEDEPENDS += "opensbi" + +UBOOT_ENTRYPOINT_loongarch32 = "0x80400000" +UBOOT_ENTRYPOINT_loongarch64 = "0x80200000" + +# qemuboot options +QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi" +QB_MACHINE = "-machine virt" +QB_DEFAULT_BIOS = "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" diff --git a/meta/conf/machine/include/loongarch/tune-loongarch.inc b/meta/conf/machine/include/loongarch/tune-loongarch.inc new file mode 100644 index 0000000000..f02ddda474 --- /dev/null +++ b/meta/conf/machine/include/loongarch/tune-loongarch.inc @@ -0,0 +1,13 @@ +require conf/machine/include/loongarch/arch-loongarch.inc + +TUNEVALID[loongarch64] = "Enable 64-bit LoongArch optimizations" + +TUNEVALID[littleendian] = "Little endian mode" + +AVAILTUNES += "loongarch64" + +# Default +TUNE_FEATURES:tune-loongarch64 = "loongarch64" +TUNE_ARCH:tune-loongarch64 = "loongarch64" +TUNE_PKGARCH:tune-loongarch64 = "loongarch64" +PACKAGE_EXTRA_ARCHS:tune-loongarch64 = "loongarch64" |