From f3962d3f574e5a1cffacd4e9bc48713060a2a314 Mon Sep 17 00:00:00 2001 From: TsiChung Liew Date: Tue, 21 Oct 2008 13:47:54 +0000 Subject: ColdFire: Relocate FEC's GPIO and mii functions protocols Place FEC pin assignments in cpu_init.c from platform's mii.c Signed-off-by: TsiChung Liew --- cpu/mcf547x_8x/cpu_init.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'cpu/mcf547x_8x/cpu_init.c') diff --git a/cpu/mcf547x_8x/cpu_init.c b/cpu/mcf547x_8x/cpu_init.c index 9a0e04083c..1ba57835e5 100644 --- a/cpu/mcf547x_8x/cpu_init.c +++ b/cpu/mcf547x_8x/cpu_init.c @@ -29,6 +29,12 @@ #include #include +#if defined(CONFIG_CMD_NET) +#include +#include +#include +#endif + /* * Breath some life into the CPU... * @@ -130,3 +136,24 @@ void uart_port_conf(void) *pscsicr &= 0xF8; } + +#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_dma *info = (struct fec_info_dma *)dev->priv; + + if (setclear) { + if (info->iobase == CONFIG_SYS_FEC0_IOBASE) + gpio->par_feci2cirq |= 0xF000; + else + gpio->par_feci2cirq |= 0x0FC0; + } else { + if (info->iobase == CONFIG_SYS_FEC0_IOBASE) + gpio->par_feci2cirq &= 0x0FFF; + else + gpio->par_feci2cirq &= 0xF03F; + } + return 0; +} +#endif -- cgit v1.2.1