UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Observer aroytman
Observer
187 Views
Registered: ‎12-07-2017

Reading eeprom over i2c mux

Hello,

I am searching for a way to read/write an eeprom that is connected to i2c via a mux. This has to be done via command line at u-boot prompt.

I am using (a board similar to) zcu102. So, a procedure that will work on that board is OK.

Per ug1182, on zcu102 there is an eeprom connected to channel 0 of pca9548a mux at i2c address 0x54.

The mux is connected to i2c_1 at address 0x74.

I do not know how to reach the eeprom. I tried many ways, none worked.

I am not using the DM drivers.

Thank you very much

Tags (1)
0 Kudos
3 Replies
Moderator
Moderator
154 Views
Registered: ‎07-31-2012

Re: Reading eeprom over i2c mux

Hi @aroytman ,

 

There is an example for eeprom access over I2C through mux.

Please refer to this source file - https://github.com/Xilinx/embeddedsw/blob/master/XilinxProcessorIPLib/drivers/iic/examples/xiic_eeprom_example.c

Regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Observer aroytman
Observer
137 Views
Registered: ‎12-07-2017

Re: Reading eeprom over i2c mux

Hello,

Thank you very much for the pointer.

Actually, I was looking for a way to do this via command line at u-boot prompt.

Hopefully, I will not have to reverse engineer this code and translate it to i2c commands.

Anyway, as last resort, this code is good hint.

Thank you

0 Kudos
Moderator
Moderator
117 Views
Registered: ‎07-31-2012

Re: Reading eeprom over i2c mux

Hi @aroytman ,

Here is commands to be used in Uboot.

Writes different patterns to the I2C EEPROM, reads back the contents of the EEPROM and performs data verification.

ZynqMP> i2c bus
Bus 0: i2c@ff020000
ZynqMP> i2c dev 0
Setting bus to 0
ZynqMP> i2c speed
Current bus speed=400000
ZynqMP> i2c probe
Valid chip addresses: 00 0A 0B 0D 0E 0F 10 11 12 13 14 15 16 17 18 1A 1B 1C 1D 1E 20 50 68 70 71 72 73 74 75 76
ZynqMP> md.b 100000
ZynqMP> mw.b 100000 cc 10
ZynqMP> md.b 100000
ZynqMP> md.b 200000
ZynqMP> i2c write 100000 50 0.1 10
ZynqMP> i2c read 50 0.1 10 200000
ZynqMP> md.b 200000

 

Regards

Praveen


-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos