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

WIP dunfell tegra l4t multiversion #15

Merged
merged 20 commits into from
Dec 12, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
98dfe5d
tegra-mender-setup.bbclass: add override based on L4T version
madisongh Dec 4, 2021
c3792e3
tegra: libubootenv: import changes from meta-tegra-community
madisongh Dec 4, 2021
ba572a4
tegra: libubootenv-fake: update to support tegra-boot-tools
madisongh Dec 4, 2021
18a79b8
tegra: libubootenv-fake: switch to using tegra-boot-tools
madisongh Dec 4, 2021
be4f21b
tegra: u-boot-mender-tegra: remove installed fw_env.config file
madisongh Dec 4, 2021
10f5634
tegra: tegra-minimal-init: import script change from meta-tegra-commu…
madisongh Dec 4, 2021
b3ec9d1
tegra: linux-tegra: import bbappend from meta-tegra-community
madisongh Dec 4, 2021
63b6757
tegra: mender-client: update runtime dependencies
madisongh Dec 4, 2021
c2bead2
tegra: tegra-state-scripts: remove unnecessary bbappend
madisongh Dec 4, 2021
6a26548
tegra: tegra-state-scripts: import updates from meta-tegra-community
madisongh Dec 4, 2021
a60c8ca
tegra: u-boot-tegra: drop runtime dependency addition
madisongh Dec 4, 2021
fdef10c
tegra: mender-client: update runtime dependencies
madisongh Dec 4, 2021
3807d75
tegra: tegra-bup-payload: switch to tegra-boot-tools-updater
madisongh Dec 4, 2021
b85dfba
tegra: tegra-mender-setup: undo MACHINE_ESSENTIAL_EXTRA_RDEPENDS changes
madisongh Dec 4, 2021
2240f22
tegra: mender-custom-flash-layout: import layouts for L4T R32.5.x, R3…
madisongh Dec 4, 2021
dbefdc6
tegra: u-boot-mender-tegra: add patches for L4T R32.5.2
madisongh Dec 4, 2021
06352d1
tegra: tegra-mender-setup: updates for L4T R32.5.x
madisongh Dec 4, 2021
d959235
tegra: u-boot-mender-tegra: update env offsets for L4T R32.5.x and later
madisongh Dec 4, 2021
ddd6dd7
tegra: u-boot-tegra: update for L4T R32.6.1
madisongh Dec 4, 2021
ceebe79
tegra: tegra-mender-setup: add compatibility settings
madisongh Dec 5, 2021
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
45 changes: 44 additions & 1 deletion meta-mender-tegra/classes/tegra-mender-setup.bbclass
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
inherit l4t_bsp

python () {
# insert l4t-mender-<version> as a machine-specific override for tegra platforms
machine_overrides = d.getVar('MACHINEOVERRIDES', False).split(':')
try:
i = machine_overrides.index('tegra')
l4t_ver = 'l4t-mender-%s' % d.getVar('L4T_VERSION').replace('.','-')
d.setVar('MACHINEOVERRIDES', ':'.join(machine_overrides[:i] + [l4t_ver] + machine_overrides[i:]))
except ValueError:
pass
}

def tegra_mender_set_rootfs_partsize(calc_rootfs_size_kb):
return calc_rootfs_size_kb * 1024

Expand Down Expand Up @@ -42,6 +55,16 @@ MENDER_ROOTFS_PART_B_NUMBER_DEFAULT_tegra210 = "${@'15' if (d.getVar('TEGRA_SPIF
MENDER_ROOTFS_PART_B_NUMBER_DEFAULT_jetson-nano-emmc = "18"
MENDER_ROOTFS_PART_B_NUMBER_DEFAULT_xavier-nx = "11"

# Machine name and flash layout changed for SDcard Nanos in L4T R32.5.x
MENDER_DATA_PART_NUMBER_DEFAULT_jetson-nano-devkit = "3"
MENDER_ROOTFS_PART_B_NUMBER_DEFAULT_jetson-nano-devkit = "2"
# Machine name changed for Nano-eMMC in L4T R32.5.x
MENDER_DATA_PART_NUMBER_DEFAULT_jetson-nano-devkit-emmc = "19"
MENDER_ROOTFS_PART_B_NUMBER_DEFAULT_jetson-nano-devkit-emmc = "18"
# Added in L4T R32.5.x
MENDER_DATA_PART_NUMBER_DEFAULT_jetson-nano-2gb-devkit = "4"
MENDER_ROOTFS_PART_B_NUMBER_DEFAULT_jetson-nano-2gb-devkit = "2"

# Use a 4096 byte alignment for support of tegraflash scheme and default partition locations
MENDER_PARTITION_ALIGNMENT = "4096"

Expand Down Expand Up @@ -98,7 +121,9 @@ def tegra_mender_calc_total_size(d):
return total_size_bytes // (1024*1024) - int(d.getVar('TEGRA_MENDER_RESERVED_SPACE_MB'))

MENDER_IMAGE_ROOTFS_SIZE_DEFAULT = "${@tegra_mender_image_rootfs_size(d)}"
TEGRA_MENDER_RESERVED_SPACE_MB ?= "1024"
TEGRA_MENDER_RESERVED_SPACE_MB_DEFAULT = "1024"
TEGRA_MENDER_RESERVED_SPACE_MB_DEFAULT_jetson-nano-2gb-devkit = "5120"
TEGRA_MENDER_RESERVED_SPACE_MB ?= "${TEGRA_MENDER_RESERVED_SPACE_MB_DEFAULT}"
MENDER_STORAGE_TOTAL_SIZE_MB_DEFAULT_tegra = "${@tegra_mender_calc_total_size(d)}"

def tegra_mender_uboot_feature(d):
Expand All @@ -109,3 +134,21 @@ def tegra_mender_uboot_feature(d):
_MENDER_IMAGE_DEPS_EXTRA = ""
_MENDER_IMAGE_DEPS_EXTRA_tegra = "tegra-state-scripts:do_deploy"
do_image_mender[depends] += "${_MENDER_IMAGE_DEPS_EXTRA}"

# mender-setup-image adds kernel-image and kernel-devicetree
# to MACHINE_ESSENTIAL_EXTRA_RDEPENDS, but they should *not*
# be included by default on cboot platforms.
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_remove_tegra194 = "kernel-image kernel-devicetree"
MACHINE_ESSENTIAL_EXTRA_RDEPENDS_remove_tegra186 = "${@'kernel-image kernel-devicetree' if (d.getVar('PREFERRED_PROVIDER_virtual/bootloader') or '').startswith('cboot') else ''}"

# Compatibility settings for handling the machine name changes
# made in L4T R32.5.x, to allow for upgrades. This does not
# include jetson-nano-qspi-sd (now jetson-nano-devkit) due to
# major changes in the flash layout.
MENDER_DEVICE_TYPES_COMPATIBLE_append_jetson-tx1-devkit = " jetson-tx1"
MENDER_DEVICE_TYPES_COMPATIBLE_append_jetson-tx2-devkit = " jetson-tx2"
MENDER_DEVICE_TYPES_COMPATIBLE_append_jetson-tx2-devkit-tx2i = " jetson-tx2i"
MENDER_DEVICE_TYPES_COMPATIBLE_append_jetson-tx2-devkit-4gb = " jetson-tx2-4gb"
MENDER_DEVICE_TYPES_COMPATIBLE_append_jetson-agx-xavier-devkit = " jetson-xavier"
MENDER_DEVICE_TYPES_COMPATIBLE_append_jetson-agx-xavier-devkit-8gb = " jetson-xavier-8gb"
MENDER_DEVICE_TYPES_COMPATIBLE_append_jetson-nano-devkit-emmc = " jetson-nano-emmc"
Original file line number Diff line number Diff line change
@@ -0,0 +1,272 @@
<?xml version="1.0"?>

<!-- Nvidia Tegra Partition Layout Version 1.0.0 -->

<partition_layout version="01.00.0000">
<device type="spi" instance="0">
<partition name="BCT" type="boot_config_table">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 262144 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Contains Boot Configuration Table (BCT). </description>
</partition>

<partition name="NXC" type="NVCTYPE">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 196608 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> NVCFILE </filename>
<description> **Required.** Contains TegraBoot binary. </description>
</partition>

<partition name="PT" type="partition_table">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 65536 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> flash.xml.bin </filename>
<description> **Required.** Contains Partition Table. </description>
</partition>

<partition name="NXC_R" type="NVCTYPE">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 196608 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> NVCFILE </filename>
<description> **Required.** Contains a redundant copy of the TegraBoot
binary. </description>
</partition>

<partition name="TXC" type="TBCTYPE">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 131072 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> TBCFILE </filename>
<description> **Required.** Contains TegraBoot CPU-side binary. </description>
</partition>

<partition name="RP1" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 327680 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> DTBFILE </filename>
<description> **Required.** Contains Bootloader DTB binary. </description>
</partition>

<partition name="EBT" type="bootloader">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 589824 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> EBTFILE </filename>
<description> **Required.** Contains CBoot, the final boot stage CPU bootloader
binary that loads the binary in the kernel partition.. </description>
</partition>

<partition name="WX0" type="WB0TYPE">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 65536 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> WB0FILE </filename>
<description> **Required.** Contains warm boot binary. </description>
</partition>

<partition name="BXF" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 196608 </size>
<file_system_attribute> 0 </file_system_attribute>
<partition_attribute> 0 </partition_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> BPFFILE </filename>
<description> **Required.** Contains SC7 entry firmware. </description>
</partition>

<partition name="BXF-DTB" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 65536 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> BPFDTB-FILE </filename>
<description> **Optional.** Reserved for future use by BPMP DTB binary;
can't remove. </description>
</partition>

<partition name="TXS" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 458752 </size>
<file_system_attribute> 0 </file_system_attribute>
<partition_attribute> 0 </partition_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> TOSFILE </filename>
<description> **Required.** Contains TOS binary. </description>
</partition>

<partition name="DXB" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 327680 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> DTBFILE </filename>
<description> **Required.** Contains kernel DTB binary. </description>
</partition>

<partition name="LNX" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 753664 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> LNXFILE </filename>
<description> **Required.** Contains U-Boot, which loads and launches the kernel from
the rootfs at `/boot`. </description>
</partition>

<partition name="RP4" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 131072 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> rp4.blob </filename>
<description> **Required.** Contains XUSB firmware file, making XUSB
a true USB 3.0 compliant host controller. </description>
</partition>

<partition name="UBENV" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<start_location> 0x3B0000 </start_location>
<size> 131072 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> U-Boot environment area </description>
</partition>

<partition name="VER_b" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<start_location> 0x3E0000 </start_location>
<size> 32768 </size>
<file_system_attribute> 0 </file_system_attribute>
<partition_attribute> 0 </partition_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> VERFILE </filename>
<description> **Required.** Contains a redundant copy of BSP version
information. </description>
</partition>

<partition name="VER" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<start_location> 0x3F0000 </start_location>
<size> 32768 </size>
<file_system_attribute> 0 </file_system_attribute>
<partition_attribute> 0 </partition_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<filename> VERFILE </filename>
<description> **Required.** Contains BSP version information. </description>
</partition>

</device>
<device type="sdcard" instance="0">
<partition name="GP1" type="GP1">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 2097152 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Contains primary GPT of the `sdcard` device. All
partitions defined after this entry are configured in the kernel, and are accessible
by standard partition tools such as gdisk and parted. </description>
</partition>

<partition name="APP" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> APPSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<align_boundary> 4096 </align_boundary>
<filename> APPFILE </filename>
<description> **Required.** Contains the rootfs. This partition must be defined after
`primary_GPT` so that it can be accessed as the fixed known special device
`/dev/mmcblk0p1`. </description>
</partition>

<partition name="APP_b" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> APPSIZE </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<align_boundary> 4096 </align_boundary>
<filename> APPFILE </filename>
</partition>

<partition name="SWAP" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 4294967296 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 0x8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<align_boundary> 4096 </align_boundary>
</partition>

<partition name="UDA" type="data">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 2097152 </size>
<allocation_attribute> 0x808 </allocation_attribute>
<filename> DATAFILE </filename>
</partition>

<partition name="GPT" type="GPT">
<allocation_policy> sequential </allocation_policy>
<filesystem_type> basic </filesystem_type>
<size> 2097152 </size>
<file_system_attribute> 0 </file_system_attribute>
<allocation_attribute> 8 </allocation_attribute>
<percent_reserved> 0 </percent_reserved>
<description> **Required.** Contains secondary GPT of the `sdcard` device. </description>
</partition>
</device>
</partition_layout>
Loading