PRCM: 34XX: Fix wrong shift value used in dpll4_m4x2_ck enable bit
[linux-ginger.git] / arch / m68knommu / platform / 523x / config.c
blob13f02611ea23a8c866755af5b0fe8585e2d60de2
1 /***************************************************************************/
3 /*
4 * linux/arch/m68knommu/platform/523x/config.c
6 * Sub-architcture dependant initialization code for the Freescale
7 * 523x CPUs.
9 * Copyright (C) 1999-2005, Greg Ungerer (gerg@snapgear.com)
10 * Copyright (C) 2001-2003, SnapGear Inc. (www.snapgear.com)
13 /***************************************************************************/
15 #include <linux/kernel.h>
16 #include <linux/param.h>
17 #include <linux/init.h>
18 #include <linux/interrupt.h>
19 #include <linux/io.h>
20 #include <asm/machdep.h>
21 #include <asm/coldfire.h>
22 #include <asm/mcfsim.h>
23 #include <asm/mcfuart.h>
25 /***************************************************************************/
27 void coldfire_reset(void);
29 /***************************************************************************/
31 static struct mcf_platform_uart m523x_uart_platform[] = {
33 .mapbase = MCF_MBAR + MCFUART_BASE1,
34 .irq = MCFINT_VECBASE + MCFINT_UART0,
37 .mapbase = MCF_MBAR + MCFUART_BASE2,
38 .irq = MCFINT_VECBASE + MCFINT_UART0 + 1,
41 .mapbase = MCF_MBAR + MCFUART_BASE3,
42 .irq = MCFINT_VECBASE + MCFINT_UART0 + 2,
44 { },
47 static struct platform_device m523x_uart = {
48 .name = "mcfuart",
49 .id = 0,
50 .dev.platform_data = m523x_uart_platform,
53 static struct platform_device *m523x_devices[] __initdata = {
54 &m523x_uart,
57 /***************************************************************************/
59 #define INTC0 (MCF_MBAR + MCFICM_INTC0)
61 static void __init m523x_uart_init_line(int line, int irq)
63 u32 imr;
65 if ((line < 0) || (line > 2))
66 return;
68 writeb(0x30+line, (INTC0 + MCFINTC_ICR0 + MCFINT_UART0 + line));
70 imr = readl(INTC0 + MCFINTC_IMRL);
71 imr &= ~((1 << (irq - MCFINT_VECBASE)) | 1);
72 writel(imr, INTC0 + MCFINTC_IMRL);
75 static void __init m523x_uarts_init(void)
77 const int nrlines = ARRAY_SIZE(m523x_uart_platform);
78 int line;
80 for (line = 0; (line < nrlines); line++)
81 m523x_uart_init_line(line, m523x_uart_platform[line].irq);
84 /***************************************************************************/
86 void mcf_disableall(void)
88 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRH)) = 0xffffffff;
89 *((volatile unsigned long *) (MCF_IPSBAR + MCFICM_INTC0 + MCFINTC_IMRL)) = 0xffffffff;
92 /***************************************************************************/
94 void mcf_autovector(unsigned int vec)
96 /* Everything is auto-vectored on the 523x */
99 /***************************************************************************/
101 void __init config_BSP(char *commandp, int size)
103 mcf_disableall();
104 mach_reset = coldfire_reset;
105 m523x_uarts_init();
108 /***************************************************************************/
110 static int __init init_BSP(void)
112 platform_add_devices(m523x_devices, ARRAY_SIZE(m523x_devices));
113 return 0;
116 arch_initcall(init_BSP);
118 /***************************************************************************/