Adding a Device Tree Overlay for an i2c driver to the Orin AGX

I’ve looked through a number of forum posts about device-tree overlays but I haven’t been able to find exactly what I’m looking for. I’m using a ConnectTech Rogue Carrier Board for the Orin AGX and I’m trying to ADD an overlay for the pinctrl_mcp23s08 driver. The devices that will use the pinctrl_mcp23s08 driver is located on i2c bus 0.

Ideally what I want to do is:

  1. keep the original .dtb file intact (kernel_tegra234-orin-agx-cti-AGX202.dtb)
  2. I want to add an overlay .dtbo to the /boot/dtb directory specifically for the pinctrl_mcp23s08 driver that gets added to the orignal .dtb.
  3. Update /boot/extlinux/extlinux.conf such that it to points to the original .dtb file but also pulls in the new overlay file.

I was able to do a “hack” method to get everything to work. I was able to do the following procedure to get everything working correctly:

  1. I Decompile kernel_tegra234-orin-agx-cti-AGX202.dtb into a .dts file. (This is the original .dtb file on my system)
  2. Inside the newly created .dts file, I added the necessary lines of code in the i2c@3160000 section and saved the updated .dts file as kernel_tegra234-orin-agx-cti-AGX202_Updated.dts.
  3. I then Recompile kernel_tegra234-orin-agx-cti-AGX202_Updated.dts as a .dtb and put this new compilation in /boot/dtb.
  4. I then changed the “FDT” line in the extlinux.conf file to reference kernel_tegra234-orin-agx-cti-AGX202_Updated.dtb.
  5. When I reboot the driver is reference correctly and everything works as expect.

This second procedure works but it’s NOT the best method to use when adding new drivers. I can’t quite figure out why my first method is not working correctly. I’m sure I have some error or forgot some step in my procedure. I just don’t know what it is.

To show exactly what I’ve done, I’ve included the following files.
kernel_tegra234-orin-agx-cti-AGX202_Updated.txt. - This is the hacked together device tree file (.dts) that adds the mcp23s08 driver to i2c@3160000{ };. This is the file that works.

orin_mcp23s08_ol2.txt - which is my overlay device tree file(.dts) for the mcp23s08 driver.

extlinux.conf.txt - which is extlinux.conf with the changes to try and include the overlay compilation of orin_mcp23s08_ol2.dts.

EXTLINUX.CONF.TXT
extlinux.conf.txt (1.1 KB)

ORIN_MCP23S08_OL2.TXT
orin_mcp23s08_ol2.txt (1.1 KB)

ORIGINAL DEVICE TREE
kernel_tegra234-orin-agx-cti-AGX202_Updated.txt (417.4 KB)

Thank you.

Hi joe.cely,

What your Jetpack version in use?

	  FDTOVERLAYS /boot/dtd/Orin_mcp23s08_dt_overlay.dtbo

In your extlinux.conf, it seems you have typo. Please try modify dtd to dtb and verify again.

Thanks for the reply KevinFFF.

image

I corrected the folder path from /boot/dtd to /boot/dtb but that didn’t work. I also tried to rebuild Orin_mcp23s08_dt_overlay and name it .dtb instead of .dtbo but this did not fix the problem either. I looked over dmesg but I don’t see any errors.

Have you tried to add overlay dtb in board config as following?

OVERLAY_DTB_FILE="Orin_mcp23s08_dt_overlay.dtbo"

and reflash the board to apply the change.

Or try using Jetson-IO to apply overlay dtbo as Device Tree Overlays

You’re suggestion about changing the FDTOVERLAYS to OVERLAY_DTB_FILE was the solution. My final board configuration looks like this.

Thanks for the Help

What I mean should be adding it to the board configuration file like jetson-agx-orin-devkit.conf before flash rather than extlinux.conf.

Is the current approach meeting your use case?

jetson-agx-orin-devkit.conf doesn’t exist on my platform. I’m using the Orin AGX platform but the Carrier isn’t the NVIDIA Dev board, it’s the Rogue Carrier sold by ConnectTech. This could have something to do with the file not being present.
Yes, updating the extlinux.conf file with that variable change is meeting our use case.
thank you

1 Like

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