I2C MDIO for SFP Module

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

I2C MDIO for SFP Module

5,005 Views
smiller2
Contributor IV

I am trying to get a SFP RJ45 Ethernet module working on a new LS1046A design.   The module has a Broadcom chipset and the PHY is connected to the I2C port at 7-bit address 0x56.   ( The modules has an EEPROM at 0x50 and does not support  0X51.)     I cannot get it setup in U-Boot because, the MDIO bus is not connected to the module. (At least that is my best guess.)   With U-Boot not understanding the PHY,  then Linux cannot find it either.  

I saw some references in this Forum to getting this MDIO data via I2C.  However, there was no example code.  I found some older code on the Internet at the URL below.

https://code.woboq.org/linux/linux/drivers/net/phy/mdio-i2c.c.html

Is this code or something similar already in the code base somewhere?

Can anyone share the code they hacked into the existing base already?

According to the marketing blurb that accompanied the module,  setup via I2C is "generally not required".  Is it possible to fake out MDIO with some canned values to make U-Boot happy?    If so, could anyone point me to how to do this?

Thanks.

 

0 Kudos
Reply
1 Reply

4,995 Views
Pavel
NXP Employee
NXP Employee

There are the following u-boot commands for u-boot:

=> help i2c

i2c - I2C sub-system

 

Usage:

i2c bus [muxtype:muxaddr:muxchannel] - show I2C bus info

i2c crc32 chip address[.0, .1, .2] count - compute CRC32 checksum

i2c dev [dev] - show or set current I2C bus

i2c loop chip address[.0, .1, .2] [# of objects] - looping read of device

i2c md chip address[.0, .1, .2] [# of objects] - read from I2C device

i2c mm chip address[.0, .1, .2] - write to I2C device (auto-incrementing)

i2c mw chip address[.0, .1, .2] value [count] - write to I2C device (fill)

i2c nm chip address[.0, .1, .2] - write to I2C device (constant address)

i2c probe [address] - test for and show device(s) on the I2C bus

i2c read chip address[.0, .1, .2] length memaddress - read to memory

i2c write memaddress chip address[.0, .1, .2] length [-s] - write memory

          to I2C; the -s option selects bulk write in a single transaction

i2c flags chip [flags] - set or get chip flags

i2c olen chip [offset_length] - set or get chip offset length

i2c reset - re-init the I2C Controller

i2c speed [speed] - show or set I2C bus speed

=>

 

Try to find your device using the "i2c probe" command in u-boot.

0 Kudos
Reply