edk-firmware-tegra: Support A/B redundancy

When USE_REDUNDANT_FLASH_LAYOUT is specified, add the
.dtbo file to the build which enables RootfsA/B suport
in UEFI based on discussion at [1].

This content of the variable is set based on the corresponding
logic found in nvidia's flash.sh.  The usage for this variable
can be found at [2].

1: https://github.com/OE4T/meta-tegra/discussions/1182#discussioncomment-5067058
2: 71fc2f6de4/Silicon/NVIDIA/Application/L4TLauncher/L4TRootfsValidation.c (L464-L466)

Signed-off-by: Dan Walkes <danwalkes@trellis-logic.com>
This commit is contained in:
Dan Walkes
2023-12-02 11:19:51 -07:00
committed by Matt Madison
parent 32fad08d3f
commit d421bf5cfe
3 changed files with 42 additions and 0 deletions

View File

@@ -13,6 +13,7 @@ UBOOT_EXTLINUX_KERNEL_ARGS ?= "${KERNEL_ARGS}"
UBOOT_EXTLINUX_INITRD ?= "${@'/boot/initrd' if d.getVar('INITRAMFS_IMAGE') != '' and d.getVar('INITRAMFS_IMAGE_BUNDLE') != '1' else ''}"
TEGRA_BOOTCONTROL_OVERLAYS ?= "L4TConfiguration.dtbo"
TEGRA_BOOTCONTROL_OVERLAYS += "${@'L4TConfiguration-RootfsRedundancyLevelABEnable.dtbo' if bb.utils.to_boolean(d.getVar('USE_REDUNDANT_FLASH_LAYOUT')) else ''}"
TEGRA_PLUGIN_MANAGER_OVERLAYS ??= ""
# The following variable is deprecated; add new overlays
# to one of the above instead.

View File

@@ -20,6 +20,8 @@ NVDISPLAY_INIT ?= "${NVDISPLAY_INIT_DEFAULT}"
NVDISPLAY_INIT_DEPS = ""
NVDISPLAY_INIT_DEPS:tegra194 = "nvdisp-init:do_deploy"
SRC_URI += "${@'file://L4TConfiguration-RootfsRedundancyLevelABEnable.dtsi' if bb.utils.to_boolean(d.getVar('USE_REDUNDANT_FLASH_LAYOUT')) else ''}"
do_compile:append() {
rm -rf ${B}/images
mkdir ${B}/images
@@ -42,6 +44,9 @@ do_compile:append() {
done
cp ${B}/images/L4TConfiguration.dtbo ${B}/images/L4TConfiguration-rcmboot.dtbo
fdtput -t s ${B}/images/L4TConfiguration-rcmboot.dtbo /fragment@0/__overlay__/firmware/uefi/variables/gNVIDIATokenSpaceGuid/DefaultBootPriority data boot.img
if [ ${USE_REDUNDANT_FLASH_LAYOUT} -eq 1 ]; then
dtc -Idts -Odtb -o ${B}/images/L4TConfiguration-RootfsRedundancyLevelABEnable.dtbo ${WORKDIR}/L4TConfiguration-RootfsRedundancyLevelABEnable.dtsi
fi
}
do_compile[depends] += "${NVDISPLAY_INIT_DEPS}"

View File

@@ -0,0 +1,36 @@
/dts-v1/;
/ {
overlay-name = "L4T Configuration Settings";
fragment@0 {
target-path = "/";
board_config {
sw-modules = "uefi";
};
__overlay__ {
firmware {
uefi {
variables {
gNVIDIAPublicVariableGuid {
RootfsRedundancyLevel {
data = [01 00 00 00];
runtime;
locked;
};
};
};
};
};
};
};
};