I2C touchscreen driver overlay, fdtoverlay tool fails with error: FDT_ERR_NOTFOUND

Hi folks,

I am trying to get the Ilitek ILI2511 I2C touchscreen driver working on a Jetson Nano Dev Kit running JP5, using a device tree overlay on top of a known-working base device tree generated by the jetson-io tool and I am getting a rather unhelpful error message (FDT_ERR_NOTFOUND) when runing fdtoverlay. Wondering if you could help me troubleshoot this.

Jetpack and Kernel Version:

$ sudo apt-cache show nvidia-jetpack | grep Version
Version: 5.1.3-b29
$ uname -a 
Linux nvdk-1 5.10.192-tegra #1 SMP PREEMPT Tue Apr 23 17:12:18 PDT 2024 aarch64 aarch64 aarch64 GNU/Linux

The ili210x kernel module is compiled and loaded:

$ lsmod | grep ili
ili210x                16384  0

The 40P header is configured using the jetson-io tool to enable I2C and a few other peripherals, this resulted in the DTB kernel_tegra234-p3767-0003-p3768-0000-a0-user-custom.dtb being generated and an entry being added to /boot/extlinux/extlinux.conf.

To ensure I2C works, I’ve connected a 24 series EEPROM and it is indeed detected:

$ sudo i2cdetect -y -r 7
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- -- 
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
50: 50 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 
70: -- -- -- -- -- -- -- --                        

(Side note: jetson-io refers to the I2C port on 40P header pins 3,5 as i2c8 but the i2cdetect tool thinks this is port 7)

With I2C working, I created a very simple overlay:

/dts-v1/;
 
/ {
    overlay-name = "DTS Overlay Test";
    compatible = "nvidia,p3768-0000+p3767-0003";
 
    fragment@0 {
        target-path = "/";
        __overlay__ {
            custom-board-version = "V1";
        };
    };
};

Compiled and merged it with the base DTB:

dtc -I dts -O dtb version-overlay.dts -o version-overlay.dtb
fdtoverlay -i kernel_tegra234-p3767-0003-p3768-0000-a0-user-custom.dtb -o custom-board-v1.dtb version-overlay.dtb

Copied this merged DTB to /boot and referenced it in the entry I created in /boot/extlinux/extlinux.conf and restarted the devkit.

Confirmed that the merged device tree worked:

cat /proc/device-tree/custom-board-version
V1

So, at this point I am confident that fdtoverlay works, and I can boot this board with my custom DTB.

Next step is to work on the ILI2511 overlay, here’s the physical connections I am using:

I2C SDA    PDD.02  GP16_I2C8_DAT    40P Header Physical Pin 3
I2C SCL    PDD.01  GP15_I2C8_CLK    40P Header Physical Pin 5
Interrupt  PY.00   GP36_SPI3_CLK    40P Header Physical Pin 13
Reset      PY.04   GP40_SPI3_CS1_N  40P Header Physical Pin 16

I notice that we need to use pin numbers in the DTS, so used the following to get the correct GPIO numbers:

Interrupt: PY.00
$ sudo cat /sys/kernel/debug/gpio | grep PY.00
 gpio-470 (PY.00               )

Reset: PY.04
$ sudo cat /sys/kernel/debug/gpio | grep PY.04
 gpio-474 (PY.04               )

And put together the overlay:

// Ref: https://github.com/torvalds/linux/blob/v5.10/Documentation/devicetree/bindings/input/ilitek%2Cili2xxx.txt
/dts-v1/;
/plugin/;

 / {
    overlay-name = "ILI2511 I2C Touch Overlay";
    compatible = "nvidia,p3768-0000+p3767-0003";

 	fragment@0 {
		target = <&i2c8>;
		__overlay__ {
			#address-cells = <1>;
			#size-cells = <0>;
			status = "okay";

 			ili251x: ili251x@41 {
				compatible = "ilitek,ili251x";
				reg = <0x41>;
                interrupt-parent = <&gpio>;
                interrupts = <470 2>;  // gpio-470 (PY.000), 2: IRQ_TYPE_EDGE_FALLING
                reset-gpios = <&gpio 474 0>; // gpio-474 (PY.04), 0: GPIO_ACTIVE_LOW ????
				touchscreen-size-x = <16384>;
				touchscreen-size-y = <9600>;
			};
		};
	};

};

Like I did with the quick test overlay, I compile it and try to merge it with the base DTB:

dtc -I dts -O dtb ilitek251x-overlay.dts -o ilitek251x-overlay.dtb

This compiles fine, no errors.

$ fdtoverlay -i kernel_tegra234-p3767-0003-p3768-0000-a0-user-custom.dtb -o custom-board-v1.dtb version-overlay.dtb ilitek251x-overlay.dtb

This fails with:

Failed to apply 'ilitek251x-overlay.dtb': FDT_ERR_NOTFOUND

I am guessing it has something to do with how I am addressing things inside the overlay, but I am a bit lost.

Pointers/comments much appreciated.

kernel_tegra234-p3767-0003-p3768-0000-a0-user-custom.zip (54.1 KB) attached, in case it is helpful.

Thanks.

hello ok_w,

this usually due to one of incorrect property in your device tree.
please examine those GPIO definitions, I double the failure is caused by… interrupt-parent = <&gpio>;

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