aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm
diff options
context:
space:
mode:
authorMarek <marek.vasut@gmail.com>2010-03-08 22:04:12 -0500
committerEric Miao <eric.y.miao@gmail.com>2010-05-11 11:25:02 -0400
commit543cd84255f499a53d409014bc5ba71543474b05 (patch)
treef5246dea6a9226a4d4bed163a18d0f55d5414dc2 /arch/arm
parentb637799248520d711f0fdc64666131c1c869cfbc (diff)
[ARM] pxa: add basic support for Voipac PXA270 SBC
This patch adds basic support for the Voipac PXA270 SBC. The device consists of the following hardware: - PXA270 @ 520 MHz - 256MB RAM (sparsemem, 2*128MB regions) - 64MB NOR flash - 640x480 LCD - Ports: 2xUHC, 1xUDC, 1xPCMCIA, VGA, FFUART, 2xPS2, Speaker, MIC Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm')
-rw-r--r--arch/arm/mach-pxa/Kconfig6
-rw-r--r--arch/arm/mach-pxa/Makefile1
-rw-r--r--arch/arm/mach-pxa/include/mach/vpac270.h26
-rw-r--r--arch/arm/mach-pxa/vpac270.c305
4 files changed, 338 insertions, 0 deletions
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 2e4122de6081..e4a0452e0e2d 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -249,6 +249,12 @@ config MACH_COLIBRI320
249 select PXA3xx 249 select PXA3xx
250 select CPU_PXA320 250 select CPU_PXA320
251 251
252config MACH_VPAC270
253 bool "Voipac PXA270"
254 select PXA27x
255 help
256 PXA270 based Single Board Computer.
257
252comment "End-user Products (sorted by vendor name)" 258comment "End-user Products (sorted by vendor name)"
253 259
254config MACH_H4700 260config MACH_H4700
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index e929231f6a97..b8f1f4bc7ca7 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -61,6 +61,7 @@ obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
61obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o 61obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o
62obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o 62obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o
63obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o 63obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o
64obj-$(CONFIG_MACH_VPAC270) += vpac270.o
64 65
65# End-user Products 66# End-user Products
66obj-$(CONFIG_MACH_H4700) += hx4700.o 67obj-$(CONFIG_MACH_H4700) += hx4700.o
diff --git a/arch/arm/mach-pxa/include/mach/vpac270.h b/arch/arm/mach-pxa/include/mach/vpac270.h
new file mode 100644
index 000000000000..8f8eaed101dc
--- /dev/null
+++ b/arch/arm/mach-pxa/include/mach/vpac270.h
@@ -0,0 +1,26 @@
1/*
2 * GPIOs and interrupts for Voipac PXA270
3 *
4 * Copyright (C) 2010
5 * Marek Vasut <marek.vasut@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#ifndef _INCLUDE_VPAC270_H_
14#define _INCLUDE_VPAC270_H_
15
16#define GPIO1_VPAC270_USER_BTN 1
17
18#define GPIO15_VPAC270_LED_ORANGE 15
19
20#define GPIO81_VPAC270_BKL_ON 81
21#define GPIO83_VPAC270_NL_ON 83
22
23#define GPIO52_VPAC270_SD_READONLY 52
24#define GPIO53_VPAC270_SD_DETECT_N 53
25
26#endif
diff --git a/arch/arm/mach-pxa/vpac270.c b/arch/arm/mach-pxa/vpac270.c
new file mode 100644
index 000000000000..710a17c80a14
--- /dev/null
+++ b/arch/arm/mach-pxa/vpac270.c
@@ -0,0 +1,305 @@
1/*
2 * Hardware definitions for Voipac PXA270
3 *
4 * Copyright (C) 2010
5 * Marek Vasut <marek.vasut@gmail.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 */
12
13#include <linux/platform_device.h>
14#include <linux/delay.h>
15#include <linux/irq.h>
16#include <linux/gpio_keys.h>
17#include <linux/input.h>
18#include <linux/gpio.h>
19#include <linux/sysdev.h>
20#include <linux/mtd/mtd.h>
21#include <linux/mtd/partitions.h>
22#include <linux/mtd/physmap.h>
23
24#include <asm/mach-types.h>
25#include <asm/mach/arch.h>
26
27#include <mach/pxa27x.h>
28#include <mach/vpac270.h>
29#include <mach/mmc.h>
30#include <mach/pxafb.h>
31
32#include "generic.h"
33#include "devices.h"
34
35/******************************************************************************
36 * Pin configuration
37 ******************************************************************************/
38static unsigned long vpac270_pin_config[] __initdata = {
39 /* MMC */
40 GPIO32_MMC_CLK,
41 GPIO92_MMC_DAT_0,
42 GPIO109_MMC_DAT_1,
43 GPIO110_MMC_DAT_2,
44 GPIO111_MMC_DAT_3,
45 GPIO112_MMC_CMD,
46 GPIO53_GPIO, /* SD detect */
47 GPIO52_GPIO, /* SD r/o switch */
48
49 /* GPIO KEYS */
50 GPIO1_GPIO, /* USER BTN */
51
52 /* LEDs */
53 GPIO15_GPIO, /* orange led */
54
55 /* FFUART */
56 GPIO34_FFUART_RXD,
57 GPIO39_FFUART_TXD,
58 GPIO27_FFUART_RTS,
59 GPIO100_FFUART_CTS,
60 GPIO33_FFUART_DSR,
61 GPIO40_FFUART_DTR,
62 GPIO10_FFUART_DCD,
63 GPIO38_FFUART_RI,
64
65 /* LCD */
66 GPIO58_LCD_LDD_0,
67 GPIO59_LCD_LDD_1,
68 GPIO60_LCD_LDD_2,
69 GPIO61_LCD_LDD_3,
70 GPIO62_LCD_LDD_4,
71 GPIO63_LCD_LDD_5,
72 GPIO64_LCD_LDD_6,
73 GPIO65_LCD_LDD_7,
74 GPIO66_LCD_LDD_8,
75 GPIO67_LCD_LDD_9,
76 GPIO68_LCD_LDD_10,
77 GPIO69_LCD_LDD_11,
78 GPIO70_LCD_LDD_12,
79 GPIO71_LCD_LDD_13,
80 GPIO72_LCD_LDD_14,
81 GPIO73_LCD_LDD_15,
82 GPIO86_LCD_LDD_16,
83 GPIO87_LCD_LDD_17,
84 GPIO74_LCD_FCLK,
85 GPIO75_LCD_LCLK,
86 GPIO76_LCD_PCLK,
87 GPIO77_LCD_BIAS,
88};
89
90/******************************************************************************
91 * NOR Flash
92 ******************************************************************************/
93#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
94static struct mtd_partition vpac270_partitions[] = {
95 {
96 .name = "Flash",
97 .offset = 0x00000000,
98 .size = MTDPART_SIZ_FULL,
99 }
100};
101
102static struct physmap_flash_data vpac270_flash_data[] = {
103 {
104 .width = 2, /* bankwidth in bytes */
105 .parts = vpac270_partitions,
106 .nr_parts = ARRAY_SIZE(vpac270_partitions)
107 }
108};
109
110static struct resource vpac270_flash_resource = {
111 .start = PXA_CS0_PHYS,
112 .end = PXA_CS0_PHYS + SZ_64M - 1,
113 .flags = IORESOURCE_MEM,
114};
115
116static struct platform_device vpac270_flash = {
117 .name = "physmap-flash",
118 .id = 0,
119 .resource = &vpac270_flash_resource,
120 .num_resources = 1,
121 .dev = {
122 .platform_data = vpac270_flash_data,
123 },
124};
125static void __init vpac270_nor_init(void)
126{
127 platform_device_register(&vpac270_flash);
128}
129#else
130static inline void vpac270_nor_init(void) {}
131#endif
132
133/******************************************************************************
134 * SD/MMC card controller
135 ******************************************************************************/
136#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
137static struct pxamci_platform_data vpac270_mci_platform_data = {
138 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
139 .gpio_card_detect = GPIO53_VPAC270_SD_DETECT_N,
140 .gpio_card_ro = GPIO52_VPAC270_SD_READONLY,
141 .detect_delay = 20,
142};
143
144static void __init vpac270_mmc_init(void)
145{
146 pxa_set_mci_info(&vpac270_mci_platform_data);
147}
148#else
149static inline void vpac270_mmc_init(void) {}
150#endif
151
152/******************************************************************************
153 * GPIO keys
154 ******************************************************************************/
155#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
156static struct gpio_keys_button vpac270_pxa_buttons[] = {
157 {KEY_POWER, GPIO1_VPAC270_USER_BTN, 0, "USER BTN"},
158};
159
160static struct gpio_keys_platform_data vpac270_pxa_keys_data = {
161 .buttons = vpac270_pxa_buttons,
162 .nbuttons = ARRAY_SIZE(vpac270_pxa_buttons),
163};
164
165static struct platform_device vpac270_pxa_keys = {
166 .name = "gpio-keys",
167 .id = -1,
168 .dev = {
169 .platform_data = &vpac270_pxa_keys_data,
170 },
171};
172
173static void __init vpac270_keys_init(void)
174{
175 platform_device_register(&vpac270_pxa_keys);
176}
177#else
178static inline void vpac270_keys_init(void) {}
179#endif
180
181/******************************************************************************
182 * LED
183 ******************************************************************************/
184#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
185struct gpio_led vpac270_gpio_leds[] = {
186{
187 .name = "vpac270:orange:user",
188 .default_trigger = "none",
189 .gpio = GPIO15_VPAC270_LED_ORANGE,
190 .active_low = 1,
191}
192};
193
194static struct gpio_led_platform_data vpac270_gpio_led_info = {
195 .leds = vpac270_gpio_leds,
196 .num_leds = ARRAY_SIZE(vpac270_gpio_leds),
197};
198
199static struct platform_device vpac270_leds = {
200 .name = "leds-gpio",
201 .id = -1,
202 .dev = {
203 .platform_data = &vpac270_gpio_led_info,
204 }
205};
206
207static void __init vpac270_leds_init(void)
208{
209 platform_device_register(&vpac270_leds);
210}
211#else
212static inline void vpac270_leds_init(void) {}
213#endif
214
215/******************************************************************************
216 * Framebuffer
217 ******************************************************************************/
218#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
219static struct pxafb_mode_info vpac270_lcd_modes[] = {
220{
221 .pixclock = 57692,
222 .xres = 640,
223 .yres = 480,
224 .bpp = 32,
225 .depth = 18,
226
227 .left_margin = 144,
228 .right_margin = 32,
229 .upper_margin = 13,
230 .lower_margin = 30,
231
232 .hsync_len = 32,
233 .vsync_len = 2,
234
235 .sync = FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,
236},
237};
238
239static struct pxafb_mach_info vpac270_lcd_screen = {
240 .modes = vpac270_lcd_modes,
241 .num_modes = ARRAY_SIZE(vpac270_lcd_modes),
242 .lcd_conn = LCD_COLOR_TFT_18BPP,
243};
244
245static void vpac270_lcd_power(int on, struct fb_var_screeninfo *info)
246{
247 gpio_set_value(GPIO81_VPAC270_BKL_ON, on);
248}
249
250static void __init vpac270_lcd_init(void)
251{
252 int ret;
253
254 ret = gpio_request(GPIO81_VPAC270_BKL_ON, "BKL-ON");
255 if (ret) {
256 pr_err("Requesting BKL-ON GPIO failed!\n");
257 goto err;
258 }
259
260 ret = gpio_direction_output(GPIO81_VPAC270_BKL_ON, 1);
261 if (ret) {
262 pr_err("Setting BKL-ON GPIO direction failed!\n");
263 goto err2;
264 }
265
266 vpac270_lcd_screen.pxafb_lcd_power = vpac270_lcd_power;
267 set_pxa_fb_info(&vpac270_lcd_screen);
268 return;
269
270err2:
271 gpio_free(GPIO81_VPAC270_BKL_ON);
272err:
273 return;
274}
275#else
276static inline void vpac270_lcd_init(void) {}
277#endif
278
279/******************************************************************************
280 * Machine init
281 ******************************************************************************/
282static void __init vpac270_init(void)
283{
284 pxa2xx_mfp_config(ARRAY_AND_SIZE(vpac270_pin_config));
285
286 pxa_set_ffuart_info(NULL);
287 pxa_set_btuart_info(NULL);
288 pxa_set_stuart_info(NULL);
289
290 vpac270_lcd_init();
291 vpac270_mmc_init();
292 vpac270_nor_init();
293 vpac270_leds_init();
294 vpac270_keys_init();
295}
296
297MACHINE_START(VPAC270, "Voipac PXA270")
298 .phys_io = 0x40000000,
299 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
300 .boot_params = 0xa0000100,
301 .map_io = pxa_map_io,
302 .init_irq = pxa27x_init_irq,
303 .timer = &pxa_timer,
304 .init_machine = vpac270_init
305MACHINE_END