Skip to content

Commit

Permalink
edk-firmware-tegra: Support A/B redundancy
Browse files Browse the repository at this point in the history
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: #1182 (comment)
2: https://github.com/NVIDIA/edk2-nvidia/blob/71fc2f6de48f3e9f01214b4e9464dd03620b876b/Silicon/NVIDIA/Application/L4TLauncher/L4TRootfsValidation.c#L464-L466

Signed-off-by: Dan Walkes <[email protected]>
  • Loading branch information
dwalkes committed Dec 2, 2023
1 parent e0e04e8 commit 41aabd4
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
1 change: 1 addition & 0 deletions conf/machine/include/tegra-common.inc
Original file line number Diff line number Diff line change
Expand Up @@ -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 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.
Expand Down
5 changes: 5 additions & 0 deletions recipes-bsp/uefi/edk2-firmware-tegra_35.4.1.bb
Original file line number Diff line number Diff line change
Expand Up @@ -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.dtso' if d.getVar('USE_REDUNDANT_FLASH_LAYOUT') else ''}"

do_compile:append() {
rm -rf ${B}/images
mkdir ${B}/images
Expand All @@ -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} ]; then
dtc -Idts -Odtb -o ${B}/images/L4TConfiguration-RootfsRedundancyLevelABEnable.dtbo ${WORKDIR}/L4TConfiguration-RootfsRedundancyLevelABEnable.dtso
fi
}
do_compile[depends] += "${NVDISPLAY_INIT_DEPS}"

Expand Down
Original file line number Diff line number Diff line change
@@ -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;
};

};

};
};
};
};
};
};

0 comments on commit 41aabd4

Please sign in to comment.