aboutsummaryrefslogtreecommitdiffstats
path: root/arch/m68knommu
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2008-02-01 02:34:58 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 04:55:43 -0500
commitb2e1810e6467455e6dd28c7c7170c2e9c37fd1b0 (patch)
tree401c856ebce465b3d45caae93574dced3b0699b4 /arch/m68knommu
parente206da0bb3ccb479d624172580963bd70431b455 (diff)
m68knommu: platform setup for 532x ColdFire parts
Switch to platform style configuration for 532x 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')
-rw-r--r--arch/m68knommu/platform/532x/config.c80
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/* 42static struct mcf_platform_uart m532x_uart_platform[] = {
42 * DMA channel base address table. 43 {
43 */ 44 .mapbase = MCF_MBAR + MCFUART_BASE1,
44unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { }; 45 .irq = MCFINT_VECBASE + MCFINT_UART0,
45unsigned 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
58static struct platform_device m532x_uart = {
59 .name = "mcfuart",
60 .id = 0,
61 .dev.platform_data = m532x_uart_platform,
62};
63
64static struct platform_device *m532x_devices[] __initdata = {
65 &m532x_uart,
66};
67
68/***************************************************************************/
69
70static 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
88static 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
83void config_BSP(char *commandp, int size) 133void __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/********************************************************************/ 164static 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
171arch_initcall(init_BSP);
172
173/***************************************************************************/
174/* Board initialization */
175/***************************************************************************/
116/* 176/*
117 * PLL min/max specifications 177 * PLL min/max specifications
118 */ 178 */