initial commit with v2.6.9
[linux-2.6.9-moxart.git] / arch / arm / mach-sa1100 / cerf.c
blob2c4c05013cc9fa1f56b242d53a2a5140137199ca
1 /*
2 * linux/arch/arm/mach-sa1100/cerf.c
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
8 * Apr-2003 : Removed some old PDA crud [FB]
9 * Oct-2003 : Added uart2 resource [FB]
10 * Jan-2004 : Removed io map for flash [FB]
13 #include <linux/config.h>
14 #include <linux/init.h>
15 #include <linux/kernel.h>
16 #include <linux/tty.h>
17 #include <linux/device.h>
19 #include <asm/irq.h>
20 #include <asm/hardware.h>
21 #include <asm/setup.h>
23 #include <asm/mach-types.h>
24 #include <asm/mach/arch.h>
25 #include <asm/mach/map.h>
26 #include <asm/mach/serial_sa1100.h>
28 #include <asm/arch/cerf.h>
29 #include "generic.h"
31 static struct resource cerfuart2_resources[] = {
32 [0] = {
33 .start = 0x80030000,
34 .end = 0x8003ffff,
35 .flags = IORESOURCE_MEM,
39 static struct platform_device cerfuart2_device = {
40 .name = "sa11x0-uart",
41 .id = 2,
42 .num_resources = ARRAY_SIZE(cerfuart2_resources),
43 .resource = cerfuart2_resources,
46 static struct platform_device *cerf_devices[] __initdata = {
47 &cerfuart2_device,
50 static void __init cerf_init_irq(void)
52 sa1100_init_irq();
53 set_irq_type(CERF_ETH_IRQ, IRQT_RISING);
56 static struct map_desc cerf_io_desc[] __initdata = {
57 /* virtual physical length type */
58 { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE } /* Crystal Ethernet Chip */
61 static void __init cerf_map_io(void)
63 sa1100_map_io();
64 iotable_init(cerf_io_desc, ARRAY_SIZE(cerf_io_desc));
66 sa1100_register_uart(0, 3);
67 sa1100_register_uart(1, 2); /* disable this and the uart2 device for sa1100_fir */
68 sa1100_register_uart(2, 1);
70 /* set some GPDR bits here while it's safe */
71 GPDR |= CERF_GPIO_CF_RESET;
74 static int __init cerf_init(void)
76 int ret;
78 if (!machine_is_cerf())
79 return -ENODEV;
81 ret = platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
82 if (ret < 0)
83 return ret;
85 return 0;
88 arch_initcall(cerf_init);
90 MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
91 MAINTAINER("support@intrinsyc.com")
92 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
93 MAPIO(cerf_map_io)
94 INITIRQ(cerf_init_irq)
95 INITTIME(sa1100_init_time)
96 MACHINE_END