diff options
Diffstat (limited to 'arch/m68knommu')
-rw-r--r-- | arch/m68knommu/platform/532x/config.c | 80 |
1 files changed, 70 insertions, 10 deletions
diff --git a/arch/m68knommu/platform/532x/config.c b/arch/m68knommu/platform/532x/config.c index f77328b7b6db..758bc7a9af96 100644 --- a/arch/m68knommu/platform/532x/config.c +++ b/arch/m68knommu/platform/532x/config.c | |||
@@ -21,10 +21,11 @@ | |||
21 | #include <linux/param.h> | 21 | #include <linux/param.h> |
22 | #include <linux/init.h> | 22 | #include <linux/init.h> |
23 | #include <linux/interrupt.h> | 23 | #include <linux/interrupt.h> |
24 | #include <asm/dma.h> | 24 | #include <linux/io.h> |
25 | #include <asm/machdep.h> | 25 | #include <asm/machdep.h> |
26 | #include <asm/coldfire.h> | 26 | #include <asm/coldfire.h> |
27 | #include <asm/mcfsim.h> | 27 | #include <asm/mcfsim.h> |
28 | #include <asm/mcfuart.h> | ||
28 | #include <asm/mcfdma.h> | 29 | #include <asm/mcfdma.h> |
29 | #include <asm/mcfwdebug.h> | 30 | #include <asm/mcfwdebug.h> |
30 | 31 | ||
@@ -38,11 +39,60 @@ extern unsigned int mcf_timerlevel; | |||
38 | 39 | ||
39 | /***************************************************************************/ | 40 | /***************************************************************************/ |
40 | 41 | ||
41 | /* | 42 | static struct mcf_platform_uart m532x_uart_platform[] = { |
42 | * DMA channel base address table. | 43 | { |
43 | */ | 44 | .mapbase = MCF_MBAR + MCFUART_BASE1, |
44 | unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { }; | 45 | .irq = MCFINT_VECBASE + MCFINT_UART0, |
45 | unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS]; | 46 | }, |
47 | { | ||
48 | .mapbase = MCF_MBAR + MCFUART_BASE2, | ||
49 | .irq = MCFINT_VECBASE + MCFINT_UART1, | ||
50 | }, | ||
51 | { | ||
52 | .mapbase = MCF_MBAR + MCFUART_BASE3, | ||
53 | .irq = MCFINT_VECBASE + MCFINT_UART2, | ||
54 | }, | ||
55 | { }, | ||
56 | }; | ||
57 | |||
58 | static struct platform_device m532x_uart = { | ||
59 | .name = "mcfuart", | ||
60 | .id = 0, | ||
61 | .dev.platform_data = m532x_uart_platform, | ||
62 | }; | ||
63 | |||
64 | static struct platform_device *m532x_devices[] __initdata = { | ||
65 | &m532x_uart, | ||
66 | }; | ||
67 | |||
68 | /***************************************************************************/ | ||
69 | |||
70 | static void __init m532x_uart_init_line(int line, int irq) | ||
71 | { | ||
72 | if (line == 0) { | ||
73 | MCF_INTC0_ICR26 = 0x3; | ||
74 | MCF_INTC0_CIMR = 26; | ||
75 | /* GPIO initialization */ | ||
76 | MCF_GPIO_PAR_UART |= 0x000F; | ||
77 | } else if (line == 1) { | ||
78 | MCF_INTC0_ICR27 = 0x3; | ||
79 | MCF_INTC0_CIMR = 27; | ||
80 | /* GPIO initialization */ | ||
81 | MCF_GPIO_PAR_UART |= 0x0FF0; | ||
82 | } else if (line == 2) { | ||
83 | MCF_INTC0_ICR28 = 0x3; | ||
84 | MCF_INTC0_CIMR = 28; | ||
85 | } | ||
86 | } | ||
87 | |||
88 | static void __init m532x_uarts_init(void) | ||
89 | { | ||
90 | const int nrlines = ARRAY_SIZE(m532x_uart_platform); | ||
91 | int line; | ||
92 | |||
93 | for (line = 0; (line < nrlines); line++) | ||
94 | m532x_uart_init_line(line, m532x_uart_platform[line].irq); | ||
95 | } | ||
46 | 96 | ||
47 | /***************************************************************************/ | 97 | /***************************************************************************/ |
48 | 98 | ||
@@ -80,7 +130,7 @@ int mcf_timerirqpending(int timer) | |||
80 | 130 | ||
81 | /***************************************************************************/ | 131 | /***************************************************************************/ |
82 | 132 | ||
83 | void config_BSP(char *commandp, int size) | 133 | void __init config_BSP(char *commandp, int size) |
84 | { | 134 | { |
85 | mcf_setimr(MCFSIM_IMR_MASKALL); | 135 | mcf_setimr(MCFSIM_IMR_MASKALL); |
86 | 136 | ||
@@ -99,7 +149,7 @@ void config_BSP(char *commandp, int size) | |||
99 | mcf_profilevector = 64+33; | 149 | mcf_profilevector = 64+33; |
100 | mach_reset = coldfire_reset; | 150 | mach_reset = coldfire_reset; |
101 | 151 | ||
102 | #ifdef MCF_BDM_DISABLE | 152 | #ifdef CONFIG_BDM_DISABLE |
103 | /* | 153 | /* |
104 | * Disable the BDM clocking. This also turns off most of the rest of | 154 | * Disable the BDM clocking. This also turns off most of the rest of |
105 | * the BDM device. This is good for EMC reasons. This option is not | 155 | * the BDM device. This is good for EMC reasons. This option is not |
@@ -110,9 +160,19 @@ void config_BSP(char *commandp, int size) | |||
110 | } | 160 | } |
111 | 161 | ||
112 | /***************************************************************************/ | 162 | /***************************************************************************/ |
113 | /* Board initialization */ | ||
114 | 163 | ||
115 | /********************************************************************/ | 164 | static int __init init_BSP(void) |
165 | { | ||
166 | m532x_uarts_init(); | ||
167 | platform_add_devices(m532x_devices, ARRAY_SIZE(m532x_devices)); | ||
168 | return 0; | ||
169 | } | ||
170 | |||
171 | arch_initcall(init_BSP); | ||
172 | |||
173 | /***************************************************************************/ | ||
174 | /* Board initialization */ | ||
175 | /***************************************************************************/ | ||
116 | /* | 176 | /* |
117 | * PLL min/max specifications | 177 | * PLL min/max specifications |
118 | */ | 178 | */ |