import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / arm / mach-sa1100 / cerf.c
1 /*
2  * linux/arch/arm/mach-sa1100/cerf.c
3  */
4 #include <linux/config.h>
5 #include <linux/init.h>
6 #include <linux/kernel.h>
7 #include <linux/tty.h>
8
9 #include <asm/hardware.h>
10 #include <asm/setup.h>
11
12 #include <asm/mach/arch.h>
13 #include <asm/mach/map.h>
14 #include <asm/mach/serial_sa1100.h>
15
16 #include "generic.h"
17
18
19 static void __init cerf_init_irq(void)
20 {
21         sa1100_init_irq();
22
23         /* Need to register these as rising edge interrupts
24          * For standard 16550 serial driver support
25          * Basically - I copied it from pfs168.c :)
26          */
27 #ifdef CONFIG_SA1100_CERF_CPLD
28         /* PDA Full serial port */
29         set_GPIO_IRQ_edge(GPIO_GPIO3, GPIO_RISING_EDGE);
30         /* PDA Bluetooth */
31         set_GPIO_IRQ_edge(GPIO_GPIO2, GPIO_RISING_EDGE);
32 #endif /* CONFIG_SA1100_CERF_CPLD */
33
34         set_GPIO_IRQ_edge(GPIO_UCB1200_IRQ, GPIO_RISING_EDGE);
35 }
36
37 static void __init
38 fixup_cerf(struct machine_desc *desc, struct param_struct *params,
39            char **cmdline, struct meminfo *mi)
40 {
41 #if defined(CONFIG_SA1100_CERF_64MB)
42         SET_BANK( 0, 0xc0000000, 64*1024*1024 );
43         mi->nr_banks = 1;
44 #elif defined(CONFIG_SA1100_CERF_32MB)
45         SET_BANK( 0, 0xc0000000, 32*1024*1024 );
46         mi->nr_banks = 1;
47 #elif defined(CONFIG_SA1100_CERF_16MB)
48         SET_BANK( 0, 0xc0000000, 8*1024*1024 );
49         SET_BANK( 1, 0xc8000000, 8*1024*1024 );
50         mi->nr_banks = 2;
51 #elif defined(CONFIG_SA1100_CERF_8MB)
52         SET_BANK( 0, 0xc0000000, 8*1024*1024 );
53         mi->nr_banks = 1;
54 #else
55 #error "Undefined memory size for Cerfboard."
56 #endif
57
58 //      ROOT_DEV = MKDEV(RAMDISK_MAJOR,0);
59 //      setup_ramdisk(1,  0, 0, 8192);
60 //      // Save 2Meg for RAMDisk
61 //      setup_initrd(0xc0500000, 3*1024*1024);
62 }
63
64 static struct map_desc cerf_io_desc[] __initdata = {
65   /* virtual     physical    length      domain     r  w  c  b */
66   { 0xe8000000, 0x00000000, 0x02000000, DOMAIN_IO, 0, 1, 0, 0 }, /* Flash bank 0 */
67   { 0xf0000000, 0x08000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* Crystal Ethernet Chip */
68 #ifdef CONFIG_SA1100_CERF_CPLD
69   { 0xf1000000, 0x40000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* CPLD Chip */
70   { 0xf2000000, 0x10000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* CerfPDA Bluetooth */
71   { 0xf3000000, 0x18000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* CerfPDA Serial */
72 #endif
73   LAST_DESC
74 };
75
76 static void __init cerf_map_io(void)
77 {
78         sa1100_map_io();
79         iotable_init(cerf_io_desc);
80
81         sa1100_register_uart(0, 3);
82 #ifdef CONFIG_SA1100_CERF_IRDA_ENABLED
83         sa1100_register_uart(1, 1);
84 #else
85         sa1100_register_uart(1, 2);
86         sa1100_register_uart(2, 1);
87 #endif
88
89         /* set some GPDR bits here while it's safe */
90         GPDR |= GPIO_CF_RESET;
91 #ifdef CONFIG_SA1100_CERF_CPLD
92         GPDR |= GPIO_PWR_SHUTDOWN;
93 #endif
94 }
95
96 MACHINE_START(CERF, "Intrinsyc's Cerf Family of Products")
97         MAINTAINER("support@intrinsyc.com")
98         BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
99         FIXUP(fixup_cerf)
100         MAPIO(cerf_map_io)
101         INITIRQ(cerf_init_irq)
102 MACHINE_END