xianglai li 57059bcb9b Platform/Loongson: Fixed multi-core boot issue 1 år sedan
..
Drivers 1e5af5e68c Platform/Loongson: Add timer Dxe driver. 1 år sedan
Include 6154c1c609 Platform/Loongson: Add StableTimerLib. 1 år sedan
Library 3d07287180 Platform/Loongson: Enable zero address protection. 1 år sedan
PlatformPei 5e4c03d35d Platform/Loongson: Add bootmode support. 1 år sedan
Sec 57059bcb9b Platform/Loongson: Fixed multi-core boot issue 1 år sedan
Loongson.dec 7f56a1f90a Platform/Loongson: Support Dxe 1 år sedan
Loongson.dsc 8efa4f42b5 Platform/Loongson: Allow building with stack protector support 1 år sedan
Loongson.fdf 6c1ab0c4a1 Platform/Loongson: Support vga for loongarch. 1 år sedan
Loongson.fdf.inc 7f56a1f90a Platform/Loongson: Support Dxe 1 år sedan
Readme.md ae08383792 Platform/Loongson: Modify Readme of Loongarch. 1 år sedan
VarStore.fdf.inc 3162e656fd Platform/Loongson: Support pflash for loongarch. 1 år sedan

Readme.md

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 $ cd edk2 $ git submodule update –init $ cd .. $ git clone https://github.com/tianocore/edk2-platforms.git $ cd edk2-platforms $ git submodule update –init $ cd .. $ 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