From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from loongson.cn (loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web12.3623.1668157968313071215 for ; Fri, 11 Nov 2022 01:12:50 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: loongson.cn, ip: 114.242.206.163, mailfrom: lixianglai@loongson.cn) Received: from loongson.cn (unknown [10.2.5.185]) by gateway (Coremail) with SMTP id _____8Dx_NgOEm5jtRMGAA--.18851S3; Fri, 11 Nov 2022 17:12:46 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8BxFlcAEm5jXc0QAA--.27651S17; Fri, 11 Nov 2022 17:12:46 +0800 (CST) From: "xianglai" To: devel@edk2.groups.io Cc: Bibo Mao , Chao Li , Leif Lindholm , Liming Gao , Michael D Kinney Subject: [edk2-platforms][PATCH V5 15/15] Platform/Loongson: Add Readme. Date: Fri, 11 Nov 2022 17:12:30 +0800 Message-Id: <42880684010bfac8d87f9256d4b6230dcbeba45c.1668157715.git.lixianglai@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: AQAAf8BxFlcAEm5jXc0QAA--.27651S17 X-CM-SenderInfo: 5ol0xt5qjotxo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBjvJXoWxAr1rKr1kZr1xGrW3Xw4kCrg_yoWruFyDpF 13ZF1fKr18Grs0v390k3y8u3yUArnYkr97JrWkAr4UuasxXrykZa9Fya1fAanrA340qa4q kry8uw4jkF1UuaDanT9S1TB71UUUUjDqnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU b4xFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4 AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26F1j6w1UM28EF7xvwVC0I7IYx2IY6xkF 7I0E14v26F4j6r4UJwA2z4x0Y4vEx4A2jsIE14v26F4UJVW0owA2z4x0Y4vEx4A2jsIEc7 CjxVAFwI0_Cr1j6rxdM2kKe7AKxVWUAVWUtwAS0I0E0xvYzxvE52x082IY62kv0487Mc80 4VCY07AIYIkI8VC2zVCFFI0UMc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VCjz48v1sIEY2 0_WwAm72CE4IkC6x0Yz7v_Jr0_Gr1lF7xvr2IYc2Ij64vIr41lc7CjxVAaw2AFwI0_JF0_ Jw1l42xK82IYc2Ij64vIr41l42xK82IY6x8ErcxFaVAv8VWrMxC20s026xCaFVCjc4AY6r 1j6r4UMxCIbckI1I0E14v26r126r1DMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xv wVAFwI0_JrI_JrWlx4CE17CEb7AF67AKxVWUAVWUtwCIc40Y0x0EwIxGrwCI42IY6xIIjx v20xvE14v26F1j6w1UMIIF0xvE2Ix0cI8IcVCY1x0267AKxVWxJVW8Jr1lIxAIcVCF04k2 6cxKx2IYs7xG6r1j6r1xMIIF0xvEx4A2jsIE14v26r4UJVWxJr1lIxAIcVC2z280aVCY1x 0267AKxVW8Jr0_Cr1UYxBIdaVFxhVjvjDU0xZFpf9x0zR9iSdUUUUU= Content-Transfer-Encoding: quoted-printable Add Readme for LoogArch and Modify the Readme in the root directory.=0D =0D REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D4054=0D =0D Cc: Bibo Mao =0D Cc: Chao Li =0D Cc: Leif Lindholm =0D Cc: Liming Gao =0D Cc: Michael D Kinney =0D Signed-off-by: xianglai li =0D ---=0D Platform/Loongson/LoongArchQemuPkg/Readme.md | 60 ++++++++++++++++++++=0D Readme.md | 9 +++=0D 2 files changed, 69 insertions(+)=0D create mode 100644 Platform/Loongson/LoongArchQemuPkg/Readme.md=0D =0D diff --git a/Platform/Loongson/LoongArchQemuPkg/Readme.md b/Platform/Loongs= on/LoongArchQemuPkg/Readme.md=0D new file mode 100644=0D index 0000000000..7b11905f14=0D --- /dev/null=0D +++ b/Platform/Loongson/LoongArchQemuPkg/Readme.md=0D @@ -0,0 +1,60 @@=0D +# Introduction=0D +=0D + This document provides the guideline to build UEFI firmware for Qemu of = LoongArch.=0D +=0D + LoongArch is the general processor architecture of Loongson.=0D +=0D + We can get the latest LoongArch documents or LoongArch tools at https://= github.com/loongson/.=0D +=0D +# How to build (X86 Linux Environment)=0D +=0D + 1. Install LoongArch cross-tools on X86 machines.=0D + Download cross-tools from https://github.com/loongson/build-tools ,The= n config cross-tools env.=0D + For Example:=0D +=0D + $ wget https://github.com/loongson/build-tools/releases/download/2022.= 09.06/loongarch64-clfs-6.3-cross-tools-gcc-glibc.tar.xz=0D + $ tar -vxf loongarch64-clfs-6.3-cross-tools-gcc-glibc.tar.xz -C /opt= =0D + $ export PATH=3D/opt/cross-tools/bin:$PATH=0D +=0D + Note: Please obtain the latest cross-compilation tools from https://gi= thub.com/loongson/build-tools .=0D +=0D + 2. Follow edk2-platforms/Readme.md to obtaining source code,And config b= uild env.=0D + For Example:=0D +=0D + $ export WORKSPACE=3D/work/git/tianocore=0D + $ mkdir -p $WORKSPACE=0D + $ cd $WORKSPACE=0D + $ git clone https://github.com/tianocore/edk2.git=0D + $ git submodule update --init=0D + $ git clone https://github.com/tianocore/edk2-platforms.git=0D + $ git submodule update --init=0D + $ git clone https://github.com/tianocore/edk2-non-osi.git=0D + $ export PACKAGES_PATH=3D$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-o= si=0D +=0D + 3. Config cross compiler prefix.=0D + For Example:=0D +=0D + $ export GCC5_LOONGARCH64_PREFIX=3Dloongarch64-unknown-linux-gnu-=0D +=0D + 4.Set up the build environment And build BaseTool.=0D + For Example:=0D +=0D + $. edk2/edksetup.sh=0D + $make -C edk2/BaseTools=0D +=0D + 5.Build platform.=0D + For Exmaple:=0D +=0D + $build --buildtarget=3DDEBUG --tagname=3DGCC5 --arch=3DLOONGARCH64 --= platform=3DPlatform/Loongson/LoongArchQemuPkg/Loongson.dsc=0D +=0D + After a successful build, the resulting images can be found in `Build/{P= latform Name}/{TARGET}_{TOOL_CHAIN_TAG}/FV/QEMU_EFI.fd`.=0D +=0D + A compile script is provided here:=0D +=0D + #!/bin/bash=0D + export WORKSPACE=3D/work/git/tianocore=0D + export PACKAGES_PATH=3D$WORKSPACE/edk2:$WORKSPACE/edk2-platforms=0D + export GCC5_LOONGARCH64_PREFIX=3Dloongarch64-unknown-linux-gnu-=0D + . edk2/edksetup.sh=0D + make -C edk2/BaseTools=0D + build --buildtarget=3DDEBUG --tagname=3DGCC5 --arch=3DLOONGARCH64 --p= latform=3DPlatform/Loongson/LoongArchQemuPkg/Loongson.dsc=0D diff --git a/Readme.md b/Readme.md=0D index 62876b4b7d..93e4dc5255 100644=0D --- a/Readme.md=0D +++ b/Readme.md=0D @@ -57,6 +57,7 @@ IA32 | i?86-linux-gnu-* _or_ x86_64-linux-= gnu-=0D IPF | ia64-linux-gnu=0D X64 | x86_64-linux-gnu-=0D RISCV64 | riscv64-unknown-elf-=0D +LOONGARCH64 | loongarch64-unknown-linux-=0D =0D \* i386, i486, i586 or i686=0D =0D @@ -71,6 +72,11 @@ RISC-V open source community provides GCC toolchains for= =0D [riscv64-unknown-elf](https://github.com/riscv/riscv-gnu-toolchain)=0D compiled to run on x86 Linux.=0D =0D +### GCC for LoongArch=0D +Loonson open source community provides GCC toolchains for=0D +[loongarch64-unknown-elf](https://github.com/loongson/build-tools)=0D +compiled to run on x86 Linux=0D +=0D ### clang=0D Clang does not require separate cross compilers, but it does need a=0D target-specific binutils. These are included with any prepackaged GCC tool= chain=0D @@ -257,6 +263,9 @@ For more information, see the=0D ##### Minnowboard Max/Turbot based on Intel Valleyview2 SoC=0D * [Minnowboard Max](Platform/Intel/Vlv2TbltDevicePkg)=0D =0D +## Loongson=0D +* [LoongArchQemu](Platform/Loongson/LoongArchQemuPkg)=0D +=0D ## Marvell=0D * [Armada 70x0](Platform/Marvell/Armada70x0Db)=0D * [Armada 80x0](Platform/Marvell/Armada80x0Db)=0D -- =0D 2.31.1=0D =0D