aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarek Vasut <marek.vasut@gmail.com>2010-05-21 18:29:39 -0400
committerEric Miao <eric.y.miao@gmail.com>2010-06-18 03:07:34 -0400
commit403d29713e0a5c671d852913a0b5935c0ff00cb7 (patch)
treeb632213f80d6d5f6c800da6844f78899b17e082e
parent4c243c8584be9fbff9e11fc37fa2449448c5d442 (diff)
[ARM] pxa/income: Add Income SBC support
This is support for custom design based on Toradex Colibri PXA270 CPU card. Initial patch was by Pavel Revak. [daniel - rebased the code to follow the module/board split] Signed-off-by: Marek Vasut <marek.vasut@gmail.com> Cc: Pavel Revak <palo@bielyvlk.sk> Cc: Daniel Mack <daniel@caiaq.de> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
-rw-r--r--MAINTAINERS7
-rw-r--r--arch/arm/mach-pxa/Kconfig7
-rw-r--r--arch/arm/mach-pxa/Makefile1
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270-income.c272
-rw-r--r--arch/arm/mach-pxa/colibri-pxa270.c29
-rw-r--r--arch/arm/mach-pxa/include/mach/colibri.h7
6 files changed, 320 insertions, 3 deletions
diff --git a/MAINTAINERS b/MAINTAINERS
index 6d119c98b89b..870940ab090b 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -695,6 +695,13 @@ T: git git://git.kernel.org/pub/scm/linux/kernel/git/kristoffer/linux-hpc.git
695F: arch/arm/mach-sa1100/jornada720.c 695F: arch/arm/mach-sa1100/jornada720.c
696F: arch/arm/mach-sa1100/include/mach/jornada720.h 696F: arch/arm/mach-sa1100/include/mach/jornada720.h
697 697
698ARM/INCOME PXA270 SUPPORT
699M: Marek Vasut <marek.vasut@gmail.com>
700L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
701S: Maintained
702F: arch/arm/mach-pxa/income.c
703F: arch/arm/mach-pxa/include/mach-pxa/income.h
704
698ARM/INTEL IOP32X ARM ARCHITECTURE 705ARM/INTEL IOP32X ARM ARCHITECTURE
699M: Lennert Buytenhek <kernel@wantstofly.org> 706M: Lennert Buytenhek <kernel@wantstofly.org>
700M: Dan Williams <dan.j.williams@intel.com> 707M: Dan Williams <dan.j.williams@intel.com>
diff --git a/arch/arm/mach-pxa/Kconfig b/arch/arm/mach-pxa/Kconfig
index 819b44fe4081..2ff0b325a7d5 100644
--- a/arch/arm/mach-pxa/Kconfig
+++ b/arch/arm/mach-pxa/Kconfig
@@ -242,6 +242,13 @@ config MACH_COLIBRI_PXA270_EVALBOARD
242 bool "Toradex Colibri Evaluation Carrier Board support (PXA270)" 242 bool "Toradex Colibri Evaluation Carrier Board support (PXA270)"
243 depends on MACH_COLIBRI 243 depends on MACH_COLIBRI
244 244
245config MACH_COLIBRI_PXA270_INCOME
246 bool "Income s.r.o. PXA270 SBC"
247 depends on MACH_COLIBRI
248 select PXA27x
249 select HAVE_PWM
250 select PXA_HAVE_BOARD_IRQS
251
245config MACH_COLIBRI300 252config MACH_COLIBRI300
246 bool "Toradex Colibri PXA300/310" 253 bool "Toradex Colibri PXA300/310"
247 select PXA3xx 254 select PXA3xx
diff --git a/arch/arm/mach-pxa/Makefile b/arch/arm/mach-pxa/Makefile
index 4751c9de5c60..66e8989b8ef2 100644
--- a/arch/arm/mach-pxa/Makefile
+++ b/arch/arm/mach-pxa/Makefile
@@ -60,6 +60,7 @@ obj-$(CONFIG_MACH_PCM027) += pcm027.o
60obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o 60obj-$(CONFIG_MACH_PCM990_BASEBOARD) += pcm990-baseboard.o
61obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o 61obj-$(CONFIG_MACH_COLIBRI) += colibri-pxa270.o
62obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) += colibri-pxa270-evalboard.o 62obj-$(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) += colibri-pxa270-evalboard.o
63obj-$(CONFIG_MACH_COLIBRI_PXA270_INCOME) += colibri-pxa270-income.o
63obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o 64obj-$(CONFIG_MACH_COLIBRI300) += colibri-pxa3xx.o colibri-pxa300.o
64obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o 65obj-$(CONFIG_MACH_COLIBRI320) += colibri-pxa3xx.o colibri-pxa320.o
65obj-$(CONFIG_MACH_VPAC270) += vpac270.o 66obj-$(CONFIG_MACH_VPAC270) += vpac270.o
diff --git a/arch/arm/mach-pxa/colibri-pxa270-income.c b/arch/arm/mach-pxa/colibri-pxa270-income.c
new file mode 100644
index 000000000000..37f0f3ed7c61
--- /dev/null
+++ b/arch/arm/mach-pxa/colibri-pxa270-income.c
@@ -0,0 +1,272 @@
1/*
2 * linux/arch/arm/mach-pxa/income.c
3 *
4 * Support for Income s.r.o. SH-Dmaster PXA270 SBC
5 *
6 * Copyright (C) 2010
7 * Marek Vasut <marek.vasut@gmail.com>
8 * Pavel Revak <palo@bielyvlk.sk>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#include <linux/bitops.h>
16#include <linux/delay.h>
17#include <linux/gpio.h>
18#include <linux/init.h>
19#include <linux/interrupt.h>
20#include <linux/ioport.h>
21#include <linux/kernel.h>
22#include <linux/platform_device.h>
23#include <linux/pwm_backlight.h>
24#include <linux/sysdev.h>
25
26#include <asm/irq.h>
27#include <asm/mach-types.h>
28
29#include <mach/hardware.h>
30#include <mach/mmc.h>
31#include <mach/ohci.h>
32#include <mach/pxa27x.h>
33#include <mach/pxa27x-udc.h>
34#include <mach/pxafb.h>
35
36#include <plat/i2c.h>
37
38#include "devices.h"
39#include "generic.h"
40
41#define GPIO114_INCOME_ETH_IRQ (114)
42#define GPIO0_INCOME_SD_DETECT (0)
43#define GPIO0_INCOME_SD_RO (1)
44#define GPIO54_INCOME_LED_A (54)
45#define GPIO55_INCOME_LED_B (55)
46#define GPIO113_INCOME_TS_IRQ (113)
47
48/******************************************************************************
49 * Pin configuration
50 ******************************************************************************/
51static mfp_cfg_t income_pin_config[] __initdata = {
52 /* MMC */
53 GPIO32_MMC_CLK,
54 GPIO92_MMC_DAT_0,
55 GPIO109_MMC_DAT_1,
56 GPIO110_MMC_DAT_2,
57 GPIO111_MMC_DAT_3,
58 GPIO112_MMC_CMD,
59 GPIO0_GPIO, /* SD detect */
60 GPIO1_GPIO, /* SD read-only */
61
62 /* FFUART */
63 GPIO39_FFUART_TXD,
64 GPIO34_FFUART_RXD,
65
66 /* BFUART */
67 GPIO42_BTUART_RXD,
68 GPIO43_BTUART_TXD,
69 GPIO45_BTUART_RTS,
70
71 /* STUART */
72 GPIO46_STUART_RXD,
73 GPIO47_STUART_TXD,
74
75 /* UHC */
76 GPIO88_USBH1_PWR,
77 GPIO89_USBH1_PEN,
78
79 /* LCD */
80 GPIOxx_LCD_TFT_16BPP,
81
82 /* PWM */
83 GPIO16_PWM0_OUT,
84
85 /* I2C */
86 GPIO117_I2C_SCL,
87 GPIO118_I2C_SDA,
88
89 /* LED */
90 GPIO54_GPIO, /* LED A */
91 GPIO55_GPIO, /* LED B */
92};
93
94/******************************************************************************
95 * SD/MMC card controller
96 ******************************************************************************/
97#if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
98static struct pxamci_platform_data income_mci_platform_data = {
99 .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
100 .gpio_power = -1,
101 .gpio_card_detect = GPIO0_INCOME_SD_DETECT,
102 .gpio_card_ro = GPIO0_INCOME_SD_RO,
103 .detect_delay_ms = 200,
104};
105
106static void __init income_mmc_init(void)
107{
108 pxa_set_mci_info(&income_mci_platform_data);
109}
110#else
111static inline void income_mmc_init(void) {}
112#endif
113
114/******************************************************************************
115 * USB Host
116 ******************************************************************************/
117#if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
118static struct pxaohci_platform_data income_ohci_info = {
119 .port_mode = PMM_PERPORT_MODE,
120 .flags = ENABLE_PORT1 | POWER_CONTROL_LOW | POWER_SENSE_LOW,
121};
122
123static void __init income_uhc_init(void)
124{
125 pxa_set_ohci_info(&income_ohci_info);
126}
127#else
128static inline void income_uhc_init(void) {}
129#endif
130
131/******************************************************************************
132 * LED
133 ******************************************************************************/
134#if defined(CONFIG_LEDS_GPIO) || defined(CONFIG_LEDS_GPIO_MODULE)
135struct gpio_led income_gpio_leds[] = {
136 {
137 .name = "income:green:leda",
138 .default_trigger = "none",
139 .gpio = GPIO54_INCOME_LED_A,
140 .active_low = 1,
141 },
142 {
143 .name = "income:green:ledb",
144 .default_trigger = "none",
145 .gpio = GPIO55_INCOME_LED_B,
146 .active_low = 1,
147 }
148};
149
150static struct gpio_led_platform_data income_gpio_led_info = {
151 .leds = income_gpio_leds,
152 .num_leds = ARRAY_SIZE(income_gpio_leds),
153};
154
155static struct platform_device income_leds = {
156 .name = "leds-gpio",
157 .id = -1,
158 .dev = {
159 .platform_data = &income_gpio_led_info,
160 }
161};
162
163static void __init income_led_init(void)
164{
165 platform_device_register(&income_leds);
166}
167#else
168static inline void income_led_init(void) {}
169#endif
170
171/******************************************************************************
172 * I2C
173 ******************************************************************************/
174#if defined(CONFIG_I2C_PXA) || defined(CONFIG_I2C_PXA_MODULE)
175static struct i2c_board_info __initdata income_i2c_devs[] = {
176 {
177 I2C_BOARD_INFO("ds1340", 0x68),
178 }, {
179 I2C_BOARD_INFO("lm75", 0x4f),
180 },
181};
182
183static void __init income_i2c_init(void)
184{
185 pxa_set_i2c_info(NULL);
186 pxa27x_set_i2c_power_info(NULL);
187 i2c_register_board_info(0, ARRAY_AND_SIZE(income_i2c_devs));
188}
189#else
190static inline void income_i2c_init(void) {}
191#endif
192
193/******************************************************************************
194 * Framebuffer
195 ******************************************************************************/
196#if defined(CONFIG_FB_PXA) || defined(CONFIG_FB_PXA_MODULE)
197static struct pxafb_mode_info income_lcd_modes[] = {
198{
199 .pixclock = 144700,
200 .xres = 320,
201 .yres = 240,
202 .bpp = 32,
203 .depth = 18,
204
205 .left_margin = 10,
206 .right_margin = 10,
207 .upper_margin = 7,
208 .lower_margin = 8,
209
210 .hsync_len = 20,
211 .vsync_len = 2,
212
213 .sync = FB_SYNC_VERT_HIGH_ACT,
214},
215};
216
217static struct pxafb_mach_info income_lcd_screen = {
218 .modes = income_lcd_modes,
219 .num_modes = ARRAY_SIZE(income_lcd_modes),
220 .lcd_conn = LCD_COLOR_TFT_18BPP | LCD_PCLK_EDGE_FALL,
221};
222
223static void __init income_lcd_init(void)
224{
225 set_pxa_fb_info(&income_lcd_screen);
226}
227#else
228static inline void income_lcd_init(void) {}
229#endif
230
231/******************************************************************************
232 * Backlight
233 ******************************************************************************/
234#if defined(CONFIG_BACKLIGHT_PWM) || defined(CONFIG_BACKLIGHT_PWM__MODULE)
235static struct platform_pwm_backlight_data income_backlight_data = {
236 .pwm_id = 0,
237 .max_brightness = 0x3ff,
238 .dft_brightness = 0x1ff,
239 .pwm_period_ns = 1000000,
240};
241
242static struct platform_device income_backlight = {
243 .name = "pwm-backlight",
244 .dev = {
245 .parent = &pxa27x_device_pwm0.dev,
246 .platform_data = &income_backlight_data,
247 },
248};
249
250static void __init income_pwm_init(void)
251{
252 platform_device_register(&income_backlight);
253}
254#else
255static inline void income_pwm_init(void) {}
256#endif
257
258void __init colibri_pxa270_income_boardinit(void)
259{
260 pxa2xx_mfp_config(ARRAY_AND_SIZE(income_pin_config));
261 pxa_set_ffuart_info(NULL);
262 pxa_set_btuart_info(NULL);
263 pxa_set_stuart_info(NULL);
264
265 income_mmc_init();
266 income_uhc_init();
267 income_led_init();
268 income_i2c_init();
269 income_lcd_init();
270 income_pwm_init();
271}
272
diff --git a/arch/arm/mach-pxa/colibri-pxa270.c b/arch/arm/mach-pxa/colibri-pxa270.c
index b4f53ccf3e80..98673ac6efd0 100644
--- a/arch/arm/mach-pxa/colibri-pxa270.c
+++ b/arch/arm/mach-pxa/colibri-pxa270.c
@@ -110,17 +110,17 @@ static inline void colibri_pxa270_nor_init(void) {}
110 ******************************************************************************/ 110 ******************************************************************************/
111#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 111#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
112static struct resource colibri_pxa270_dm9000_resources[] = { 112static struct resource colibri_pxa270_dm9000_resources[] = {
113 [0] = { 113 {
114 .start = PXA_CS2_PHYS, 114 .start = PXA_CS2_PHYS,
115 .end = PXA_CS2_PHYS + 3, 115 .end = PXA_CS2_PHYS + 3,
116 .flags = IORESOURCE_MEM, 116 .flags = IORESOURCE_MEM,
117 }, 117 },
118 [1] = { 118 {
119 .start = PXA_CS2_PHYS + 4, 119 .start = PXA_CS2_PHYS + 4,
120 .end = PXA_CS2_PHYS + 4 + 500, 120 .end = PXA_CS2_PHYS + 4 + 500,
121 .flags = IORESOURCE_MEM, 121 .flags = IORESOURCE_MEM,
122 }, 122 },
123 [2] = { 123 {
124 .start = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ), 124 .start = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
125 .end = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ), 125 .end = gpio_to_irq(GPIO114_COLIBRI_PXA270_ETH_IRQ),
126 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING, 126 .flags = IORESOURCE_IRQ | IRQF_TRIGGER_RISING,
@@ -187,12 +187,25 @@ static void __init colibri_pxa270_init(void)
187 case COLIBRI_PXA270_EVALBOARD: 187 case COLIBRI_PXA270_EVALBOARD:
188 colibri_pxa270_evalboard_init(); 188 colibri_pxa270_evalboard_init();
189 break; 189 break;
190 case COLIBRI_PXA270_INCOME:
191 colibri_pxa270_income_boardinit();
192 break;
190 default: 193 default:
191 printk(KERN_ERR "Illegal colibri_pxa270_baseboard type %d\n", 194 printk(KERN_ERR "Illegal colibri_pxa270_baseboard type %d\n",
192 colibri_pxa270_baseboard); 195 colibri_pxa270_baseboard);
193 } 196 }
194} 197}
195 198
199/* The "Income s.r.o. SH-Dmaster PXA270 SBC" board can be booted either
200 * with the INCOME mach type or with COLIBRI and the kernel parameter
201 * "colibri_pxa270_baseboard=1"
202 */
203static void __init colibri_pxa270_income_init(void)
204{
205 colibri_pxa270_baseboard = COLIBRI_PXA270_INCOME;
206 colibri_pxa270_init();
207}
208
196MACHINE_START(COLIBRI, "Toradex Colibri PXA270") 209MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
197 .phys_io = 0x40000000, 210 .phys_io = 0x40000000,
198 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, 211 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
@@ -203,3 +216,13 @@ MACHINE_START(COLIBRI, "Toradex Colibri PXA270")
203 .timer = &pxa_timer, 216 .timer = &pxa_timer,
204MACHINE_END 217MACHINE_END
205 218
219MACHINE_START(INCOME, "Income s.r.o. SH-Dmaster PXA270 SBC")
220 .phys_io = 0x40000000,
221 .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc,
222 .boot_params = 0xa0000100,
223 .init_machine = colibri_pxa270_income_init,
224 .map_io = pxa_map_io,
225 .init_irq = pxa27x_init_irq,
226 .timer = &pxa_timer,
227MACHINE_END
228
diff --git a/arch/arm/mach-pxa/include/mach/colibri.h b/arch/arm/mach-pxa/include/mach/colibri.h
index 6434f66824b3..58dada11054f 100644
--- a/arch/arm/mach-pxa/include/mach/colibri.h
+++ b/arch/arm/mach-pxa/include/mach/colibri.h
@@ -10,6 +10,7 @@
10 10
11enum { 11enum {
12 COLIBRI_PXA270_EVALBOARD = 0, 12 COLIBRI_PXA270_EVALBOARD = 0,
13 COLIBRI_PXA270_INCOME,
13}; 14};
14 15
15#if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD) 16#if defined(CONFIG_MACH_COLIBRI_PXA270_EVALBOARD)
@@ -18,6 +19,12 @@ extern void colibri_pxa270_evalboard_init(void);
18static inline void colibri_pxa270_evalboard_init(void) {} 19static inline void colibri_pxa270_evalboard_init(void) {}
19#endif 20#endif
20 21
22#if defined(CONFIG_MACH_COLIBRI_PXA270_INCOME)
23extern void colibri_pxa270_income_boardinit(void);
24#else
25static inline void colibri_pxa270_income_boardinit(void) {}
26#endif
27
21/* 28/*
22 * common settings for all modules 29 * common settings for all modules
23 */ 30 */