diff options
author | Wolfgang Denk <wd@pollux.denx.de> | 2005-10-29 23:45:04 +0200 |
---|---|---|
committer | Wolfgang Denk <wd@pollux.denx.de> | 2005-10-29 23:45:04 +0200 |
commit | 5d4ee51061e70118fb598e3aca082dd11a154e87 (patch) | |
tree | b7cddabfe81abe8fa066dd082a9425bee556cd88 /cpu/arm920t/at91rm9200/ether.c | |
parent | 7b5cac0e1958173a390ae6d620a610028cad25f8 (diff) | |
parent | 99eb35dbbfd94d8d4e047952663f92526ae4dfc8 (diff) | |
download | u-boot-imx-5d4ee51061e70118fb598e3aca082dd11a154e87.zip u-boot-imx-5d4ee51061e70118fb598e3aca082dd11a154e87.tar.gz u-boot-imx-5d4ee51061e70118fb598e3aca082dd11a154e87.tar.bz2 |
Merge with /home/m8/git/u-boot
Diffstat (limited to 'cpu/arm920t/at91rm9200/ether.c')
-rw-r--r-- | cpu/arm920t/at91rm9200/ether.c | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/cpu/arm920t/at91rm9200/ether.c b/cpu/arm920t/at91rm9200/ether.c index ca5b7d1..67008d0 100644 --- a/cpu/arm920t/at91rm9200/ether.c +++ b/cpu/arm920t/at91rm9200/ether.c @@ -23,6 +23,7 @@ #include <at91rm9200_net.h> #include <net.h> +#include <miiphy.h> /* ----- Ethernet Buffer definitions ----- */ @@ -150,7 +151,6 @@ UCHAR at91rm9200_EmacWritePhy (AT91PS_EMAC p_mac, return TRUE; } - int eth_init (bd_t * bd) { int ret; @@ -265,8 +265,9 @@ void eth_halt (void) { }; -#if (CONFIG_COMMANDS & CFG_CMD_MII) -int miiphy_read(unsigned char addr, unsigned char reg, unsigned short * value) +#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) +int at91rm9200_miiphy_read(char *devname, unsigned char addr, + unsigned char reg, unsigned short * value) { at91rm9200_EmacEnableMDIO (p_mac); at91rm9200_EmacReadPhy (p_mac, reg, value); @@ -274,14 +275,24 @@ int miiphy_read(unsigned char addr, unsigned char reg, unsigned short * value) return 0; } -int miiphy_write(unsigned char addr, unsigned char reg, unsigned short value) +int at91rm9200_miiphy_write(char *devname, unsigned char addr, + unsigned char reg, unsigned short value) { at91rm9200_EmacEnableMDIO (p_mac); at91rm9200_EmacWritePhy (p_mac, reg, &value); at91rm9200_EmacDisableMDIO (p_mac); return 0; } -#endif /* CONFIG_COMMANDS & CFG_CMD_MII */ + +#endif /* defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) */ + +int at91rm9200_miiphy_initialize(bd_t *bis) +{ +#if defined(CONFIG_MII) || (CONFIG_COMMANDS & CFG_CMD_MII) + miiphy_register("at91rm9200phy", at91rm9200_miiphy_read, at91rm9200_miiphy_write); +#endif + return 0; +} #endif /* CONFIG_COMMANDS & CFG_CMD_NET */ |