cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
319 Views
Registered: ‎09-28-2018

ZCU102: Linux enumeration on i2c multiplexer IC

Jump to solution

Hi Xilinx. 

I'm working on a ZCU102 platform and i'm accessing the I2c devices (like ina226) directly through the I2C bus instead on loading the drivers. 

But inside Linux the enumeration of the I2C mux channels seems to change from time to time which makes it difficult to write a user space driver for the ina 226 devices as the virtual file system entry for the hosting mux channels is dynamic. 

According to kernel.org this is normal behavior. 

https://www.kernel.org/doc/Documentation/i2c/dev-interface
https://unix.stackexchange.com/a/402664

 

Is it possible to add some kind of dummy driver to the devicetree of each ina226 device so it can be read out from the virtual filesystem, like for instance a name? 

( It seems to me there are no real device tree options for the mux IC. )

 

Any help is much appreciated. 

Deville

 

 

1 Solution

Accepted Solutions
Highlighted
Voyager
Voyager
271 Views
Registered: ‎10-21-2015

Re: ZCU102: Linux enumeration on i2c multiplexer IC

Jump to solution

Hi

See the comment at https://github.com/Xilinx/linux-xlnx/blob/master/drivers/i2c/i2c-core-base.c#L1416

 * This routine is used to declare an I2C adapter when its bus number
 * doesn't matter or when its bus number is specified by an dt alias.

Add your numbered i2c buses to  aliases node of device-tree like this

/ {
    aliases {
        i2c0 = "/abma/i2c@ff030000/i2c-mux@74/i2c@0";
        .............................................
    };
};

 

 

View solution in original post

2 Replies
Highlighted
Voyager
Voyager
272 Views
Registered: ‎10-21-2015

Re: ZCU102: Linux enumeration on i2c multiplexer IC

Jump to solution

Hi

See the comment at https://github.com/Xilinx/linux-xlnx/blob/master/drivers/i2c/i2c-core-base.c#L1416

 * This routine is used to declare an I2C adapter when its bus number
 * doesn't matter or when its bus number is specified by an dt alias.

Add your numbered i2c buses to  aliases node of device-tree like this

/ {
    aliases {
        i2c0 = "/abma/i2c@ff030000/i2c-mux@74/i2c@0";
        .............................................
    };
};

 

 

View solution in original post

Highlighted
Explorer
Explorer
248 Views
Registered: ‎09-28-2018

Re: ZCU102: Linux enumeration on i2c multiplexer IC

Jump to solution

@hokim 

Thanks for your reply. ( This message is edited, At first I must have done something wrong but now it works just fine )

I did insert the aliases for the target busses, Like this: 

aliases 
{ ethernet0 = &gem3; //i2c0 = &i2c0; // @ff020000 i2c1 = "/amba/i2c@ff020000/i2c-mux@75/i2c@0"; // 10 ina226 devices i2c2 = "/amba/i2c@ff020000/i2c-mux@75/i2c@1"; // 8 ina226 devices i2c3 = "/amba/i2c@ff020000/i2c-mux@75/i2c@2"; // 14 max devices //i2c4 = &i2c1; //@ff030000 i2c5 = "/amba/i2c@ff030000/i2c-mux@74/i2c@0"; // U53 eeprom i2c6 = "/amba/i2c@ff030000/i2c-mux@74/i2c@1"; // si5341: clock-generator@36 i2c7 = "/amba/i2c@ff030000/i2c-mux@74/i2c@2"; // si570_1: clock-generator@5d i2c8 = "/amba/i2c@ff030000/i2c-mux@74/i2c@3"; // si570_2: clock-generator@5d i2c9 = "/amba/i2c@ff030000/i2c-mux@74/i2c@4"; // si5328: clock-generator@69 serial0 = &uart0; serial1 = &uart1; spi0 = &qspi; mmc0 = &sdhci0; mmc1 = &sdhci1; };

And this results in the preferred result:

Screenshot from 2020-04-28 14-45-16.png

 

Thanks for the assistance !!