aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorGreg Ungerer <gerg@snapgear.com>2008-02-01 02:34:32 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2008-02-01 04:55:43 -0500
commit84e6defae684656193621a5812f51ff3561550b1 (patch)
tree0ee9abaaa449fffb0cad0071df2139670000eee2 /arch
parent7dabb9ad8de527c3afef055a3ea18d027a4cca63 (diff)
m68knommu: platform setup for 5272 ColdFire parts
Switch to platform style configuration for 5272 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')
-rw-r--r--arch/m68knommu/platform/5272/config.c72
1 files changed, 63 insertions, 9 deletions
diff --git a/arch/m68knommu/platform/5272/config.c b/arch/m68knommu/platform/5272/config.c
index 634a6375e4a5..2a3cf5ea1336 100644
--- a/arch/m68knommu/platform/5272/config.c
+++ b/arch/m68knommu/platform/5272/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
@@ -37,14 +37,57 @@ unsigned char ledbank = 0xff;
37 37
38/***************************************************************************/ 38/***************************************************************************/
39 39
40/* 40static struct mcf_platform_uart m5272_uart_platform[] = {
41 * DMA channel base address table. 41 {
42 */ 42 .mapbase = MCF_MBAR + MCFUART_BASE1,
43unsigned int dma_base_addr[MAX_M68K_DMA_CHANNELS] = { 43 .irq = 73,
44 MCF_MBAR + MCFDMA_BASE0, 44 },
45 {
46 .mapbase = MCF_MBAR + MCFUART_BASE2,
47 .irq = 74,
48 },
49 { },
45}; 50};
46 51
47unsigned int dma_device_address[MAX_M68K_DMA_CHANNELS]; 52static struct platform_device m5272_uart = {
53 .name = "mcfuart",
54 .id = 0,
55 .dev.platform_data = m5272_uart_platform,
56};
57
58static struct platform_device *m5272_devices[] __initdata = {
59 &m5272_uart,
60};
61
62/***************************************************************************/
63
64static void __init m5272_uart_init_line(int line, int irq)
65{
66 u32 v;
67
68 if ((line >= 0) && (line < 2)) {
69 v = (line) ? 0x0e000000 : 0xe0000000;
70 writel(v, MCF_MBAR + MCFSIM_ICR2);
71
72 /* Enable the output lines for the serial ports */
73 v = readl(MCF_MBAR + MCFSIM_PBCNT);
74 v = (v & ~0x000000ff) | 0x00000055;
75 writel(v, MCF_MBAR + MCFSIM_PBCNT);
76
77 v = readl(MCF_MBAR + MCFSIM_PDCNT);
78 v = (v & ~0x000003fc) | 0x000002a8;
79 writel(v, MCF_MBAR + MCFSIM_PDCNT);
80 }
81}
82
83static void __init m5272_uarts_init(void)
84{
85 const int nrlines = ARRAY_SIZE(m5272_uart_platform);
86 int line;
87
88 for (line = 0; (line < nrlines); line++)
89 m5272_uart_init_line(line, m5272_uart_platform[line].irq);
90}
48 91
49/***************************************************************************/ 92/***************************************************************************/
50 93
@@ -93,7 +136,7 @@ int mcf_timerirqpending(int timer)
93 136
94/***************************************************************************/ 137/***************************************************************************/
95 138
96void config_BSP(char *commandp, int size) 139void __init config_BSP(char *commandp, int size)
97{ 140{
98#if defined (CONFIG_MOD5272) 141#if defined (CONFIG_MOD5272)
99 volatile unsigned char *pivrp; 142 volatile unsigned char *pivrp;
@@ -125,3 +168,14 @@ void config_BSP(char *commandp, int size)
125} 168}
126 169
127/***************************************************************************/ 170/***************************************************************************/
171
172static int __init init_BSP(void)
173{
174 m5272_uarts_init();
175 platform_add_devices(m5272_devices, ARRAY_SIZE(m5272_devices));
176 return 0;
177}
178
179arch_initcall(init_BSP);
180
181/***************************************************************************/