summaryrefslogtreecommitdiffstats
path: root/meta/conf/machine
diff options
context:
space:
mode:
authorXiaotian Wu <wuxiaotian@loongson.cn>2023-02-03 07:16:12 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2023-02-04 17:02:10 +0000
commit324b03e15fb8623690a5c5c64006602fdc7027a2 (patch)
treeee0bd81ab19521469baa48447cc61132351f91a0 /meta/conf/machine
parent69b8b7ef1bd3c2e4a5140aff3de5318b1b292986 (diff)
downloadpoky-324b03e15fb8623690a5c5c64006602fdc7027a2.tar.gz
base: add support for loongarch64
(From OE-Core rev: 759baaceb4dd623d5da12ba0d01540fa080154ba) Signed-off-by: Xiaotian Wu <wuxiaotian@loongson.cn> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/conf/machine')
-rw-r--r--meta/conf/machine/include/loongarch/arch-loongarch.inc7
-rw-r--r--meta/conf/machine/include/loongarch/qemuloongarch.inc35
-rw-r--r--meta/conf/machine/include/loongarch/tune-loongarch.inc13
-rw-r--r--meta/conf/machine/qemuloongarch64.conf11
4 files changed, 66 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 @@
1# LoongArch Architecture definition
2
3DEFAULTTUNE ?= "loongarch64"
4
5TUNE_ARCH = "${TUNE_ARCH:tune-${DEFAULTTUNE}}"
6TUNE_PKGARCH = "${TUNE_PKGARCH:tune-${DEFAULTTUNE}}"
7TUNE_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 @@
1PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot"
2
3require conf/machine/include/qemu.inc
4require conf/machine/include/loongarch/tune-loongarch.inc
5
6MACHINE_FEATURES = "screen keyboard ext2 ext3 serial"
7
8KERNEL_IMAGETYPE = "vmlinuz"
9KERNEL_IMAGETYPES += "vmlinuz"
10KEEPUIMAGE = "no"
11
12SERIAL_CONSOLES ?= "115200;ttyS0 115200;hvc0"
13
14IMAGE_FSTYPES += "ext4 wic.qcow2"
15
16WKS_FILE ?= "qemuloongarch.wks"
17
18MACHINE_EXTRA_RRECOMMENDS += " kernel-modules"
19
20#EXTRA_IMAGEDEPENDS += "opensbi"
21
22UBOOT_ENTRYPOINT_loongarch32 = "0x80400000"
23UBOOT_ENTRYPOINT_loongarch64 = "0x80200000"
24
25# qemuboot options
26QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi"
27QB_MACHINE = "-machine virt"
28QB_DEFAULT_BIOS = "fw_jump.elf"
29QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no"
30QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@"
31QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0"
32QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon"
33QB_TCPSERIAL_OPT = " -device virtio-serial-device -chardev socket,id=virtcon,port=@PORT@,host=127.0.0.1 -device virtconsole,chardev=virtcon"
34# Add the 'virtio-rng-pci' device otherwise the guest may run out of entropy
35QB_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 @@
1require conf/machine/include/loongarch/arch-loongarch.inc
2
3TUNEVALID[loongarch64] = "Enable 64-bit LoongArch optimizations"
4
5TUNEVALID[littleendian] = "Little endian mode"
6
7AVAILTUNES += "loongarch64"
8
9# Default
10TUNE_FEATURES:tune-loongarch64 = "loongarch64"
11TUNE_ARCH:tune-loongarch64 = "loongarch64"
12TUNE_PKGARCH:tune-loongarch64 = "loongarch64"
13PACKAGE_EXTRA_ARCHS:tune-loongarch64 = "loongarch64"
diff --git a/meta/conf/machine/qemuloongarch64.conf b/meta/conf/machine/qemuloongarch64.conf
new file mode 100644
index 0000000000..675d525afd
--- /dev/null
+++ b/meta/conf/machine/qemuloongarch64.conf
@@ -0,0 +1,11 @@
1#@TYPE: Machine
2#@NAME: generic loongarch64 machine
3#@DESCRIPTION: Machine configuration for running a generic loongarch64
4
5require conf/machine/include/loongarch/qemuloongarch.inc
6
7XVISOR_PLAT = "loongarch/virt64"
8
9EXTRA_IMAGEDEPENDS += "u-boot"
10UBOOT_MACHINE = "qemu-loongarch64_smode_defconfig"
11UBOOT_ELF = "u-boot"