[U-Boot] MII - Incorrect type specified for offset addr

Hebbar, Gururaja gururaja.hebbar at ti.com
Mon Jul 25 07:50:29 CEST 2011


Hi,

We have an upcoming SOC with Ethernet controller which has registers with offsets crossing 0x110.
In order to access these registers, we use miiphy_read() & miiphy_write() api provided by Standard u-boot mii phy util code (common/miiphyutil.c).

However the syntax of miiphy_read() & miiphy_write() is as below 

int miiphy_read (char *devname, unsigned char addr, unsigned char reg,
		 unsigned short *value);

int miiphy_write (char *devname, unsigned char addr, unsigned char reg,
		  unsigned short value);

Here the "reg" argument is of type "unsigned char" which limits the offset to a max of 0xff.
In linux, they are using u32 as type.

Right now we have modified the type to short and using it. 

Is this correct? 
If yes, can we send a patch for the same?
If not, what is the alternative?

Thanks & Regards
Gururaja
 


More information about the U-Boot mailing list