http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / kernel / linux / arch / arm / mach-sa1100 / pfs168.c
1 /*
2  * linux/arch/arm/mach-sa1100/pfs168.c
3  */
4 #include <linux/init.h>
5 #include <linux/kernel.h>
6 #include <linux/tty.h>
7 #include <linux/errno.h>
8 #include <linux/ioport.h>
9 #include <linux/device.h>
10
11 #include <asm/hardware.h>
12 #include <asm/mach-types.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
19 #include "generic.h"
20
21 static struct resource sa1111_resources[] = {
22         [0] = {
23                 .start          = 0x40000000,
24                 .end            = 0x40001fff,
25                 .flags          = IORESOURCE_MEM,
26         },
27         [1] = {
28                 .start          = IRQ_GPIO25,
29                 .end            = IRQ_GPIO25,
30                 .flags          = IORESOURCE_IRQ,
31         },
32 };
33
34 static u64 sa1111_dmamask = 0xffffffffUL;
35
36 static struct platform_device sa1111_device = {
37         .name           = "sa1111",
38         .id             = 0,
39         .dev            = {
40                 .dma_mask = &sa1111_dmamask,
41                 .coherent_dma_mask = 0xffffffff,
42         },
43         .num_resources  = ARRAY_SIZE(sa1111_resources),
44         .resource       = sa1111_resources,
45 };
46
47 static struct platform_device *devices[] __initdata = {
48         &sa1111_device,
49 };
50
51 static int __init pfs168_init(void)
52 {
53         int ret;
54
55         if (!machine_is_pfs168())
56                 return -ENODEV;
57
58         /*
59          * Ensure that the memory bus request/grant signals are setup,
60          * and the grant is held in its inactive state
61          */
62         sa1110_mb_disable();
63
64         return platform_add_devices(devices, ARRAY_SIZE(devices));
65 }
66
67 arch_initcall(pfs168_init);
68
69
70 static void __init pfs168_init_irq(void)
71 {
72         sa1100_init_irq();
73
74         /*
75          * Need to register these as rising edge interrupts
76          * for standard 16550 serial driver support.
77          */
78         set_GPIO_IRQ_edge(GPIO_GPIO(19), GPIO_RISING_EDGE);
79         set_GPIO_IRQ_edge(GPIO_GPIO(20), GPIO_RISING_EDGE);
80         set_GPIO_IRQ_edge(GPIO_GPIO(25), GPIO_RISING_EDGE);
81         set_GPIO_IRQ_edge(GPIO_UCB1300_IRQ, GPIO_RISING_EDGE);
82 }
83
84 static struct map_desc pfs168_io_desc[] __initdata = {
85  /* virtual     physical    length      type */
86   { 0xf0000000, 0x10000000, 0x00001000, MT_DEVICE }, /* 16C752 DUART port A (COM5) */
87   { 0xf0001000, 0x10800000, 0x00001000, MT_DEVICE }, /* 16C752 DUART port B (COM6) */
88   { 0xf0002000, 0x11000000, 0x00001000, MT_DEVICE }, /* COM1 RTS control (SYSC1RTS) */
89   { 0xf0003000, 0x11400000, 0x00001000, MT_DEVICE }, /* Status LED control (SYSLED) */
90   { 0xf0004000, 0x11800000, 0x00001000, MT_DEVICE }, /* DTMF code read (SYSDTMF) */
91   { 0xf0005000, 0x11c00000, 0x00001000, MT_DEVICE }, /* LCD configure, enable (SYSLCDDE) */
92   { 0xf0006000, 0x12000000, 0x00001000, MT_DEVICE }, /* COM1 DSR and motion sense (SYSC1DSR) */
93   { 0xf0007000, 0x12800000, 0x00001000, MT_DEVICE }, /* COM3 xmit enable (SYSC3TEN) */
94   { 0xf0008000, 0x13000000, 0x00001000, MT_DEVICE }, /* Control register A (SYSCTLA) */
95   { 0xf0009000, 0x13800000, 0x00001000, MT_DEVICE }, /* Control register B (SYSCTLB) */
96   { 0xf000a000, 0x18000000, 0x00001000, MT_DEVICE }, /* SMC91C96 */
97   { 0xf2800000, 0x4b800000, 0x00800000, MT_DEVICE }, /* MQ200 */
98   { 0xf4000000, 0x40000000, 0x00100000, MT_DEVICE }  /* SA-1111 */
99 };
100
101 static void __init pfs168_map_io(void)
102 {
103         sa1100_map_io();
104         iotable_init(pfs168_io_desc, ARRAY_SIZE(pfs168_io_desc));
105
106         sa1100_register_uart(0, 3);
107         sa1100_register_uart(1, 1);
108 }
109
110 MACHINE_START(PFS168, "Tulsa")
111         BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
112         BOOT_PARAMS(0xc0000100)
113         MAPIO(pfs168_map_io)
114         INITIRQ(pfs168_init_irq)
115         INITTIME(sa1100_init_time)
116 MACHINE_END