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/523x/config.c | |
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/523x/config.c')
-rw-r--r-- | arch/m68knommu/platform/523x/config.c | 51 |
1 files changed, 51 insertions, 0 deletions
diff --git a/arch/m68knommu/platform/523x/config.c b/arch/m68knommu/platform/523x/config.c index 13f02611ea2..74133f27b30 100644 --- a/arch/m68knommu/platform/523x/config.c +++ b/arch/m68knommu/platform/523x/config.c | |||
@@ -50,8 +50,39 @@ static struct platform_device m523x_uart = { | |||
50 | .dev.platform_data = m523x_uart_platform, | 50 | .dev.platform_data = m523x_uart_platform, |
51 | }; | 51 | }; |
52 | 52 | ||
53 | static struct resource m523x_fec_resources[] = { | ||
54 | { | ||
55 | .start = MCF_MBAR + 0x1000, | ||
56 | .end = MCF_MBAR + 0x1000 + 0x7ff, | ||
57 | .flags = IORESOURCE_MEM, | ||
58 | }, | ||
59 | { | ||
60 | .start = 64 + 23, | ||
61 | .end = 64 + 23, | ||
62 | .flags = IORESOURCE_IRQ, | ||
63 | }, | ||
64 | { | ||
65 | .start = 64 + 27, | ||
66 | .end = 64 + 27, | ||
67 | .flags = IORESOURCE_IRQ, | ||
68 | }, | ||
69 | { | ||
70 | .start = 64 + 29, | ||
71 | .end = 64 + 29, | ||
72 | .flags = IORESOURCE_IRQ, | ||
73 | }, | ||
74 | }; | ||
75 | |||
76 | static struct platform_device m523x_fec = { | ||
77 | .name = "fec", | ||
78 | .id = 0, | ||
79 | .num_resources = ARRAY_SIZE(m523x_fec_resources), | ||
80 | .resource = m523x_fec_resources, | ||
81 | }; | ||
82 | |||
53 | static struct platform_device *m523x_devices[] __initdata = { | 83 | static struct platform_device *m523x_devices[] __initdata = { |
54 | &m523x_uart, | 84 | &m523x_uart, |
85 | &m523x_fec, | ||
55 | }; | 86 | }; |
56 | 87 | ||
57 | /***************************************************************************/ | 88 | /***************************************************************************/ |
@@ -83,6 +114,25 @@ static void __init m523x_uarts_init(void) | |||
83 | 114 | ||
84 | /***************************************************************************/ | 115 | /***************************************************************************/ |
85 | 116 | ||
117 | static void __init m523x_fec_init(void) | ||
118 | { | ||
119 | u32 imr; | ||
120 | |||
121 | /* Unmask FEC interrupts at ColdFire interrupt controller */ | ||
122 | writeb(0x28, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 23); | ||
123 | writeb(0x27, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 27); | ||
124 | writeb(0x26, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_ICR0 + 29); | ||
125 | |||
126 | imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH); | ||
127 | imr &= ~0xf; | ||
128 | writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH); | ||
129 | imr = readl(MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL); | ||
130 | imr &= ~0xff800001; | ||
131 | writel(imr, MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL); | ||
132 | } | ||
133 | |||
134 | /***************************************************************************/ | ||
135 | |||
86 | void mcf_disableall(void) | 136 | void mcf_disableall(void) |
87 | { | 137 | { |
88 | *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff; | 138 | *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff; |
@@ -103,6 +153,7 @@ void __init config_BSP(char *commandp, int size) | |||
103 | mcf_disableall(); | 153 | mcf_disableall(); |
104 | mach_reset = coldfire_reset; | 154 | mach_reset = coldfire_reset; |
105 | m523x_uarts_init(); | 155 | m523x_uarts_init(); |
156 | m523x_fec_init(); | ||
106 | } | 157 | } |
107 | 158 | ||
108 | /***************************************************************************/ | 159 | /***************************************************************************/ |