diff options
author | Greg Ungerer <gerg@snapgear.com> | 2008-02-01 02:34:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-02-01 04:54:03 -0500 |
commit | 4b61a353e4c893ea07ff5a812de8c0894ed5982f (patch) | |
tree | 9331a9ac544b8cd42c9b03ad5ed0b7d500e24430 /arch | |
parent | cf64c233839e97221d63ed7887b59196c8c748c3 (diff) |
m68knommu: platform setup for 523x ColdFire parts
Switch to platform style configuration for 523x 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')
-rw-r--r-- | arch/m68knommu/platform/523x/config.c | 75 |
1 files changed, 65 insertions, 10 deletions
diff --git a/arch/m68knommu/platform/523x/config.c b/arch/m68knommu/platform/523x/config.c index e7f80c8e8636..13f02611ea23 100644 --- a/arch/m68knommu/platform/523x/config.c +++ b/arch/m68knommu/platform/523x/config.c | |||
@@ -16,11 +16,11 @@ | |||
16 | #include <linux/param.h> | 16 | #include <linux/param.h> |
17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
19 | #include <asm/dma.h> | 19 | #include <linux/io.h> |
20 | #include <asm/machdep.h> | 20 | #include <asm/machdep.h> |
21 | #include <asm/coldfire.h> | 21 | #include <asm/coldfire.h> |
22 | #include <asm/mcfsim.h> | 22 | #include <asm/mcfsim.h> |
23 | #include <asm/mcfdma.h> | 23 | #include <asm/mcfuart.h> |
24 | 24 | ||
25 | /***************************************************************************/ | 25 | /***************************************************************************/ |
26 | 26 | ||
@@ -28,14 +28,58 @@ void coldfire_reset(void); | |||
28 | 28 | ||
29 | /***************************************************************************/ | 29 | /***************************************************************************/ |
30 | 30 | ||
31 | /* | 31 | static struct mcf_platform_uart m523x_uart_platform[] = { |
32 | * DMA channel base address table. | 32 | { |
33 | */ | 33 | .mapbase = MCF_MBAR + MCFUART_BASE1, |
34 | unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { | 34 | .irq = MCFINT_VECBASE + MCFINT_UART0, |
35 | MCF_MBAR + MCFDMA_BASE0, | 35 | }, |
36 | { | ||
37 | .mapbase = MCF_MBAR + MCFUART_BASE2, | ||
38 | .irq = MCFINT_VECBASE + MCFINT_UART0 + 1, | ||
39 | }, | ||
40 | { | ||
41 | .mapbase = MCF_MBAR + MCFUART_BASE3, | ||
42 | .irq = MCFINT_VECBASE + MCFINT_UART0 + 2, | ||
43 | }, | ||
44 | { }, | ||
45 | }; | ||
46 | |||
47 | static struct platform_device m523x_uart = { | ||
48 | .name = "mcfuart", | ||
49 | .id = 0, | ||
50 | .dev.platform_data = m523x_uart_platform, | ||
51 | }; | ||
52 | |||
53 | static struct platform_device *m523x_devices[] __initdata = { | ||
54 | &m523x_uart, | ||
36 | }; | 55 | }; |
37 | 56 | ||
38 | unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS]; | 57 | /***************************************************************************/ |
58 | |||
59 | #define INTC0 (MCF_MBAR + MCFICM_INTC0) | ||
60 | |||
61 | static void __init m523x_uart_init_line(int line, int irq) | ||
62 | { | ||
63 | u32 imr; | ||
64 | |||
65 | if ((line < 0) || (line > 2)) | ||
66 | return; | ||
67 | |||
68 | writeb(0x30+line, (INTC0 + MCFINTC_ICR0 + MCFINT_UART0 + line)); | ||
69 | |||
70 | imr = readl(INTC0 + MCFINTC_IMRL); | ||
71 | imr &= ~((1 << (irq - MCFINT_VECBASE)) | 1); | ||
72 | writel(imr, INTC0 + MCFINTC_IMRL); | ||
73 | } | ||
74 | |||
75 | static void __init m523x_uarts_init(void) | ||
76 | { | ||
77 | const int nrlines = ARRAY_SIZE(m523x_uart_platform); | ||
78 | int line; | ||
79 | |||
80 | for (line = 0; (line < nrlines); line++) | ||
81 | m523x_uart_init_line(line, m523x_uart_platform[line].irq); | ||
82 | } | ||
39 | 83 | ||
40 | /***************************************************************************/ | 84 | /***************************************************************************/ |
41 | 85 | ||
@@ -49,15 +93,26 @@ void mcf_disableall(void) | |||
49 | 93 | ||
50 | void mcf_autovector(unsigned int vec) | 94 | void mcf_autovector(unsigned int vec) |
51 | { | 95 | { |
52 | /* Everything is auto-vectored on the 5272 */ | 96 | /* Everything is auto-vectored on the 523x */ |
53 | } | 97 | } |
54 | 98 | ||
55 | /***************************************************************************/ | 99 | /***************************************************************************/ |
56 | 100 | ||
57 | void config_BSP(char *commandp, int size) | 101 | void __init config_BSP(char *commandp, int size) |
58 | { | 102 | { |
59 | mcf_disableall(); | 103 | mcf_disableall(); |
60 | mach_reset = coldfire_reset; | 104 | mach_reset = coldfire_reset; |
105 | m523x_uarts_init(); | ||
61 | } | 106 | } |
62 | 107 | ||
63 | /***************************************************************************/ | 108 | /***************************************************************************/ |
109 | |||
110 | static int __init init_BSP(void) | ||
111 | { | ||
112 | platform_add_devices(m523x_devices, ARRAY_SIZE(m523x_devices)); | ||
113 | return 0; | ||
114 | } | ||
115 | |||
116 | arch_initcall(init_BSP); | ||
117 | |||
118 | /***************************************************************************/ | ||