clocksource: convert ARM 32-bit up counting clocksources
[linux-2.6/linux-acpi-2.6/ibm-acpi-2.6.git] / arch / arm / mach-pxa / h5000.c
blob657db469de1ff996469ca7e360d548abb4c46666
1 /*
2 * Hardware definitions for HP iPAQ h5xxx Handheld Computers
4 * Copyright 2000-2003 Hewlett-Packard Company.
5 * Copyright 2002 Jamey Hicks <jamey.hicks@hp.com>
6 * Copyright 2004-2005 Phil Blundell <pb@handhelds.org>
7 * Copyright 2007-2008 Anton Vorontsov <cbouatmailru@gmail.com>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
14 * COMPAQ COMPUTER CORPORATION MAKES NO WARRANTIES, EXPRESSED OR IMPLIED,
15 * AS TO THE USEFULNESS OR CORRECTNESS OF THIS CODE OR ITS
16 * FITNESS FOR ANY PARTICULAR PURPOSE.
18 * Author: Jamey Hicks.
21 #include <linux/kernel.h>
22 #include <linux/init.h>
23 #include <linux/platform_device.h>
24 #include <linux/mtd/mtd.h>
25 #include <linux/mtd/partitions.h>
26 #include <linux/mtd/physmap.h>
28 #include <asm/mach-types.h>
29 #include <asm/mach/arch.h>
30 #include <asm/mach/map.h>
32 #include <mach/pxa25x.h>
33 #include <mach/h5000.h>
34 #include <mach/udc.h>
35 #include <mach/smemc.h>
37 #include "generic.h"
40 * Flash
43 static struct mtd_partition h5000_flash0_partitions[] = {
45 .name = "bootldr",
46 .size = 0x00040000,
47 .offset = 0,
48 .mask_flags = MTD_WRITEABLE,
51 .name = "root",
52 .size = MTDPART_SIZ_FULL,
53 .offset = MTDPART_OFS_APPEND,
57 static struct mtd_partition h5000_flash1_partitions[] = {
59 .name = "second root",
60 .size = SZ_16M - 0x00040000,
61 .offset = 0,
64 .name = "asset",
65 .size = MTDPART_SIZ_FULL,
66 .offset = MTDPART_OFS_APPEND,
67 .mask_flags = MTD_WRITEABLE,
71 static struct physmap_flash_data h5000_flash0_data = {
72 .width = 4,
73 .parts = h5000_flash0_partitions,
74 .nr_parts = ARRAY_SIZE(h5000_flash0_partitions),
77 static struct physmap_flash_data h5000_flash1_data = {
78 .width = 4,
79 .parts = h5000_flash1_partitions,
80 .nr_parts = ARRAY_SIZE(h5000_flash1_partitions),
83 static struct resource h5000_flash0_resources = {
84 .start = PXA_CS0_PHYS,
85 .end = PXA_CS0_PHYS + SZ_32M - 1,
86 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
89 static struct resource h5000_flash1_resources = {
90 .start = PXA_CS0_PHYS + SZ_32M,
91 .end = PXA_CS0_PHYS + SZ_32M + SZ_16M - 1,
92 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
95 static struct platform_device h5000_flash[] = {
97 .name = "physmap-flash",
98 .id = 0,
99 .resource = &h5000_flash0_resources,
100 .num_resources = 1,
101 .dev = {
102 .platform_data = &h5000_flash0_data,
106 .name = "physmap-flash",
107 .id = 1,
108 .resource = &h5000_flash1_resources,
109 .num_resources = 1,
110 .dev = {
111 .platform_data = &h5000_flash1_data,
117 * USB Device Controller
120 static struct pxa2xx_udc_mach_info h5000_udc_mach_info __initdata = {
121 .gpio_pullup = H5000_GPIO_USB_PULLUP,
125 * GPIO setup
128 static unsigned long h5000_pin_config[] __initdata = {
129 /* Crystal and Clock Signals */
130 GPIO12_32KHz,
132 /* SDRAM and Static Memory I/O Signals */
133 GPIO15_nCS_1,
134 GPIO78_nCS_2,
135 GPIO79_nCS_3,
136 GPIO80_nCS_4,
138 /* FFUART */
139 GPIO34_FFUART_RXD,
140 GPIO35_FFUART_CTS,
141 GPIO36_FFUART_DCD,
142 GPIO37_FFUART_DSR,
143 GPIO38_FFUART_RI,
144 GPIO39_FFUART_TXD,
145 GPIO40_FFUART_DTR,
146 GPIO41_FFUART_RTS,
148 /* BTUART */
149 GPIO42_BTUART_RXD,
150 GPIO43_BTUART_TXD,
151 GPIO44_BTUART_CTS,
152 GPIO45_BTUART_RTS,
154 /* SSP1 */
155 GPIO23_SSP1_SCLK,
156 GPIO25_SSP1_TXD,
157 GPIO26_SSP1_RXD,
159 /* I2S */
160 GPIO28_I2S_BITCLK_OUT,
161 GPIO29_I2S_SDATA_IN,
162 GPIO30_I2S_SDATA_OUT,
163 GPIO31_I2S_SYNC,
164 GPIO32_I2S_SYSCLK,
168 * Localbus setup:
169 * CS0: Flash;
170 * CS1: MediaQ chip, select 16-bit bus and vlio;
171 * CS5: SAMCOP.
174 static void fix_msc(void)
176 __raw_writel(0x129c24f2, MSC0);
177 __raw_writel(0x7ff424fa, MSC1);
178 __raw_writel(0x7ff47ff4, MSC2);
180 __raw_writel(__raw_readl(MDREFR) | 0x02080000, MDREFR);
184 * Platform devices
187 static struct platform_device *devices[] __initdata = {
188 &h5000_flash[0],
189 &h5000_flash[1],
192 static void __init h5000_init(void)
194 fix_msc();
196 pxa2xx_mfp_config(ARRAY_AND_SIZE(h5000_pin_config));
197 pxa_set_ffuart_info(NULL);
198 pxa_set_btuart_info(NULL);
199 pxa_set_stuart_info(NULL);
200 pxa_set_udc_info(&h5000_udc_mach_info);
201 platform_add_devices(ARRAY_AND_SIZE(devices));
204 MACHINE_START(H5400, "HP iPAQ H5000")
205 .boot_params = 0xa0000100,
206 .map_io = pxa25x_map_io,
207 .init_irq = pxa25x_init_irq,
208 .timer = &pxa_timer,
209 .init_machine = h5000_init,
210 MACHINE_END