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 17:02:10 +0000 |
commit | 324b03e15fb8623690a5c5c64006602fdc7027a2 (patch) | |
tree | ee0bd81ab19521469baa48447cc61132351f91a0 /meta/conf/machine | |
parent | 69b8b7ef1bd3c2e4a5140aff3de5318b1b292986 (diff) | |
download | poky-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.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 | ||||
-rw-r--r-- | meta/conf/machine/qemuloongarch64.conf | 11 |
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 | |||
3 | DEFAULTTUNE ?= "loongarch64" | ||
4 | |||
5 | TUNE_ARCH = "${TUNE_ARCH:tune-${DEFAULTTUNE}}" | ||
6 | TUNE_PKGARCH = "${TUNE_PKGARCH:tune-${DEFAULTTUNE}}" | ||
7 | 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 @@ | |||
1 | PREFERRED_PROVIDER_virtual/bootloader ?= "u-boot" | ||
2 | |||
3 | require conf/machine/include/qemu.inc | ||
4 | require conf/machine/include/loongarch/tune-loongarch.inc | ||
5 | |||
6 | MACHINE_FEATURES = "screen keyboard ext2 ext3 serial" | ||
7 | |||
8 | KERNEL_IMAGETYPE = "vmlinuz" | ||
9 | KERNEL_IMAGETYPES += "vmlinuz" | ||
10 | KEEPUIMAGE = "no" | ||
11 | |||
12 | SERIAL_CONSOLES ?= "115200;ttyS0 115200;hvc0" | ||
13 | |||
14 | IMAGE_FSTYPES += "ext4 wic.qcow2" | ||
15 | |||
16 | WKS_FILE ?= "qemuloongarch.wks" | ||
17 | |||
18 | MACHINE_EXTRA_RRECOMMENDS += " kernel-modules" | ||
19 | |||
20 | #EXTRA_IMAGEDEPENDS += "opensbi" | ||
21 | |||
22 | UBOOT_ENTRYPOINT_loongarch32 = "0x80400000" | ||
23 | UBOOT_ENTRYPOINT_loongarch64 = "0x80200000" | ||
24 | |||
25 | # qemuboot options | ||
26 | QB_KERNEL_CMDLINE_APPEND = "earlycon=sbi" | ||
27 | QB_MACHINE = "-machine virt" | ||
28 | QB_DEFAULT_BIOS = "fw_jump.elf" | ||
29 | QB_TAP_OPT = "-netdev tap,id=net0,ifname=@TAP@,script=no,downscript=no" | ||
30 | QB_NETWORK_DEVICE = "-device virtio-net-device,netdev=net0,mac=@MAC@" | ||
31 | QB_ROOTFS_OPT = "-drive id=disk0,file=@ROOTFS@,if=none,format=raw -device virtio-blk-device,drive=disk0" | ||
32 | QB_SERIAL_OPT = "-device virtio-serial-device -chardev null,id=virtcon -device virtconsole,chardev=virtcon" | ||
33 | QB_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 | ||
35 | 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 @@ | |||
1 | require conf/machine/include/loongarch/arch-loongarch.inc | ||
2 | |||
3 | TUNEVALID[loongarch64] = "Enable 64-bit LoongArch optimizations" | ||
4 | |||
5 | TUNEVALID[littleendian] = "Little endian mode" | ||
6 | |||
7 | AVAILTUNES += "loongarch64" | ||
8 | |||
9 | # Default | ||
10 | TUNE_FEATURES:tune-loongarch64 = "loongarch64" | ||
11 | TUNE_ARCH:tune-loongarch64 = "loongarch64" | ||
12 | TUNE_PKGARCH:tune-loongarch64 = "loongarch64" | ||
13 | PACKAGE_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 | |||
5 | require conf/machine/include/loongarch/qemuloongarch.inc | ||
6 | |||
7 | XVISOR_PLAT = "loongarch/virt64" | ||
8 | |||
9 | EXTRA_IMAGEDEPENDS += "u-boot" | ||
10 | UBOOT_MACHINE = "qemu-loongarch64_smode_defconfig" | ||
11 | UBOOT_ELF = "u-boot" | ||