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.web10.6226.1668652809210133884 for ; Wed, 16 Nov 2022 18:40:09 -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 _____8CxfbYHn3VjQyQIAA--.11795S3; Thu, 17 Nov 2022 10:40:07 +0800 (CST) Received: from localhost.localdomain (unknown [10.2.5.185]) by localhost.localdomain (Coremail) with SMTP id AQAAf8DxLeD5nnVjCpcVAA--.56818S18; Thu, 17 Nov 2022 10:40:06 +0800 (CST) From: "xianglai" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Bibo Mao , Chao Li , Leif Lindholm , Liming Gao , Michael D Kinney Subject: [edk2-platforms][PATCH V6 16/16] Platform/Loongson: Add Readme. Date: Thu, 17 Nov 2022 10:39:42 +0800 Message-Id: <9e8ca74f63df87170d65b82bbcb11964d4e2147a.1668652102.git.lixianglai@loongson.cn> X-Mailer: git-send-email 2.31.1 In-Reply-To: References: MIME-Version: 1.0 X-CM-TRANSID: AQAAf8DxLeD5nnVjCpcVAA--.56818S18 X-CM-SenderInfo: 5ol0xt5qjotxo6or00hjvr0hdfq/ X-Coremail-Antispam: 1Uk129KBjvJXoWxAr17GFWxJr47KFW7uF1DGFg_yoWrtF1kpF 13Z3WfKr18Jr1jv390k3y8u3yUZrn5Cr97JrWkAr4Uuas8XryDZa9Fya1FyanrA340q3Wq kry0kw4jkF1UuaDanT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUj1kv1TuYvTs0mT0YCTnIWj qI5I8CrVACY4xI64kE6c02F40Ex7xfYxn0WfASr-VFAUDa7-sFnT9fnUUIcSsGvfJTRUUU bexFc2x0x2IEx4CE42xK8VAvwI8IcIk0rVWrJVCq3wA2ocxC64kIII0Yj41l84x0c7CEw4 AK67xGY2AK021l84ACjcxK6xIIjxv20xvE14v26w1j6s0DM28EF7xvwVC0I7IYx2IY6xkF 7I0E14v26r4UJVWxJr1l84ACjcxK6I8E87Iv67AKxVW8Jr0_Cr1UM28EF7xvwVC2z280aV CY1x0267AKxVW8Jr0_Cr1UM2AIxVAIcxkEcVAq07x20xvEncxIr21l57IF6xkI12xvs2x2 6I8E6xACxx1l5I8CrVACY4xI64kE6c02F40Ex7xfMcIj6x8ErcxFaVAv8VWrMcvjeVCFs4 IE7xkEbVWUJVW8JwACjcxG0xvY0x0EwIxGrwCF04k20xvY0x0EwIxGrwCF04k20xvE74AG Y7Cv6cx26rWl4I8I3I0E4IkC6x0Yz7v_Jr0_Gr1lx2IqxVAqx4xG67AKxVWUJVWUGwC20s 026x8GjcxK67AKxVWUGVWUWwC2zVAF1VAY17CE14v26r126r1DMIIYrxkI7VAKI48JMIIF 0xvE2Ix0cI8IcVAFwI0_Ar0_tr1lIxAIcVC0I7IYx2IY6xkF7I0E14v26F4j6r4UJwCI42 IY6xAIw20EY4v20xvaj40_Jr0_JF4lIxAIcVC2z280aVAFwI0_Cr0_Gr1UMIIF0xvEx4A2 jsIEc7CjxVAFwI0_Gr0_Gr1UYxBIdaVFxhVjvjDU0xZFpf9x0zRVWlkUUUUU= Content-Transfer-Encoding: 8bit Add Readme for LoogArch and Modify the Readme in the root directory. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=4054 Cc: Ard Biesheuvel Cc: Bibo Mao Cc: Chao Li Cc: Leif Lindholm Cc: Liming Gao Cc: Michael D Kinney Signed-off-by: xianglai li Reviewed-by: Chao Li --- Platform/Loongson/LoongArchQemuPkg/Readme.md | 60 ++++++++++++++++++++ Readme.md | 9 +++ 2 files changed, 69 insertions(+) create mode 100644 Platform/Loongson/LoongArchQemuPkg/Readme.md diff --git a/Platform/Loongson/LoongArchQemuPkg/Readme.md b/Platform/Loongson/LoongArchQemuPkg/Readme.md new file mode 100644 index 0000000000..7b11905f14 --- /dev/null +++ b/Platform/Loongson/LoongArchQemuPkg/Readme.md @@ -0,0 +1,60 @@ +# Introduction + + This document provides the guideline to build UEFI firmware for Qemu of LoongArch. + + LoongArch is the general processor architecture of Loongson. + + We can get the latest LoongArch documents or LoongArch tools at https://github.com/loongson/. + +# How to build (X86 Linux Environment) + + 1. Install LoongArch cross-tools on X86 machines. + Download cross-tools from https://github.com/loongson/build-tools ,Then config cross-tools env. + For Example: + + $ wget https://github.com/loongson/build-tools/releases/download/2022.09.06/loongarch64-clfs-6.3-cross-tools-gcc-glibc.tar.xz + $ tar -vxf loongarch64-clfs-6.3-cross-tools-gcc-glibc.tar.xz -C /opt + $ export PATH=/opt/cross-tools/bin:$PATH + + Note: Please obtain the latest cross-compilation tools from https://github.com/loongson/build-tools . + + 2. Follow edk2-platforms/Readme.md to obtaining source code,And config build env. + For Example: + + $ export WORKSPACE=/work/git/tianocore + $ mkdir -p $WORKSPACE + $ cd $WORKSPACE + $ git clone https://github.com/tianocore/edk2.git + $ git submodule update --init + $ git clone https://github.com/tianocore/edk2-platforms.git + $ git submodule update --init + $ git clone https://github.com/tianocore/edk2-non-osi.git + $ export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi + + 3. Config cross compiler prefix. + For Example: + + $ export GCC5_LOONGARCH64_PREFIX=loongarch64-unknown-linux-gnu- + + 4.Set up the build environment And build BaseTool. + For Example: + + $. edk2/edksetup.sh + $make -C edk2/BaseTools + + 5.Build platform. + For Exmaple: + + $build --buildtarget=DEBUG --tagname=GCC5 --arch=LOONGARCH64 --platform=Platform/Loongson/LoongArchQemuPkg/Loongson.dsc + + After a successful build, the resulting images can be found in `Build/{Platform Name}/{TARGET}_{TOOL_CHAIN_TAG}/FV/QEMU_EFI.fd`. + + A compile script is provided here: + + #!/bin/bash + export WORKSPACE=/work/git/tianocore + export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms + export GCC5_LOONGARCH64_PREFIX=loongarch64-unknown-linux-gnu- + . edk2/edksetup.sh + make -C edk2/BaseTools + build --buildtarget=DEBUG --tagname=GCC5 --arch=LOONGARCH64 --platform=Platform/Loongson/LoongArchQemuPkg/Loongson.dsc diff --git a/Readme.md b/Readme.md index 62876b4b7d..93e4dc5255 100644 --- a/Readme.md +++ b/Readme.md @@ -57,6 +57,7 @@ IA32 | i?86-linux-gnu-* _or_ x86_64-linux-gnu- IPF | ia64-linux-gnu X64 | x86_64-linux-gnu- RISCV64 | riscv64-unknown-elf- +LOONGARCH64 | loongarch64-unknown-linux- \* i386, i486, i586 or i686 @@ -71,6 +72,11 @@ RISC-V open source community provides GCC toolchains for [riscv64-unknown-elf](https://github.com/riscv/riscv-gnu-toolchain) compiled to run on x86 Linux. +### GCC for LoongArch +Loonson open source community provides GCC toolchains for +[loongarch64-unknown-elf](https://github.com/loongson/build-tools) +compiled to run on x86 Linux + ### clang Clang does not require separate cross compilers, but it does need a target-specific binutils. These are included with any prepackaged GCC toolchain @@ -257,6 +263,9 @@ For more information, see the ##### Minnowboard Max/Turbot based on Intel Valleyview2 SoC * [Minnowboard Max](Platform/Intel/Vlv2TbltDevicePkg) +## Loongson +* [LoongArchQemu](Platform/Loongson/LoongArchQemuPkg) + ## Marvell * [Armada 70x0](Platform/Marvell/Armada70x0Db) * [Armada 80x0](Platform/Marvell/Armada80x0Db) -- 2.31.1