[ARM] pxa: introduce pxa{25x,27x,300,320,930}.h for board usage
[deliverable/linux.git] / arch / arm / mach-pxa / h5000.c
CommitLineData
bc2fd1c0
AV
1/*
2 * Hardware definitions for HP iPAQ h5xxx Handheld Computers
3 *
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>
8 *
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.
13 *
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.
17 *
18 * Author: Jamey Hicks.
19 */
20
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>
51c62982 27
bc2fd1c0
AV
28#include <asm/mach-types.h>
29#include <asm/mach/arch.h>
30#include <asm/mach/map.h>
51c62982
EM
31
32#include <mach/pxa25x.h>
bc2fd1c0 33#include <mach/h5000.h>
bc2fd1c0 34#include <mach/udc.h>
51c62982 35
bc2fd1c0
AV
36#include "generic.h"
37
38/*
39 * Flash
40 */
41
42static struct mtd_partition h5000_flash0_partitions[] = {
43 {
44 .name = "bootldr",
45 .size = 0x00040000,
46 .offset = 0,
47 .mask_flags = MTD_WRITEABLE,
48 },
49 {
50 .name = "root",
51 .size = MTDPART_SIZ_FULL,
52 .offset = MTDPART_OFS_APPEND,
53 },
54};
55
56static struct mtd_partition h5000_flash1_partitions[] = {
57 {
58 .name = "second root",
59 .size = SZ_16M - 0x00040000,
60 .offset = 0,
61 },
62 {
63 .name = "asset",
64 .size = MTDPART_SIZ_FULL,
65 .offset = MTDPART_OFS_APPEND,
66 .mask_flags = MTD_WRITEABLE,
67 },
68};
69
70static struct physmap_flash_data h5000_flash0_data = {
71 .width = 4,
72 .parts = h5000_flash0_partitions,
73 .nr_parts = ARRAY_SIZE(h5000_flash0_partitions),
74};
75
76static struct physmap_flash_data h5000_flash1_data = {
77 .width = 4,
78 .parts = h5000_flash1_partitions,
79 .nr_parts = ARRAY_SIZE(h5000_flash1_partitions),
80};
81
82static struct resource h5000_flash0_resources = {
83 .start = PXA_CS0_PHYS,
84 .end = PXA_CS0_PHYS + SZ_32M - 1,
85 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
86};
87
88static struct resource h5000_flash1_resources = {
89 .start = PXA_CS0_PHYS + SZ_32M,
90 .end = PXA_CS0_PHYS + SZ_32M + SZ_16M - 1,
91 .flags = IORESOURCE_MEM | IORESOURCE_MEM_32BIT,
92};
93
94static struct platform_device h5000_flash[] = {
95 {
96 .name = "physmap-flash",
97 .id = 0,
98 .resource = &h5000_flash0_resources,
99 .num_resources = 1,
100 .dev = {
101 .platform_data = &h5000_flash0_data,
102 },
103 },
104 {
105 .name = "physmap-flash",
106 .id = 1,
107 .resource = &h5000_flash1_resources,
108 .num_resources = 1,
109 .dev = {
110 .platform_data = &h5000_flash1_data,
111 },
112 },
113};
114
115/*
116 * USB Device Controller
117 */
118
119static struct pxa2xx_udc_mach_info h5000_udc_mach_info __initdata = {
120 .gpio_pullup = H5000_GPIO_USB_PULLUP,
121};
122
123/*
124 * GPIO setup
125 */
126
127static unsigned long h5000_pin_config[] __initdata = {
128 /* Crystal and Clock Signals */
129 GPIO12_32KHz,
130
131 /* SDRAM and Static Memory I/O Signals */
132 GPIO15_nCS_1,
133 GPIO78_nCS_2,
134 GPIO79_nCS_3,
135 GPIO80_nCS_4,
136
137 /* FFUART */
138 GPIO34_FFUART_RXD,
139 GPIO35_FFUART_CTS,
140 GPIO36_FFUART_DCD,
141 GPIO37_FFUART_DSR,
142 GPIO38_FFUART_RI,
143 GPIO39_FFUART_TXD,
144 GPIO40_FFUART_DTR,
145 GPIO41_FFUART_RTS,
146
147 /* BTUART */
148 GPIO42_BTUART_RXD,
149 GPIO43_BTUART_TXD,
150 GPIO44_BTUART_CTS,
151 GPIO45_BTUART_RTS,
152
153 /* SSP1 */
154 GPIO23_SSP1_SCLK,
155 GPIO25_SSP1_TXD,
156 GPIO26_SSP1_RXD,
157};
158
159/*
160 * Localbus setup:
161 * CS0: Flash;
162 * CS1: MediaQ chip, select 16-bit bus and vlio;
163 * CS5: SAMCOP.
164 */
165
166static void fix_msc(void)
167{
168 MSC0 = 0x129c24f2;
169 MSC1 = 0x7ff424fa;
170 MSC2 = 0x7ff47ff4;
171
172 MDREFR |= 0x02080000;
173}
174
175/*
176 * Platform devices
177 */
178
179static struct platform_device *devices[] __initdata = {
180 &h5000_flash[0],
181 &h5000_flash[1],
182};
183
184static void __init h5000_init(void)
185{
186 fix_msc();
187
188 pxa2xx_mfp_config(ARRAY_AND_SIZE(h5000_pin_config));
189 pxa_set_udc_info(&h5000_udc_mach_info);
190 platform_add_devices(ARRAY_AND_SIZE(devices));
191}
192
193MACHINE_START(H5400, "HP iPAQ H5000")
194 .phys_io = 0x40000000,
195 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
196 .boot_params = 0xa0000100,
197 .map_io = pxa_map_io,
198 .init_irq = pxa25x_init_irq,
199 .timer = &pxa_timer,
200 .init_machine = h5000_init,
201MACHINE_END
This page took 0.045798 seconds and 5 git commands to generate.