workaround for encrypted device tree in Nvidia Jetson Nano

Hi,

I had to develop a system based on Nvidia Jetson Nano board, which required compilation of my own drivers and modification of original device tree.
Unfortunately, it appeared that the original development envirnoment was very unconvenient. E.g., I was forced to install closed source binaries (like “SDK manager”) and give them root access to my development host.
I have found the scripts that allow me to compile the kernel and modules on jetson itself: https://github.com/JetsonHacksNano/buildKernelAndModules
However, I was not able to compile and encrypt the Device Tree.
Fortunately, it appeared, that I can patch the 4.9 kernel used in JetPack 4.2.2, L4T 32.2.1 with a patch enabling the configfs access to the Device Tree overlays.
I have used the patch available at https://raw.githubusercontent.com/xieyaxiongfly/Atheros_CSI_tool_OpenWRT_src_bkup/master/target/linux/brcm2708/patches-4.9/950-0090-OF-DT-Overlay-configfs-interface.patch
After that I was able to switch on the configfs access to DT overlays (CONFIG_OF_CONFIGFS=y).
When Jetson booted, I simply mounted configfs

mkdir /config

mount -t configfs none /config

And then I was able to load my DT overlays.

mkdir /config/device-tree/overlays/ovl1

cat ovl_1.dtbo > /config/device-tree/overlays/ovl1/dtbo

and unload them:

rmdir /config/device-tree/overlays/ovl1

That significantly improved the speed of the development.
I hope that this trick may be also useful for others.

Regards,
Wojtek

1 Like

hello WZab,

you may also found a similar discussion thread to generate DTB file on Nano itself, Topic 1064654.
please also note that this tool should depends-on JetPack release,
thanks

Thanks for this tool @WZab !

Did you write device tree overlays succesfully?

I’m having trouble to write some because I cannot find examples.
The examples which are in the kernel Image downloaded by SDK have hexadecimal adresses as targets, which I don’t understand.

Any help appreciated !

Best,
Manu

@WZab I never knew about configfs, This is awesome, Thanks a lot for sharing!