Custom Carrier Board Pinmux and DTS Process

dtb_patchbuilder.tgz (3.5 KB)
I’ve attached the script I used to build the update from the dtsi files. Take a look at build.sh to see the steps to build the .dtb files. Particularly the __build_dtb function starting on line 103

In my case, I replaced the 4 files:
cp -v "${GPIO}" tmp/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0000-b00.dtsi
cp -v "${GPIO}" tmp/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-gpio-p3448-0002-b00.dtsi
cp -v "${PINMUX}" tmp/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0000-b00.dtsi
cp -v "${PINMUX}" tmp/hardware/nvidia/platform/t210/porg/kernel-dts/porg-platforms/tegra210-porg-pinmux-p3448-0002-b00.dtsi

and then when I built the bootloader update package (bup) I made sure to replace all 3 Nano .dtb files.

If the date is showing correctly and the configuration still isn’t correct, it’s possible your changes didn’t actually get loaded into the new dtb (just a guess).

Also, poke around in /proc/device-tree, which is a reflection of the actual device tree configuration in use.

for example:
cat /proc/device-tree/nvidia,dtbbuildtime
is an alternative method to check the date of the actual loaded device tree.
cat /proc/device-tree/nvidia,dtsfilename
will show the file name of the dts file used, in case a different .dtb file other than expected has been loaded.

Lastly, use the following command to export the active devicetree configuration to a text file
dtc -I fs -O dts -o /root/active_devicetree_config.dts /proc/device-tree

Then review the resultant /root/active_devicetree_config.dts and compare some of the changes from your .dtsi files to the contents of the dts file and make sure they are as expected. If something between the .dts file and your .dtsi files doesn’t match, then the .dtsi files were not incorporated into the currently loaded device tree.

If you put your .dtsi files in the same directory as the files in the .tgz I shared above and then run the script, it will create a single .sh file that you can use that should definitively load your changes.

It was tested with the previous version of Tegra, 4.5.1, but it should work with 4.6. Either way, the script will also download the necessary files to complete all the steps, including building the new .dtb and bootloader update, and package it all neatly for you into a single .sh file that can be run on your Nano to push the changes.

Make sure you also pin some deb packages, otherwise if you update them your changes will be overwritten:

apt-mark hold nvidia-l4t-bootloader nvidia-l4t-kernel-dtbs nvidia-l4t-kernel

should work to prevent any unwanted package updates that could unravel your changes, though this is what I’m currently working on and haven’t fully tested this hypothesis yet. That said, before pushing your changes, make sure the system is updated as preferred. Any future updates to those 3 packages will require you to re-run the bupdate.sh, which SHOULD reimplement your changes with the new kernel packages - but also, untested as of right now.

2 Likes