aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/platform/5272/config.c
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@uclinux.org>2009-02-27 01:40:38 -0500
committerDavid S. Miller <davem@davemloft.net>2009-02-27 01:40:38 -0500
commitffba3f48bcd2d8af0570e7d4ce9b86fc4de9b10d (patch)
treed10a834586c8e66b496589aa55966368f9c08889 /arch/m68knommu/platform/5272/config.c
parent211174ea8dca4502e20008de7ff2ad389db023a5 (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/5272/config.c')
-rw-r--r--arch/m68knommu/platform/5272/config.c48
1 files changed, 48 insertions, 0 deletions
diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c
index 230bae691a7f..e049245f4092 100644
--- a/arch/m68knommu/platform/5272/config.c
+++ b/arch/m68knommu/platform/5272/config.c
@@ -55,8 +55,39 @@ static struct platform_device m5272_uart = {
55 .dev.platform_data = m5272_uart_platform, 55 .dev.platform_data = m5272_uart_platform,
56}; 56};
57 57
58static struct resource m5272_fec_resources[] = {
59 {
60 .start = MCF_MBAR + 0x840,
61 .end = MCF_MBAR + 0x840 + 0x1cf,
62 .flags = IORESOURCE_MEM,
63 },
64 {
65 .start = 86,
66 .end = 86,
67 .flags = IORESOURCE_IRQ,
68 },
69 {
70 .start = 87,
71 .end = 87,
72 .flags = IORESOURCE_IRQ,
73 },
74 {
75 .start = 88,
76 .end = 88,
77 .flags = IORESOURCE_IRQ,
78 },
79};
80
81static struct platform_device m5272_fec = {
82 .name = "fec",
83 .id = 0,
84 .num_resources = ARRAY_SIZE(m5272_fec_resources),
85 .resource = m5272_fec_resources,
86};
87
58static struct platform_device *m5272_devices[] __initdata = { 88static struct platform_device *m5272_devices[] __initdata = {
59 &m5272_uart, 89 &m5272_uart,
90 &m5272_fec,
60}; 91};
61 92
62/***************************************************************************/ 93/***************************************************************************/
@@ -91,6 +122,22 @@ static void __init m5272_uarts_init(void)
91 122
92/***************************************************************************/ 123/***************************************************************************/
93 124
125static void __init m5272_fec_init(void)
126{
127 u32 imr;
128
129 /* Unmask FEC interrupts at ColdFire interrupt controller */
130 imr = readl(MCF_MBAR + MCFSIM_ICR3);
131 imr = (imr & ~0x00000fff) | 0x00000ddd;
132 writel(imr, MCF_MBAR + MCFSIM_ICR3);
133
134 imr = readl(MCF_MBAR + MCFSIM_ICR1);
135 imr = (imr & ~0x0f000000) | 0x0d000000;
136 writel(imr, MCF_MBAR + MCFSIM_ICR1);
137}
138
139/***************************************************************************/
140
94void mcf_disableall(void) 141void mcf_disableall(void)
95{ 142{
96 volatile unsigned long *icrp; 143 volatile unsigned long *icrp;
@@ -155,6 +202,7 @@ void __init config_BSP(char *commandp, int size)
155static int __init init_BSP(void) 202static int __init init_BSP(void)
156{ 203{
157 m5272_uarts_init(); 204 m5272_uarts_init();
205 m5272_fec_init();
158 platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices)); 206 platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices));
159 return 0; 207 return 0;
160} 208}