]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - cpu/arm920t/at91rm9200/ether.c
Big white-space cleanup.
[karo-tx-uboot.git] / cpu / arm920t / at91rm9200 / ether.c
index d88517f4b1af6f1683b3a4dfea94543e5045e906..f20e0703432c1e82a7b4545513128b863f46bcbd 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <at91rm9200_net.h>
 #include <net.h>
+#include <miiphy.h>
 
 /* ----- Ethernet Buffer definitions ----- */
 
@@ -49,7 +50,7 @@ typedef struct {
 
 #ifdef CONFIG_DRIVER_ETHER
 
-#if (CONFIG_COMMANDS & CFG_CMD_NET)
+#if defined(CONFIG_CMD_NET)
 
 /* alignment as per Errata #11 (64 bytes) is insufficient! */
 rbf_t rbfdt[RBF_FRAMEMAX] __attribute((aligned(512)));
@@ -104,7 +105,7 @@ void at91rm9200_EmacDisableMDIO (AT91PS_EMAC p_mac)
  * Arguments:
  *     dev - pointer to struct net_device
  *     RegisterAddress - unsigned char
- *     pInput - pointer to value read from register
+ *     pInput - pointer to value read from register
  * Return value:
  *     TRUE - if data read successfully
  */
@@ -133,7 +134,7 @@ UCHAR at91rm9200_EmacReadPhy (AT91PS_EMAC p_mac,
  * Arguments:
  *     dev - pointer to struct net_device
  *     RegisterAddress - unsigned char
- *     pOutput - pointer to value to be written in the register
+ *     pOutput - pointer to value to be written in the register
  * Return value:
  *     TRUE - if data read successfully
  */
@@ -150,7 +151,6 @@ UCHAR at91rm9200_EmacWritePhy (AT91PS_EMAC p_mac,
        return TRUE;
 }
 
-
 int eth_init (bd_t * bd)
 {
        int ret;
@@ -184,7 +184,7 @@ int eth_init (bd_t * bd)
 
        /* Init Ehternet buffers */
        for (i = 0; i < RBF_FRAMEMAX; i++) {
-               rbfdt[i].addr = rbf_framebuf[i];
+               rbfdt[i].addr = (unsigned long)rbf_framebuf[i];
                rbfdt[i].size = 0;
        }
        rbfdt[RBF_FRAMEMAX - 1].addr |= RBF_WRAP;
@@ -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) || defined(CONFIG_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,15 +275,25 @@ 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 /* CONFIG_COMMANDS & CFG_CMD_NET */
+#endif
+
+int at91rm9200_miiphy_initialize(bd_t *bis)
+{
+#if defined(CONFIG_MII) || defined(CONFIG_CMD_MII)
+       miiphy_register("at91rm9200phy", at91rm9200_miiphy_read, at91rm9200_miiphy_write);
+#endif
+       return 0;
+}
+
+#endif
 
 #endif /* CONFIG_DRIVER_ETHER */