1 /***************************************************************************/
4 * linux/arch/m68knommu/platform/5206e/config.c
6 * Copyright (C) 1999-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>
19 #include <asm/mcfdma.h>
20 #include <asm/mcfuart.h>
22 /***************************************************************************/
24 static struct mcf_platform_uart m5206e_uart_platform[] = {
26 .mapbase = MCF_MBAR + MCFUART_BASE1,
30 .mapbase = MCF_MBAR + MCFUART_BASE2,
36 static struct platform_device m5206e_uart = {
39 .dev.platform_data = m5206e_uart_platform,
42 static struct platform_device *m5206e_devices[] __initdata = {
46 /***************************************************************************/
48 static void __init m5206e_uart_init_line(int line, int irq)
51 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI1, MCF_MBAR + MCFSIM_UART1ICR);
52 writeb(irq, MCFUART_BASE1 + MCFUART_UIVR);
53 mcf_clrimr(MCFINTC_UART0);
54 } else if (line == 1) {
55 writel(MCFSIM_ICR_LEVEL6 | MCFSIM_ICR_PRI2, MCF_MBAR + MCFSIM_UART2ICR);
56 writeb(irq, MCFUART_BASE2 + MCFUART_UIVR);
57 mcf_clrimr(MCFINTC_UART1);
61 static void __init m5206e_uarts_init(void)
63 const int nrlines = ARRAY_SIZE(m5206e_uart_platform);
66 for (line = 0; (line < nrlines); line++)
67 m5206e_uart_init_line(line, m5206e_uart_platform[line].irq);
70 /***************************************************************************/
72 void mcf_settimericr(unsigned int timer, unsigned int level)
74 volatile unsigned char *icrp;
75 unsigned int icr, imr;
79 case 2: icr = MCFSIM_TIMER2ICR; imr = MCFINTC_TIMER2; break;
80 default: icr = MCFSIM_TIMER1ICR; imr = MCFINTC_TIMER1; break;
83 icrp = (volatile unsigned char *) (MCF_MBAR + icr);
84 *icrp = MCFSIM_ICR_AUTOVEC | (level << 2) | MCFSIM_ICR_PRI3;
89 /***************************************************************************/
91 void m5206e_cpu_reset(void)
94 /* Set watchdog to soft reset, and enabled */
95 __raw_writeb(0xc0, MCF_MBAR + MCFSIM_SYPCR);
97 /* wait for watchdog to timeout */;
100 /***************************************************************************/
102 void __init config_BSP(char *commandp, int size)
104 #if defined(CONFIG_NETtel)
105 /* Copy command line from FLASH to local buffer... */
106 memcpy(commandp, (char *) 0xf0004000, size);
107 commandp[size-1] = 0;
108 #endif /* CONFIG_NETtel */
110 mach_reset = m5206e_cpu_reset;
113 /***************************************************************************/
115 static int __init init_BSP(void)
118 platform_add_devices(m5206e_devices, ARRAY_SIZE(m5206e_devices));
122 arch_initcall(init_BSP);
124 /***************************************************************************/