Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable rootfs ab redundancy support #1428

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions conf/machine/clara-agx-xavier-devkit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ EMMC_SIZE ?= "31276924928"
EMMC_DEVSECT_SIZE ?= "512"
BOOTPART_SIZE ?= "8388608"
BOOTPART_LIMIT ?= "10485760"
ROOTFSPART_SIZE ?= "30064771072"
ROOTFSPART_SIZE_DEFAULT ?= "30064771072"
ODMDATA ?= "0x69190000"
EMMC_BCT ?= "tegra194-mb1-bct-memcfg-p2888.cfg"
EMMC_BCT_OVERRIDE ?= "tegra194-memcfg-sw-override.cfg"
NVIDIA_BOARD ?= "t186ref"
PARTITION_LAYOUT_TEMPLATE ?= "flash_t194_sdmmc.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_t194_sdmmc.xml"

TEGRA_AUDIO_DEVICE ?= "tegra-hda-jetson-agx"

Expand Down
2 changes: 1 addition & 1 deletion conf/machine/include/agx-xavier.inc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ EMMC_SIZE ?= "31276924928"
EMMC_DEVSECT_SIZE ?= "512"
BOOTPART_SIZE ?= "8388608"
BOOTPART_LIMIT ?= "10485760"
ROOTFSPART_SIZE ?= "30064771072"
ROOTFSPART_SIZE_DEFAULT ?= "30064771072"
ODMDATA ?= "0x9190000"

EMMC_BCT_OVERRIDE ?= "tegra194-memcfg-sw-override.cfg"
Expand Down
2 changes: 1 addition & 1 deletion conf/machine/include/orin-nano.inc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ MACHINE_EXTRA_RDEPENDS += "linux-firmware-rtl8168"

EMMC_SIZE ?= ""
BOOTPART_SIZE ?= "8388608"
ROOTFSPART_SIZE ?= "30064771072"
ROOTFSPART_SIZE_DEFAULT ?= "30064771072"
ODMDATA ?= "gbe-uphy-config-8,hsstp-lane-map-3,hsio-uphy-config-0"
EMMC_BCT ?= "tegra234-p3767-0000-sdram-l4t.dts"
NVIDIA_BOARD ?= "t186ref"
Expand Down
14 changes: 14 additions & 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 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.
Expand Down Expand Up @@ -104,3 +105,16 @@ TEGRA_FLASHVARS ?= "BPFDTB_FILE BPF_FILE BR_CMD_CONFIG DEVICEPROD_CONFIG DEVICE_
EMMC_BCTS ?= "${EMMC_BCT}${@',' + d.getVar('EMMC_BCT_OVERRIDE') if d.getVar('EMMC_BCT_OVERRIDE') else ''}"

TEGRA_UEFI_SIGNING_CLASS ?= "tegra-uefi-signing"

USE_REDUNDANT_FLASH_LAYOUT_DEFAULT ??= "0"
HAS_REDUNDANT_PARTITION_LAYOUT_EXTERNAL ?= "1"
USE_REDUNDANT_FLASH_LAYOUT ?= "${@d.getVar('USE_REDUNDANT_FLASH_LAYOUT_DEFAULT') if bb.utils.to_boolean(d.getVar('HAS_REDUNDANT_PARTITION_LAYOUT_EXTERNAL')) else '0'}"
PARTITION_LAYOUT_TEMPLATE_DEFAULT_SUPPORTS_REDUNDANT ??= "0"

PARTITION_LAYOUT_TEMPLATE_REDUNDANT ?= "${@d.getVar('PARTITION_LAYOUT_TEMPLATE_DEFAULT') if bb.utils.to_boolean(d.getVar('PARTITION_LAYOUT_TEMPLATE_DEFAULT_SUPPORTS_REDUNDANT')) else d.getVar('PARTITION_LAYOUT_TEMPLATE_DEFAULT').replace('.xml','_rootfs_ab.xml')}"
PARTITION_LAYOUT_TEMPLATE ?= "${@d.getVar('PARTITION_LAYOUT_TEMPLATE_REDUNDANT') if bb.utils.to_boolean(d.getVar('USE_REDUNDANT_FLASH_LAYOUT')) else d.getVar('PARTITION_LAYOUT_TEMPLATE_DEFAULT')}"
PARTITION_LAYOUT_EXTERNAL_REDUNDANT ?= "${@d.getVar('PARTITION_LAYOUT_EXTERNAL_DEFAULT').replace('.xml','_rootfs_ab.xml')}"
PARTITION_LAYOUT_EXTERNAL ?= "${@d.getVar('PARTITION_LAYOUT_EXTERNAL_REDUNDANT') if bb.utils.to_boolean(d.getVar('USE_REDUNDANT_FLASH_LAYOUT')) else d.getVar('PARTITION_LAYOUT_EXTERNAL_DEFAULT')}"

ROOTFSPART_SIZE_REDUNDANT ?= "${@int(d.getVar('ROOTFSPART_SIZE_DEFAULT')) // 2}"
ROOTFSPART_SIZE ?= "${@d.getVar('ROOTFSPART_SIZE_REDUNDANT') if bb.utils.to_boolean(d.getVar('USE_REDUNDANT_FLASH_LAYOUT')) else d.getVar('ROOTFSPART_SIZE_DEFAULT')}"
2 changes: 1 addition & 1 deletion conf/machine/include/tegra194.inc
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ MACHINE_EXTRA_RRECOMMENDS += "kernel-module-tegra-udrm"
KERNEL_MODULE_PROBECONF += "tegra-udrm"
module_conf_tegra-udrm = "options tegra-udrm modeset=1"

PARTITION_LAYOUT_EXTERNAL ?= "flash_l4t_nvme.xml"
PARTITION_LAYOUT_EXTERNAL_DEFAULT ?= "flash_l4t_nvme.xml"

TEGRA_BOOT_FIRMWARE_FILES = "\
adsp-fw.bin \
Expand Down
2 changes: 1 addition & 1 deletion conf/machine/include/tegra234.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ NVFANCONTROL ?= "nvfancontrol_p3701_0000"

MACHINE_EXTRA_RRECOMMENDS += "kernel-module-nvidia kernel-module-nvidia-drm kernel-module-nvidia-modeset kernel-module-userspace-alert"

PARTITION_LAYOUT_EXTERNAL ?= "flash_l4t_t234_nvme.xml"
PARTITION_LAYOUT_EXTERNAL_DEFAULT ?= "flash_l4t_t234_nvme.xml"

TEGRA_BOOT_FIRMWARE_FILES = "\
adsp-fw.bin \
Expand Down
2 changes: 1 addition & 1 deletion conf/machine/include/xavier-nx.inc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ KERNEL_ARGS ?= "console=ttyTCU0,115200 console=tty0 fbcon=map:0 video=efifb:off
EMMC_DEVSECT_SIZE ?= "512"
BOOTPART_SIZE ?= ""
BOOTPART_LIMIT ?= "10485760"
ROOTFSPART_SIZE ?= "15032385536"
ROOTFSPART_SIZE_DEFAULT ?= "15032385536"
RECROOTFSSIZE ?= "104857600"
ODMDATA ?= "0xB8190000"
EMMC_BCT ?= "tegra194-mb1-bct-memcfg-p3668-0001-a00.cfg"
Expand Down
4 changes: 2 additions & 2 deletions conf/machine/jetson-agx-orin-devkit-industrial.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,11 @@ EMMC_SIZE ?= "63652757504"
EMMC_DEVSECT_SIZE ?= "512"
BOOTPART_SIZE ?= "8388608"
BOOTPART_LIMIT ?= "10485760"
ROOTFSPART_SIZE ?= "59055800320"
ROOTFSPART_SIZE_DEFAULT ?= "59055800320"
ODMDATA ?= "gbe-uphy-config-22,hsstp-lane-map-3,nvhs-uphy-config-0,hsio-uphy-config-0,gbe0-enable-10g"
EMMC_BCT ?= "tegra234-p3701-0008-sdram-l4t.dts"
NVIDIA_BOARD ?= "t186ref"
PARTITION_LAYOUT_TEMPLATE ?= "flash_t234_qspi_sdmmc_industrial.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_t234_qspi_sdmmc_industrial.xml"
TEGRA_AUDIO_DEVICE ?= "tegra-ape"

OTABOOTDEV ?= "/dev/mtdblock0"
Expand Down
4 changes: 2 additions & 2 deletions conf/machine/jetson-agx-orin-devkit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@ EMMC_SIZE ?= "31276924928"
EMMC_DEVSECT_SIZE ?= "512"
BOOTPART_SIZE ?= "8388608"
BOOTPART_LIMIT ?= "10485760"
ROOTFSPART_SIZE ?= "30064771072"
ROOTFSPART_SIZE_DEFAULT ?= "30064771072"
ODMDATA ?= "gbe-uphy-config-22,hsstp-lane-map-3,nvhs-uphy-config-0,hsio-uphy-config-0,gbe0-enable-10g"
EMMC_BCT ?= "tegra234-p3701-0000-sdram-l4t.dts"
NVIDIA_BOARD ?= "t186ref"
PARTITION_LAYOUT_TEMPLATE ?= "flash_t234_qspi_sdmmc.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_t234_qspi_sdmmc.xml"
TEGRA_AUDIO_DEVICE ?= "tegra-hda-jetson-agx"

OTABOOTDEV ?= "/dev/mtdblock0"
Expand Down
2 changes: 1 addition & 1 deletion conf/machine/jetson-agx-xavier-devkit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ KERNEL_DEVICETREE ?= "tegra194-p2888-0001-p2822-0000.dtb"

EMMC_BCT ?= "tegra194-mb1-bct-memcfg-p2888.cfg"

PARTITION_LAYOUT_TEMPLATE ?= "flash_t194_sdmmc.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_t194_sdmmc.xml"
BOOT_PARTITIONS_ON_EMMC = "1"
TEGRA_PLUGIN_MANAGER_OVERLAYS ?= "tegra194-p2822-camera-dual-imx274-overlay.dtbo tegra194-p2822-camera-e3326-overlay.dtbo tegra194-p2822-camera-e3331-overlay.dtbo tegra194-p2822-camera-e3333-overlay.dtbo tegra194-p2822-camera-imx185-overlay.dtbo tegra194-p2822-camera-imx390-overlay.dtbo tegra194-p2888-0005-overlay.dtbo tegra194-p2888-0001-p2822-0000-overlay.dtbo"

Expand Down
2 changes: 1 addition & 1 deletion conf/machine/jetson-agx-xavier-industrial.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ KERNEL_DEVICETREE ?= "tegra194-p2888-0008-p2822-0000.dtb"

EMMC_BCT ?= "tegra194-mb1-bct-memcfg-4x-derated-ecc-p2888.cfg"

PARTITION_LAYOUT_TEMPLATE ?= "flash_l4t_t194_spi_emmc_jaxi.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_l4t_t194_spi_emmc_jaxi.xml"
TEGRA_PLUGIN_MANAGER_OVERLAYS ?= "${TEGRA_BOOTCONTROL_OVERLAYS} tegra194-p2822-camera-dual-imx274-overlay.dtbo tegra194-p2822-camera-e3326-overlay.dtbo tegra194-p2822-camera-e3331-overlay.dtbo tegra194-p2822-camera-e3333-overlay.dtbo tegra194-p2822-camera-imx185-overlay.dtbo tegra194-p2822-camera-imx390-overlay.dtbo tegra194-p2888-0005-overlay.dtbo tegra194-p2888-0001-p2822-0000-overlay.dtbo"

OTA_BOOT_DEVICE ?= "/dev/mtdblock0"
Expand Down
7 changes: 5 additions & 2 deletions conf/machine/jetson-orin-nano-devkit-nvme.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@

MACHINEOVERRIDES =. "jetson-orin-nano-devkit:"
TNSPEC_BOOTDEV ?= "nvme0n1p1"
PARTITION_LAYOUT_TEMPLATE ?= "flash_t234_qspi.xml"
PARTITION_LAYOUT_EXTERNAL ?= "flash_l4t_external.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_t234_qspi.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT_SUPPORTS_REDUNDANT ?= "1"
madisongh marked this conversation as resolved.
Show resolved Hide resolved
PARTITION_LAYOUT_EXTERNAL_DEFAULT ?= "flash_l4t_external.xml"
PARTITION_LAYOUT_EXTERNAL_REDUNDANT ?= "flash_l4t_nvme_rootfs_ab.xml"

require conf/machine/include/orin-nano.inc
require conf/machine/include/devkit-wifi.inc

2 changes: 1 addition & 1 deletion conf/machine/jetson-orin-nano-devkit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ require conf/machine/include/devkit-wifi.inc

TEGRA_SPIFLASH_BOOT ?= "1"
TEGRAFLASH_SDCARD_SIZE ?= "32G"
PARTITION_LAYOUT_TEMPLATE ?= "flash_t234_qspi_sd.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_t234_qspi_sd.xml"
2 changes: 1 addition & 1 deletion conf/machine/jetson-xavier-nx-devkit-emmc.conf
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ require conf/machine/include/xavier-nx.inc
require conf/machine/include/devkit-wifi.inc

EMMC_SIZE ?= "15758000128"
PARTITION_LAYOUT_TEMPLATE ?= "flash_l4t_t194_spi_emmc_p3668.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_l4t_t194_spi_emmc_p3668.xml"
BOOT_PARTITIONS_ON_EMMC = "1"
2 changes: 1 addition & 1 deletion conf/machine/jetson-xavier-nx-devkit.conf
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,6 @@ require conf/machine/include/xavier-nx.inc
require conf/machine/include/devkit-wifi.inc

EMMC_SIZE ?= ""
PARTITION_LAYOUT_TEMPLATE ?= "flash_l4t_t194_spi_sd_p3668.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_l4t_t194_spi_sd_p3668.xml"
TEGRA_SPIFLASH_BOOT ?= "1"
TEGRAFLASH_SDCARD_SIZE ?= "16G"
7 changes: 4 additions & 3 deletions conf/machine/p3509-a02-p3767-0000.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ NVPMODEL ?= "nvpmodel_p3767_0000"
NVFANCONTROL ?= "nvfancontrol_p3767_0000"

TNSPEC_BOOTDEV ?= "nvme0n1p1"
PARTITION_LAYOUT_TEMPLATE ?= "flash_t234_qspi.xml"
PARTITION_LAYOUT_EXTERNAL ?= "flash_l4t_external.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_t234_qspi.xml"
PARTITION_LAYOUT_EXTERNAL_DEFAULT ?= "flash_l4t_external.xml"
HAS_REDUNDANT_PARTITION_LAYOUT_EXTERNAL ?= "0"
TEGRAFLASH_NO_INTERNAL_STORAGE = "1"

require conf/machine/include/tegra234.inc
Expand All @@ -37,7 +38,7 @@ MACHINE_EXTRA_RDEPENDS += "linux-firmware-rtl8168"
EMMC_SIZE ?= ""
BOOTPART_SIZE ?= "8388608"
# 55GiB default rootfs size
ROOTFSPART_SIZE ?= "59055800320"
ROOTFSPART_SIZE_DEFAULT ?= "59055800320"
ODMDATA ?= "gbe-uphy-config-8,hsstp-lane-map-3,hsio-uphy-config-0"
EMMC_BCT ?= "tegra234-p3767-0000-sdram-l4t.dts"
NVIDIA_BOARD ?= "t186ref"
Expand Down
7 changes: 4 additions & 3 deletions conf/machine/p3768-0000-p3767-0000.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ NVPMODEL ?= "nvpmodel_p3767_0000"
NVFANCONTROL ?= "nvfancontrol_p3767_0000"

TNSPEC_BOOTDEV ?= "nvme0n1p1"
PARTITION_LAYOUT_TEMPLATE ?= "flash_t234_qspi.xml"
PARTITION_LAYOUT_EXTERNAL ?= "flash_l4t_external.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_t234_qspi.xml"
PARTITION_LAYOUT_EXTERNAL_DEFAULT ?= "flash_l4t_external.xml"
HAS_REDUNDANT_PARTITION_LAYOUT_EXTERNAL ?= "0"
TEGRAFLASH_NO_INTERNAL_STORAGE = "1"

require conf/machine/include/tegra234.inc
Expand All @@ -37,7 +38,7 @@ MACHINE_EXTRA_RDEPENDS += "linux-firmware-rtl8168"
EMMC_SIZE ?= ""
BOOTPART_SIZE ?= "8388608"
# 55GiB default rootfs size
ROOTFSPART_SIZE ?= "59055800320"
ROOTFSPART_SIZE_DEFAULT ?= "59055800320"
ODMDATA ?= "gbe-uphy-config-8,hsstp-lane-map-3,hsio-uphy-config-0"
EMMC_BCT ?= "tegra234-p3767-0000-sdram-l4t.dts"
NVIDIA_BOARD ?= "t186ref"
Expand Down
5 changes: 3 additions & 2 deletions conf/machine/p3768-0000-p3767-0004.conf
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
MACHINEOVERRIDES =. "jetson-orin-nano-4g-devkit:"
TNSPEC_BOOTDEV ?= "nvme0n1p1"

PARTITION_LAYOUT_TEMPLATE ?= "flash_t234_qspi.xml"
PARTITION_LAYOUT_EXTERNAL ?= "flash_l4t_external.xml"
PARTITION_LAYOUT_TEMPLATE_DEFAULT ?= "flash_t234_qspi.xml"
PARTITION_LAYOUT_EXTERNAL_DEFAULT ?= "flash_l4t_external.xml"
HAS_REDUNDANT_PARTITION_LAYOUT_EXTERNAL ?= "0"

TEGRA_BOARDSKU = "0004"
KERNEL_DEVICETREE = "tegra234-p3767-0004-p3768-0000-a0.dtb"
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.dtsi' if bb.utils.to_boolean(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} -eq 1 ]; then
dtc -Idts -Odtb -o ${B}/images/L4TConfiguration-RootfsRedundancyLevelABEnable.dtbo ${WORKDIR}/L4TConfiguration-RootfsRedundancyLevelABEnable.dtsi
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;
};

};

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