From 63ff004c4fcad9f690bf44dbd15d568bb47aac2d Mon Sep 17 00:00:00 2001 From: Marian Balakowicz Date: Fri, 28 Oct 2005 22:30:33 +0200 Subject: Add support for multiple PHYs. --- include/configs/Alaska8220.h | 1 + include/configs/IAD210.h | 1 + include/configs/ICU862.h | 1 + include/configs/IceCube.h | 2 ++ include/configs/KUP4K.h | 1 + include/configs/KUP4X.h | 1 + include/configs/MPC8560ADS.h | 2 ++ include/configs/PM520.h | 1 + include/configs/PM854.h | 2 +- include/configs/QS860T.h | 1 + include/configs/SXNI855T.h | 1 + include/configs/TQM5200.h | 2 +- include/configs/TQM834x.h | 1 + include/configs/TQM8560.h | 2 +- include/configs/Total5200.h | 2 ++ include/configs/Yukon8220.h | 1 + include/configs/at91rm9200dk.h | 2 +- include/configs/cpci5200.h | 2 ++ include/configs/o2dnt.h | 2 +- include/configs/pf5200.h | 1 + include/miiphy.h | 36 ++++++++++++++++++++++++++++-------- include/net.h | 1 + 22 files changed, 53 insertions(+), 13 deletions(-) (limited to 'include') diff --git a/include/configs/Alaska8220.h b/include/configs/Alaska8220.h index 9a3acfecd5..c08b2c39f8 100644 --- a/include/configs/Alaska8220.h +++ b/include/configs/Alaska8220.h @@ -90,6 +90,7 @@ CFG_CMD_SNTP ) #define CONFIG_NET_MULTI +#define CONFIG_MII /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/configs/IAD210.h b/include/configs/IAD210.h index fd15b85c22..32d59a4d77 100644 --- a/include/configs/IAD210.h +++ b/include/configs/IAD210.h @@ -88,6 +88,7 @@ # undef CONFIG_SCC1_ENET /* disable SCC1 ethernet */ # define CONFIG_FEC_ENET 1 /* use FEC ethernet */ +# define CONFIG_MII 1 # define CFG_DISCOVER_PHY 1 # define CONFIG_FEC_UTOPIA 1 # define CONFIG_ETHADDR 08:00:06:26:A2:6D diff --git a/include/configs/ICU862.h b/include/configs/ICU862.h index b0c8ac6b4e..73ff0a3560 100644 --- a/include/configs/ICU862.h +++ b/include/configs/ICU862.h @@ -85,6 +85,7 @@ #undef CONFIG_SCC1_ENET /* disable SCC1 ethernet */ #define CONFIG_FEC_ENET 1 /* use FEC ethernet */ +#define CONFIG_MII 1 #if 1 #define CFG_DISCOVER_PHY 1 #else diff --git a/include/configs/IceCube.h b/include/configs/IceCube.h index 6a9a05d31a..9d4e7b2309 100644 --- a/include/configs/IceCube.h +++ b/include/configs/IceCube.h @@ -71,6 +71,7 @@ #define CFG_XLB_PIPELINING 1 #define CONFIG_NET_MULTI 1 +#define CONFIG_MII 1 #define CONFIG_EEPRO100 1 #define CFG_RX_ETH_BUFFER 8 /* use 8 rx buffer on eepro100 */ #define CONFIG_NS8382X 1 @@ -79,6 +80,7 @@ #else /* MPC5100 */ +#define CONFIG_MII 1 #define ADD_PCI_CMD 0 /* no CFG_CMD_PCI */ #endif diff --git a/include/configs/KUP4K.h b/include/configs/KUP4K.h index 34577707bc..4d39b352a2 100644 --- a/include/configs/KUP4K.h +++ b/include/configs/KUP4K.h @@ -141,6 +141,7 @@ #define CONFIG_RTC_PCF8563 /* use Philips PCF8563 RTC */ #define CFG_DISCOVER_PHY +#define CONFIG_MII #if 0 #define CONFIG_ETHADDR 00:0B:64:00:00:00 /* our OUI from IEEE */ diff --git a/include/configs/KUP4X.h b/include/configs/KUP4X.h index 5bad824964..9a42cb17d1 100644 --- a/include/configs/KUP4X.h +++ b/include/configs/KUP4X.h @@ -150,6 +150,7 @@ #define CONFIG_RTC_PCF8563 /* use Philips PCF8563 RTC */ #define CFG_DISCOVER_PHY +#define CONFIG_MII #if 0 #define CONFIG_ETHADDR 00:0B:64:80:00:00 /* our OUI from IEEE */ diff --git a/include/configs/MPC8560ADS.h b/include/configs/MPC8560ADS.h index db878cb193..2d5031b77d 100644 --- a/include/configs/MPC8560ADS.h +++ b/include/configs/MPC8560ADS.h @@ -43,7 +43,9 @@ #define CONFIG_PCI #define CONFIG_TSEC_ENET /* tsec ethernet support */ +#undef CONFIG_TSEC_ENET /* tsec ethernet support */ #undef CONFIG_ETHER_ON_FCC /* cpm FCC ethernet support */ +#define CONFIG_ETHER_ON_FCC /* cpm FCC ethernet support */ #define CONFIG_ENV_OVERWRITE #define CONFIG_SPD_EEPROM /* Use SPD EEPROM for DDR setup*/ #define CONFIG_DDR_DLL /* possible DLL fix needed */ diff --git a/include/configs/PM520.h b/include/configs/PM520.h index 49ae55c6b4..1189989342 100644 --- a/include/configs/PM520.h +++ b/include/configs/PM520.h @@ -72,6 +72,7 @@ #define CONFIG_PCI_IO_SIZE 0x01000000 #define CONFIG_NET_MULTI 1 +#define CONFIG_MII 1 #define CONFIG_EEPRO100 1 #define CFG_RX_ETH_BUFFER 8 /* use 8 rx buffer on eepro100 */ #undef CONFIG_NS8382X diff --git a/include/configs/PM854.h b/include/configs/PM854.h index 0b8c71d852..da01186771 100644 --- a/include/configs/PM854.h +++ b/include/configs/PM854.h @@ -235,7 +235,7 @@ #define CONFIG_NET_MULTI #define CONFIG_PCI_PNP /* do pci plug-and-play */ -/* #define CONFIG_EEPRO100 XXX - FIXME: conflicts when CONFIG_MII is enabled */ +#define CONFIG_EEPRO100 #define CONFIG_E1000 #undef CONFIG_TULIP diff --git a/include/configs/QS860T.h b/include/configs/QS860T.h index 8d29a31a05..37c5cf430b 100644 --- a/include/configs/QS860T.h +++ b/include/configs/QS860T.h @@ -56,6 +56,7 @@ #define CONFIG_QS860T 1 /* ...on a QS860T module */ #define CONFIG_FEC_ENET 1 /* FEC 10/100BaseT ethernet */ +#define CONFIG_MII #define FEC_INTERRUPT SIU_LEVEL1 #undef CONFIG_SCC1_ENET /* SCC1 10BaseT ethernet */ #define CFG_DISCOVER_PHY diff --git a/include/configs/SXNI855T.h b/include/configs/SXNI855T.h index 9ce83b48bf..c1c765f39d 100644 --- a/include/configs/SXNI855T.h +++ b/include/configs/SXNI855T.h @@ -142,6 +142,7 @@ # define CFG_I2C_EEPROM_ADDR_LEN 2 /* two byte address */ #define CONFIG_FEC_ENET 1 /* use FEC ethernet */ +#define CONFIG_MII 1 #define CFG_DISCOVER_PHY diff --git a/include/configs/TQM5200.h b/include/configs/TQM5200.h index a57f7cf9ec..1236ce35a8 100644 --- a/include/configs/TQM5200.h +++ b/include/configs/TQM5200.h @@ -83,7 +83,7 @@ #define CONFIG_PCI_IO_SIZE 0x01000000 #define CONFIG_NET_MULTI 1 -/* #define CONFIG_EEPRO100 XXX - FIXME: conflicts when CONFIG_MII is enabled */ +#define CONFIG_EEPRO100 #define CFG_RX_ETH_BUFFER 8 /* use 8 rx buffer on eepro100 */ #define CONFIG_NS8382X 1 #endif /* CONFIG_STK52XX */ diff --git a/include/configs/TQM834x.h b/include/configs/TQM834x.h index 0fad36a1c5..d434eb7599 100644 --- a/include/configs/TQM834x.h +++ b/include/configs/TQM834x.h @@ -280,6 +280,7 @@ extern int tqm834x_num_flash_banks; #undef CONFIG_EEPRO100 +#define CONFIG_EEPRO100 #undef CONFIG_TULIP #if !defined(CONFIG_PCI_PNP) diff --git a/include/configs/TQM8560.h b/include/configs/TQM8560.h index 04966d77a4..d2c230d563 100644 --- a/include/configs/TQM8560.h +++ b/include/configs/TQM8560.h @@ -283,7 +283,7 @@ #define CONFIG_NET_MULTI #define CONFIG_PCI_PNP /* do pci plug-and-play */ -/* #define CONFIG_EEPRO100 XXX - FIXME: conflicts when CONFIG_MII is enabled */ +#define CONFIG_EEPRO100 #undef CONFIG_TULIP #if !defined(CONFIG_PCI_PNP) diff --git a/include/configs/Total5200.h b/include/configs/Total5200.h index 7e3c11ea69..ab02dd1285 100644 --- a/include/configs/Total5200.h +++ b/include/configs/Total5200.h @@ -100,6 +100,7 @@ #define CONFIG_PCI_IO_SIZE 0x01000000 #define CONFIG_NET_MULTI 1 +#define CONFIG_MII 1 #define CONFIG_EEPRO100 1 #define CFG_RX_ETH_BUFFER 8 /* use 8 rx buffer on eepro100 */ #define CONFIG_NS8382X 1 @@ -108,6 +109,7 @@ #else /* MGT5100 */ +#define CONFIG_MII 1 #define ADD_PCI_CMD 0 /* no CFG_CMD_PCI */ #endif diff --git a/include/configs/Yukon8220.h b/include/configs/Yukon8220.h index 2d3c0e5a91..37ef1058f9 100644 --- a/include/configs/Yukon8220.h +++ b/include/configs/Yukon8220.h @@ -90,6 +90,7 @@ CFG_CMD_SNTP ) #define CONFIG_NET_MULTI +#define CONFIG_MII /* this must be included AFTER the definition of CONFIG_COMMANDS (if any) */ #include diff --git a/include/configs/at91rm9200dk.h b/include/configs/at91rm9200dk.h index f0c0283956..8fad55d81c 100644 --- a/include/configs/at91rm9200dk.h +++ b/include/configs/at91rm9200dk.h @@ -98,7 +98,7 @@ /* #define CONFIG_ENV_OVERWRITE 1 */ #define CONFIG_COMMANDS \ - ((CONFIG_CMD_DFL | \ + ((CONFIG_CMD_DFL | CFG_CMD_MII |\ CFG_CMD_DHCP ) & \ ~(CFG_CMD_BDI | \ CFG_CMD_IMI | \ diff --git a/include/configs/cpci5200.h b/include/configs/cpci5200.h index 3898f91282..711e348139 100644 --- a/include/configs/cpci5200.h +++ b/include/configs/cpci5200.h @@ -83,6 +83,8 @@ #define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS #define CONFIG_PCI_IO_SIZE 0x01000000 #endif + +#define CONFIG_MII #if 0 /* test-only !!! */ #define CONFIG_NET_MULTI 1 #define CONFIG_EEPRO100 1 diff --git a/include/configs/o2dnt.h b/include/configs/o2dnt.h index 62b90e85fd..04d7d8a282 100644 --- a/include/configs/o2dnt.h +++ b/include/configs/o2dnt.h @@ -69,7 +69,7 @@ #define CFG_XLB_PIPELINING 1 #define CONFIG_NET_MULTI 1 -/* #define CONFIG_EEPRO100 XXX - FIXME: conflicts when CONFIG_MII is enabled */ +#define CONFIG_EEPRO100 #define CFG_RX_ETH_BUFFER 8 /* use 8 rx buffer on eepro100 */ #define CONFIG_NS8382X 1 diff --git a/include/configs/pf5200.h b/include/configs/pf5200.h index a8edff28b3..385e6d7182 100644 --- a/include/configs/pf5200.h +++ b/include/configs/pf5200.h @@ -83,6 +83,7 @@ #define CONFIG_PCI_IO_PHYS CONFIG_PCI_IO_BUS #define CONFIG_PCI_IO_SIZE 0x01000000 +#define CONFIG_MII 1 #if 0 /* test-only !!! */ #define CONFIG_NET_MULTI 1 #define CONFIG_EEPRO100 1 diff --git a/include/miiphy.h b/include/miiphy.h index afdd5a7fe1..3c6ee77077 100644 --- a/include/miiphy.h +++ b/include/miiphy.h @@ -38,18 +38,38 @@ #ifndef _miiphy_h_ #define _miiphy_h_ +#include -int miiphy_read(unsigned char addr, unsigned char reg, unsigned short * value); -int miiphy_write(unsigned char addr, unsigned char reg, unsigned short value); -int miiphy_info(unsigned char addr, unsigned int *oui, unsigned char *model, - unsigned char *rev); -int miiphy_reset(unsigned char addr); -int miiphy_speed(unsigned char addr); -int miiphy_duplex(unsigned char addr); +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); +int miiphy_info(char *devname, unsigned char addr, unsigned int *oui, + unsigned char *model, unsigned char *rev); +int miiphy_reset(char *devname, unsigned char addr); +int miiphy_speed(char *devname, unsigned char addr); +int miiphy_duplex(char *devname, unsigned char addr); #ifdef CFG_FAULT_ECHO_LINK_DOWN -int miiphy_link(unsigned char addr); +int miiphy_link(char *devname, unsigned char addr); #endif +void miiphy_register(char *devname, + int (* read)(char *devname, unsigned char addr, + unsigned char reg, unsigned short *value), + int (* write)(char *devname, unsigned char addr, + unsigned char reg, unsigned short value)); + +int miiphy_set_current_dev(char *devname); +char *miiphy_get_current_dev(void); + +void miiphy_listdev(void); + +#define BB_MII_DEVNAME "bbmii" + +int bb_miiphy_read (char *devname, unsigned char addr, + unsigned char reg, unsigned short *value); +int bb_miiphy_write (char *devname, unsigned char addr, + unsigned char reg, unsigned short value); /* phy seed setup */ #define AUTO 99 diff --git a/include/net.h b/include/net.h index 47eab59dde..461e038014 100644 --- a/include/net.h +++ b/include/net.h @@ -114,6 +114,7 @@ extern void eth_try_another(int first_restart); /* Change the device */ extern void eth_set_current(void); /* set nterface to ethcur var. */ #endif extern struct eth_device *eth_get_dev(void); /* get the current device MAC */ +extern struct eth_device *eth_get_dev_by_name(char *devname); /* get device */ extern int eth_get_dev_index (void); /* get the device index */ extern void eth_set_enetaddr(int num, char* a); /* Set new MAC address */ -- cgit v1.2.3