diff options
author | Wolfgang Denk <wd@denx.de> | 2008-11-09 00:01:59 +0100 |
---|---|---|
committer | Wolfgang Denk <wd@denx.de> | 2008-11-09 00:01:59 +0100 |
commit | ac4aeb1735404d2d331bd018e8c709e17c7392ad (patch) | |
tree | 00b8e8044f5b1d9e78b15ad116c1703854a08e64 /cpu/mcf5445x/cpu_init.c | |
parent | 0829323073c505556ed5f5073f91adb504584d45 (diff) | |
parent | c06d9bbbeb0416f189e841ffb214ada6194ed874 (diff) |
Merge branch 'master' of /home/wd/git/u-boot/custodians
Diffstat (limited to 'cpu/mcf5445x/cpu_init.c')
-rw-r--r-- | cpu/mcf5445x/cpu_init.c | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/cpu/mcf5445x/cpu_init.c b/cpu/mcf5445x/cpu_init.c index 50b4561f3f..7e04e32c70 100644 --- a/cpu/mcf5445x/cpu_init.c +++ b/cpu/mcf5445x/cpu_init.c @@ -27,10 +27,15 @@ #include <common.h> #include <watchdog.h> - #include <asm/immap.h> #include <asm/rtc.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,30 @@ 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; + struct fec_info_s *info = (struct fec_info_s *)dev->priv; + + if (setclear) { + gpio->par_feci2c |= + (GPIO_PAR_FECI2C_MDC0_MDC0 | GPIO_PAR_FECI2C_MDIO0_MDIO0); + + if (info->iobase == CONFIG_SYS_FEC0_IOBASE) + gpio->par_fec |= GPIO_PAR_FEC_FEC0_RMII_GPIO; + else + gpio->par_fec |= GPIO_PAR_FEC_FEC1_RMII_ATA; + } else { + gpio->par_feci2c &= + ~(GPIO_PAR_FECI2C_MDC0_MDC0 | GPIO_PAR_FECI2C_MDIO0_MDIO0); + + if (info->iobase == CONFIG_SYS_FEC0_IOBASE) + gpio->par_fec &= GPIO_PAR_FEC_FEC0_MASK; + else + gpio->par_fec &= GPIO_PAR_FEC_FEC1_MASK; + } + return 0; +} +#endif |