kernel.org linux-2.6.10
[linux-2.6.git] / arch / arm / mach-sa1100 / shannon.c
1 /*
2  * linux/arch/arm/mach-sa1100/shannon.c
3  */
4
5 #include <linux/init.h>
6 #include <linux/kernel.h>
7 #include <linux/tty.h>
8 #include <linux/mtd/mtd.h>
9 #include <linux/mtd/partitions.h>
10
11 #include <asm/hardware.h>
12 #include <asm/setup.h>
13 #include <asm/irq.h>
14
15 #include <asm/mach/arch.h>
16 #include <asm/mach/flash.h>
17 #include <asm/mach/map.h>
18 #include <asm/mach/serial_sa1100.h>
19 #include <asm/arch/shannon.h>
20
21 #include "generic.h"
22
23 static struct mtd_partition shannon_partitions[] = {
24         {
25                 .name           = "BLOB boot loader",
26                 .offset         = 0,
27                 .size           = 0x20000
28         },
29         {
30                 .name           = "kernel",
31                 .offset         = MTDPART_OFS_APPEND,
32                 .size           = 0xe0000
33         },
34         { 
35                 .name           = "initrd",
36                 .offset         = MTDPART_OFS_APPEND,   
37                 .size           = MTDPART_SIZ_FULL
38         }
39 };
40
41 static struct flash_platform_data shannon_flash_data = {
42         .map_name       = "cfi_probe",
43         .parts          = shannon_partitions,
44         .nr_parts       = ARRAY_SIZE(shannon_partitions),
45 };
46
47 static struct resource shannon_flash_resource = {
48         .start          = SA1100_CS0_PHYS,
49         .end            = SA1100_CS0_PHYS + SZ_4M - 1,
50         .flags          = IORESOURCE_MEM,
51 };
52
53 static void __init shannon_init(void)
54 {
55         sa11x0_set_flash_data(&shannon_flash_data, shannon_flash_resource, 1);
56 }
57
58 static void __init shannon_map_io(void)
59 {
60         sa1100_map_io();
61
62         sa1100_register_uart(0, 3);
63         sa1100_register_uart(1, 1);
64
65         Ser1SDCR0 |= SDCR0_SUS;
66         GAFR |= (GPIO_UART_TXD | GPIO_UART_RXD);
67         GPDR |= GPIO_UART_TXD | SHANNON_GPIO_CODEC_RESET;
68         GPDR &= ~GPIO_UART_RXD;
69         PPAR |= PPAR_UPR;
70
71         /* reset the codec */
72         GPCR = SHANNON_GPIO_CODEC_RESET;
73         GPSR = SHANNON_GPIO_CODEC_RESET;
74 }
75
76 MACHINE_START(SHANNON, "Shannon (AKA: Tuxscreen)")
77         BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
78         BOOT_PARAMS(0xc0000100)
79         MAPIO(shannon_map_io)
80         INITIRQ(sa1100_init_irq)
81         .timer          = &sa1100_timer,
82         .init_machine   = shannon_init,
83 MACHINE_END