Skip to content

Instantly share code, notes, and snippets.

@AdrianKoshka
Last active November 6, 2020 21:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save AdrianKoshka/16b77375857e6b61a1697497ba870d21 to your computer and use it in GitHub Desktop.
Save AdrianKoshka/16b77375857e6b61a1697497ba870d21 to your computer and use it in GitHub Desktop.

Building UEFI for the macchiatobin

CC0
To the extent possible under law, Adrian Lucrèce Céleste has waived all copyright and related or neighboring rights to Building UEFI for the macchiatobin. This work is published from: United States.

This is an abridged version of the guide on Solidrun's site that fixes some issues I ran into.

Installing the Required Packages

This guide assumes you're on Debian 10, on an arm64 machine

$ sudo apt install build-essential acpica-tools device-tree-compiler uuid-dev libssl-dev

Clone the required repos:

$ mkdir build-edk2; cd build-edk2
$ git clone --recurse-submodules https://github.com/tianocore/edk2.git -b edk2-stable202008
$ git clone https://github.com/tianocore/edk2-non-osi.git -b master
$ git clone https://github.com/tianocore/edk2-platforms.git -b master
$ cd edk2-platforms
$ git checkout 1e09147a01aeb45aa43e36923d96a1d6b0ec9106 # pulls in an RNG fix
$ cd ..
$ git clone https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git -b master
$ git clone https://github.com/MarvellEmbeddedProcessors/binaries-marvell.git -b binaries-marvell-armada-18.12 binaries
$ git clone https://github.com/MarvellEmbeddedProcessors/mv-ddr-marvell.git -b mv-ddr-devel

Building EDK2

export export WORKSPACE=$PWD
export PACKAGES_PATH=$PWD/edk2:$PWD/edk2-platforms:$PWD/edk2-non-osi
export GCC5_AARCH64_PREFIX=aarch64-linux-gnu-

$ make -C edk2/BaseTools
$ source edk2/edksetup.sh
$ build -a AARCH64 -b RELEASE -t GCC5 -p Platform/SolidRun/Armada80x0McBin/Armada80x0McBin.dsc -D X64EMU_ENABLE

$ ls Build/Armada80x0McBin-AARCH64/RELEASE_GCC5/FV/ARMADA_EFI.fd

Build the Final Image with TF-A

export CROSS_COMPILE=aarch64-linux-gnu-

$ make -C trusted-firmware-a \
        PLAT=a80x0_mcbin \
        MV_DDR_PATH=$PWD/mv-ddr \
        SCP_BL2=$PWD/binaries/mrvl_scp_bl2.img \
        BL33=$PWD/Build/Armada80x0McBin-AARCH64/RELEASE_GCC5/FV/ARMADA_EFI.fd \
        all fip

$ cp trusted-firmware-a/build/a80x0_mcbin/release/fip.bin uefi-mcbin-spi.bin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment