From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id 56288AC0FF7 for ; Mon, 11 Mar 2024 09:40:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=t3UzFSREnjSNQPK4XhNxUA4u7EmPPgIy5SoNLKXCmAQ=; c=relaxed/simple; d=groups.io; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Transfer-Encoding; s=20240206; t=1710150005; v=1; b=yqRnEsKBhKqB7yKP5EHTB2bDiGE+LQ6aPR0fyLztOfxH3ofZZUwAWbbFvwMNXQ4bjxFhNTAU ygcZ0g8g/cY4LvPNDtbATMY8FDUglI6swQALWPRacunLSeGJguqYsK8WLN3ayr6RO8jML5IGe2u D7ypuKxZmMPL+TKN8c+t0AFf7DdbCIjkN+C2HiTR0AhFsj8CAl9EwPVkxebAEEWCU4tTEGzUyc6 8fyaocJ59IMO8+82LoTeb1rSBQ2VZWQ5RgmdSI7oXkwiGS45SVHhWsrtzjf2APM3xxVyVkJozrq DaTpGtJtichShK1M5DzyyHW7xzRB0d1nIguSZRYeN3TDw== X-Received: by 127.0.0.2 with SMTP id zR5UYY7687511xFlRswdXtQo; Mon, 11 Mar 2024 02:40:05 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web11.58786.1710150003909857535 for ; Mon, 11 Mar 2024 02:40:04 -0700 X-Received: from loongson.cn (unknown [10.2.9.245]) by gateway (Coremail) with SMTP id _____8DxdfFu0e5lPBsXAA--.56873S3; Mon, 11 Mar 2024 17:39:58 +0800 (CST) X-Received: from code-server.gen (unknown [10.2.9.245]) by localhost.localdomain (Coremail) with SMTP id AQAAf8CxZMxq0e5lOyVWAA--.36352S2; Mon, 11 Mar 2024 17:39:54 +0800 (CST) From: "Chao Li" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Jiewen Yao , Jordan Justen , Gerd Hoffmann , Bibo Mao , Dongyan Qian Subject: [edk2-devel] [PATCH v1 26/26] OvmfPkg/LoongArchVirt: Add self introduction file Date: Mon, 11 Mar 2024 02:40:04 -0700 Message-Id: <20240311093953.1255022-1-lichao@loongson.cn> In-Reply-To: <20240311093631.1251466-1-lichao@loongson.cn> References: <20240311093631.1251466-1-lichao@loongson.cn> MIME-Version: 1.0 X-CM-TRANSID: AQAAf8CxZMxq0e5lOyVWAA--.36352S2 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQANCGXuwOYBAQAEst X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: KA7LYNKvi8dfQtSK8pvmxTXlx7686176AA= Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=yqRnEsKB; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io Add self introduction file for LoongArch virtual machine. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=4584 Cc: Ard Biesheuvel Cc: Jiewen Yao Cc: Jordan Justen Cc: Gerd Hoffmann Cc: Bibo Mao Cc: Dongyan Qian Signed-off-by: Chao Li Reviewed-by: Bibo Mao --- OvmfPkg/LoongArchVirt/Readme.md | 69 +++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 OvmfPkg/LoongArchVirt/Readme.md diff --git a/OvmfPkg/LoongArchVirt/Readme.md b/OvmfPkg/LoongArchVirt/Readme.md new file mode 100644 index 0000000000..f57fbf6162 --- /dev/null +++ b/OvmfPkg/LoongArchVirt/Readme.md @@ -0,0 +1,69 @@ +# LoongArch QEMU virt platform + +## Overview + + LoongArch QEMU virt is a generic platform that dose not require any actual hardware. + The minimum required QEMU version is [8.1](https://gitlab.com/qemu-project/qemu/-/tags), the minimum required GCC version is [GCC13](https://gcc.gnu.org/gcc-13/), the minimum required Binutils version is [2.40](https://ftp.gnu.org/gnu/binutils/). + +## Prepare (X86 Linux Environment) + +### Fedora39 and higher +Install LoongArch64 cross compiler, LoongArch system QEMU. + + yum install gcc-loongarch64-linux-gnu + yum install qemu-system-loongarch64 + +### Others X86 OS ENV +#### Configure cross-tools + +**Download:** + + wget https://github.com/loongson/build-tools/releases/download/2023.08.08/x86_64-cross-tools-loongarch64-binutils_2.41-gcc_13.2.0.tar.xz + +**Configure the cross-tools environment:** + + mkdir /opt/loongarch64_cross-toolchain/ + tar -vxf x86_64-cross-tools-loongarch64-binutils_2.41-gcc_13.2.0.tar.xz -C /opt/loongarch64_cross-toolchain/ + export PATH=/opt/loongarch64_cross-toolchain/cross-tools/bin:$PATH + +Note: Please obtain [the latest cross-compilation](https://github.com/loongson/build-tools) toolchains. + +#### Build QEMU + + git clone https://gitlab.com/qemu-project/qemu.git + +Note: Please refer to QEMU compilation rules, located in qemu/doc/system/loongarch/virt.rst. + + +## Build LoongArch QEMU virtual machine firmware +#### Get edk2 resouces + + git clone --recurse-submodule https://github.com/tianocore/edk2.git + +#### Building LoongArch QEMU virt FW with GCC + + export WORKSPACE=`pwd` + export GCC5_LOONGARCH64_PREFIX=loongarch64-unknown-linux-gnu- + export PACKAGES_PATH=$WORKSPACE/edk2 + export EDK_TOOLS_PATH=$WORKSPACE/edk2/BaseTools + source edk2/edksetup.sh --reconfig + make -C edk2/BaseTools + source edk2/edksetup.sh BaseTools + build -b RELEASE -t GCC5 -a LOONGARCH64 -p OvmfPkg/LoongArchVirt/LoongArchVirtQemu.dsc + +## Test LoongArch QEMU virtual machine firmware + qemu-system-loongarch64 \ + -m 4G \ + -M virt \ + -smp 2 \ + -cpu la464 \ + -bios Build/LoongArchVirtQemu/RELEASE_GCC5/FV/QEMU_EFI.fd \ + -serial stdio + +## Test LoongArch QEMU virtual machine OS + +* Download ArchLinux QCOW [images](https://mirrors.pku.edu.cn/loongarch/archlinux/images) for LoongArch. + +* [Running LoongArch ArchLinux on virtual machine](https://mirrors.pku.edu.cn/loongarch/archlinux/images/README.html). + +* Download openEuler 22.03 LTS QCOW [images](https://mirrors.nju.edu.cn/openeuler/openEuler-22.03-LTS/virtual_machine_img/loongarch64/openEuler-22.03-LTS-LoongArch-loongarch64.qcow2.xz) for LoongArch. -- 2.27.0 -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#116609): https://edk2.groups.io/g/devel/message/116609 Mute This Topic: https://groups.io/mt/104859904/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-