diff options
author | Greg Ungerer <gerg@uclinux.org> | 2009-02-27 01:40:38 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-27 01:40:38 -0500 |
commit | ffba3f48bcd2d8af0570e7d4ce9b86fc4de9b10d (patch) | |
tree | d10a834586c8e66b496589aa55966368f9c08889 /arch/m68knommu/platform/520x | |
parent | 211174ea8dca4502e20008de7ff2ad389db023a5 (diff) |
fec: add FEC platform support to ColdFire CPU's setup code
m68knommu: add FEC platform support to ColdFire CPU's setup code
Move the per-CPU FEC driver setup code into the actual platform
setup code for each ColdFire CPU varient.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/m68knommu/platform/520x')
-rw-r--r-- | arch/m68knommu/platform/520x/config.c | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/arch/m68knommu/platform/520x/config.c b/arch/m68knommu/platform/520x/config.c index 06d887cdcbfb..855fc6a79d72 100644 --- a/arch/m68knommu/platform/520x/config.c +++ b/arch/m68knommu/platform/520x/config.c | |||
@@ -49,8 +49,39 @@ static struct platform_device m520x_uart = { | |||
49 | .dev.platform_data = m520x_uart_platform, | 49 | .dev.platform_data = m520x_uart_platform, |
50 | }; | 50 | }; |
51 | 51 | ||
52 | static struct resource m520x_fec_resources[] = { | ||
53 | { | ||
54 | .start = MCF_MBAR + 0x30000, | ||
55 | .end = MCF_MBAR + 0x30000 + 0x7ff, | ||
56 | .flags = IORESOURCE_MEM, | ||
57 | }, | ||
58 | { | ||
59 | .start = 64 + 36, | ||
60 | .end = 64 + 36, | ||
61 | .flags = IORESOURCE_IRQ, | ||
62 | }, | ||
63 | { | ||
64 | .start = 64 + 40, | ||
65 | .end = 64 + 40, | ||
66 | .flags = IORESOURCE_IRQ, | ||
67 | }, | ||
68 | { | ||
69 | .start = 64 + 42, | ||
70 | .end = 64 + 42, | ||
71 | .flags = IORESOURCE_IRQ, | ||
72 | }, | ||
73 | }; | ||
74 | |||
75 | static struct platform_device m520x_fec = { | ||
76 | .name = "fec", | ||
77 | .id = 0, | ||
78 | .num_resources = ARRAY_SIZE(m520x_fec_resources), | ||
79 | .resource = m520x_fec_resources, | ||
80 | }; | ||
81 | |||
52 | static struct platform_device *m520x_devices[] __initdata = { | 82 | static struct platform_device *m520x_devices[] __initdata = { |
53 | &m520x_uart, | 83 | &m520x_uart, |
84 | &m520x_fec, | ||
54 | }; | 85 | }; |
55 | 86 | ||
56 | /***************************************************************************/ | 87 | /***************************************************************************/ |
@@ -103,6 +134,30 @@ static void __init m520x_uarts_init(void) | |||
103 | 134 | ||
104 | /***************************************************************************/ | 135 | /***************************************************************************/ |
105 | 136 | ||
137 | static void __init m520x_fec_init(void) | ||
138 | { | ||
139 | u32 imr; | ||
140 | u8 v; | ||
141 | |||
142 | /* Unmask FEC interrupts at ColdFire interrupt controller */ | ||
143 | writeb(0x4, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 36); | ||
144 | writeb(0x4, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 40); | ||
145 | writeb(0x4, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 42); | ||
146 | |||
147 | imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH); | ||
148 | imr &= ~0x0001FFF0; | ||
149 | writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH); | ||
150 | |||
151 | /* Set multi-function pins to ethernet mode */ | ||
152 | v = readb(MCF_IPSBAR + MCF_GPIO_PAR_FEC); | ||
153 | writeb(v | 0xf0, MCF_IPSBAR + MCF_GPIO_PAR_FEC); | ||
154 | |||
155 | v = readb(MCF_IPSBAR + MCF_GPIO_PAR_FECI2C); | ||
156 | writeb(v | 0x0f, MCF_IPSBAR + MCF_GPIO_PAR_FECI2C); | ||
157 | } | ||
158 | |||
159 | /***************************************************************************/ | ||
160 | |||
106 | /* | 161 | /* |
107 | * Program the vector to be an auto-vectored. | 162 | * Program the vector to be an auto-vectored. |
108 | */ | 163 | */ |
@@ -118,6 +173,7 @@ void __init config_BSP(char *commandp, int size) | |||
118 | { | 173 | { |
119 | mach_reset = coldfire_reset; | 174 | mach_reset = coldfire_reset; |
120 | m520x_uarts_init(); | 175 | m520x_uarts_init(); |
176 | m520x_fec_init(); | ||
121 | } | 177 | } |
122 | 178 | ||
123 | /***************************************************************************/ | 179 | /***************************************************************************/ |