ftp://ftp.kernel.org/pub/linux/kernel/v2.6/linux-2.6.6.tar.bz2
[linux-2.6.git] / 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 "generic.h"
31
32 #ifndef PXA_IDP_REV02
33 /* shadow registers for write only registers */
34 unsigned int idp_cpld_led_control_shadow = 0x1;
35 unsigned int idp_cpld_periph_pwr_shadow = 0xd;
36 unsigned int ipd_cpld_cir_shadow = 0;
37 unsigned int idp_cpld_kb_col_high_shadow = 0;
38 unsigned int idp_cpld_kb_col_low_shadow = 0;
39 unsigned int idp_cpld_pccard_en_shadow = 0xC3;
40 unsigned int idp_cpld_gpioh_dir_shadow = 0;
41 unsigned int idp_cpld_gpioh_value_shadow = 0;
42 unsigned int idp_cpld_gpiol_dir_shadow = 0;
43 unsigned int idp_cpld_gpiol_value_shadow = 0;
44
45 /*
46  * enable all LCD signals -- they should still be on
47  * write protect flash
48  * enable all serial port transceivers
49  */
50
51 unsigned int idp_control_port_shadow = ((0x7 << 21) |           /* LCD power */
52                                         (0x1 << 19) |           /* disable flash write enable */
53                                         (0x7 << 9));            /* enable serial port transeivers */
54
55 #endif
56
57 static void __init idp_init(void)
58 {
59         printk("idp_init()\n");
60 }
61
62 static void __init idp_init_irq(void)
63 {
64         pxa_init_irq();
65 }
66
67 static struct map_desc idp_io_desc[] __initdata = {
68  /* virtual     physical    length      type */
69
70
71 #ifndef PXA_IDP_REV02
72   { IDP_CTRL_PORT_BASE,
73     IDP_CTRL_PORT_PHYS,
74     IDP_CTRL_PORT_SIZE,
75     MT_DEVICE },
76 #endif
77
78   { IDP_IDE_BASE,
79     IDP_IDE_PHYS,
80     IDP_IDE_SIZE,
81     MT_DEVICE },
82   { IDP_ETH_BASE,
83     IDP_ETH_PHYS,
84     IDP_ETH_SIZE,
85     MT_DEVICE },
86   { IDP_COREVOLT_BASE,
87     IDP_COREVOLT_PHYS,
88     IDP_COREVOLT_SIZE,
89     MT_DEVICE },
90   { IDP_CPLD_BASE,
91     IDP_CPLD_PHYS,
92     IDP_CPLD_SIZE,
93     MT_DEVICE }
94 };
95
96 static void __init idp_map_io(void)
97 {
98         pxa_map_io();
99         iotable_init(idp_io_desc, ARRAY_SIZE(idp_io_desc));
100
101         set_irq_type(IRQ_TO_GPIO_2_80(TOUCH_PANEL_IRQ), TOUCH_PANEL_IRQ_EDGE);
102
103         // serial ports 2 & 3
104         pxa_gpio_mode(GPIO42_BTRXD_MD);
105         pxa_gpio_mode(GPIO43_BTTXD_MD);
106         pxa_gpio_mode(GPIO44_BTCTS_MD);
107         pxa_gpio_mode(GPIO45_BTRTS_MD);
108         pxa_gpio_mode(GPIO46_STRXD_MD);
109         pxa_gpio_mode(GPIO47_STTXD_MD);
110
111 }
112
113
114 MACHINE_START(PXA_IDP, "Accelent Xscale IDP")
115         MAINTAINER("Accelent Systems Inc.")
116         BOOT_MEM(0xa0000000, 0x40000000, io_p2v(0x40000000))
117         MAPIO(idp_map_io)
118         INITIRQ(idp_init_irq)
119         INIT_MACHINE(idp_init)
120 MACHINE_END