Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Princemachiavelli committed Jun 17, 2024
1 parent fd15130 commit 029b421
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 34 deletions.
51 changes: 26 additions & 25 deletions device-pkgs/default.nix
Original file line number Diff line number Diff line change
Expand Up @@ -99,9 +99,9 @@ let
export BOARDSKU=${variant.boardsku}
export FAB=${variant.fab}
export BOARDREV=${variant.boardrev}
${lib.optionalString (variant.chipsku != null) ''
${lib.optionalString (variant.chipsku != null) ''
export CHIP_SKU=${toString variant.chipsku}
''}
''}
export CHIPREV=${variant.chiprev}
${cfg.firmware.secureBoot.preSignCommands}
Expand Down Expand Up @@ -215,33 +215,34 @@ let
}
(mkFlashScript {
flashCommands = cfg.firmware.secureBoot.preSignCommands + lib.concatMapStringsSep "\n"
(v: with v; ''
(v: with v;
''
BOARDID=${boardid} BOARDSKU=${boardsku} FAB=${fab} BOARDREV=${boardrev} FUSELEVEL=${fuselevel} CHIPREV=${chiprev} ${lib.optionalString (chipsku != null) "CHIP_SKU=${builtins.toString chipsku}"} ./flash.sh ${lib.optionalString (partitionTemplate != null) "-c flash.xml"} --no-root-check --no-flash --sign ${builtins.toString flashArgs}
# TODO: ideally we would add chipsku to the boardspec for flashFromDevice to match against but
# tegra-boardspec does not read the chipsku from EEPROM so we cannot match against it.
# The CHIP_SKU only determines BPFFILE which is the same within a given SOM family (orin-nx, orin-nano, etc.);
# since we already seperate Orin NX and Orin Nano, we don't have to worry about using incorrect BPFFILE.
outdir=$out/${boardid}-${fab}-${boardsku}-${boardrev}-${if fuselevel == "fuselevel_production" then "1" else "0"}-${chiprev}--
mkdir -p $outdir
cp -v bootloader/signed/flash.idx $outdir/
# Copy files referenced by flash.idx
while IFS=", " read -r partnumber partloc start_location partsize partfile partattrs partsha; do
if [[ "$partfile" != "" ]]; then
if [[ -f "bootloader/signed/$partfile" ]]; then
cp -v "bootloader/signed/$partfile" $outdir/
elif [[ -f "bootloader/$partfile" ]]; then
cp -v "bootloader/$partfile" $outdir/
else
echo "Unable to find $partfile"
exit 1
# TODO: ideally we would add chipsku to the boardspec for flashFromDevice to match against but
# tegra-boardspec does not read the chipsku from EEPROM so we cannot match against it.
# The CHIP_SKU only determines BPFFILE which is the same within a given SOM family (orin-nx, orin-nano, etc.);
# since we already seperate Orin NX and Orin Nano, we don't have to worry about using incorrect BPFFILE.
outdir=$out/${boardid}-${fab}-${boardsku}-${boardrev}-${if fuselevel == "fuselevel_production" then "1" else "0"}-${chiprev}--
mkdir -p $outdir
cp -v bootloader/signed/flash.idx $outdir/
# Copy files referenced by flash.idx
while IFS=", " read -r partnumber partloc start_location partsize partfile partattrs partsha; do
if [[ "$partfile" != "" ]]; then
if [[ -f "bootloader/signed/$partfile" ]]; then
cp -v "bootloader/signed/$partfile" $outdir/
elif [[ -f "bootloader/$partfile" ]]; then
cp -v "bootloader/$partfile" $outdir/
else
echo "Unable to find $partfile"
exit 1
fi
fi
fi
done < bootloader/signed/flash.idx
done < bootloader/signed/flash.idx
rm -rf bootloader/signed
rm -rf bootloader/signed
'')
cfg.firmware.variants;
});
Expand Down
18 changes: 9 additions & 9 deletions modules/flash-script.nix
Original file line number Diff line number Diff line change
Expand Up @@ -385,24 +385,24 @@ in
];

orin-agx = [
{ boardid = "3701"; boardsku = "0000"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D0"; }
{ boardid = "3701"; boardsku = "0004"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D2"; } # 32GB
{ boardid = "3701"; boardsku = "0005"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D0"; } # 64GB
{ boardid = "3701"; boardsku = "0000"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D0"; }
{ boardid = "3701"; boardsku = "0004"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D2"; } # 32GB
{ boardid = "3701"; boardsku = "0005"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D0"; } # 64GB
];

orin-agx-industrial = [
{ boardid = "3701"; boardsku = "0008"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:90"; }
{ boardid = "3701"; boardsku = "0008"; fab = "300"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:90"; }
];

orin-nx = [
{ boardid = "3767"; boardsku = "0000"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D3";} # Orin NX 16GB
{ boardid = "3767"; boardsku = "0001"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D4";} # Orin NX 8GB
{ boardid = "3767"; boardsku = "0000"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D3"; } # Orin NX 16GB
{ boardid = "3767"; boardsku = "0001"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D4"; } # Orin NX 8GB
];

orin-nano = [
{ boardid = "3767"; boardsku = "0003"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D5"; } # Orin Nano 8GB
{ boardid = "3767"; boardsku = "0004"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D6"; } # Orin Nano 4GB
{ boardid = "3767"; boardsku = "0005"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku="00:00:00:D5"; } # Orin Nano devkit module
{ boardid = "3767"; boardsku = "0003"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D5"; } # Orin Nano 8GB
{ boardid = "3767"; boardsku = "0004"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D6"; } # Orin Nano 4GB
{ boardid = "3767"; boardsku = "0005"; fab = "000"; boardrev = ""; fuselevel = "fuselevel_production"; chiprev = ""; chipsku = "00:00:00:D5"; } # Orin Nano devkit module
];
}.${cfg.som}
)) else lib.mkOptionDefault [ ];
Expand Down

0 comments on commit 029b421

Please sign in to comment.