First Support on Ginger and OMAP TI
[linux-ginger.git] / arch / m68knommu / platform / 523x / config.c
blob6ba84f2aa397cc639eff61ea38acb9f0e1be903b
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/io.h>
19 #include <asm/machdep.h>
20 #include <asm/coldfire.h>
21 #include <asm/mcfsim.h>
22 #include <asm/mcfuart.h>
24 /***************************************************************************/
26 static struct mcf_platform_uart m523x_uart_platform[] = {
28 .mapbase = MCF_MBAR + MCFUART_BASE1,
29 .irq = MCFINT_VECBASE + MCFINT_UART0,
32 .mapbase = MCF_MBAR + MCFUART_BASE2,
33 .irq = MCFINT_VECBASE + MCFINT_UART0 + 1,
36 .mapbase = MCF_MBAR + MCFUART_BASE3,
37 .irq = MCFINT_VECBASE + MCFINT_UART0 + 2,
39 { },
42 static struct platform_device m523x_uart = {
43 .name = "mcfuart",
44 .id = 0,
45 .dev.platform_data = m523x_uart_platform,
48 static struct resource m523x_fec_resources[] = {
50 .start = MCF_MBAR + 0x1000,
51 .end = MCF_MBAR + 0x1000 + 0x7ff,
52 .flags = IORESOURCE_MEM,
55 .start = 64 + 23,
56 .end = 64 + 23,
57 .flags = IORESOURCE_IRQ,
60 .start = 64 + 27,
61 .end = 64 + 27,
62 .flags = IORESOURCE_IRQ,
65 .start = 64 + 29,
66 .end = 64 + 29,
67 .flags = IORESOURCE_IRQ,
71 static struct platform_device m523x_fec = {
72 .name = "fec",
73 .id = 0,
74 .num_resources = ARRAY_SIZE(m523x_fec_resources),
75 .resource = m523x_fec_resources,
78 static struct platform_device *m523x_devices[] __initdata = {
79 &m523x_uart,
80 &m523x_fec,
83 /***************************************************************************/
85 static void __init m523x_fec_init(void)
87 u16 par;
88 u8 v;
90 /* Set multi-function pins to ethernet use */
91 par = readw(MCF_IPSBAR + 0x100082);
92 writew(par | 0xf00, MCF_IPSBAR + 0x100082);
93 v = readb(MCF_IPSBAR + 0x100078);
94 writeb(v | 0xc0, MCF_IPSBAR + 0x100078);
97 /***************************************************************************/
99 static void m523x_cpu_reset(void)
101 local_irq_disable();
102 __raw_writeb(MCF_RCR_SWRESET, MCF_IPSBAR + MCF_RCR);
105 /***************************************************************************/
107 void __init config_BSP(char *commandp, int size)
109 mach_reset = m523x_cpu_reset;
112 /***************************************************************************/
114 static int __init init_BSP(void)
116 m523x_fec_init();
117 platform_add_devices(m523x_devices, ARRAY_SIZE(m523x_devices));
118 return 0;
121 arch_initcall(init_BSP);
123 /***************************************************************************/