From patchwork Tue May 14 16:15:11 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waldemar Brodkorb X-Patchwork-Id: 1935094 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vf1fh1f7Fz20dM for ; Wed, 15 May 2024 02:15:23 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id BEDB441582; Tue, 14 May 2024 16:15:21 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id zI6HxRXqAF7U; Tue, 14 May 2024 16:15:20 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 6455D41550 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 6455D41550; Tue, 14 May 2024 16:15:20 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 189031BF3CD for ; Tue, 14 May 2024 16:15:19 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 0514381F69 for ; Tue, 14 May 2024 16:15:19 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id QjUBfMRHLX2O for ; Tue, 14 May 2024 16:15:15 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=wbx@openadk.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 9562181F4E DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 9562181F4E Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) by smtp1.osuosl.org (Postfix) with ESMTPS id 9562181F4E for ; Tue, 14 May 2024 16:15:14 +0000 (UTC) Received: by helium.openadk.org (Postfix, from userid 1000) id D1F893521163; Tue, 14 May 2024 18:15:11 +0200 (CEST) Date: Tue, 14 May 2024 18:15:11 +0200 From: Waldemar Brodkorb To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux 5.10.0-27-amd64 x86_64 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=openadk.org; s=2022; t=1715703312; bh=pxhdMZtqin08z2E+FunbbCg8J1AUjWhB3RnN5oTEmfE=; h=Date:From:To:Subject:From; b=Hi76cw1zw8D05IzIIYpwBrxTSa2xiPD+w5DBofRcdEA7gr89Q4MEKgYNlkAEMvQ4+ D1P9btUVbQmn0IJ8eCKsbdcbo4aPv2PlRVfK2qz1YPX01TcGM6t9HXMxaAeDEZP/k4 cWqdk1ZpJdzGqEyG6QtvzM1VRtFaNnZZn5efHJ4ostF8BegJv/qwgeN1akvHxZdXXw vHGrkKDG4NuiAMiMsyGHwsfprSfZsLE23125ZoT/zKg8+tB2LOTu/DRo1X2tWpyfb7 4rvuOvrTOT4cowy/56KzelFSWxLE88vKFVF/JUX+YAaywR1XBJB3k5ByQrkqBOF6qH GFs4nw6SdJ2Bw== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=openadk.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key, unprotected) header.d=openadk.org header.i=@openadk.org header.a=rsa-sha256 header.s=2022 header.b=Hi76cw1z Subject: [Buildroot] [PATCHv2 1/3] arch: add support for loongarch64 X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Loongarch is a RISC microprocessor from Loongarch Technologies. - at the moment we only support lp64d ABI - binutils 2.40 is too old so disable it for loongarch64 - gcc 12.x is too old to compile a Linux kernel, so disable it for loongarch64 - gdb versions work fine Signed-off-by: Waldemar Brodkorb --- v1->v2: - added me to DEVELOPERS file requested by Thomas P. - check older binutils/gcc/gdb for support requested by Thomas P. --- DEVELOPERS | 1 + arch/Config.in | 12 ++++++++++++ arch/Config.in.loongarch64 | 14 ++++++++++++++ package/binutils/Config.in.host | 1 + package/gcc/Config.in.host | 2 ++ package/glibc/Config.in | 1 + package/musl/Config.in | 1 + 7 files changed, 32 insertions(+) create mode 100644 arch/Config.in.loongarch64 diff --git a/DEVELOPERS b/DEVELOPERS index a9deddb343..9e299e7e66 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -3203,6 +3203,7 @@ N: Wade Berrier F: package/ngrep/ N: Waldemar Brodkorb +F: arch/Config.in.loongarch64 F: board/qemu/riscv32-virt/ F: configs/qemu_riscv32_nommu_virt_defconfig F: package/asterisk/ diff --git a/arch/Config.in b/arch/Config.in index f39c33ef7f..070a4aca3a 100644 --- a/arch/Config.in +++ b/arch/Config.in @@ -77,6 +77,14 @@ config BR2_i386 Intel i386 architecture compatible microprocessor http://en.wikipedia.org/wiki/I386 +config BR2_loongarch64 + bool "loongarch64" + select BR2_ARCH_IS_64 + select BR2_USE_MMU + help + Loongarch is a RISC microprocessor from Loongarch Technologies. + https://en.wikipedia.org/wiki/Loongson + config BR2_m68k bool "m68k" # MMU support is set by the subarchitecture file, arch/Config.in.m68k @@ -374,6 +382,10 @@ if BR2_arm || BR2_armeb || BR2_aarch64 || BR2_aarch64_be source "arch/Config.in.arm" endif +if BR2_loongarch64 +source "arch/Config.in.loongarch64" +endif + if BR2_m68k source "arch/Config.in.m68k" endif diff --git a/arch/Config.in.loongarch64 b/arch/Config.in.loongarch64 new file mode 100644 index 0000000000..2b5bac095d --- /dev/null +++ b/arch/Config.in.loongarch64 @@ -0,0 +1,14 @@ +config BR2_ARCH + default "loongarch64" + +config BR2_NORMALIZED_ARCH + default "loongarch" + +config BR2_ENDIAN + default "LITTLE" + +config BR2_READELF_ARCH_NAME + default "LoongArch" + +# vim: ft=kconfig +# -*- mode:kconfig; -*- diff --git a/package/binutils/Config.in.host b/package/binutils/Config.in.host index cb65f5f5e4..89e36d6047 100644 --- a/package/binutils/Config.in.host +++ b/package/binutils/Config.in.host @@ -14,6 +14,7 @@ choice config BR2_BINUTILS_VERSION_2_40_X bool "binutils 2.40" + depends on !BR2_loongarch64 config BR2_BINUTILS_VERSION_2_41_X bool "binutils 2.41" diff --git a/package/gcc/Config.in.host b/package/gcc/Config.in.host index 2324561a3e..a0377cc0a3 100644 --- a/package/gcc/Config.in.host +++ b/package/gcc/Config.in.host @@ -30,6 +30,8 @@ config BR2_GCC_VERSION_12_X depends on !BR2_POWERPC_CPU_HAS_SPE # ARC HS48 rel 31 only supported by gcc arc fork. depends on !BR2_archs4x_rel31 + # too old to compile Linux Kernel + depends on !BR2_loongarch64 select BR2_TOOLCHAIN_GCC_AT_LEAST_12 config BR2_GCC_VERSION_13_X diff --git a/package/glibc/Config.in b/package/glibc/Config.in index 81c64083f4..5385e2a855 100644 --- a/package/glibc/Config.in +++ b/package/glibc/Config.in @@ -5,6 +5,7 @@ config BR2_PACKAGE_GLIBC_ARCH_SUPPORTS default y if BR2_aarch64 default y if BR2_aarch64_be default y if BR2_i386 + default y if BR2_loongarch64 default y if BR2_m68k_m68k default y if BR2_mips default y if BR2_mipsel diff --git a/package/musl/Config.in b/package/musl/Config.in index a6e2af054c..70475326f5 100644 --- a/package/musl/Config.in +++ b/package/musl/Config.in @@ -5,6 +5,7 @@ config BR2_PACKAGE_MUSL_ARCH_SUPPORTS default y if BR2_arm default y if BR2_armeb default y if BR2_i386 + default y if BR2_loongarch64 default y if BR2_m68k_m68k default y if BR2_microblaze default y if BR2_mips From patchwork Tue May 14 16:16:19 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waldemar Brodkorb X-Patchwork-Id: 1935095 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=2605:bc80:3010::137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [IPv6:2605:bc80:3010::137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vf1gv0wFNz20dM for ; Wed, 15 May 2024 02:16:27 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 9101141521; Tue, 14 May 2024 16:16:25 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Tqeb1AK_yO0R; Tue, 14 May 2024 16:16:24 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 7948D415AF Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 7948D415AF; Tue, 14 May 2024 16:16:24 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id B8DAC1BF3CD for ; Tue, 14 May 2024 16:16:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id A55F581E8A for ; Tue, 14 May 2024 16:16:22 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id af7JApDMYOds for ; Tue, 14 May 2024 16:16:22 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=wbx@openadk.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org A768A81E52 DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org A768A81E52 Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) by smtp1.osuosl.org (Postfix) with ESMTPS id A768A81E52 for ; Tue, 14 May 2024 16:16:21 +0000 (UTC) Received: by helium.openadk.org (Postfix, from userid 1000) id B03683521163; Tue, 14 May 2024 18:16:19 +0200 (CEST) Date: Tue, 14 May 2024 18:16:19 +0200 From: Waldemar Brodkorb To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux 5.10.0-27-amd64 x86_64 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=openadk.org; s=2022; t=1715703379; bh=FanOUHXVVgJU3q+mib+S/F2gLKHEBtKseaNX6mGNonA=; h=Date:From:To:Subject:From; b=D51rUktLrqcXyL8pR9FcKIzW7mK0W0BHCxB2vDa5rxC8zPTaY/FZNKx7HQIe9w/8p QKrVgf8pMe547tCsnZWBj9gHgX/rFM3umFVMq7gi70sZ7aa0nfhiHz9XPscTkZ9gz7 3uIa1vapEoWDvr9M+BQlEtVO3U1CmFtbme81siptWMiT3+cKMsgEtxWO/s6vSr5dCi R8I3oyVPOcA6IhYYzEDns8hPBFA/aAFFbZT5x8QO8AcXrfjFgnFOnHMYy/aAkk/SoG e9WyPqZ493PCIuoqoWATxz7RhLCXD+iWU/l4koBqXA5IRq1rq97qEQ2WouyBiLi8HZ KEVuwlAcxtvvg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=openadk.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=openadk.org header.i=@openadk.org header.a=rsa-sha256 header.s=2022 header.b=D51rUktL Subject: [Buildroot] [PATCHv2 2/3] linux: add support for vmlinux.efi X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Signed-off-by: Waldemar Brodkorb --- v1->v2: - no changes --- linux/Config.in | 4 ++++ linux/linux.mk | 2 ++ 2 files changed, 6 insertions(+) diff --git a/linux/Config.in b/linux/Config.in index d3d4c42910..8aab953ddf 100644 --- a/linux/Config.in +++ b/linux/Config.in @@ -285,6 +285,10 @@ config BR2_LINUX_KERNEL_VMLINUX_BIN bool "vmlinux.bin" depends on BR2_mips || BR2_mipsel || BR2_sh +config BR2_LINUX_KERNEL_VMLINUX_EFI + bool "vmlinux.efi" + depends on BR2_loongarch64 + config BR2_LINUX_KERNEL_VMLINUX bool "vmlinux" diff --git a/linux/linux.mk b/linux/linux.mk index 16d9f19470..3e0e728656 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -231,6 +231,8 @@ else ifeq ($(BR2_LINUX_KERNEL_IMAGEGZ),y) LINUX_IMAGE_NAME = Image.gz else ifeq ($(BR2_LINUX_KERNEL_LINUX_BIN),y) LINUX_IMAGE_NAME = linux.bin +else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_EFI),y) +LINUX_IMAGE_NAME = vmlinux.efi else ifeq ($(BR2_LINUX_KERNEL_VMLINUX_BIN),y) LINUX_IMAGE_NAME = vmlinux.bin else ifeq ($(BR2_LINUX_KERNEL_VMLINUX),y) From patchwork Tue May 14 16:18:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Waldemar Brodkorb X-Patchwork-Id: 1935096 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=buildroot.org (client-ip=140.211.166.137; helo=smtp4.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver=patchwork.ozlabs.org) Received: from smtp4.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (secp384r1) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4Vf1kX6svVz20dM for ; Wed, 15 May 2024 02:18:44 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by smtp4.osuosl.org (Postfix) with ESMTP id 614EE40300; Tue, 14 May 2024 16:18:43 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp4.osuosl.org ([127.0.0.1]) by localhost (smtp4.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id ywfJnDvwWHzf; Tue, 14 May 2024 16:18:41 +0000 (UTC) X-Comment: SPF check N/A for local connections - client-ip=140.211.166.34; helo=ash.osuosl.org; envelope-from=buildroot-bounces@buildroot.org; receiver= DKIM-Filter: OpenDKIM Filter v2.11.0 smtp4.osuosl.org 4D47640639 Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by smtp4.osuosl.org (Postfix) with ESMTP id 4D47640639; Tue, 14 May 2024 16:18:41 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from smtp1.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id 82FE11BF3CD for ; Tue, 14 May 2024 16:18:39 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id 6F15181EAC for ; Tue, 14 May 2024 16:18:39 +0000 (UTC) X-Virus-Scanned: amavis at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavis, port 10024) with ESMTP id Qw3WIqNTKwGQ for ; Tue, 14 May 2024 16:18:38 +0000 (UTC) Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=89.238.66.15; helo=helium.openadk.org; envelope-from=wbx@openadk.org; receiver= DMARC-Filter: OpenDMARC Filter v1.4.2 smtp1.osuosl.org 5C87F81E8A DKIM-Filter: OpenDKIM Filter v2.11.0 smtp1.osuosl.org 5C87F81E8A Received: from helium.openadk.org (helium.openadk.org [89.238.66.15]) by smtp1.osuosl.org (Postfix) with ESMTPS id 5C87F81E8A for ; Tue, 14 May 2024 16:18:38 +0000 (UTC) Received: by helium.openadk.org (Postfix, from userid 1000) id 8137E3521100; Tue, 14 May 2024 18:18:36 +0200 (CEST) Date: Tue, 14 May 2024 18:18:36 +0200 From: Waldemar Brodkorb To: buildroot@buildroot.org Message-ID: MIME-Version: 1.0 Content-Disposition: inline X-Operating-System: Linux 5.10.0-27-amd64 x86_64 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=openadk.org; s=2022; t=1715703516; bh=gK4Ts7ASPqyszyIVZoifmTro3g9TZ+MX97mKu62a2XI=; h=Date:From:To:Subject:From; b=X4xo78zFfPrj+StKpBLdoz1TyhARd9M4c6gF/wRNnVgQ7Tki+Fbej9L3lrn5fAYQo JQbQ1jdh2dKl3OFIjffYHggCqHTvlwhhdJEsCvMdBYd+SlkP/0ui741CS5UbnXKZ7P ngsmghy23WJ4cqAaYeO6q+x5q+Y5e6IBn2FeQC9WlZ55oBCxW/mIWjydBuz2iy0dZl Pzq3/X+62EV8liJ0lUjsI+nNsB283kOGUN1okeI0f1+CPSEXQSGW/wqcsUKt7uM9HR zp7/JwaLsSw8jn6zUrGQ7LUj7p5tx4IX6DgZMzINoeV51wIYqYmHIj8zfEmx4xKuik A71eCqxSscJDg== X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dmarc=none (p=none dis=none) header.from=openadk.org X-Mailman-Original-Authentication-Results: smtp1.osuosl.org; dkim=pass (2048-bit key) header.d=openadk.org header.i=@openadk.org header.a=rsa-sha256 header.s=2022 header.b=X4xo78zF Subject: [Buildroot] [PATCHv2 3/3] configs/qemu_loongarch64: new defconfig X-BeenThere: buildroot@buildroot.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@buildroot.org Sender: "buildroot" Signed-off-by: Waldemar Brodkorb --- 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 --git a/DEVELOPERS b/DEVELOPERS index 9e299e7e66..fa933b8742 100644 --- a/DEVELOPERS +++ b/DEVELOPERS @@ -3204,7 +3204,9 @@ F: package/ngrep/ N: Waldemar Brodkorb 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