]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - cpu/mcf532x/cpu_init.c
ColdFire: Relocate FEC's GPIO and mii functions protocols
[karo-tx-uboot.git] / cpu / mcf532x / cpu_init.c
index d348e29a1f5b3f98a5bb58846fdb6171dd5698ed..39be11f0903b6b1bc789a9071a6d1c86aaa8a0cb 100644 (file)
 
 #include <common.h>
 #include <watchdog.h>
-
 #include <asm/immap.h>
 
+#if defined(CONFIG_CMD_NET)
+#include <config.h>
+#include <net.h>
+#include <asm/fec.h>
+#endif
+
 /*
  * Breath some life into the CPU...
  *
@@ -139,3 +144,21 @@ void uart_port_conf(void)
                break;
        }
 }
+
+#if defined(CONFIG_CMD_NET)
+int fecpin_setclear(struct eth_device *dev, int setclear)
+{
+       volatile gpio_t *gpio = (gpio_t *) MMAP_GPIO;
+
+       if (setclear) {
+               gpio->par_fec |= GPIO_PAR_FEC_7W_FEC | GPIO_PAR_FEC_MII_FEC;
+               gpio->par_feci2c |=
+                   GPIO_PAR_FECI2C_MDC_EMDC | GPIO_PAR_FECI2C_MDIO_EMDIO;
+       } else {
+               gpio->par_fec &= ~(GPIO_PAR_FEC_7W_FEC | GPIO_PAR_FEC_MII_FEC);
+               gpio->par_feci2c &=
+                   ~(GPIO_PAR_FECI2C_MDC_EMDC | GPIO_PAR_FECI2C_MDIO_EMDIO);
+       }
+       return 0;
+}
+#endif