public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "xianglai" <lixianglai@loongson.cn>
To: devel@edk2.groups.io
Cc: Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Bibo Mao <maobibo@loongson.cn>, Chao Li <lichao@loongson.cn>,
	Leif Lindholm <quic_llindhol@quicinc.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Michael D Kinney <michael.d.kinney@intel.com>
Subject: [edk2-platforms][PATCH V6 16/16] Platform/Loongson: Add Readme.
Date: Thu, 17 Nov 2022 10:39:42 +0800	[thread overview]
Message-ID: <9e8ca74f63df87170d65b82bbcb11964d4e2147a.1668652102.git.lixianglai@loongson.cn> (raw)
In-Reply-To: <cover.1668652102.git.lixianglai@loongson.cn>

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 <ardb+tianocore@kernel.org>
Cc: Bibo Mao <maobibo@loongson.cn>
Cc: Chao Li <lichao@loongson.cn>
Cc: Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Liming Gao <gaoliming@byosoft.com.cn>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
Signed-off-by: xianglai li <lixianglai@loongson.cn>
Reviewed-by: Chao Li <lichao@loongson.cn>
---
 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


  parent reply	other threads:[~2022-11-17  2:40 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-11-17  2:39 [edk2-platforms][PATCH V6 00/16] Platform: Add Loongson support xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 01/16] Platform/Loongson: Add Serial Port library xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 02/16] Platform/Loongson: Support SEC xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 03/16] Platform/Loongson: Add PeiServicesTablePointerLib xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 04/16] Platform/Loongson: Add QemuFwCfgLib xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 05/16] Platform/Loongson: Add MmuLib xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 06/16] Platform/Loongson: Add StableTimerLib xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 07/16] Platform/Loongson: Support PEI phase xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 08/16] Platform/Loongson: Add CPU DXE driver xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 09/16] Platform/Loongson: Add PciCpuIoDxe driver xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 10/16] Platform/Loongson: Add timer Dxe driver xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 11/16] Platform/Loongson: Add RealTime Clock lib xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 12/16] Platform/Loongson: Add Platform Boot Manager Lib xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 13/16] Platform/Loongson: Add Reset System Lib xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 14/16] Platform/Loongson: Add Hob Dxe Lib xianglai
2022-11-17  2:39 ` [edk2-platforms][PATCH V6 15/16] Platform/Loongson: Support Dxe xianglai
2022-11-17  2:39 ` xianglai [this message]
2022-11-21  9:08 ` [edk2-platforms][PATCH V6 00/16] Platform: Add Loongson support Chao Li

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9e8ca74f63df87170d65b82bbcb11964d4e2147a.1668652102.git.lixianglai@loongson.cn \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox