Skip to content

Commit

Permalink
sg2044: update edk2 build helper
Browse files Browse the repository at this point in the history
  • Loading branch information
SophgoChaoWei committed Sep 25, 2024
1 parent b845728 commit 275f556
Showing 1 changed file with 18 additions and 7 deletions.
25 changes: 18 additions & 7 deletions scripts/envsetup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -419,13 +419,13 @@ function build_rv_edk2()
git submodule update --init --recursive

export WORKSPACE=$RV_EDKII_SRC_DIR
export PACKAGES_PATH=$WORKSPACE/edk2:$RV_EDKII_SRC_DIR/edk2-platforms:$RV_EDKII_SRC_DIR/edk2-non-osi
export PACKAGES_PATH=$WORKSPACE/edk2:$RV_EDKII_SRC_DIR/edk2-platforms:$RV_EDKII_SRC_DIR/edk2-non-osi:$WORKSPACE/external-modules
export EDK_TOOLS_PATH=$WORKSPACE/edk2/BaseTools
export GCC5_RISCV64_PREFIX=$RISCV64_ELF_CROSS_COMPILE

source edk2/edksetup.sh

make -C edk2/BaseTools
make -C edk2/BaseTools -j$(nproc)

if [ $CHIP = 'mango' ]; then
if [ "$CHIP_NUM" = "multi" ];then
Expand All @@ -440,12 +440,23 @@ function build_rv_edk2()

cp $RV_EDKII_SRC_DIR/Build/SG2042_EVB/$TARGET\_GCC5/FV/SG2042.fd $RV_FIRMWARE_INSTALL_DIR
else
pushd edk2-platforms
git checkout devel-${CHIP}
popd

TARGET=DEBUG
build -a RISCV64 -t GCC5 -b $TARGET -p Platform/Sophgo/${CHIP^^}Pkg/${CHIP^^}.dsc
git checkout devel-${CHIP}

pushd edk2-platforms
git checkout devel-${CHIP}
popd

pushd edk2-non-osi
git checkout devel-${CHIP}
popd

pushd edk2
git checkout devel-${CHIP}
popd

TARGET=RELEASE
build -a RISCV64 -t GCC5 -b $TARGET -D X64EMU_ENABLE -p Platform/Sophgo/${CHIP^^}Pkg/${CHIP^^}.dsc

mkdir -p $RV_FIRMWARE_INSTALL_DIR

Expand Down

0 comments on commit 275f556

Please sign in to comment.