1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/5249/config.c
6 * Copyright (C) 2002, Greg Ungerer (gerg@snapgear.com)
9 /***************************************************************************/
11 #include <linux/kernel.h>
12 #include <linux/param.h>
13 #include <linux/init.h>
15 #include <asm/machdep.h>
16 #include <asm/coldfire.h>
17 #include <asm/mcfsim.h>
18 #include <asm/mcfuart.h>
20 /***************************************************************************/
22 static struct mcf_platform_uart m5249_uart_platform
[] = {
24 .mapbase
= MCF_MBAR
+ MCFUART_BASE1
,
28 .mapbase
= MCF_MBAR
+ MCFUART_BASE2
,
34 static struct platform_device m5249_uart
= {
37 .dev
.platform_data
= m5249_uart_platform
,
40 static struct platform_device
*m5249_devices
[] __initdata
= {
44 /***************************************************************************/
46 static void __init
m5249_uart_init_line(int line
, int irq
)
49 writeb(MCFSIM_ICR_LEVEL6
| MCFSIM_ICR_PRI1
, MCF_MBAR
+ MCFSIM_UART1ICR
);
50 writeb(irq
, MCF_MBAR
+ MCFUART_BASE1
+ MCFUART_UIVR
);
51 mcf_mapirq2imr(irq
, MCFINTC_UART0
);
52 } else if (line
== 1) {
53 writeb(MCFSIM_ICR_LEVEL6
| MCFSIM_ICR_PRI2
, MCF_MBAR
+ MCFSIM_UART2ICR
);
54 writeb(irq
, MCF_MBAR
+ MCFUART_BASE2
+ MCFUART_UIVR
);
55 mcf_mapirq2imr(irq
, MCFINTC_UART1
);
59 static void __init
m5249_uarts_init(void)
61 const int nrlines
= ARRAY_SIZE(m5249_uart_platform
);
64 for (line
= 0; (line
< nrlines
); line
++)
65 m5249_uart_init_line(line
, m5249_uart_platform
[line
].irq
);
68 /***************************************************************************/
70 static void __init
m5249_timers_init(void)
72 /* Timer1 is always used as system timer */
73 writeb(MCFSIM_ICR_AUTOVEC
| MCFSIM_ICR_LEVEL6
| MCFSIM_ICR_PRI3
,
74 MCF_MBAR
+ MCFSIM_TIMER1ICR
);
75 mcf_mapirq2imr(MCF_IRQ_TIMER
, MCFINTC_TIMER1
);
77 #ifdef CONFIG_HIGHPROFILE
78 /* Timer2 is to be used as a high speed profile timer */
79 writeb(MCFSIM_ICR_AUTOVEC
| MCFSIM_ICR_LEVEL7
| MCFSIM_ICR_PRI3
,
80 MCF_MBAR
+ MCFSIM_TIMER2ICR
);
81 mcf_mapirq2imr(MCF_IRQ_PROFILER
, MCFINTC_TIMER2
);
85 /***************************************************************************/
87 void m5249_cpu_reset(void)
90 /* Set watchdog to soft reset, and enabled */
91 __raw_writeb(0xc0, MCF_MBAR
+ MCFSIM_SYPCR
);
93 /* wait for watchdog to timeout */;
96 /***************************************************************************/
98 void __init
config_BSP(char *commandp
, int size
)
100 mach_reset
= m5249_cpu_reset
;
105 /***************************************************************************/
107 static int __init
init_BSP(void)
109 platform_add_devices(m5249_devices
, ARRAY_SIZE(m5249_devices
));
113 arch_initcall(init_BSP
);
115 /***************************************************************************/