mirror of
https://github.com/lingble/meta-tegra.git
synced 2025-10-29 11:32:30 +00:00
edk2-firmware-tegra: add support for JetsonMinimal builds
The AGX Orin platform supports a minimal UEFI for booting off its internal eMMC. Add support for a TEGRA_UEFI_MINIMAL variable, which when set to a boolean true value, builds this minimal configuration instead of the normal UEFI. See the "miniUEFI Support" section in the Jetson Linux developer guide for more information about support, restrictions, etc. Signed-off-by: Matt Madison <matt@madison.systems>
This commit is contained in:
committed by
Matt Madison
parent
b26b6ff09b
commit
70f85df34b
@@ -76,10 +76,16 @@ do_compile[dirs] =+ "${B}/nvidia-config/Jetson"
|
||||
|
||||
PACKAGES_PATH = "${@nvidia_edk2_packages_path(d)}"
|
||||
|
||||
TEGRA_UEFI_MINIMAL ??= "0"
|
||||
def nvidia_edk2_build_ids(d):
|
||||
if bb.utils.to_boolean(d.getVar('TEGRA_UEFI_MINIMAL')):
|
||||
return "-D BUILD_GUID=f98bcf32-fd20-4ba9-ada4-e0406947ca3c -DBUILD_NAME=JetsonMinimal"
|
||||
else:
|
||||
return "-D BUILD_GUID=49a79a15-8f69-4be7-a30c-a172f44abce7 -DBUILD_NAME=Jetson"
|
||||
|
||||
# BUILD_* taken from Silicon/NVIDIA/edk2nv/stuart/settings.py and
|
||||
# builder.py, plus Platform/NVIDIA/Jetson/PlatformBuild.py
|
||||
EDK2_EXTRA_BUILD = '-D "BUILDID_STRING=v${PV}" -D "BUILD_DATE_TIME=${@format_build_date(d)}" -D "BUILD_PROJECT_TYPE=EDK2" \
|
||||
-D BUILD_GUID=49a79a15-8f69-4be7-a30c-a172f44abce7 -DBUILD_NAME=Jetson'
|
||||
EDK2_EXTRA_BUILD = '-D "BUILDID_STRING=v${PV}" -D "BUILD_DATE_TIME=${@format_build_date(d)}" -D "BUILD_PROJECT_TYPE=EDK2" ${@nvidia_edk2_build_ids(d)}'
|
||||
|
||||
def format_build_date(d):
|
||||
import datetime
|
||||
|
||||
@@ -10,14 +10,14 @@ TEGRA_UEFI_SIGNING_CLASS ??= "tegra-uefi-signing"
|
||||
|
||||
inherit l4t_bsp deploy ${TEGRA_UEFI_SIGNING_CLASS}
|
||||
|
||||
EDK2_PLATFORM = "Jetson"
|
||||
EDK2_PLATFORM = "${@'JetsonMinimal' if bb.utils.to_boolean(d.getVar('TEGRA_UEFI_MINIMAL')) else 'Jetson'}"
|
||||
EDK2_PLATFORM_DSC = "Platform/NVIDIA/NVIDIA.common.dsc"
|
||||
EDK2_BIN_NAME = "uefi_jetson.bin"
|
||||
|
||||
SRC_URI += "file://nvbuildconfig.py"
|
||||
|
||||
do_configure:append() {
|
||||
${PYTHON} ${UNPACKDIR}/nvbuildconfig.py ${S_EDK2_NVIDIA}/Platform/NVIDIA/Kconfig ${S_EDK2_NVIDIA}/Platform/NVIDIA/Jetson/Jetson.defconfig ${B}/nvidia-config/Jetson/.config ${B}/nvidia-config/Jetson/config.dsc.inc
|
||||
${PYTHON} ${UNPACKDIR}/nvbuildconfig.py ${S_EDK2_NVIDIA}/Platform/NVIDIA/Kconfig ${S_EDK2_NVIDIA}/Platform/NVIDIA/${EDK2_PLATFORM}/Jetson.defconfig ${B}/nvidia-config/Jetson/.config ${B}/nvidia-config/Jetson/config.dsc.inc
|
||||
}
|
||||
|
||||
def fmp_lowest_version(d):
|
||||
@@ -36,13 +36,15 @@ do_compile:append() {
|
||||
${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/FV/UEFI_NS.Fv \
|
||||
${B}/images/${EDK2_BIN_NAME}.tmp
|
||||
mv ${B}/images/${EDK2_BIN_NAME}.tmp ${B}/images/${EDK2_BIN_NAME}
|
||||
${PYTHON} ${S_EDK2_NVIDIA}/Silicon/NVIDIA/edk2nv/FormatUefiBinary.py \
|
||||
${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/AARCH64/L4TLauncher.efi \
|
||||
${B}/images/BOOTAA64.efi
|
||||
if ${@'false' if bb.utils.to_boolean(d.getVar('TEGRA_UEFI_MINIMAL')) else 'true'}; then
|
||||
${PYTHON} ${S_EDK2_NVIDIA}/Silicon/NVIDIA/edk2nv/FormatUefiBinary.py \
|
||||
${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/AARCH64/L4TLauncher.efi \
|
||||
${B}/images/BOOTAA64.efi
|
||||
fi
|
||||
for f in ${B}/Build/${EDK2_PLATFORM}/${EDK2_BUILD_MODE}_${EDK_COMPILER}/AARCH64/Silicon/NVIDIA/Tegra/DeviceTree/DeviceTree/OUTPUT/*.dtb; do
|
||||
[ -e "$f" ] || continue
|
||||
fbase=$(basename "$f" ".dtb")
|
||||
cp $f ${B}/images/$fbase.dtbo
|
||||
[ -e "$f" ] || continue
|
||||
fbase=$(basename "$f" ".dtb")
|
||||
cp $f ${B}/images/$fbase.dtbo
|
||||
done
|
||||
fdtput -t i ${B}/images/L4TConfiguration.dtbo "/fragment@0/__overlay__/firmware/uefi" fmp-lowest-supported-version ${@fmp_lowest_version(d)}
|
||||
cp ${B}/images/L4TConfiguration.dtbo ${B}/images/L4TConfiguration-rcmboot.dtbo
|
||||
@@ -63,7 +65,9 @@ addtask sign_efi_launcher after do_compile before do_install
|
||||
|
||||
do_install() {
|
||||
install -d ${D}${EFIDIR}
|
||||
install -m 0644 ${B}/images/BOOTAA64.efi ${D}${EFIDIR}/${EFI_BOOT_IMAGE}
|
||||
if ${@'false' if bb.utils.to_boolean(d.getVar('TEGRA_UEFI_MINIMAL')) else 'true'}; then
|
||||
install -m 0644 ${B}/images/BOOTAA64.efi ${D}${EFIDIR}/${EFI_BOOT_IMAGE}
|
||||
fi
|
||||
}
|
||||
|
||||
PACKAGES = "l4t-launcher"
|
||||
|
||||
Reference in New Issue
Block a user