import of upstream 2.4.34.4 from kernel.org
[linux-2.4.git] / arch / arm / mach-sa1100 / xp860.c
1 /*
2  * linux/arch/arm/mach-sa1100/xp860.c
3  */
4
5 #include <linux/init.h>
6 #include <linux/kernel.h>
7 #include <linux/delay.h>
8 #include <linux/pm.h>
9 #include <linux/tty.h>
10
11 #include <asm/hardware.h>
12 #include <asm/setup.h>
13
14 #include <asm/mach/arch.h>
15 #include <asm/mach/map.h>
16 #include <asm/mach/serial_sa1100.h>
17
18 #include "generic.h"
19 #include "sa1111.h"
20
21
22 static void xp860_power_off(void)
23 {
24         cli();
25         GPDR |= GPIO_GPIO20;
26         GPSR = GPIO_GPIO20;
27         mdelay(1000);
28         GPCR = GPIO_GPIO20;
29         while(1);
30 }
31
32 /*
33  * Note: I replaced the sa1111_init() without the full SA1111 initialisation
34  * because this machine doesn't appear to use the DMA features.  If this is
35  * wrong, please look at neponset.c to fix it properly.
36  */
37 static int __init xp860_init(void)
38 {
39         pm_power_off = xp860_power_off;
40
41         /*
42          * Probe for SA1111.
43          */
44         ret = sa1111_probe(0x40000000);
45         if (ret < 0)
46                 return ret;
47
48         /*
49          * We found it.  Wake the chip up.
50          */
51         sa1111_wake();
52
53         return 0;
54 }
55
56 __initcall(xp860_init);
57
58
59 static void __init
60 fixup_xp860(struct machine_desc *desc, struct param_struct *params,
61             char **cmdline, struct meminfo *mi)
62 {
63         SET_BANK( 0, 0xc0000000, 32*1024*1024 );
64         mi->nr_banks = 1;
65 }
66
67 static struct map_desc xp860_io_desc[] __initdata = {
68  /* virtual     physical    length      domain     r  w  c  b */
69   { 0xf0000000, 0x10000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* SCSI */
70   { 0xf1000000, 0x18000000, 0x00100000, DOMAIN_IO, 0, 1, 0, 0 }, /* LAN */
71   { 0xf4000000, 0x40000000, 0x00800000, DOMAIN_IO, 0, 1, 0, 0 }, /* SA-1111 */
72   LAST_DESC
73 };
74
75 static void __init xp860_map_io(void)
76 {
77         sa1100_map_io();
78         iotable_init(xp860_io_desc);
79
80         sa1100_register_uart(0, 3);
81         sa1100_register_uart(1, 1);
82 }
83
84 MACHINE_START(XP860, "XP860")
85         BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
86         FIXUP(fixup_xp860)
87         MAPIO(xp860_map_io)
88         INITIRQ(sa1100_init_irq)
89 MACHINE_END