aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu/platform
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2008-02-01 02:34:30 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 04:55:43 -0500
commit5f84bd52f03f8606982c75dfbda8c4cc1b725fee (patch)
treeac6e4f3f29b4d203ddee57d480374ad6986e8baf /arch/m68knommu/platform
parent84e6defae684656193621a5812f51ff3561550b1 (diff)
m68knommu: platform setup for 5249 ColdFire parts
Switch to platform style configuration for 5249 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/5249/config.c69
1 files changed, 57 insertions, 12 deletions
diff --git a/arch/m68knommu/platform/5249/config.c b/arch/m68knommu/platform/5249/config.c
index d4d39435cb15..76a2c785245e 100644
--- a/arch/m68knommu/platform/5249/config.c
+++ b/arch/m68knommu/platform/5249/config.c
@@ -12,11 +12,11 @@
12#include <linux/param.h> 12#include <linux/param.h>
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/interrupt.h> 14#include <linux/interrupt.h>
15#include <asm/dma.h> 15#include <linux/io.h>
16#include <asm/machdep.h> 16#include <asm/machdep.h>
17#include <asm/coldfire.h> 17#include <asm/coldfire.h>
18#include <asm/mcfsim.h> 18#include <asm/mcfsim.h>
19#include <asm/mcfdma.h> 19#include <asm/mcfuart.h>
20 20
21/***************************************************************************/ 21/***************************************************************************/
22 22
@@ -24,17 +24,51 @@ void coldfire_reset(void);
24 24
25/***************************************************************************/ 25/***************************************************************************/
26 26
27/* 27static struct mcf_platform_uart m5249_uart_platform[] = {
28 * DMA channel base address table. 28 {
29 */ 29 .mapbase = MCF_MBAR + MCFUART_BASE1,
30unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { 30 .irq = 73,
31 MCF_MBAR + MCFDMA_BASE0, 31 },
32 MCF_MBAR + MCFDMA_BASE1, 32 {
33 MCF_MBAR + MCFDMA_BASE2, 33 .mapbase = MCF_MBAR + MCFUART_BASE2,
34 MCF_MBAR + MCFDMA_BASE3, 34 .irq = 74,
35 }
35}; 36};
36 37
37unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS]; 38static struct platform_device m5249_uart = {
39 .name = "mcfuart",
40 .id = 0,
41 .dev.platform_data = m5249_uart_platform,
42};
43
44static struct platform_device *m5249_devices[] __initdata = {
45 &m5249_uart,
46};
47
48/***************************************************************************/
49
50static void __init m5249_uart_init_line(int line, int irq)
51{
52 if (line == 0) {
53 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
54 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR);
55 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1);
56 } else if (line == 1) {
57 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
58 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR);
59 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2);
60 }
61}
62
63static void __init m5249_uarts_init(void)
64{
65 const int nrlines = ARRAY_SIZE(m5249_uart_platform);
66 int line;
67
68 for (line = 0; (line < nrlines); line++)
69 m5249_uart_init_line(line, m5249_uart_platform[line].irq);
70}
71
38 72
39/***************************************************************************/ 73/***************************************************************************/
40 74
@@ -85,10 +119,21 @@ int mcf_timerirqpending(int timer)
85 119
86/***************************************************************************/ 120/***************************************************************************/
87 121
88void config_BSP(char *commandp, int size) 122void __init config_BSP(char *commandp, int size)
89{ 123{
90 mcf_setimr(MCFSIM_IMR_MASKALL); 124 mcf_setimr(MCFSIM_IMR_MASKALL);
91 mach_reset = coldfire_reset; 125 mach_reset = coldfire_reset;
92} 126}
93 127
94/***************************************************************************/ 128/***************************************************************************/
129
130static int __init init_BSP(void)
131{
132 m5249_uarts_init();
133 platform_add_devices(m5249_devices, ARRAY_SIZE(m5249_devices));
134 return 0;
135}
136
137arch_initcall(init_BSP);
138
139/***************************************************************************/