diff options
Diffstat (limited to 'arch/m68knommu/platform/528x/config.c')
-rw-r--r-- | arch/m68knommu/platform/528x/config.c | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/arch/m68knommu/platform/528x/config.c b/arch/m68knommu/platform/528x/config.c index dfdb5c2ed8e6..2ffb549876f0 100644 --- a/arch/m68knommu/platform/528x/config.c +++ b/arch/m68knommu/platform/528x/config.c | |||
@@ -285,8 +285,40 @@ static struct platform_device m528x_uart = { | |||
285 | .dev.platform_data = m528x_uart_platform, | 285 | .dev.platform_data = m528x_uart_platform, |
286 | }; | 286 | }; |
287 | 287 | ||
288 | static struct resource m528x_fec_resources[] = { | ||
289 | { | ||
290 | .start = MCF_MBAR + 0x1000, | ||
291 | .end = MCF_MBAR + 0x1000 + 0x7ff, | ||
292 | .flags = IORESOURCE_MEM, | ||
293 | }, | ||
294 | { | ||
295 | .start = 64 + 23, | ||
296 | .end = 64 + 23, | ||
297 | .flags = IORESOURCE_IRQ, | ||
298 | }, | ||
299 | { | ||
300 | .start = 64 + 27, | ||
301 | .end = 64 + 27, | ||
302 | .flags = IORESOURCE_IRQ, | ||
303 | }, | ||
304 | { | ||
305 | .start = 64 + 29, | ||
306 | .end = 64 + 29, | ||
307 | .flags = IORESOURCE_IRQ, | ||
308 | }, | ||
309 | }; | ||
310 | |||
311 | static struct platform_device m528x_fec = { | ||
312 | .name = "fec", | ||
313 | .id = 0, | ||
314 | .num_resources = ARRAY_SIZE(m528x_fec_resources), | ||
315 | .resource = m528x_fec_resources, | ||
316 | }; | ||
317 | |||
318 | |||
288 | static struct platform_device *m528x_devices[] __initdata = { | 319 | static struct platform_device *m528x_devices[] __initdata = { |
289 | &m528x_uart, | 320 | &m528x_uart, |
321 | &m528x_fec, | ||
290 | }; | 322 | }; |
291 | 323 | ||
292 | /***************************************************************************/ | 324 | /***************************************************************************/ |
@@ -327,6 +359,31 @@ static void __init m528x_uarts_init(void) | |||
327 | 359 | ||
328 | /***************************************************************************/ | 360 | /***************************************************************************/ |
329 | 361 | ||
362 | static void __init m528x_fec_init(void) | ||
363 | { | ||
364 | u32 imr; | ||
365 | u16 v16; | ||
366 | |||
367 | /* Unmask FEC interrupts at ColdFire interrupt controller */ | ||
368 | writeb(0x28, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 23); | ||
369 | writeb(0x27, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 27); | ||
370 | writeb(0x26, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 29); | ||
371 | |||
372 | imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH); | ||
373 | imr &= ~0xf; | ||
374 | writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH); | ||
375 | imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL); | ||
376 | imr &= ~0xff800001; | ||
377 | writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL); | ||
378 | |||
379 | /* Set multi-function pins to ethernet mode for fec0 */ | ||
380 | v16 = readw(MCF_IPSBAR + 0x100056); | ||
381 | writew(v16 | 0xf00, MCF_IPSBAR + 0x100056); | ||
382 | writeb(0xc0, MCF_IPSBAR + 0x100058); | ||
383 | } | ||
384 | |||
385 | /***************************************************************************/ | ||
386 | |||
330 | void mcf_disableall(void) | 387 | void mcf_disableall(void) |
331 | { | 388 | { |
332 | *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff; | 389 | *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff; |
@@ -386,6 +443,7 @@ void __init config_BSP(char *commandp, int size) | |||
386 | static int __init init_BSP(void) | 443 | static int __init init_BSP(void) |
387 | { | 444 | { |
388 | m528x_uarts_init(); | 445 | m528x_uarts_init(); |
446 | m528x_fec_init(); | ||
389 | platform_add_devices(m528x_devices, ARRAY_SIZE(m528x_devices)); | 447 | platform_add_devices(m528x_devices, ARRAY_SIZE(m528x_devices)); |
390 | return 0; | 448 | return 0; |
391 | } | 449 | } |