sudo apt-get install autoconf automake autotools-dev curl python3 libmpc-dev libmpfr-dev libgmp-dev gawk build-essential bison flex texinfo gperf libtool patchutils bc zlib1g-dev libexpat-dev ninja-build uuid-dev gcc-riscv64-unknown-elf
git clone https://github.com/sophgo/sophgo-edk2.git
cd sophgo-edk2
git submodule sync git submodule update --init --recursive
export WORKSPACE=`pwd` export PACKAGES_PATH=$WORKSPACE/edk2:$WORKSPACE/edk2-platforms:$WORKSPACE/edk2-non-osi export GCC5_RISCV64_PREFIX=riscv64-unknown-elf- source edk2/edksetup.sh
make -C edk2/BaseTools
Final output is $WORKSPACE/Build/SG2044/DEBUG_GCC5/FV/SG2044.fd.
build -a RISCV64 -t GCC5 -b DEBUG -p Platform/Sophgo/SG2044Pkg/SG2044.dsc
Build Debug version or Release version: use
-b DEBUGor-b RELEASE.Final output is in
$WORKSPACE/Build/SG2044/DEBUG_GCC5/FV/SG2044.fd# build debug version build -a RISCV64 -t GCC5 -b DEBUG -p Platform/Sophgo/SG2044Pkg/SG2044.dsc # build release version build -a RISCV64 -t GCC5 -b RELEASE -p Platform/Sophgo/SG2044Pkg/SG2044.dsc
Enable
MultiArchUefiPkgfor graphics cards supporting UEFI: use-D X64EMU_ENABLE.build -a RISCV64 -t GCC5 -b RELEASE -D X64EMU_ENABLE -p Platform/Sophgo/SG2044Pkg/SG2044.dsc
-D X64EMU_ENABLEis an option to enable MultiArchUefiPkg, an emulator for x64 OpRoms, or not. Please see the link https://github.com/intel/MultiArchUefiPkg for more details. If you use-b DEBUGto replace-b RELEASEto build, MultiArchUefiPkg maybe not work.Enable ACPI: use
-D ACPI_ENABLE.Make sure the iASL (Intel ACPI Source Language Optimizing Compiler and Disassembler) is the latest version
20241212.The iASL compiler/disassembler is a fully-featured translator for the ACPI Source Language (ASL) and ACPI binary data tables. Please see the link https://www.intel.com/content/www/us/en/content-details/772895/iasl-acpi-source-language-optimizing-compiler-disassembler-user-guide-doc.html for more details.
The install steps as follows.
# Download source code git clone https://github.com/acpica/acpica.git cd acpica # Compile make # Install sudo make install # Check version iasl -v # # Show the info Intel ACPI Component Architecture ASL+ Optimizing Compiler/Disassembler version 20241212 Copyright (c) 2000 - 2023 Intel Corporation
-D ACPI_ENABLEis an option to enable ACPI. ACPI support is currently provided for SG2044 EVB. To use the ACPI feature in the Linux Kernel on the SG2044 platform, see the link https://github.com/sophgo/linux-riscv/tree/sg2044-dev-6.12.build -a RISCV64 -t GCC5 -b DEBUG -D ACPI_ENABLE -p Platform/Sophgo/SG2044Pkg/SG2044.dsc
Mount your SD card (assume your SD card is
/dev/sdcon your PC).sudo mount /dev/sdc1 /mnt
Copy
SG2044.fdto your SD card in the0:riscv64/directory.sudo cp SG2044.fd /mnt/riscv64/