aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2011-02-15 09:01:35 -0500
committerLinus Walleij <linus.walleij@linaro.org>2011-03-14 09:05:16 -0400
commit4b4f757c807375564ce3d4ff1d088d3847c52f6d (patch)
treeeac756e13f38cb9fd899df6225665a0d8caaff62 /arch/arm/mach-ux500
parent4bc3a698c3db6592490cd685e395e27216ed2454 (diff)
mach-ux500: basic HREFv60 support v2
The HREFv60 variant of the MOP500 family of boards remove the external GPIO expander and route these pins back to some of the readily available internal GPIO pins instead. Based on a patch by Bibek Basu <bibek.basu@stericsson.com> for an internal kernel version. Cc: Bibek Basu <bibek.basu@stericsson.com> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Diffstat (limited to 'arch/arm/mach-ux500')
-rw-r--r--arch/arm/mach-ux500/board-mop500-sdi.c42
-rw-r--r--arch/arm/mach-ux500/board-mop500-stuib.c12
-rw-r--r--arch/arm/mach-ux500/board-mop500.c23
-rw-r--r--arch/arm/mach-ux500/board-mop500.h14
-rw-r--r--arch/arm/mach-ux500/include/mach/uncompress.h6
5 files changed, 81 insertions, 16 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-sdi.c b/arch/arm/mach-ux500/board-mop500-sdi.c
index 68c8375e45c6..bf0b02414e5b 100644
--- a/arch/arm/mach-ux500/board-mop500-sdi.c
+++ b/arch/arm/mach-ux500/board-mop500-sdi.c
@@ -12,6 +12,7 @@
12#include <linux/mmc/host.h> 12#include <linux/mmc/host.h>
13#include <linux/platform_device.h> 13#include <linux/platform_device.h>
14 14
15#include <asm/mach-types.h>
15#include <plat/ste_dma40.h> 16#include <plat/ste_dma40.h>
16#include <mach/devices.h> 17#include <mach/devices.h>
17#include <mach/hardware.h> 18#include <mach/hardware.h>
@@ -68,7 +69,6 @@ static struct mmci_platform_data mop500_sdi0_data = {
68 .ocr_mask = MMC_VDD_29_30, 69 .ocr_mask = MMC_VDD_29_30,
69 .f_max = 100000000, 70 .f_max = 100000000,
70 .capabilities = MMC_CAP_4_BIT_DATA, 71 .capabilities = MMC_CAP_4_BIT_DATA,
71 .gpio_cd = GPIO_SDMMC_CD,
72 .gpio_wp = -1, 72 .gpio_wp = -1,
73#ifdef CONFIG_STE_DMA40 73#ifdef CONFIG_STE_DMA40
74 .dma_filter = stedma40_filter, 74 .dma_filter = stedma40_filter,
@@ -77,23 +77,40 @@ static struct mmci_platform_data mop500_sdi0_data = {
77#endif 77#endif
78}; 78};
79 79
80void mop500_sdi_tc35892_init(void) 80/* GPIO pins used by the sdi0 level shifter */
81static int sdi0_en = -1;
82static int sdi0_vsel = -1;
83
84static void sdi0_configure(void)
81{ 85{
82 int ret; 86 int ret;
83 87
84 ret = gpio_request(GPIO_SDMMC_EN, "SDMMC_EN"); 88 ret = gpio_request(sdi0_en, "level shifter enable");
85 if (!ret) 89 if (!ret)
86 ret = gpio_request(GPIO_SDMMC_1V8_3V_SEL, 90 ret = gpio_request(sdi0_vsel,
87 "GPIO_SDMMC_1V8_3V_SEL"); 91 "level shifter 1v8-3v select");
88 if (ret) 92
93 if (ret) {
94 pr_warning("unable to config sdi0 gpios for level shifter.\n");
89 return; 95 return;
96 }
90 97
91 gpio_direction_output(GPIO_SDMMC_1V8_3V_SEL, 0); 98 /* Select the default 2.9V and enable level shifter */
92 gpio_direction_output(GPIO_SDMMC_EN, 1); 99 gpio_direction_output(sdi0_vsel, 0);
100 gpio_direction_output(sdi0_en, 1);
93 101
102 /* Add the device */
94 db8500_add_sdi0(&mop500_sdi0_data); 103 db8500_add_sdi0(&mop500_sdi0_data);
95} 104}
96 105
106void mop500_sdi_tc35892_init(void)
107{
108 mop500_sdi0_data.gpio_cd = GPIO_SDMMC_CD;
109 sdi0_en = GPIO_SDMMC_EN;
110 sdi0_vsel = GPIO_SDMMC_1V8_3V_SEL;
111 sdi0_configure();
112}
113
97/* 114/*
98 * SDI 2 (POP eMMC, not on DB8500ed) 115 * SDI 2 (POP eMMC, not on DB8500ed)
99 */ 116 */
@@ -179,8 +196,15 @@ void __init mop500_sdi_init(void)
179 /* On-board eMMC */ 196 /* On-board eMMC */
180 db8500_add_sdi4(&mop500_sdi4_data); 197 db8500_add_sdi4(&mop500_sdi4_data);
181 198
199 if (machine_is_hrefv60()) {
200 mop500_sdi0_data.gpio_cd = HREFV60_SDMMC_CD_GPIO;
201 sdi0_en = HREFV60_SDMMC_EN_GPIO;
202 sdi0_vsel = HREFV60_SDMMC_1V8_3V_GPIO;
203 sdi0_configure();
204 }
182 /* 205 /*
183 * sdi0 will finally be added when the TC35892 initializes and calls 206 * On boards with the TC35892 GPIO expander, sdi0 will finally
207 * be added when the TC35892 initializes and calls
184 * mop500_sdi_tc35892_init() above. 208 * mop500_sdi_tc35892_init() above.
185 */ 209 */
186} 210}
diff --git a/arch/arm/mach-ux500/board-mop500-stuib.c b/arch/arm/mach-ux500/board-mop500-stuib.c
index 8b6323e229ff..8c979770d872 100644
--- a/arch/arm/mach-ux500/board-mop500-stuib.c
+++ b/arch/arm/mach-ux500/board-mop500-stuib.c
@@ -12,6 +12,7 @@
12#include <linux/interrupt.h> 12#include <linux/interrupt.h>
13#include <linux/i2c.h> 13#include <linux/i2c.h>
14#include <linux/input/matrix_keypad.h> 14#include <linux/input/matrix_keypad.h>
15#include <asm/mach-types.h>
15 16
16#include "board-mop500.h" 17#include "board-mop500.h"
17 18
@@ -154,7 +155,6 @@ static struct bu21013_platform_device tsc_plat_device = {
154 .cs_dis = bu21013_gpio_board_exit, 155 .cs_dis = bu21013_gpio_board_exit,
155 .irq_read_val = bu21013_read_pin_val, 156 .irq_read_val = bu21013_read_pin_val,
156 .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN), 157 .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
157 .cs_pin = GPIO_BU21013_CS,
158 .touch_x_max = TOUCH_XMAX, 158 .touch_x_max = TOUCH_XMAX,
159 .touch_y_max = TOUCH_YMAX, 159 .touch_y_max = TOUCH_YMAX,
160 .ext_clk = false, 160 .ext_clk = false,
@@ -167,7 +167,6 @@ static struct bu21013_platform_device tsc_plat2_device = {
167 .cs_dis = bu21013_gpio_board_exit, 167 .cs_dis = bu21013_gpio_board_exit,
168 .irq_read_val = bu21013_read_pin_val, 168 .irq_read_val = bu21013_read_pin_val,
169 .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN), 169 .irq = NOMADIK_GPIO_TO_IRQ(TOUCH_GPIO_PIN),
170 .cs_pin = GPIO_BU21013_CS,
171 .touch_x_max = TOUCH_XMAX, 170 .touch_x_max = TOUCH_XMAX,
172 .touch_y_max = TOUCH_YMAX, 171 .touch_y_max = TOUCH_YMAX,
173 .ext_clk = false, 172 .ext_clk = false,
@@ -189,6 +188,15 @@ static struct i2c_board_info __initdata u8500_i2c3_devices_stuib[] = {
189 188
190void __init mop500_stuib_init(void) 189void __init mop500_stuib_init(void)
191{ 190{
191 if (machine_is_hrefv60()) {
192 tsc_plat_device.cs_pin = HREFV60_TOUCH_RST_GPIO;
193 tsc_plat2_device.cs_pin = HREFV60_TOUCH_RST_GPIO;
194 } else {
195 tsc_plat_device.cs_pin = GPIO_BU21013_CS;
196 tsc_plat2_device.cs_pin = GPIO_BU21013_CS;
197
198 }
199
192 mop500_uib_i2c_add(0, mop500_i2c0_devices_stuib, 200 mop500_uib_i2c_add(0, mop500_i2c0_devices_stuib,
193 ARRAY_SIZE(mop500_i2c0_devices_stuib)); 201 ARRAY_SIZE(mop500_i2c0_devices_stuib));
194 202
diff --git a/arch/arm/mach-ux500/board-mop500.c b/arch/arm/mach-ux500/board-mop500.c
index 72448e17260f..8790d984cac8 100644
--- a/arch/arm/mach-ux500/board-mop500.c
+++ b/arch/arm/mach-ux500/board-mop500.c
@@ -202,7 +202,6 @@ static struct gpio_keys_button mop500_gpio_keys[] = {
202 .desc = "SFH7741 Proximity Sensor", 202 .desc = "SFH7741 Proximity Sensor",
203 .type = EV_SW, 203 .type = EV_SW,
204 .code = SW_FRONT_PROXIMITY, 204 .code = SW_FRONT_PROXIMITY,
205 .gpio = GPIO_PROX_SENSOR,
206 .active_low = 0, 205 .active_low = 0,
207 .can_disable = 1, 206 .can_disable = 1,
208 } 207 }
@@ -379,8 +378,18 @@ static void __init mop500_uart_init(void)
379 db8500_add_uart2(&uart2_plat); 378 db8500_add_uart2(&uart2_plat);
380} 379}
381 380
382static void __init u8500_init_machine(void) 381static void __init mop500_init_machine(void)
383{ 382{
383 /*
384 * The HREFv60 board removed a GPIO expander and routed
385 * all these GPIO pins to the internal GPIO controller
386 * instead.
387 */
388 if (machine_is_hrefv60())
389 mop500_gpio_keys[0].gpio = HREFV60_PROX_SENSE_GPIO;
390 else
391 mop500_gpio_keys[0].gpio = GPIO_PROX_SENSOR;
392
384 u8500_init_devices(); 393 u8500_init_devices();
385 394
386 mop500_pins_init(); 395 mop500_pins_init();
@@ -407,5 +416,13 @@ MACHINE_START(U8500, "ST-Ericsson MOP500 platform")
407 .init_irq = ux500_init_irq, 416 .init_irq = ux500_init_irq,
408 /* we re-use nomadik timer here */ 417 /* we re-use nomadik timer here */
409 .timer = &ux500_timer, 418 .timer = &ux500_timer,
410 .init_machine = u8500_init_machine, 419 .init_machine = mop500_init_machine,
420MACHINE_END
421
422MACHINE_START(HREFV60, "ST-Ericsson U8500 Platform HREFv60+")
423 .boot_params = 0x100,
424 .map_io = u8500_map_io,
425 .init_irq = ux500_init_irq,
426 .timer = &ux500_timer,
427 .init_machine = mop500_init_machine,
411MACHINE_END 428MACHINE_END
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index 48abca77335c..56722f4be71b 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -7,9 +7,21 @@
7#ifndef __BOARD_MOP500_H 7#ifndef __BOARD_MOP500_H
8#define __BOARD_MOP500_H 8#define __BOARD_MOP500_H
9 9
10#define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x)) 10/* HREFv60-specific GPIO assignments, this board has no GPIO expander */
11#define HREFV60_TOUCH_RST_GPIO 143
12#define HREFV60_PROX_SENSE_GPIO 217
13#define HREFV60_HAL_SW_GPIO 145
14#define HREFV60_SDMMC_EN_GPIO 169
15#define HREFV60_SDMMC_1V8_3V_GPIO 5
16#define HREFV60_SDMMC_CD_GPIO 95
17#define HREFV60_ACCEL_INT1_GPIO 82
18#define HREFV60_ACCEL_INT2_GPIO 83
19#define HREFV60_MAGNET_DRDY_GPIO 32
20#define HREFV60_DISP1_RST_GPIO 65
21#define HREFV60_DISP2_RST_GPIO 66
11 22
12/* GPIOs on the TC35892 expander */ 23/* GPIOs on the TC35892 expander */
24#define MOP500_EGPIO(x) (NOMADIK_NR_GPIO + (x))
13#define GPIO_SDMMC_CD MOP500_EGPIO(3) 25#define GPIO_SDMMC_CD MOP500_EGPIO(3)
14#define GPIO_PROX_SENSOR MOP500_EGPIO(7) 26#define GPIO_PROX_SENSOR MOP500_EGPIO(7)
15#define GPIO_BU21013_CS MOP500_EGPIO(13) 27#define GPIO_BU21013_CS MOP500_EGPIO(13)
diff --git a/arch/arm/mach-ux500/include/mach/uncompress.h b/arch/arm/mach-ux500/include/mach/uncompress.h
index 9a6614c6808e..ab0fe1432fae 100644
--- a/arch/arm/mach-ux500/include/mach/uncompress.h
+++ b/arch/arm/mach-ux500/include/mach/uncompress.h
@@ -50,7 +50,11 @@ static void flush(void)
50 50
51static inline void arch_decomp_setup(void) 51static inline void arch_decomp_setup(void)
52{ 52{
53 if (machine_is_u8500()) 53 /* Check in run time if we run on an U8500 or U5500 */
54 if (machine_is_u8500() ||
55 machine_is_svp8500v1() ||
56 machine_is_svp8500v2() ||
57 machine_is_hrefv60())
54 ux500_uart_base = U8500_UART2_BASE; 58 ux500_uart_base = U8500_UART2_BASE;
55 else if (machine_is_u5500()) 59 else if (machine_is_u5500())
56 ux500_uart_base = U5500_UART0_BASE; 60 ux500_uart_base = U5500_UART0_BASE;