public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot-Users] Configuration of the PHY address
@ 2006-08-08 17:28 Mirco Fuchs
  2006-08-10 10:43 ` Mirco Fuchs
  0 siblings, 1 reply; 2+ messages in thread
From: Mirco Fuchs @ 2006-08-08 17:28 UTC (permalink / raw)
  To: u-boot

Hi,
I'm operating on an at91rm9200-based board. The AT91RM9200 is 
connected to an ethernet PHY via MII interface. The current 
implementations of the MII-access functions in ether.c assume, that 
the phy's address is 00000. But the address of the PHY that I use 
(KS8721) is 00001 by default, so i cannot access the MII-registers 
with the this implementation. Apart from that a user could configure 
the address of the PHY on his board with pull-ups. I think we need to 
set the PHY address explicite when accessing it.

I suggest to introduce a new macro (e. g. CFG_PHY_ADDRESS) that can 
be set by the user in the board specific header file.

There are two ways to implement the usage of this macro.
The first is that we use the macro directly in the functions 
at91rm9200_EmacWritePhy() and at91rm9200_EmacReadPhy() without 
changing any parameters. The advantage is that we can implement it 
very easy and very fast. The disadvantage is that we cannot change 
the address after compilation (which shouldn't be a problem in most 
cases). 

The second way is to add a new parameter (e. g. phyadd) to the 
EmacWrite and EmacRead function. The PHY driver would be responsible 
to set the PHY address when calling these functions. The PHY address 
could be taken from CFG_PHY_ADDRESS (like above) or could be set 
dynamically (e. g. if we have more than one PHY connected). In 
addition to the EmacRead and EmacWrite interface itself, we need to 
change all drivers using this function and implement the new 
interface in this case.

Which of the suggested ways would you prefer? 


Best Regards
Mirco

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [U-Boot-Users] Configuration of the PHY address
  2006-08-08 17:28 [U-Boot-Users] Configuration of the PHY address Mirco Fuchs
@ 2006-08-10 10:43 ` Mirco Fuchs
  0 siblings, 0 replies; 2+ messages in thread
From: Mirco Fuchs @ 2006-08-10 10:43 UTC (permalink / raw)
  To: u-boot

> I suggest to introduce a new macro (e. g. CFG_PHY_ADDRESS) that can > be set by the user in the board specific header file.
I've just found that there is allready a macro called CONFIG_PHY_ADDR 
which is doing exactly what i want - sorry for the waste.

But the ethernet driver for the at91rm9200 does not support this 
macro. I'll modify the functions at91rm9200_EmacWritePhy() and 
at91rm9200_EmacReadPhy() and provide a patch. 

BTW: The PHY drivers for the at91rm9200 (bcm5221.c, dm9161) are using 
the functions at91rm9200_Emac...Phy() to access the PHY. Why do they 
not use the miiphy_...() functions defined in miiphy.h?


Best Regards

Mirco

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2006-08-10 10:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-08-08 17:28 [U-Boot-Users] Configuration of the PHY address Mirco Fuchs
2006-08-10 10:43 ` Mirco Fuchs

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox