http://downloads.netgear.com/files/GPL/GPL_Source_V361j_DM111PSP_series_consumer_rele...
[bcm963xx.git] / kernel / linux / arch / arm / mach-pxa / idp.c
1 /*
2  *  linux/arch/arm/mach-pxa/idp.c
3  *
4  *  This program is free software; you can redistribute it and/or modify
5  *  it under the terms of the GNU General Public License version 2 as
6  *  published by the Free Software Foundation.
7  *
8  *  Copyright (c) 2001 Cliff Brake, Accelent Systems Inc.
9  *
10  *  2001-09-13: Cliff Brake <cbrake@accelent.com>
11  *              Initial code
12  *
13  * Expected command line: mem=32M initrd=0xa1000000,4M root=/dev/ram ramdisk=8192
14  */
15 #include <linux/kernel.h>
16 #include <linux/init.h>
17 #include <linux/major.h>
18 #include <linux/fs.h>
19 #include <linux/interrupt.h>
20
21 #include <asm/setup.h>
22 #include <asm/memory.h>
23 #include <asm/mach-types.h>
24 #include <asm/hardware.h>
25 #include <asm/irq.h>
26
27 #include <asm/mach/arch.h>
28 #include <asm/mach/map.h>
29
30 #include <asm/arch/idp.h>
31
32 #include "generic.h"
33
34 #ifndef PXA_IDP_REV02
35 /* shadow registers for write only registers */
36 unsigned int idp_cpld_led_control_shadow = 0x1;
37 unsigned int idp_cpld_periph_pwr_shadow = 0xd;
38 unsigned int ipd_cpld_cir_shadow = 0;
39 unsigned int idp_cpld_kb_col_high_shadow = 0;
40 unsigned int idp_cpld_kb_col_low_shadow = 0;
41 unsigned int idp_cpld_pccard_en_shadow = 0xC3;
42 unsigned int idp_cpld_gpioh_dir_shadow = 0;
43 unsigned int idp_cpld_gpioh_value_shadow = 0;
44 unsigned int idp_cpld_gpiol_dir_shadow = 0;
45 unsigned int idp_cpld_gpiol_value_shadow = 0;
46
47 /*
48  * enable all LCD signals -- they should still be on
49  * write protect flash
50  * enable all serial port transceivers
51  */
52
53 unsigned int idp_control_port_shadow = ((0x7 << 21) |           /* LCD power */
54                                         (0x1 << 19) |           /* disable flash write enable */
55                                         (0x7 << 9));            /* enable serial port transeivers */
56
57 #endif
58
59 static void __init idp_init(void)
60 {
61         printk("idp_init()\n");
62 }
63
64 static void __init idp_init_irq(void)
65 {
66         pxa_init_irq();
67 }
68
69 static struct map_desc idp_io_desc[] __initdata = {
70  /* virtual     physical    length      type */
71
72
73 #ifndef PXA_IDP_REV02
74   { IDP_CTRL_PORT_BASE,
75     IDP_CTRL_PORT_PHYS,
76     IDP_CTRL_PORT_SIZE,
77     MT_DEVICE },
78 #endif
79
80   { IDP_IDE_BASE,
81     IDP_IDE_PHYS,
82     IDP_IDE_SIZE,
83     MT_DEVICE },
84   { IDP_ETH_BASE,
85     IDP_ETH_PHYS,
86     IDP_ETH_SIZE,
87     MT_DEVICE },
88   { IDP_COREVOLT_BASE,
89     IDP_COREVOLT_PHYS,
90     IDP_COREVOLT_SIZE,
91     MT_DEVICE },
92   { IDP_CPLD_BASE,
93     IDP_CPLD_PHYS,
94     IDP_CPLD_SIZE,
95     MT_DEVICE }
96 };
97
98 static void __init idp_map_io(void)
99 {
100         pxa_map_io();
101         iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc));
102
103         set_irq_type(IRQ_TO_GPIO_2_80(TOUCH_PANEL_IRQ), TOUCH_PANEL_IRQ_EDGE);
104
105         // serial ports 2 & 3
106         pxa_gpio_mode(GPIO42_BTRXD_MD);
107         pxa_gpio_mode(GPIO43_BTTXD_MD);
108         pxa_gpio_mode(GPIO44_BTCTS_MD);
109         pxa_gpio_mode(GPIO45_BTRTS_MD);
110         pxa_gpio_mode(GPIO46_STRXD_MD);
111         pxa_gpio_mode(GPIO47_STTXD_MD);
112
113 }
114
115
116 MACHINE_START(PXA_IDP, "Accelent Xscale IDP")
117         MAINTAINER("Accelent Systems Inc.")
118         BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
119         MAPIO(idp_map_io)
120         INITIRQ(idp_init_irq)
121         INITTIME(pxa_init_time)
122         INIT_MACHINE(idp_init)
123 MACHINE_END