diff mbox series

[PATCHv2,3/3] configs/qemu_loongarch64: new defconfig

Message ID ZkOO3O+OwNALpA/H@waldemar-brodkorb.de
State New
Headers show
Series [PATCHv2,1/3] arch: add support for loongarch64 | expand

Commit Message

Waldemar Brodkorb May 14, 2024, 4:18 p.m. UTC
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
---
v1->v2:
 - add me to DEVELOPERS file as requested by Thomas P.
 - add the missing readme.txt file requested by Thomas P.
---
 DEVELOPERS                                    |  2 ++
 .../patches/linux-headers/linux-headers.hash  |  2 ++
 .../qemu/loongarch64/patches/linux/linux.hash |  2 ++
 board/qemu/loongarch64/readme.txt             | 11 ++++++++
 configs/qemu_loongarch64_defconfig            | 27 +++++++++++++++++++
 5 files changed, 44 insertions(+)
 create mode 100644 board/qemu/loongarch64/patches/linux-headers/linux-headers.hash
 create mode 100644 board/qemu/loongarch64/patches/linux/linux.hash
 create mode 100644 board/qemu/loongarch64/readme.txt
 create mode 100644 configs/qemu_loongarch64_defconfig
diff mbox series

Patch

diff --git a/DEVELOPERS b/DEVELOPERS
index 9e299e7e66..fa933b8742 100644
--- a/DEVELOPERS
+++ b/DEVELOPERS
@@ -3204,7 +3204,9 @@  F:	package/ngrep/
 
 N:	Waldemar Brodkorb <wbx@openadk.org>
 F:	arch/Config.in.loongarch64
+F:	board/qemu/loongarch64/
 F:	board/qemu/riscv32-virt/
+F:	configs/qemu_loongarch64_defconfig
 F:	configs/qemu_riscv32_nommu_virt_defconfig
 F:	package/asterisk/
 F:	package/libjwt/
diff --git a/board/qemu/loongarch64/patches/linux-headers/linux-headers.hash b/board/qemu/loongarch64/patches/linux-headers/linux-headers.hash
new file mode 100644
index 0000000000..f3d9c1186a
--- /dev/null
+++ b/board/qemu/loongarch64/patches/linux-headers/linux-headers.hash
@@ -0,0 +1,2 @@ 
+# From https://cdn.kernel.org/pub/linux/kernel/v6.x/sha256sums.asc
+sha256  b66a5b863b0f8669448b74ca83bd641a856f164b29956e539bbcb5fdeeab9cc6  linux-6.6.30.tar.xz
diff --git a/board/qemu/loongarch64/patches/linux/linux.hash b/board/qemu/loongarch64/patches/linux/linux.hash
new file mode 100644
index 0000000000..f3d9c1186a
--- /dev/null
+++ b/board/qemu/loongarch64/patches/linux/linux.hash
@@ -0,0 +1,2 @@ 
+# From https://cdn.kernel.org/pub/linux/kernel/v6.x/sha256sums.asc
+sha256  b66a5b863b0f8669448b74ca83bd641a856f164b29956e539bbcb5fdeeab9cc6  linux-6.6.30.tar.xz
diff --git a/board/qemu/loongarch64/readme.txt b/board/qemu/loongarch64/readme.txt
new file mode 100644
index 0000000000..3d49ba57f4
--- /dev/null
+++ b/board/qemu/loongarch64/readme.txt
@@ -0,0 +1,11 @@ 
+Qemu does not bundle the BIOS file QEMU_EFI.fd. You need to build it:
+https://github.com/tianocore/edk2-platforms/tree/master/Platform/Loongson/LoongArchQemuPkg#readme
+
+For a binary you can download it from here:
+https://debug.openadk.org/QEMU_EFI.fd
+
+Run the emulation with:
+
+ qemu-system-loongarch64 -M virt -bios QEMU_EFI.fd -append "console=ttyS0,115200" -kernel output/images/vmlinux.efi -nographic # qemu_loongarch64_defconfig
+
+The login prompt will appear in the terminal that started Qemu.
diff --git a/configs/qemu_loongarch64_defconfig b/configs/qemu_loongarch64_defconfig
new file mode 100644
index 0000000000..025e9907e2
--- /dev/null
+++ b/configs/qemu_loongarch64_defconfig
@@ -0,0 +1,27 @@ 
+# Architecture
+BR2_loongarch64=y
+
+# Filesystem
+# BR2_TARGET_ROOTFS_TAR is not set
+BR2_TARGET_ROOTFS_INITRAMFS=y
+
+# Image
+BR2_ROOTFS_POST_IMAGE_SCRIPT="board/qemu/post-image.sh"
+BR2_ROOTFS_POST_SCRIPT_ARGS="$(BR2_DEFCONFIG)"
+
+# Linux headers same as kernel
+BR2_PACKAGE_HOST_LINUX_HEADERS_CUSTOM_6_6=y
+
+# Kernel
+BR2_LINUX_KERNEL=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION=y
+BR2_LINUX_KERNEL_CUSTOM_VERSION_VALUE="6.6.30"
+BR2_LINUX_KERNEL_DEFCONFIG="loongson3"
+BR2_LINUX_KERNEL_VMLINUX_EFI=y
+
+# Disable network scripts
+# BR2_PACKAGE_IFUPDOWN_SCRIPTS is not set
+
+# host-qemu for gitlab testing
+BR2_PACKAGE_HOST_QEMU=y
+BR2_PACKAGE_HOST_QEMU_SYSTEM_MODE=y