Jetson nano I2C pinmux

Hi,
I’m working on custom Nano board bsp and have a question about the I2C pinmux and device tree configuration.
In Xavier NX, there is a file in Jetson\r3531\hardware\nvidia\soc\t19x\kernel-dts\tegra194-soc\tegra194-soc-i2c.dtsi to describe the i2c node and its register such as

i2c0 = &gen1_i2c;
gen1_i2c: i2c@3160000 {
		#address-cells = <1>;
		#size-cells = <0>;
		iommus = <&smmu TEGRA_SID_GPCDMA_0>;
		dma-coherent;
		compatible = "nvidia,tegra194-i2c";
		reg = <0x0 0x3160000 0x0 0x100>;
		nvidia,hw-instance-id = <0x0>;
		interrupts = <0 TEGRA194_IRQ_I2C1 0x04>;
		scl-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(I, 3) 0>;
		sda-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(I, 4) 0>;
		status = "disabled";
		clock-frequency = <400000>;
		clocks = <&bpmp_clks TEGRA194_CLK_I2C1
			&bpmp_clks TEGRA194_CLK_PLLP_OUT0>;
		clock-names = "div-clk", "parent";
		resets = <&bpmp_resets TEGRA194_RESET_I2C1>;
		reset-names = "i2c";
		dmas = <&gpcdma 21>, <&gpcdma 21>;
		dma-names = "rx", "tx";
	};

and I can find the specific name of this I2C controller in the device tree by the corresponding name in the excel spreadsheet, thus achieving the configuration just like this

    i2c@3160000 {
        uih_rtc: uih_rtc@68 {
            compatible = "dallas,ds1340";
            reg = <0x68>;
        };
    };

But in nano, there is no such a file to connect the device tree and pinmux excel. And in the Product Design Guide file does not have this information either.
In my situation, I want to use these two I2C bus in pinmux excel


But in bsp file, there is only unclear I2C name and I really don’t know which bus corresponds to the I2C in excel.

aliases {
		i2c0 = &i2c1;
		i2c1 = &i2c2;
		i2c2 = &i2c3;
		i2c3 = &i2c4;
		i2c4 = &i2c5;
		i2c5 = &i2c6;
		i2c6 = &i2c7;
		spi0 = &spi0;
		spi1 = &spi1;
		spi2 = &spi2;
		spi3 = &spi3;
		qspi6 = &qspi6;
		serial0 = &uarta;
		serial1 = &uartb;
		serial2 = &uartc;
		serial3 = &uartd;
		rtc0 = "/i2c@7000d000/max77620@3c";
		rtc1 = "/rtc";
	};

Can you show me the relationship between i2c0-6 and GEN1_I2C?
Thanks

By the way, the name method in jetson is too complicated. There is three name in Xavier NX’s pinmux excel. If the dtb file do not have this information, I can not know the correct register in module.

i2c0 = &gen1_i2c;
gen1_i2c: i2c@3160000

I know I can use I2C-tools to detect the device but this is inconvenient before our custom board production

Suppose your are talking Orin Nano.
You can check the TRM and subtract 1 to map to software bus number.
For example GEN1 i2c is i2c0


a

Thanks for reply, but the object I talked about is just Nano not Orin Nano

Suppose Nano is the same. You can check TRM of TX1.

Thanks

there is no this information in TX1’s TRM

You can check the pinmux file for example.
The function field of SFIO0 tell the I2C1 that’s HW name and subtract 1 to get software bus number.

but in nano’s pinmux, they are shown as, so which bus is this controller connected, I2C2 or i2c1?

THe GEN1 i2c is i2c bus 0.

Thanks

so it means Nano’s I2C GEN1、GEN2、GEN3 is i2C bus 0\1\2?


And the device tree node name is i2c@7000c000(i2c gen1)、i2c@7000c400(i2c gen2)、i2c@7000c500(i2c gen3)
screenshot-20240313-174703

Is that right?

Yes, that’s correct.

Thanks

ok,thank you!

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