aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/m68knommu/platform/5407/config.c69
1 files changed, 57 insertions, 12 deletions
diff --git a/arch/m68knommu/platform/5407/config.c b/arch/m68knommu/platform/5407/config.c
index 2d3b62eba7ca..5ed9ba5eb961 100644
--- a/arch/m68knommu/platform/5407/config.c
+++ b/arch/m68knommu/platform/5407/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 21
22/***************************************************************************/ 22/***************************************************************************/
23 23
@@ -29,17 +29,51 @@ extern unsigned int mcf_timerlevel;
29 29
30/***************************************************************************/ 30/***************************************************************************/
31 31
32/* 32static struct mcf_platform_uart m5407_uart_platform[] = {
33 * DMA channel base address table. 33 {
34 */ 34 .mapbase = MCF_MBAR + MCFUART_BASE1,
35unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { 35 .irq = 73,
36 MCF_MBAR + MCFDMA_BASE0, 36 },
37 MCF_MBAR + MCFDMA_BASE1, 37 {
38 MCF_MBAR + MCFDMA_BASE2, 38 .mapbase = MCF_MBAR + MCFUART_BASE2,
39 MCF_MBAR + MCFDMA_BASE3, 39 .irq = 74,
40 },
41 { },
42};
43
44static struct platform_device m5407_uart = {
45 .name = "mcfuart",
46 .id = 0,
47 .dev.platform_data = m5407_uart_platform,
40}; 48};
41 49
42unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS]; 50static struct platform_device *m5407_devices[] __initdata = {
51 &m5407_uart,
52};
53
54/***************************************************************************/
55
56static void __init m5407_uart_init_line(int line, int irq)
57{
58 if (line == 0) {
59 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
60 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR);
61 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART1);
62 } else if (line == 1) {
63 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
64 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR);
65 mcf_setimr(mcf_getimr() & ~MCFSIM_IMR_UART2);
66 }
67}
68
69static void __init m5407_uarts_init(void)
70{
71 const int nrlines = ARRAY_SIZE(m5407_uart_platform);
72 int line;
73
74 for (line = 0; (line < nrlines); line++)
75 m5407_uart_init_line(line, m5407_uart_platform[line].irq);
76}
43 77
44/***************************************************************************/ 78/***************************************************************************/
45 79
@@ -90,7 +124,7 @@ int mcf_timerirqpending(int timer)
90 124
91/***************************************************************************/ 125/***************************************************************************/
92 126
93void config_BSP(char *commandp, int size) 127void __init config_BSP(char *commandp, int size)
94{ 128{
95 mcf_setimr(MCFSIM_IMR_MASKALL); 129 mcf_setimr(MCFSIM_IMR_MASKALL);
96 130
@@ -105,3 +139,14 @@ void config_BSP(char *commandp, int size)
105} 139}
106 140
107/***************************************************************************/ 141/***************************************************************************/
142
143static int __init init_BSP(void)
144{
145 m5407_uarts_init();
146 platform_add_devices(m5407_devices, ARRAY_SIZE(m5407_devices));
147 return 0;
148}
149
150arch_initcall(init_BSP);
151
152/***************************************************************************/