# BRCM_VERSION=3
[bcm963xx.git] / kernel / linux / 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 #include <linux/ioport.h>
11
12 #include <asm/hardware.h>
13 #include <asm/setup.h>
14
15 #include <asm/mach/arch.h>
16 #include <asm/mach/map.h>
17 #include <asm/mach/serial_sa1100.h>
18 #include <asm/hardware/sa1111.h>
19
20 #include "generic.h"
21
22
23 static void xp860_power_off(void)
24 {
25         local_irq_disable();
26         GPDR |= GPIO_GPIO20;
27         GPSR = GPIO_GPIO20;
28         mdelay(1000);
29         GPCR = GPIO_GPIO20;
30         while(1);
31 }
32
33 static struct resource sa1111_resources[] = {
34         [0] = {
35                 .start          = 0x40000000,
36                 .end            = 0x40001fff,
37                 .flags          = IORESOURCE_MEM,
38         },
39 };
40
41 static u64 sa1111_dmamask = 0xffffffffUL;
42
43 static struct platform_device sa1111_device = {
44         .name           = "sa1111",
45         .id             = 0,
46         .dev            = {
47                 .dma_mask = &sa1111_dmamask,
48                 .coherent_dma_mask = 0xffffffff,
49         },
50         .num_resources  = ARRAY_SIZE(sa1111_resources),
51         .resource       = sa1111_resources,
52 };
53
54 static struct platform_device *devices[] __initdata = {
55         &sa1111_device,
56 };
57
58 /*
59  * Note: I replaced the sa1111_init() without the full SA1111 initialisation
60  * because this machine doesn't appear to use the DMA features.  If this is
61  * wrong, please look at neponset.c to fix it properly.
62  */
63 static int __init xp860_init(void)
64 {
65         pm_power_off = xp860_power_off;
66
67         return platform_add_devices(devices, ARRAY_SIZE(devices));
68 }
69
70 arch_initcall(xp860_init);
71
72 static struct map_desc xp860_io_desc[] __initdata = {
73  /* virtual     physical    length      type */
74   { 0xf0000000, 0x10000000, 0x00100000, MT_DEVICE }, /* SCSI */
75   { 0xf1000000, 0x18000000, 0x00100000, MT_DEVICE }, /* LAN */
76   { 0xf4000000, 0x40000000, 0x00800000, MT_DEVICE }  /* SA-1111 */
77 };
78
79 static void __init xp860_map_io(void)
80 {
81         sa1100_map_io();
82         iotable_init(xp860_io_desc, ARRAY_SIZE(xp860_io_desc));
83
84         sa1100_register_uart(0, 3);
85         sa1100_register_uart(1, 1);
86 }
87
88 MACHINE_START(XP860, "XP860")
89         BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
90         MAPIO(xp860_map_io)
91         INITIRQ(sa1100_init_irq)
92         INITTIME(sa1100_init_time)
93 MACHINE_END