2 * Hardware definitions for Compaq iPAQ H3xxx Handheld Computers
4 * Copyright 2000,1 Compaq Computer Corporation.
6 * Use consistent with the GNU GPL is permitted,
7 * provided that this copyright notice is
8 * preserved in its entirety in all copies and derived works.
10 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
11 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
12 * FITNESS FOR ANY PARTICULAR PURPOSE.
14 * Author: Jamey Hicks.
18 * 2001-10-?? Andrew Christian Added support for iPAQ H3800
19 * and abstracted EGPIO interface.
22 #include <linux/config.h>
23 #include <linux/module.h>
24 #include <linux/init.h>
25 #include <linux/kernel.h>
26 #include <linux/tty.h>
28 #include <linux/device.h>
29 #include <linux/mtd/mtd.h>
30 #include <linux/mtd/partitions.h>
31 #include <linux/serial_core.h>
34 #include <asm/hardware.h>
35 #include <asm/mach-types.h>
36 #include <asm/setup.h>
38 #include <asm/mach/irq.h>
39 #include <asm/mach/arch.h>
40 #include <asm/mach/flash.h>
41 #include <asm/mach/map.h>
42 #include <asm/mach/serial_sa1100.h>
44 #include <asm/arch/h3600.h>
46 #if defined (CONFIG_SA1100_H3600) || defined (CONFIG_SA1100_H3100)
47 #include <asm/arch/h3600_gpio.h>
50 #include "../mach-sa1100/generic.h"
52 static struct mtd_partition h3xxx_partitions
[] = {
54 .name
= "H3XXX boot firmware",
57 .mask_flags
= MTD_WRITEABLE
, /* force read-only */
59 #ifdef CONFIG_MTD_2PARTS_IPAQ
60 .name
= "H3XXX root jffs2",
61 .size
= MTDPART_SIZ_FULL
,
64 .name
= "H3XXX kernel",
68 .name
= "H3XXX params",
72 #ifdef CONFIG_JFFS2_FS
73 .name
= "H3XXX root jffs2",
74 .size
= MTDPART_SIZ_FULL
,
77 .name
= "H3XXX initrd",
81 .name
= "H3XXX root cramfs",
85 .name
= "H3XXX usr cramfs",
89 .name
= "H3XXX usr local",
90 .size
= MTDPART_SIZ_FULL
,
99 static struct flash_platform_data h3xxx_flash_data
= {
100 .map_name
= "cfi_probe",
101 .set_vpp
= ipaqsa_mtd_set_vpp
,
102 .parts
= h3xxx_partitions
,
103 .nr_parts
= ARRAY_SIZE(h3xxx_partitions
),
106 static struct resource h3xxx_flash_resource
= {
107 .start
= SA1100_CS0_PHYS
,
108 .end
= SA1100_CS0_PHYS
+ SZ_32M
- 1,
109 .flags
= IORESOURCE_MEM
,
115 * helper for sa1100fb
117 static void h3xxx_lcd_power(int enable
)
119 assign_ipaqsa_egpio(IPAQ_EGPIO_LCD_POWER
, enable
);
125 /************************* H3600 *************************/
127 #ifdef CONFIG_SA1100_H3600
129 #define H3600_EGPIO (*(volatile unsigned int *)IPAQSA_EGPIO_VIRT)
130 static unsigned int h3600_egpio
= EGPIO_H3600_RS232_ON
;
132 static void h3600_control_egpio(enum ipaq_egpio_type x
, int setp
)
134 unsigned int egpio
= 0;
138 case IPAQ_EGPIO_LCD_POWER
:
139 egpio
|= EGPIO_H3600_LCD_ON
|
140 EGPIO_H3600_LCD_PCI
|
141 EGPIO_H3600_LCD_5V_ON
|
144 case IPAQ_EGPIO_LCD_ENABLE
:
146 case IPAQ_EGPIO_CODEC_NRESET
:
147 egpio
|= EGPIO_H3600_CODEC_NRESET
;
149 case IPAQ_EGPIO_AUDIO_ON
:
150 egpio
|= EGPIO_H3600_AUD_AMP_ON
|
151 EGPIO_H3600_AUD_PWR_ON
;
153 case IPAQ_EGPIO_QMUTE
:
154 egpio
|= EGPIO_H3600_QMUTE
;
156 case IPAQ_EGPIO_OPT_NVRAM_ON
:
157 egpio
|= EGPIO_H3600_OPT_NVRAM_ON
;
159 case IPAQ_EGPIO_OPT_ON
:
160 egpio
|= EGPIO_H3600_OPT_ON
;
162 case IPAQ_EGPIO_CARD_RESET
:
163 egpio
|= EGPIO_H3600_CARD_RESET
;
165 case IPAQ_EGPIO_OPT_RESET
:
166 egpio
|= EGPIO_H3600_OPT_RESET
;
168 case IPAQ_EGPIO_IR_ON
:
169 egpio
|= EGPIO_H3600_IR_ON
;
171 case IPAQ_EGPIO_IR_FSEL
:
172 egpio
|= EGPIO_H3600_IR_FSEL
;
174 case IPAQ_EGPIO_RS232_ON
:
175 egpio
|= EGPIO_H3600_RS232_ON
;
177 case IPAQ_EGPIO_VPP_ON
:
178 egpio
|= EGPIO_H3600_VPP_ON
;
184 case IPAQ_EGPIO_PCMCIA_CD0_N
:
185 case IPAQ_EGPIO_PCMCIA_CD1_N
:
186 case IPAQ_EGPIO_PCMCIA_IRQ0
:
187 case IPAQ_EGPIO_PCMCIA_IRQ1
:
188 case IPAQ_EGPIO_BLUETOOTH_ON
:
194 local_irq_save(flags
);
196 h3600_egpio
|= egpio
;
198 h3600_egpio
&= ~egpio
;
199 H3600_EGPIO
= h3600_egpio
;
200 local_irq_restore(flags
);
205 static struct ipaq_model_ops h3600_model_ops __initdata
= {
206 .generic_name
= "3600",
207 .control
= h3600_control_egpio
,
210 static void __init
h3600_map_io(void)
213 sa1100fb_lcd_power
= h3xxx_lcd_power
;
215 /* Initialize h3600-specific values here */
217 GPCR
= 0x0fffffff; /* All outputs are set low by default */
218 GPDR
= GPIO_H3600_COM_RTS
| GPIO_H3600_L3_CLOCK
|
219 GPIO_H3600_L3_MODE
| GPIO_H3600_L3_DATA
|
220 GPIO_H3600_CLK_SET1
| GPIO_H3600_CLK_SET0
|
221 GPIO_LDD15
| GPIO_LDD14
| GPIO_LDD13
| GPIO_LDD12
|
222 GPIO_LDD11
| GPIO_LDD10
| GPIO_LDD9
| GPIO_LDD8
;
224 H3600_EGPIO
= h3600_egpio
; /* Maintains across sleep? */
225 ipaq_model_ops
= h3600_model_ops
;
228 static void h3600_mach_init(void)
231 sa11x0_set_flash_data(&h3xxx_flash_data
, &h3xxx_flash_resource
, 1);
235 MACHINE_START(H3600
, "Compaq iPAQ H3600")
236 BOOT_MEM(0xc0000000, 0x80000000, 0xf8000000)
237 BOOT_PARAMS(0xc0000100)
239 INITIRQ(sa1100_init_irq
)
240 .timer
= &sa1100_timer
,
241 .init_machine
= h3600_mach_init
,
244 #endif /* CONFIG_SA1100_H3600 */