diff options
author | Greg Ungerer <gerg@snapgear.com> | 2008-02-01 02:35:03 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-02-01 04:55:44 -0500 |
commit | c0ecfcd4b8998441cb6c647ee561e55cc3cd7e81 (patch) | |
tree | db5c67d9e3571820e8c03a34f158d81c3965b9f6 /arch/m68knommu/platform | |
parent | b2e1810e6467455e6dd28c7c7170c2e9c37fd1b0 (diff) |
m68knommu: platform setup for 5407 ColdFire parts
Switch to platform style configuration for 5407 ColdFire parts.
Initial support is for the UARTs. DMA support moved to common code
for all ColdFire parts.
Signed-off-by: Greg Ungerer <gerg@uclinux.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/m68knommu/platform')
-rw-r--r-- | arch/m68knommu/platform/5407/config.c | 69 |
1 files changed, 57 insertions, 12 deletions
diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c index 2d3b62eba7ca..5ed9ba5eb961 100644 --- a/arch/m68knommu/platform/5407/config.c +++ b/arch/m68knommu/platform/5407/config.c | |||
@@ -13,11 +13,11 @@ | |||
13 | #include <linux/param.h> | 13 | #include <linux/param.h> |
14 | #include <linux/init.h> | 14 | #include <linux/init.h> |
15 | #include <linux/interrupt.h> | 15 | #include <linux/interrupt.h> |
16 | #include <asm/dma.h> | 16 | #include <linux/io.h> |
17 | #include <asm/machdep.h> | 17 | #include <asm/machdep.h> |
18 | #include <asm/coldfire.h> | 18 | #include <asm/coldfire.h> |
19 | #include <asm/mcfsim.h> | 19 | #include <asm/mcfsim.h> |
20 | #include <asm/mcfdma.h> | 20 | #include <asm/mcfuart.h> |
21 | 21 | ||
22 | /***************************************************************************/ | 22 | /***************************************************************************/ |
23 | 23 | ||
@@ -29,17 +29,51 @@ extern unsigned int mcf_timerlevel; | |||
29 | 29 | ||
30 | /***************************************************************************/ | 30 | /***************************************************************************/ |
31 | 31 | ||
32 | /* | 32 | static struct mcf_platform_uart m5407_uart_platform[] = { |
33 | * DMA channel base address table. | 33 | { |
34 | */ | 34 | .mapbase = MCF_MBAR + MCFUART_BASE1, |
35 | unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { | 35 | .irq = 73, |
36 | MCF_MBAR + MCFDMA_BASE0, | 36 | }, |
37 | MCF_MBAR + MCFDMA_BASE1, | 37 | { |
38 | MCF_MBAR + MCFDMA_BASE2, | 38 | .mapbase = MCF_MBAR + MCFUART_BASE2, |
39 | MCF_MBAR + MCFDMA_BASE3, | 39 | .irq = 74, |
40 | }, | ||
41 | { }, | ||
42 | }; | ||
43 | |||
44 | static struct platform_device m5407_uart = { | ||
45 | .name = "mcfuart", | ||
46 | .id = 0, | ||
47 | .dev.platform_data = m5407_uart_platform, | ||
40 | }; | 48 | }; |
41 | 49 | ||
42 | unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS]; | 50 | static struct platform_device *m5407_devices[] __initdata = { |
51 | &m5407_uart, | ||
52 | }; | ||
53 | |||
54 | /***************************************************************************/ | ||
55 | |||
56 | static void __init m5407_uart_init_line(int line, int irq) | ||
57 | { | ||
58 | if (line == 0) { | ||
59 | writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR); | ||
60 | writeb(irq, MCFUART_BASE1 + MCFUART_UIVR); | ||
61 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1); | ||
62 | } else if (line == 1) { | ||
63 | writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR); | ||
64 | writeb(irq, MCFUART_BASE2 + MCFUART_UIVR); | ||
65 | mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2); | ||
66 | } | ||
67 | } | ||
68 | |||
69 | static void __init m5407_uarts_init(void) | ||
70 | { | ||
71 | const int nrlines = ARRAY_SIZE(m5407_uart_platform); | ||
72 | int line; | ||
73 | |||
74 | for (line = 0; (line < nrlines); line++) | ||
75 | m5407_uart_init_line(line, m5407_uart_platform[line].irq); | ||
76 | } | ||
43 | 77 | ||
44 | /***************************************************************************/ | 78 | /***************************************************************************/ |
45 | 79 | ||
@@ -90,7 +124,7 @@ int mcf_timerirqpending(int timer) | |||
90 | 124 | ||
91 | /***************************************************************************/ | 125 | /***************************************************************************/ |
92 | 126 | ||
93 | void config_BSP(char *commandp, int size) | 127 | void __init config_BSP(char *commandp, int size) |
94 | { | 128 | { |
95 | mcf_setimr(MCFSIM_IMR_MASKALL); | 129 | mcf_setimr(MCFSIM_IMR_MASKALL); |
96 | 130 | ||
@@ -105,3 +139,14 @@ void config_BSP(char *commandp, int size) | |||
105 | } | 139 | } |
106 | 140 | ||
107 | /***************************************************************************/ | 141 | /***************************************************************************/ |
142 | |||
143 | static int __init init_BSP(void) | ||
144 | { | ||
145 | m5407_uarts_init(); | ||
146 | platform_add_devices(m5407_devices, ARRAY_SIZE(m5407_devices)); | ||
147 | return 0; | ||
148 | } | ||
149 | |||
150 | arch_initcall(init_BSP); | ||
151 | |||
152 | /***************************************************************************/ | ||