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>
18 #include <linux/mtd/mtd.h>
19 #include <linux/mtd/partitions.h>
22 #include <asm/hardware.h>
23 #include <asm/setup.h>
25 #include <asm/mach-types.h>
26 #include <asm/mach/arch.h>
27 #include <asm/mach/flash.h>
28 #include <asm/mach/map.h>
29 #include <asm/mach/serial_sa1100.h>
31 #include <asm/arch/cerf.h>
32 #include <asm/arch/mcp.h>
35 static struct resource cerfuart2_resources[] = {
39 .flags = IORESOURCE_MEM,
43 static struct platform_device cerfuart2_device = {
44 .name = "sa11x0-uart",
46 .num_resources = ARRAY_SIZE(cerfuart2_resources),
47 .resource = cerfuart2_resources,
50 static struct platform_device *cerf_devices[] __initdata = {
54 #ifdef CONFIG_SA1100_CERF_FLASH_32MB
55 # define CERF_FLASH_SIZE 0x02000000
56 #elif defined CONFIG_SA1100_CERF_FLASH_16MB
57 # define CERF_FLASH_SIZE 0x01000000
58 #elif defined CONFIG_SA1100_CERF_FLASH_8MB
59 # define CERF_FLASH_SIZE 0x00800000
61 # error "Undefined flash size for CERF"
64 static struct mtd_partition cerf_partitions[] = {
79 .size = CERF_FLASH_SIZE-0x00160000,
84 static struct flash_platform_data cerf_flash_data = {
85 .map_name = "cfi_probe",
86 .parts = cerf_partitions,
87 .nr_parts = ARRAY_SIZE(cerf_partitions),
90 static struct resource cerf_flash_resource = {
91 .start = SA1100_CS0_PHYS,
92 .end = SA1100_CS0_PHYS + SZ_32M - 1,
93 .flags = IORESOURCE_MEM,
96 static void __init cerf_init_irq(void)
99 set_irq_type(CERF_ETH_IRQ, IRQT_RISING);
102 static struct map_desc cerf_io_desc[] __initdata = {
103 /* virtual physical length type */
104 { 0xf0000000, 0x08000000, 0x00100000, MT_DEVICE } /* Crystal Ethernet Chip */
107 static void __init cerf_map_io(void)
110 iotable_init(cerf_io_desc, ARRAY_SIZE(cerf_io_desc));
112 sa1100_register_uart(0, 3);
113 sa1100_register_uart(1, 2); /* disable this and the uart2 device for sa1100_fir */
114 sa1100_register_uart(2, 1);
116 /* set some GPDR bits here while it's safe */
117 GPDR |= CERF_GPIO_CF_RESET;
120 static struct mcp_plat_data cerf_mcp_data = {
122 .sclk_rate = 11981000,
125 static void __init cerf_init(void)
127 platform_add_devices(cerf_devices, ARRAY_SIZE(cerf_devices));
128 sa11x0_set_flash_data(&cerf_flash_data, &cerf_flash_resource, 1);
129 sa11x0_set_mcp_data(&cerf_mcp_data);
132 MACHINE_START(CERF, "Intrinsyc CerfBoard/CerfCube")
133 /* Maintainer: support@intrinsyc.com */
134 .phys_ram = 0xc0000000,
135 .phys_io = 0x80000000,
136 .io_pg_offst = ((0xf8000000) >> 18) & 0xfffc,
137 .map_io = cerf_map_io,
138 .init_irq = cerf_init_irq,
139 .timer = &sa1100_timer,
140 .init_machine = cerf_init,