Skip to content

Commit

Permalink
tegra-flashvars: add support for TEGRA_FLASH_CHECK variables
Browse files Browse the repository at this point in the history
which we can use to prevent mis-flashing when the selected
machine configuration doesn't match the actual target hardware.

Signed-off-by: Matt Madison <matt@madison.systems>
  • Loading branch information
madisongh committed Nov 10, 2024
1 parent 406f96b commit 44ba2b9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion recipes-bsp/tegra-binaries/tegra-flashvars_36.4.0.bb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,10 @@ def generate_flashvar_settings(d):
need_subst = ' '.join([v for v in vars if '@' in d.getVar('TEGRA_FLASHVAR_' + v)])
result = 'FLASHVARS="{}"\nOVERLAY_DTB_FILE="{}"\n'.format(need_subst, d.getVar('OVERLAY_DTB_FILE'))
result += 'CHIPID={}\nPLUGIN_MANAGER_OVERLAYS="{}"\n'.format(d.getVar('NVIDIA_CHIP'), ','.join(d.getVar('TEGRA_PLUGIN_MANAGER_OVERLAYS').split()))
result += '\n'.join(['{}="{}"'.format(v, d.getVar('TEGRA_FLASHVAR_' + v)) for v in d.getVar('TEGRA_FLASHVARS').split() if d.getVar('TEGRA_FLASHVAR_' + v)])
flashvar_values = '\n'.join(['{}="{}"'.format(v, d.getVar('TEGRA_FLASHVAR_' + v)) for v in d.getVar('TEGRA_FLASHVARS').split() if d.getVar('TEGRA_FLASHVAR_' + v)])
if flashvar_values:
result += flashvar_values + '\n'
result += '\n'.join(['CHECK_{}="{}"'.format(v, d.getVar('TEGRA_FLASH_CHECK_' + v)) for v in d.getVar('TEGRA_FLASH_CHECK_VARS').split() if d.getVar('TEGRA_FLASH_CHECK_' + v)])
return result

INHIBIT_DEFAULT_DEPS = "1"
Expand All @@ -26,6 +29,7 @@ ${@generate_flashvar_settings(d)}
EOF
}
do_compile[vardeps] += "TEGRA_FLASHVARS ${@' '.join(['TEGRA_FLASHVAR_' + v for v in d.getVar('TEGRA_FLASHVARS').split()])}"
do_compile[vardeps] += "TEGRA_FLASH_CHECK_VARS ${@' '.join(['TEGRA_FLASH_CHECK_' + v for v in d.getVar('TEGRA_FLASH_CHECK_VARS').split()])}"

do_install() {
install -d ${D}${datadir}/tegraflash
Expand Down

0 comments on commit 44ba2b9

Please sign in to comment.