diff options
Diffstat (limited to 'arch/m68k/platform/5272/config.c')
-rw-r--r-- | arch/m68k/platform/5272/config.c | 84 |
1 files changed, 9 insertions, 75 deletions
diff --git a/arch/m68k/platform/5272/config.c b/arch/m68k/platform/5272/config.c index 65bb582734e1..e68bc7a148eb 100644 --- a/arch/m68k/platform/5272/config.c +++ b/arch/m68k/platform/5272/config.c | |||
@@ -30,84 +30,18 @@ unsigned char ledbank = 0xff; | |||
30 | 30 | ||
31 | /***************************************************************************/ | 31 | /***************************************************************************/ |
32 | 32 | ||
33 | static struct mcf_platform_uart m5272_uart_platform[] = { | 33 | static void __init m5272_uarts_init(void) |
34 | { | ||
35 | .mapbase = MCF_MBAR + MCFUART_BASE1, | ||
36 | .irq = MCF_IRQ_UART1, | ||
37 | }, | ||
38 | { | ||
39 | .mapbase = MCF_MBAR + MCFUART_BASE2, | ||
40 | .irq = MCF_IRQ_UART2, | ||
41 | }, | ||
42 | { }, | ||
43 | }; | ||
44 | |||
45 | static struct platform_device m5272_uart = { | ||
46 | .name = "mcfuart", | ||
47 | .id = 0, | ||
48 | .dev.platform_data = m5272_uart_platform, | ||
49 | }; | ||
50 | |||
51 | static struct resource m5272_fec_resources[] = { | ||
52 | { | ||
53 | .start = MCF_MBAR + 0x840, | ||
54 | .end = MCF_MBAR + 0x840 + 0x1cf, | ||
55 | .flags = IORESOURCE_MEM, | ||
56 | }, | ||
57 | { | ||
58 | .start = MCF_IRQ_ERX, | ||
59 | .end = MCF_IRQ_ERX, | ||
60 | .flags = IORESOURCE_IRQ, | ||
61 | }, | ||
62 | { | ||
63 | .start = MCF_IRQ_ETX, | ||
64 | .end = MCF_IRQ_ETX, | ||
65 | .flags = IORESOURCE_IRQ, | ||
66 | }, | ||
67 | { | ||
68 | .start = MCF_IRQ_ENTC, | ||
69 | .end = MCF_IRQ_ENTC, | ||
70 | .flags = IORESOURCE_IRQ, | ||
71 | }, | ||
72 | }; | ||
73 | |||
74 | static struct platform_device m5272_fec = { | ||
75 | .name = "fec", | ||
76 | .id = 0, | ||
77 | .num_resources = ARRAY_SIZE(m5272_fec_resources), | ||
78 | .resource = m5272_fec_resources, | ||
79 | }; | ||
80 | |||
81 | static struct platform_device *m5272_devices[] __initdata = { | ||
82 | &m5272_uart, | ||
83 | &m5272_fec, | ||
84 | }; | ||
85 | |||
86 | /***************************************************************************/ | ||
87 | |||
88 | static void __init m5272_uart_init_line(int line, int irq) | ||
89 | { | 34 | { |
90 | u32 v; | 35 | u32 v; |
91 | 36 | ||
92 | if ((line >= 0) && (line < 2)) { | 37 | /* Enable the output lines for the serial ports */ |
93 | /* Enable the output lines for the serial ports */ | 38 | v = readl(MCF_MBAR + MCFSIM_PBCNT); |
94 | v = readl(MCF_MBAR + MCFSIM_PBCNT); | 39 | v = (v & ~0x000000ff) | 0x00000055; |
95 | v = (v & ~0x000000ff) | 0x00000055; | 40 | writel(v, MCF_MBAR + MCFSIM_PBCNT); |
96 | writel(v, MCF_MBAR + MCFSIM_PBCNT); | ||
97 | |||
98 | v = readl(MCF_MBAR + MCFSIM_PDCNT); | ||
99 | v = (v & ~0x000003fc) | 0x000002a8; | ||
100 | writel(v, MCF_MBAR + MCFSIM_PDCNT); | ||
101 | } | ||
102 | } | ||
103 | |||
104 | static void __init m5272_uarts_init(void) | ||
105 | { | ||
106 | const int nrlines = ARRAY_SIZE(m5272_uart_platform); | ||
107 | int line; | ||
108 | 41 | ||
109 | for (line = 0; (line < nrlines); line++) | 42 | v = readl(MCF_MBAR + MCFSIM_PDCNT); |
110 | m5272_uart_init_line(line, m5272_uart_platform[line].irq); | 43 | v = (v & ~0x000003fc) | 0x000002a8; |
44 | writel(v, MCF_MBAR + MCFSIM_PDCNT); | ||
111 | } | 45 | } |
112 | 46 | ||
113 | /***************************************************************************/ | 47 | /***************************************************************************/ |
@@ -146,6 +80,7 @@ void __init config_BSP(char *commandp, int size) | |||
146 | #endif | 80 | #endif |
147 | 81 | ||
148 | mach_reset = m5272_cpu_reset; | 82 | mach_reset = m5272_cpu_reset; |
83 | mach_sched_init = hw_timer_init; | ||
149 | } | 84 | } |
150 | 85 | ||
151 | /***************************************************************************/ | 86 | /***************************************************************************/ |
@@ -167,7 +102,6 @@ static int __init init_BSP(void) | |||
167 | { | 102 | { |
168 | m5272_uarts_init(); | 103 | m5272_uarts_init(); |
169 | fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status); | 104 | fixed_phy_add(PHY_POLL, 0, &nettel_fixed_phy_status); |
170 | platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices)); | ||
171 | return 0; | 105 | return 0; |
172 | } | 106 | } |
173 | 107 | ||