aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu
diff options
context:
space:
mode:
Diffstat (limited to 'arch/m68knommu')
-rw-r--r--arch/m68knommu/platform/5307/config.c71
1 files changed, 58 insertions, 13 deletions
diff --git a/arch/m68knommu/platform/5307/config.c b/arch/m68knommu/platform/5307/config.c
index 6040821e637d..5c43d79e42ac 100644
--- a/arch/m68knommu/platform/5307/config.c
+++ b/arch/m68knommu/platform/5307/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#include <asm/mcfwdebug.h> 21#include <asm/mcfwdebug.h>
22 22
23/***************************************************************************/ 23/***************************************************************************/
@@ -38,17 +38,51 @@ unsigned char ledbank = 0xff;
38 38
39/***************************************************************************/ 39/***************************************************************************/
40 40
41/* 41static struct mcf_platform_uart m5307_uart_platform[] = {
42 * DMA channel base address table. 42 {
43 */ 43 .mapbase = MCF_MBAR + MCFUART_BASE1,
44unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { 44 .irq = 73,
45 MCF_MBAR + MCFDMA_BASE0, 45 },
46 MCF_MBAR + MCFDMA_BASE1, 46 {
47 MCF_MBAR + MCFDMA_BASE2, 47 .mapbase = MCF_MBAR + MCFUART_BASE2,
48 MCF_MBAR + MCFDMA_BASE3, 48 .irq = 74,
49 },
50 { },
51};
52
53static struct platform_device m5307_uart = {
54 .name = "mcfuart",
55 .id = 0,
56 .dev.platform_data = m5307_uart_platform,
49}; 57};
50 58
51unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS]; 59static struct platform_device *m5307_devices[] __initdata = {
60 &m5307_uart,
61};
62
63/***************************************************************************/
64
65static void __init m5307_uart_init_line(int line, int irq)
66{
67 if (line == 0) {
68 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
69 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR);
70 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1);
71 } else if (line == 1) {
72 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
73 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR);
74 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2);
75 }
76}
77
78static void __init m5307_uarts_init(void)
79{
80 const int nrlines = ARRAY_SIZE(m5307_uart_platform);
81 int line;
82
83 for (line = 0; (line < nrlines); line++)
84 m5307_uart_init_line(line, m5307_uart_platform[line].irq);
85}
52 86
53/***************************************************************************/ 87/***************************************************************************/
54 88
@@ -99,7 +133,7 @@ int mcf_timerirqpending(int timer)
99 133
100/***************************************************************************/ 134/***************************************************************************/
101 135
102void config_BSP(char *commandp, int size) 136void __init config_BSP(char *commandp, int size)
103{ 137{
104 mcf_setimr(MCFSIM_IMR_MASKALL); 138 mcf_setimr(MCFSIM_IMR_MASKALL);
105 139
@@ -117,7 +151,7 @@ void config_BSP(char *commandp, int size)
117 151
118 mach_reset = coldfire_reset; 152 mach_reset = coldfire_reset;
119 153
120#ifdef MCF_BDM_DISABLE 154#ifdef CONFIG_BDM_DISABLE
121 /* 155 /*
122 * Disable the BDM clocking. This also turns off most of the rest of 156 * Disable the BDM clocking. This also turns off most of the rest of
123 * the BDM device. This is good for EMC reasons. This option is not 157 * the BDM device. This is good for EMC reasons. This option is not
@@ -128,3 +162,14 @@ void config_BSP(char *commandp, int size)
128} 162}
129 163
130/***************************************************************************/ 164/***************************************************************************/
165
166static int __init init_BSP(void)
167{
168 m5307_uarts_init();
169 platform_add_devices(m5307_devices, ARRAY_SIZE(m5307_devices));
170 return 0;
171}
172
173arch_initcall(init_BSP);
174
175/***************************************************************************/