Secureboot with R35.6 BSP

Hi,

I have been trying to use R35.6 BSP(https://developer.nvidia.com/downloads/embedded/l4t/r35_release_v6.0/release/jetson_linux_r35.6.0_aarch64.tbz2) with secureboot with a fused Jetson NX custom board.
The board has been fused successfully and the same keys has been used to flash the Jetson board. Although there is no error while flashing, the board doesn’t boot up after flash and a blank black monitor appears only.

The rootfs is not even modified by me. It is the sample rootfs provided with the R35.6. (https://developer.nvidia.com/downloads/embedded/l4t/r35_release_v6.0/release/tegra_linux_sample-root-filesystem_r35.6.0_aarch64.tbz2). However, flashing the same fused board with older BSP 35.4.1 with secureboot works fine.

I also tried to flash the same rootfs without secureboot on an unfused jetson, then it works perfectly fine.

Command used to generate the Massflash image for jetson:

sudo BOARDID=3668 FAB=100 BOARDSKU=0001 BOARDREV=B.0 ./tools/kernel_flash/l4t_initrd_flash.sh -u ./jetson.pem -v ./sbk_key.txt --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_t194_nvme.xml -S 40GiB --no-flash --massflash 8 --showlogs jetson-xavier-nx-devkit-emmc nvme0n1p1

Flashing the jetson:

sudo ./tools/kernel_flash/l4t_initrd_flash.sh --flash-only --massflash 1

sample sbk_key.txt :
0x00000000 0x11111111 0x22222222 0x33333333

Configuration file:
flash_l4t_t194_nvme.txt (10.3 KB)

I also attach the flash logs.
flash_1-6_0_20241108-174412.log (56.0 KB)

Unfortunately, I cannot get the boot logs via serial console as the debug port currently not working with my custom board.

Could you please let me know what could I have been doing wrong or is there anything changed relevant to secureboot in new BSP 35.6.0 ?

Note: I also checked the BSP 35.5.0 and the behaviour is same with secureboot.

Thank you

hello adit_bhrgv,

may I know what’s the authentication status.
please double check the BootSecurityInfo you’ve fuse to the target. i.e. FUSE_BOOT_SECURITY_INFO.

Command used to fuse the jetson board permanently:

sudo ./odmfuse.sh  -i 0x19 -j -p -k ./jetson.pem -S ./sbk_key.txt –KEK0 ./keys/kek0.txt –KEK1 ./keys/kek1.txt  –KEK2 ./keys/kek2.txt jetson-xavier-nx-devkit-emmc

Sample Xavier NX fuse file to program the RSA-3K Key + SBK Key + KEK Key. Ofcourse our keys are different

<genericfuse MagicId="0x45535546" version="1.0.0">
    <fuse name="PublicKeyHash" size="32" value="0x999585e628c285a5dfdd2bd201fa878d8e62e6c4eb842d81d1a026b22cd6e8f0"/>
    <fuse name="Kek0" size="16" value="0x112233445566778899AABBCCDDEEFF00"/>
    <fuse name="Kek1" size="16" value="0x123456789ABCDEF0FEDCBA9876543210"/>
    <fuse name="Kek2" size="16" value="0x123456789ABCDEF0FEDCBA9876543211"/>
    <fuse name="SecureBootKey" size="16" value="0x123456789ABCDEF0FEDCBA9876543210"/>
    <fuse name="BootSecurityInfo" size="4" value="0x06"/>
    <fuse name="SecurityMode" size="4" value="0x1"/>
</genericfuse>

We used the BootSecurityInfo as in our secure_fuse.xml :

 <fuse name="BootSecurityInfo" size="4" value="0x6"/>

hello adit_bhrgv,

please re-create EKS image (i.e. eks_t194.img), since you’re using a customize KEK2.
you may visit jetson-linux-r3560 to download [Driver Package (BSP) Sources].
please extract op-tee package, you may see-also below as an example,
$public_sources/r35.6.0/Linux_for_Tegra/source/public/atf_and_optee/optee/samples/hwkey-agent/host/tool/gen_ekb/example.sh

python3 gen_ekb.py -chip t194 -kek2_key kek2.key \
        -fv fv_ekb_t194 \
        -in_sym_key sym_t194.key \
        -in_sym_key2 sym2_t194.key \
        -in_auth_key auth_t194.key \
        -out eks_t194.img

please re-flash the target completely after EKS image update.

Regenerated the eks_t194.img with our keys and copied it to the bootloader folder. Still I see no output on the monitor after flashing is finished , not even UEFI Boot Menu.

python3 gen_ekb.py -chip t194 -kek2_key kek2.txt -fv fv_ekb_t194 -in_sym_key sym_t194.key -in_sym_key2 sym2_t194.key -out eks_t194.img

cp eks_t194.img /freshbsp35.6/Linux_for_Tegra/bootloader/

Question : ** In the command above, “-in_auth_key auth_t194.key” I haven’t used this key in r35.4.1 , but it is present in example.sh in r35.6.0. Do I need this key ?

#Generated internal image

sudo BOARDID=3668 FAB=100 BOARDSKU=0001 BOARDREV=B.0 ./tools/kernel_flash/l4t_initrd_flash.sh -p "-c bootloader/t186ref/cfg/flash_l4t_t194_qspi_p3668.xml" -u ./jetson.pem -v ./sbk_key.txt --showlogs --no-flash jetson-xavier-nx-devkit-emmc internal

Note: in ./flash.sh, to generate the mass flash images in offline mode, we hard-coded some random ECID from a random jetson board. It works for us everytime (with r35.4.1 BSP) when we flash the image created using it to some other jetson board too. If we don’t do this, we need to set the jetson in recovery mode again.

 # ECID=$(./${rcmcmd} ${extra_args} ${inst_args} --uid | grep BR_CID | cut -d' ' -f2);
        
   ECID=0x880219116411f187180000000a000280;

#Generated external image and appended internal image

sudo ADDITIONAL_DTB_OVERLAY_OPT="BootOrderNvme.dtbo" BOARDID=3668 FAB=100 BOARDSKU=0001 BOARDREV=B.0 ./tools/kernel_flash/l4t_initrd_flash.sh -u ./jetson.pem -v ./sbk_key.key  --external-device nvme0n1p1 -c ./tools/kernel_flash/flash_l4t_nvme.xml -S 40GiB --no-flash --massflash 8 --append --external-only --showlogs jetson-xavier-nx-devkit-emmc external```

Flashing Logs: 

[flash_1-6_0_20241113-175348.log|attachment](upload://nLYhaFgRSnY0AdKfXi2uDKW4vbC.log) (39.5 KB)

hello adit_bhrgv,

yes, please keep using those default keys to re-create EKS image.

is it possible for setting up serial console? we need logs to identify the issue.

I used our Kek2, sym_t194.key and sym2_t194.key keys to generate the EKS image but I haven’t given any auth_t194.key . Should I just give default auth key as :

echo "00000000000000000000000000000000" > auth_t194.key

and regenerate the EKS image ?

Since, it is a custom board, there is a debug port but the logs don’t come on the minicom. I am talking to vendor regarding this. They suggested to modify below patch in “kernel_tegra194-p3668-0001-p3509-0000.dtb” file and recompile it:

			serial@3100000 {
-		        compatible = "nvidia,tegra186-hsuart";
+               compatible = "nvidia,tegra20-uart";
+               console-port;
+               sqa-automation-port;
                iommus = <0x02 0x20>;
                interconnects = <0x03 0x16>;
                interconnect-names = "dma-mem";
                dma-coherent;
                reg = <0x00 0x3100000 0x00 0x10000>;
                reg-shift = <0x02>;
                interrupts = <0x00 0x70 0x04>;
                nvidia,memory-clients = <0x0e>;
                dmas = <0x1b 0x08 0x1b 0x08>;
                dma-names = "rx\0tx";
                clocks = <0x04 0x9b 0x04 0x66>;
                clock-names = "serial\0parent";
                assigned-clocks = <0x04 0x9b>;
                assigned-clock-parents = <0x04 0x66>;
-								resets = <0x04 0x64>;
-               reset-names = "serial";                
                nvidia,adjust-baud-rates = <0x1c200 0x1c200 0x64>;
                status = "okay";
                phandle = <0x2b8>;
        };

Modify extlinux.conf afterwards:

$ cd /boot/extlinux/
>> EDIT FILE : extlinux.conf
------------------------------------------------
<before>
APPEND ${cbootargs} root=/dev/nvme0n1p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=efifb:off nospectre_bhb
<after>
APPEND ${cbootargs} root=/dev/nvme0n1p1 rw rootwait rootfstype=ext4 console=ttyTCU0,115200n8 console=tty0 fbcon=map:0 net.ifnames=0 video=efifb:off nospectre_bhb console=ttyS0,115200n8

#sync
#reboot system

I did these steps, still I don’t see any output on serial console. I am using FTDI 3.3V serial cable connecting GND->GND, TX->RX and RX->TX . Is this modification of dtb and extlinux correct ? Do I need to do something else ?

One more question: while fusing the board, if “jtag_disable” fuse has been set to 1. Does it block the debug output on the debug port ? If yes, can I somehow refuse this fuse and enable it ?

Thanks

hello adit_bhrgv,

yes, it’s please using all 0s as default auth_t194.key.

it’s disabling JTAG (4-pin connector), UART should be still available for the logs.


anyways, may I know how you re-flash the targets? please give it another try by running `flash.sh`, since flash script also support image flashing with Xavier NX series.
1 Like

I used this auth_t194.key with all 0’s and now it WORKS ! The jetson could bootup with new BSP 35.6.0(secureboot + disk encryption )
Could you please let me know what is this key for ? And why it needs to be all 0’s even for a fused jetson board ?

Thank you again for your support !

hello adit_bhrgv,

this is UEFI payload authentication key file, which by default configured as all 0s. you may refer to UEFI Secureboot for more details.
let’s close this discussion thread, please open a new topic for further supports.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.