aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2008-02-01 02:34:08 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 04:54:03 -0500
commitcf64c233839e97221d63ed7887b59196c8c748c3 (patch)
tree2d83cc2619ced36f48eb1737383712f456354fc2 /arch
parent9685c43e4ea7e7267afd30157ca22af4e21e2767 (diff)
m68knommu: platform setup for 5206e ColdFire parts
Switch to platform style configuration for 5206e ColdFire parts. Initial support is for the UARTs. DMA support is moved to common code. 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/5206e/config.c66
1 files changed, 57 insertions, 9 deletions
diff --git a/arch/m68knommu/platform/5206e/config.c b/arch/m68knommu/platform/5206e/config.c
index f84a4aea8cb6..b555b5cc4b0b 100644
--- a/arch/m68knommu/platform/5206e/config.c
+++ b/arch/m68knommu/platform/5206e/config.c
@@ -10,8 +10,9 @@
10 10
11#include <linux/kernel.h> 11#include <linux/kernel.h>
12#include <linux/param.h> 12#include <linux/param.h>
13#include <linux/init.h>
13#include <linux/interrupt.h> 14#include <linux/interrupt.h>
14#include <asm/dma.h> 15#include <linux/io.h>
15#include <asm/machdep.h> 16#include <asm/machdep.h>
16#include <asm/coldfire.h> 17#include <asm/coldfire.h>
17#include <asm/mcfsim.h> 18#include <asm/mcfsim.h>
@@ -23,15 +24,51 @@ void coldfire_reset(void);
23 24
24/***************************************************************************/ 25/***************************************************************************/
25 26
26/* 27static struct mcf_platform_uart m5206e_uart_platform[] = {
27 * DMA channel base address table. 28 {
28 */ 29 .mapbase = MCF_MBAR + MCFUART_BASE1,
29unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { 30 .irq = 73,
30 MCF_MBAR + MCFDMA_BASE0, 31 },
31 MCF_MBAR + MCFDMA_BASE1, 32 {
33 .mapbase = MCF_MBAR + MCFUART_BASE2,
34 .irq = 74,
35 },
36 { },
37};
38
39static struct platform_device m5206e_uart = {
40 .name = "mcfuart",
41 .id = 0,
42 .dev.platform_data = m5206e_uart_platform,
32}; 43};
33 44
34unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS]; 45static struct platform_device *m5206e_devices[] __initdata = {
46 &m5206e_uart,
47};
48
49/***************************************************************************/
50
51static void __init m5206_uart_init_line(int line, int irq)
52{
53 if (line == 0) {
54 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
55 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR);
56 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1);
57 } else if (line == 1) {
58 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
59 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR);
60 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2);
61 }
62}
63
64static void __init m5206e_uarts_init(void)
65{
66 const int nrlines = ARRAY_SIZE(m5206e_uart_platform);
67 int line;
68
69 for (line = 0; (line < nrlines); line++)
70 m5206e_uart_init_line(line, m5206e_uart_platform[line].irq);
71}
35 72
36/***************************************************************************/ 73/***************************************************************************/
37 74
@@ -85,7 +122,7 @@ int mcf_timerirqpending(int timer)
85 122
86/***************************************************************************/ 123/***************************************************************************/
87 124
88void config_BSP(char *commandp, int size) 125void __init config_BSP(char *commandp, int size)
89{ 126{
90 mcf_setimr(MCFSIM_IMR_MASKALL); 127 mcf_setimr(MCFSIM_IMR_MASKALL);
91 128
@@ -99,3 +136,14 @@ void config_BSP(char *commandp, int size)
99} 136}
100 137
101/***************************************************************************/ 138/***************************************************************************/
139
140static int __init init_BSP(void)
141{
142 m5206e_uarts_init();
143 platform_add_devices(m5206e_devices, ARRAY_SIZE(m5206e_devices));
144 return 0;
145}
146
147arch_initcall(init_BSP);
148
149/***************************************************************************/