aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2008-02-01 02:34:04 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 04:54:03 -0500
commit9685c43e4ea7e7267afd30157ca22af4e21e2767 (patch)
tree6d7547e3eff78564fbdc0a6dabad7f6e0604143c /arch/m68knommu
parentae1b5f0d2311057643657b71a272c4748e4b21d2 (diff)
m68knommu: platform setup for 5206 ColdFire parts
Switch to platform style configuration for 5206 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')
-rw-r--r--arch/m68knommu/platform/5206/config.c68
1 files changed, 57 insertions, 11 deletions
diff --git a/arch/m68knommu/platform/5206/config.c b/arch/m68knommu/platform/5206/config.c
index b3c4dd4cc135..8836b428a514 100644
--- a/arch/m68knommu/platform/5206/config.c
+++ b/arch/m68knommu/platform/5206/config.c
@@ -13,12 +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/mcftimer.h>
20#include <asm/mcfsim.h> 19#include <asm/mcfsim.h>
21#include <asm/mcfdma.h> 20#include <asm/mcfuart.h>
22 21
23/***************************************************************************/ 22/***************************************************************************/
24 23
@@ -26,15 +25,51 @@ void coldfire_reset(void);
26 25
27/***************************************************************************/ 26/***************************************************************************/
28 27
29/* 28static struct mcf_platform_uart m5206_uart_platform[] = {
30 * DMA channel base address table. 29 {
31 */ 30 .mapbase = MCF_MBAR + MCFUART_BASE1,
32unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { 31 .irq = 73,
33 MCF_MBAR + MCFDMA_BASE0, 32 },
34 MCF_MBAR + MCFDMA_BASE1, 33 {
34 .mapbase = MCF_MBAR + MCFUART_BASE2,
35 .irq = 74,
36 },
37 { },
38};
39
40static struct platform_device m5206_uart = {
41 .name = "mcfuart",
42 .id = 0,
43 .dev.platform_data = m5206_uart_platform,
35}; 44};
36 45
37unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS]; 46static struct platform_device *m5206_devices[] __initdata = {
47 &m5206_uart,
48};
49
50/***************************************************************************/
51
52static void __init m5206_uart_init_line(int line, int irq)
53{
54 if (line == 0) {
55 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
56 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR);
57 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1);
58 } else if (line == 1) {
59 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
60 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR);
61 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2);
62 }
63}
64
65static void __init m5206_uarts_init(void)
66{
67 const int nrlines = ARRAY_SIZE(m5206_uart_platform);
68 int line;
69
70 for (line = 0; (line < nrlines); line++)
71 m5206_uart_init_line(line, m5206_uart_platform[line].irq);
72}
38 73
39/***************************************************************************/ 74/***************************************************************************/
40 75
@@ -88,10 +123,21 @@ int mcf_timerirqpending(int timer)
88 123
89/***************************************************************************/ 124/***************************************************************************/
90 125
91void config_BSP(char *commandp, int size) 126void __init config_BSP(char *commandp, int size)
92{ 127{
93 mcf_setimr(MCFSIM_IMR_MASKALL); 128 mcf_setimr(MCFSIM_IMR_MASKALL);
94 mach_reset = coldfire_reset; 129 mach_reset = coldfire_reset;
95} 130}
96 131
97/***************************************************************************/ 132/***************************************************************************/
133
134static int __init init_BSP(void)
135{
136 m5206_uarts_init();
137 platform_add_devices(m5206_devices, ARRAY_SIZE(m5206_devices));
138 return 0;
139}
140
141arch_initcall(init_BSP);
142
143/***************************************************************************/