aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-ux500
diff options
context:
space:
mode:
authorLinus Walleij <linus.walleij@linaro.org>2012-04-19 12:27:38 -0400
committerLinus Walleij <linus.walleij@linaro.org>2012-04-24 03:36:06 -0400
commit1baa57434a09ea1c3ff6e009a119e0be58d8134b (patch)
tree6d25f5ca30cd108a9418cc03a6fd29e844a3bcdc /arch/arm/mach-ux500
parent339bcf3b49832b6c6826f3549355fc8dcb6f5810 (diff)
ARM: ux500: update pin handling
This updates the Ux500 pin handling to take much more care when applying pin settings for different platforms and peripherals. This is an accumulation of a longer history of updates to the MOP500 family pin file. 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-pins.c393
-rw-r--r--arch/arm/mach-ux500/board-mop500.h4
2 files changed, 301 insertions, 96 deletions
diff --git a/arch/arm/mach-ux500/board-mop500-pins.c b/arch/arm/mach-ux500/board-mop500-pins.c
index e2a2e501b697..df5b190d331c 100644
--- a/arch/arm/mach-ux500/board-mop500-pins.c
+++ b/arch/arm/mach-ux500/board-mop500-pins.c
@@ -7,110 +7,47 @@
7#include <linux/kernel.h> 7#include <linux/kernel.h>
8#include <linux/init.h> 8#include <linux/init.h>
9#include <linux/bug.h> 9#include <linux/bug.h>
10#include <linux/string.h>
10 11
11#include <asm/mach-types.h> 12#include <asm/mach-types.h>
12#include <plat/pincfg.h> 13#include <plat/pincfg.h>
13#include <plat/gpio-nomadik.h> 14#include <plat/gpio-nomadik.h>
15
14#include <mach/hardware.h> 16#include <mach/hardware.h>
15 17
16#include "pins-db8500.h" 18#include "pins-db8500.h"
17#include "pins.h" 19#include "pins.h"
20#include "board-mop500.h"
21
22enum custom_pin_cfg_t {
23 PINS_FOR_DEFAULT,
24 PINS_FOR_U9500,
25};
26
27static enum custom_pin_cfg_t pinsfor;
18 28
19static pin_cfg_t mop500_pins_common[] = { 29static pin_cfg_t mop500_pins_common[] = {
20 /* I2C */ 30 /* uMSP0 */
21 GPIO147_I2C0_SCL,
22 GPIO148_I2C0_SDA,
23 GPIO16_I2C1_SCL,
24 GPIO17_I2C1_SDA,
25 GPIO10_I2C2_SDA,
26 GPIO11_I2C2_SCL,
27 GPIO229_I2C3_SDA,
28 GPIO230_I2C3_SCL,
29
30 /* MSP0 */
31 GPIO12_MSP0_TXD, 31 GPIO12_MSP0_TXD,
32 GPIO13_MSP0_TFS, 32 GPIO13_MSP0_TFS,
33 GPIO14_MSP0_TCK, 33 GPIO14_MSP0_TCK,
34 GPIO15_MSP0_RXD, 34 GPIO15_MSP0_RXD,
35 35
36 /* MSP2: HDMI */ 36 /* MSP2: HDMI */
37 GPIO193_MSP2_TXD, 37 GPIO193_MSP2_TXD | PIN_INPUT_PULLDOWN,
38 GPIO194_MSP2_TCK, 38 GPIO194_MSP2_TCK | PIN_INPUT_PULLDOWN,
39 GPIO195_MSP2_TFS, 39 GPIO195_MSP2_TFS | PIN_INPUT_PULLDOWN,
40 GPIO196_MSP2_RXD | PIN_OUTPUT_LOW, 40 GPIO196_MSP2_RXD | PIN_OUTPUT_LOW,
41 41
42 /* LCD TE0 */
43 GPIO68_LCD_VSI0 | PIN_INPUT_PULLUP,
44
42 /* Touch screen INTERFACE */ 45 /* Touch screen INTERFACE */
43 GPIO84_GPIO | PIN_INPUT_PULLUP, /* TOUCH_INT1 */ 46 GPIO84_GPIO | PIN_INPUT_PULLUP, /* TOUCH_INT1 */
44 47
45 /* STMPE1601/tc35893 keypad IRQ */ 48 /* STMPE1601/tc35893 keypad IRQ */
46 GPIO218_GPIO | PIN_INPUT_PULLUP, 49 GPIO218_GPIO | PIN_INPUT_PULLUP,
47 50
48 /* MMC0 (MicroSD card) */
49 GPIO18_MC0_CMDDIR | PIN_OUTPUT_HIGH,
50 GPIO19_MC0_DAT0DIR | PIN_OUTPUT_HIGH,
51 GPIO20_MC0_DAT2DIR | PIN_OUTPUT_HIGH,
52
53 GPIO22_MC0_FBCLK | PIN_INPUT_NOPULL,
54 GPIO23_MC0_CLK | PIN_OUTPUT_LOW,
55 GPIO24_MC0_CMD | PIN_INPUT_PULLUP,
56 GPIO25_MC0_DAT0 | PIN_INPUT_PULLUP,
57 GPIO26_MC0_DAT1 | PIN_INPUT_PULLUP,
58 GPIO27_MC0_DAT2 | PIN_INPUT_PULLUP,
59 GPIO28_MC0_DAT3 | PIN_INPUT_PULLUP,
60
61 /* SDI1 (SDIO) */
62 GPIO208_MC1_CLK | PIN_OUTPUT_LOW,
63 GPIO209_MC1_FBCLK | PIN_INPUT_NOPULL,
64 GPIO210_MC1_CMD | PIN_INPUT_PULLUP,
65 GPIO211_MC1_DAT0 | PIN_INPUT_PULLUP,
66 GPIO212_MC1_DAT1 | PIN_INPUT_PULLUP,
67 GPIO213_MC1_DAT2 | PIN_INPUT_PULLUP,
68 GPIO214_MC1_DAT3 | PIN_INPUT_PULLUP,
69
70 /* MMC2 (On-board DATA INTERFACE eMMC) */
71 GPIO128_MC2_CLK | PIN_OUTPUT_LOW,
72 GPIO129_MC2_CMD | PIN_INPUT_PULLUP,
73 GPIO130_MC2_FBCLK | PIN_INPUT_NOPULL,
74 GPIO131_MC2_DAT0 | PIN_INPUT_PULLUP,
75 GPIO132_MC2_DAT1 | PIN_INPUT_PULLUP,
76 GPIO133_MC2_DAT2 | PIN_INPUT_PULLUP,
77 GPIO134_MC2_DAT3 | PIN_INPUT_PULLUP,
78 GPIO135_MC2_DAT4 | PIN_INPUT_PULLUP,
79 GPIO136_MC2_DAT5 | PIN_INPUT_PULLUP,
80 GPIO137_MC2_DAT6 | PIN_INPUT_PULLUP,
81 GPIO138_MC2_DAT7 | PIN_INPUT_PULLUP,
82
83 /* MMC4 (On-board STORAGE INTERFACE eMMC) */
84 GPIO197_MC4_DAT3 | PIN_INPUT_PULLUP,
85 GPIO198_MC4_DAT2 | PIN_INPUT_PULLUP,
86 GPIO199_MC4_DAT1 | PIN_INPUT_PULLUP,
87 GPIO200_MC4_DAT0 | PIN_INPUT_PULLUP,
88 GPIO201_MC4_CMD | PIN_INPUT_PULLUP,
89 GPIO202_MC4_FBCLK | PIN_INPUT_NOPULL,
90 GPIO203_MC4_CLK | PIN_OUTPUT_LOW,
91 GPIO204_MC4_DAT7 | PIN_INPUT_PULLUP,
92 GPIO205_MC4_DAT6 | PIN_INPUT_PULLUP,
93 GPIO206_MC4_DAT5 | PIN_INPUT_PULLUP,
94 GPIO207_MC4_DAT4 | PIN_INPUT_PULLUP,
95
96 /* SKE keypad */
97 GPIO153_KP_I7,
98 GPIO154_KP_I6,
99 GPIO155_KP_I5,
100 GPIO156_KP_I4,
101 GPIO157_KP_O7,
102 GPIO158_KP_O6,
103 GPIO159_KP_O5,
104 GPIO160_KP_O4,
105 GPIO161_KP_I3,
106 GPIO162_KP_I2,
107 GPIO163_KP_I1,
108 GPIO164_KP_I0,
109 GPIO165_KP_O3,
110 GPIO166_KP_O2,
111 GPIO167_KP_O1,
112 GPIO168_KP_O0,
113
114 /* UART */ 51 /* UART */
115 /* uart-0 pins gpio configuration should be 52 /* uart-0 pins gpio configuration should be
116 * kept intact to prevent glitch in tx line 53 * kept intact to prevent glitch in tx line
@@ -129,10 +66,6 @@ static pin_cfg_t mop500_pins_common[] = {
129 GPIO30_U2_TXD | PIN_OUTPUT_HIGH, 66 GPIO30_U2_TXD | PIN_OUTPUT_HIGH,
130 GPIO31_U2_CTSn | PIN_INPUT_PULLUP, 67 GPIO31_U2_CTSn | PIN_INPUT_PULLUP,
131 GPIO32_U2_RTSn | PIN_OUTPUT_HIGH, 68 GPIO32_U2_RTSn | PIN_OUTPUT_HIGH,
132
133 /* Display & HDMI HW sync */
134 GPIO68_LCD_VSI0 | PIN_INPUT_PULLUP,
135 GPIO69_LCD_VSI1 | PIN_INPUT_PULLUP,
136}; 69};
137 70
138static pin_cfg_t mop500_pins_default[] = { 71static pin_cfg_t mop500_pins_default[] = {
@@ -142,10 +75,13 @@ static pin_cfg_t mop500_pins_default[] = {
142 GPIO145_SSP0_RXD | PIN_PULL_DOWN, 75 GPIO145_SSP0_RXD | PIN_PULL_DOWN,
143 GPIO146_SSP0_TXD, 76 GPIO146_SSP0_TXD,
144 77
78 /* XENON Flashgun INTERFACE */
79 GPIO6_IP_GPIO0 | PIN_INPUT_PULLUP,/* XENON_FLASH_ID */
80 GPIO7_IP_GPIO1 | PIN_INPUT_PULLUP,/* XENON_READY */
145 81
146 GPIO217_GPIO | PIN_INPUT_PULLUP, /* TC35892 IRQ */ 82 GPIO217_GPIO | PIN_INPUT_PULLUP, /* TC35892 IRQ */
147 83
148 /* SDI0 (MicroSD card) */ 84 /* sdi0 (removable MMC/SD/SDIO cards) not handled by pm_runtime */
149 GPIO21_MC0_DAT31DIR | PIN_OUTPUT_HIGH, 85 GPIO21_MC0_DAT31DIR | PIN_OUTPUT_HIGH,
150 86
151 /* UART */ 87 /* UART */
@@ -157,13 +93,11 @@ static pin_cfg_t mop500_pins_default[] = {
157 93
158static pin_cfg_t hrefv60_pins[] = { 94static pin_cfg_t hrefv60_pins[] = {
159 /* WLAN */ 95 /* WLAN */
160 GPIO4_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */
161 GPIO85_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */ 96 GPIO85_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */
162 97
163 /* XENON Flashgun INTERFACE */ 98 /* XENON Flashgun INTERFACE */
164 GPIO6_IP_GPIO0 | PIN_INPUT_PULLUP,/* XENON_FLASH_ID */ 99 GPIO6_IP_GPIO0 | PIN_INPUT_PULLUP,/* XENON_FLASH_ID */
165 GPIO7_IP_GPIO1 | PIN_INPUT_PULLUP,/* XENON_READY */ 100 GPIO7_IP_GPIO1 | PIN_INPUT_PULLUP,/* XENON_READY */
166 GPIO170_GPIO | PIN_OUTPUT_LOW, /* XENON_CHARGE */
167 101
168 /* Assistant LED INTERFACE */ 102 /* Assistant LED INTERFACE */
169 GPIO21_GPIO | PIN_OUTPUT_LOW, /* XENON_EN1 */ 103 GPIO21_GPIO | PIN_OUTPUT_LOW, /* XENON_EN1 */
@@ -174,7 +108,7 @@ static pin_cfg_t hrefv60_pins[] = {
174 GPIO32_GPIO | PIN_INPUT_PULLDOWN, /* Magnetometer DRDY */ 108 GPIO32_GPIO | PIN_INPUT_PULLDOWN, /* Magnetometer DRDY */
175 109
176 /* Display Interface */ 110 /* Display Interface */
177 GPIO65_GPIO | PIN_OUTPUT_LOW, /* DISP1 RST */ 111 GPIO65_GPIO | PIN_OUTPUT_HIGH, /* DISP1 NO RST */
178 GPIO66_GPIO | PIN_OUTPUT_LOW, /* DISP2 RST */ 112 GPIO66_GPIO | PIN_OUTPUT_LOW, /* DISP2 RST */
179 113
180 /* Touch screen INTERFACE */ 114 /* Touch screen INTERFACE */
@@ -216,11 +150,8 @@ static pin_cfg_t hrefv60_pins[] = {
216 /* DiPro Sensor Interface */ 150 /* DiPro Sensor Interface */
217 GPIO139_GPIO | PIN_INPUT_PULLUP, /* DIPRO_INT */ 151 GPIO139_GPIO | PIN_INPUT_PULLUP, /* DIPRO_INT */
218 152
219 /* HAL SWITCH INTERFACE */
220 GPIO145_GPIO | PIN_INPUT_PULLDOWN,/* HAL_SW */
221
222 /* Audio Amplifier Interface */ 153 /* Audio Amplifier Interface */
223 GPIO149_GPIO | PIN_OUTPUT_LOW, /* VAUDIO_HF_EN */ 154 GPIO149_GPIO | PIN_OUTPUT_HIGH, /* VAUDIO_HF_EN, enable MAX8968 */
224 155
225 /* GBF INTERFACE */ 156 /* GBF INTERFACE */
226 GPIO171_GPIO | PIN_OUTPUT_LOW, /* GBF_ENA_RESET */ 157 GPIO171_GPIO | PIN_OUTPUT_LOW, /* GBF_ENA_RESET */
@@ -232,10 +163,29 @@ static pin_cfg_t hrefv60_pins[] = {
232 GPIO82_GPIO | PIN_INPUT_PULLUP, /* ACC_INT1 */ 163 GPIO82_GPIO | PIN_INPUT_PULLUP, /* ACC_INT1 */
233 GPIO83_GPIO | PIN_INPUT_PULLUP, /* ACC_INT2 */ 164 GPIO83_GPIO | PIN_INPUT_PULLUP, /* ACC_INT2 */
234 165
235 /* Proximity Sensor */ 166 /* SD card detect */
236 GPIO217_GPIO | PIN_INPUT_PULLUP, 167 GPIO95_GPIO | PIN_INPUT_PULLUP,
168};
237 169
170static pin_cfg_t u9500_pins[] = {
171 GPIO4_U1_RXD | PIN_INPUT_PULLUP,
172 GPIO5_U1_TXD | PIN_OUTPUT_HIGH,
173 GPIO144_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */
174
175 /* HSI */
176 GPIO219_HSIR_FLA0 | PIN_INPUT_PULLDOWN,
177 GPIO220_HSIR_DAT0 | PIN_INPUT_PULLDOWN,
178 GPIO221_HSIR_RDY0 | PIN_OUTPUT_LOW,
179 GPIO222_HSIT_FLA0 | PIN_OUTPUT_LOW,
180 GPIO223_HSIT_DAT0 | PIN_OUTPUT_LOW,
181 GPIO224_HSIT_RDY0 | PIN_INPUT_PULLDOWN,
182 GPIO225_HSIT_CAWAKE0 | PIN_INPUT_PULLDOWN, /* CA_WAKE0 */
183 GPIO226_GPIO | PIN_OUTPUT_HIGH, /* AC_WAKE0 */
184};
238 185
186static pin_cfg_t u8500_pins[] = {
187 GPIO226_GPIO | PIN_OUTPUT_LOW, /* WLAN_PMU_EN */
188 GPIO4_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */
239}; 189};
240 190
241static pin_cfg_t snowball_pins[] = { 191static pin_cfg_t snowball_pins[] = {
@@ -276,13 +226,245 @@ static pin_cfg_t snowball_pins[] = {
276 226
277 /* RSTn_LAN */ 227 /* RSTn_LAN */
278 GPIO141_GPIO | PIN_OUTPUT_HIGH, 228 GPIO141_GPIO | PIN_OUTPUT_HIGH,
229
230 /* Accelerometer/Magnetometer */
231 GPIO163_GPIO | PIN_INPUT_PULLUP, /* ACCEL_IRQ1 */
232 GPIO164_GPIO | PIN_INPUT_PULLUP, /* ACCEL_IRQ2 */
233 GPIO165_GPIO | PIN_INPUT_PULLUP, /* MAG_DRDY */
234
235 /* WLAN/GBF */
236 GPIO161_GPIO | PIN_OUTPUT_LOW, /* WLAN_PMU_EN */
237 GPIO171_GPIO | PIN_OUTPUT_HIGH,/* GBF_ENA */
238 GPIO215_GPIO | PIN_OUTPUT_LOW,/* WLAN_ENA */
239 GPIO216_GPIO | PIN_INPUT_PULLUP,/* WLAN_IRQ */
240};
241
242/*
243 * I2C
244 */
245
246static UX500_PINS(mop500_pins_i2c0,
247 GPIO147_I2C0_SCL |
248 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
249 GPIO148_I2C0_SDA |
250 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
251);
252
253static UX500_PINS(mop500_pins_i2c1,
254 GPIO16_I2C1_SCL |
255 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
256 GPIO17_I2C1_SDA |
257 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
258);
259
260static UX500_PINS(mop500_pins_i2c2,
261 GPIO10_I2C2_SDA |
262 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
263 GPIO11_I2C2_SCL |
264 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
265);
266
267static UX500_PINS(mop500_pins_i2c3,
268 GPIO229_I2C3_SDA |
269 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
270 GPIO230_I2C3_SCL |
271 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
272);
273
274static UX500_PINS(mop500_pins_mcde_tvout,
275 GPIO78_LCD_D8,
276 GPIO79_LCD_D9,
277 GPIO80_LCD_D10,
278 GPIO81_LCD_D11,
279 GPIO150_LCDA_CLK,
280);
281
282static UX500_PINS(mop500_pins_mcde_hdmi,
283 GPIO69_LCD_VSI1 | PIN_INPUT_PULLUP,
284);
285
286static UX500_PINS(mop500_pins_ske,
287 GPIO153_KP_I7 | PIN_INPUT_PULLDOWN | PIN_SLPM_INPUT_PULLUP,
288 GPIO154_KP_I6 | PIN_INPUT_PULLDOWN | PIN_SLPM_INPUT_PULLUP,
289 GPIO155_KP_I5 | PIN_INPUT_PULLDOWN | PIN_SLPM_INPUT_PULLUP,
290 GPIO156_KP_I4 | PIN_INPUT_PULLDOWN | PIN_SLPM_INPUT_PULLUP,
291 GPIO161_KP_I3 | PIN_INPUT_PULLDOWN | PIN_SLPM_INPUT_PULLUP,
292 GPIO162_KP_I2 | PIN_INPUT_PULLDOWN | PIN_SLPM_INPUT_PULLUP,
293 GPIO163_KP_I1 | PIN_INPUT_PULLDOWN | PIN_SLPM_INPUT_PULLUP,
294 GPIO164_KP_I0 | PIN_INPUT_PULLDOWN | PIN_SLPM_INPUT_PULLUP,
295 GPIO157_KP_O7 | PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
296 GPIO158_KP_O6 | PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
297 GPIO159_KP_O5 | PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
298 GPIO160_KP_O4 | PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
299 GPIO165_KP_O3 | PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
300 GPIO166_KP_O2 | PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
301 GPIO167_KP_O1 | PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
302 GPIO168_KP_O0 | PIN_INPUT_PULLUP | PIN_SLPM_OUTPUT_LOW,
303);
304
305/* sdi0 (removable MMC/SD/SDIO cards) */
306static UX500_PINS(mop500_pins_sdi0,
307 GPIO18_MC0_CMDDIR | PIN_OUTPUT_HIGH,
308 GPIO19_MC0_DAT0DIR | PIN_OUTPUT_HIGH,
309 GPIO20_MC0_DAT2DIR | PIN_OUTPUT_HIGH,
310
311 GPIO22_MC0_FBCLK | PIN_INPUT_NOPULL,
312 GPIO23_MC0_CLK | PIN_OUTPUT_LOW,
313 GPIO24_MC0_CMD | PIN_INPUT_PULLUP,
314 GPIO25_MC0_DAT0 | PIN_INPUT_PULLUP,
315 GPIO26_MC0_DAT1 | PIN_INPUT_PULLUP,
316 GPIO27_MC0_DAT2 | PIN_INPUT_PULLUP,
317 GPIO28_MC0_DAT3 | PIN_INPUT_PULLUP,
318);
319
320/* sdi1 (WLAN CW1200) */
321static UX500_PINS(mop500_pins_sdi1,
322 GPIO208_MC1_CLK | PIN_OUTPUT_LOW,
323 GPIO209_MC1_FBCLK | PIN_INPUT_NOPULL,
324 GPIO210_MC1_CMD | PIN_INPUT_PULLUP,
325 GPIO211_MC1_DAT0 | PIN_INPUT_PULLUP,
326 GPIO212_MC1_DAT1 | PIN_INPUT_PULLUP,
327 GPIO213_MC1_DAT2 | PIN_INPUT_PULLUP,
328 GPIO214_MC1_DAT3 | PIN_INPUT_PULLUP,
329);
330
331/* sdi2 (POP eMMC) */
332static UX500_PINS(mop500_pins_sdi2,
333 GPIO128_MC2_CLK | PIN_OUTPUT_LOW,
334 GPIO129_MC2_CMD | PIN_INPUT_PULLUP,
335 GPIO130_MC2_FBCLK | PIN_INPUT_NOPULL,
336 GPIO131_MC2_DAT0 | PIN_INPUT_PULLUP,
337 GPIO132_MC2_DAT1 | PIN_INPUT_PULLUP,
338 GPIO133_MC2_DAT2 | PIN_INPUT_PULLUP,
339 GPIO134_MC2_DAT3 | PIN_INPUT_PULLUP,
340 GPIO135_MC2_DAT4 | PIN_INPUT_PULLUP,
341 GPIO136_MC2_DAT5 | PIN_INPUT_PULLUP,
342 GPIO137_MC2_DAT6 | PIN_INPUT_PULLUP,
343 GPIO138_MC2_DAT7 | PIN_INPUT_PULLUP,
344);
345
346/* sdi4 (PCB eMMC) */
347static UX500_PINS(mop500_pins_sdi4,
348 GPIO197_MC4_DAT3 | PIN_INPUT_PULLUP,
349 GPIO198_MC4_DAT2 | PIN_INPUT_PULLUP,
350 GPIO199_MC4_DAT1 | PIN_INPUT_PULLUP,
351 GPIO200_MC4_DAT0 | PIN_INPUT_PULLUP,
352 GPIO201_MC4_CMD | PIN_INPUT_PULLUP,
353 GPIO202_MC4_FBCLK | PIN_INPUT_NOPULL,
354 GPIO203_MC4_CLK | PIN_OUTPUT_LOW,
355 GPIO204_MC4_DAT7 | PIN_INPUT_PULLUP,
356 GPIO205_MC4_DAT6 | PIN_INPUT_PULLUP,
357 GPIO206_MC4_DAT5 | PIN_INPUT_PULLUP,
358 GPIO207_MC4_DAT4 | PIN_INPUT_PULLUP,
359);
360
361/* USB */
362static UX500_PINS(mop500_pins_usb,
363 GPIO256_USB_NXT,
364 GPIO257_USB_STP | PIN_OUTPUT_HIGH,
365 GPIO258_USB_XCLK,
366 GPIO259_USB_DIR,
367 GPIO260_USB_DAT7,
368 GPIO261_USB_DAT6,
369 GPIO262_USB_DAT5,
370 GPIO263_USB_DAT4,
371 GPIO264_USB_DAT3,
372 GPIO265_USB_DAT2,
373 GPIO266_USB_DAT1,
374 GPIO267_USB_DAT0,
375);
376
377/* SPI2 */
378static UX500_PINS(mop500_pins_spi2,
379 GPIO216_GPIO | PIN_OUTPUT_HIGH,
380 GPIO218_SPI2_RXD | PIN_INPUT_PULLDOWN,
381 GPIO215_SPI2_TXD | PIN_OUTPUT_LOW,
382 GPIO217_SPI2_CLK | PIN_OUTPUT_LOW,
383);
384
385static UX500_PINS(mop500_pins_sensors1p_v60,
386 GPIO217_GPIO| PIN_INPUT_PULLUP |
387 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
388 GPIO145_GPIO | PIN_INPUT_PULLDOWN |
389 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
390 GPIO139_GPIO | PIN_INPUT_PULLUP |
391 PIN_SLPM_GPIO | PIN_SLPM_INPUT_NOPULL,
392);
393
394static UX500_PINS(mop500_pins_sensors1p,
395 PIN_CFG_INPUT(GPIO_PROX_SENSOR, GPIO, NOPULL),
396 PIN_CFG_INPUT(GPIO_HAL_SENSOR, GPIO, NOPULL),
397);
398
399static struct ux500_pin_lookup mop500_runtime_pins[] = {
400 PIN_LOOKUP("mcde-tvout", &mop500_pins_mcde_tvout),
401 PIN_LOOKUP("av8100-hdmi", &mop500_pins_mcde_hdmi),
402 PIN_LOOKUP("nmk-i2c.0", &mop500_pins_i2c0),
403 PIN_LOOKUP("nmk-i2c.1", &mop500_pins_i2c1),
404 PIN_LOOKUP("nmk-i2c.2", &mop500_pins_i2c2),
405 PIN_LOOKUP("nmk-i2c.3", &mop500_pins_i2c3),
406 PIN_LOOKUP("sdi0", &mop500_pins_sdi0),
407 PIN_LOOKUP("sdi1", &mop500_pins_sdi1),
408 PIN_LOOKUP("sdi2", &mop500_pins_sdi2),
409 PIN_LOOKUP("sdi4", &mop500_pins_sdi4),
410 PIN_LOOKUP("musb-ux500.0", &mop500_pins_usb),
411 PIN_LOOKUP("spi2", &mop500_pins_spi2),
279}; 412};
280 413
414static struct ux500_pin_lookup mop500_runtime_pins_v60[] = {
415 PIN_LOOKUP("ske", &mop500_pins_ske),
416 PIN_LOOKUP("gpio-keys.0", &mop500_pins_sensors1p_v60),
417};
418
419static struct ux500_pin_lookup mop500_runtime_pins_pre_v60[] = {
420 PIN_LOOKUP("ske", &mop500_pins_ske),
421 PIN_LOOKUP("gpio-keys.0", &mop500_pins_sensors1p),
422};
423
424/*
425 * passing "pinsfor=" in kernel cmdline allows for custom
426 * configuration of GPIOs on u8500 derived boards.
427 */
428static int __init early_pinsfor(char *p)
429{
430 pinsfor = PINS_FOR_DEFAULT;
431
432 if (strcmp(p, "u9500-21") == 0)
433 pinsfor = PINS_FOR_U9500;
434
435 return 0;
436}
437early_param("pinsfor", early_pinsfor);
438
439int pins_for_u9500(void)
440{
441 if (pinsfor == PINS_FOR_U9500)
442 return 1;
443
444 return 0;
445}
446
281void __init mop500_pins_init(void) 447void __init mop500_pins_init(void)
282{ 448{
283 nmk_config_pins(mop500_pins_common, 449 nmk_config_pins(mop500_pins_common,
284 ARRAY_SIZE(mop500_pins_common)); 450 ARRAY_SIZE(mop500_pins_common));
285 451
452 ux500_pins_add(mop500_runtime_pins, ARRAY_SIZE(mop500_runtime_pins));
453
454 ux500_pins_add(mop500_runtime_pins_pre_v60,
455 ARRAY_SIZE(mop500_runtime_pins_pre_v60));
456
457 switch (pinsfor) {
458 case PINS_FOR_U9500:
459 nmk_config_pins(u9500_pins, ARRAY_SIZE(u9500_pins));
460 break;
461
462 case PINS_FOR_DEFAULT:
463 nmk_config_pins(u8500_pins, ARRAY_SIZE(u8500_pins));
464 default:
465 break;
466 }
467
286 nmk_config_pins(mop500_pins_default, 468 nmk_config_pins(mop500_pins_default,
287 ARRAY_SIZE(mop500_pins_default)); 469 ARRAY_SIZE(mop500_pins_default));
288} 470}
@@ -292,8 +474,11 @@ void __init snowball_pins_init(void)
292 nmk_config_pins(mop500_pins_common, 474 nmk_config_pins(mop500_pins_common,
293 ARRAY_SIZE(mop500_pins_common)); 475 ARRAY_SIZE(mop500_pins_common));
294 476
295 nmk_config_pins(snowball_pins, 477 ux500_pins_add(mop500_runtime_pins, ARRAY_SIZE(mop500_runtime_pins));
296 ARRAY_SIZE(snowball_pins)); 478
479 nmk_config_pins(u8500_pins, ARRAY_SIZE(u8500_pins));
480
481 nmk_config_pins(snowball_pins, ARRAY_SIZE(snowball_pins));
297} 482}
298 483
299void __init hrefv60_pins_init(void) 484void __init hrefv60_pins_init(void)
@@ -301,6 +486,22 @@ void __init hrefv60_pins_init(void)
301 nmk_config_pins(mop500_pins_common, 486 nmk_config_pins(mop500_pins_common,
302 ARRAY_SIZE(mop500_pins_common)); 487 ARRAY_SIZE(mop500_pins_common));
303 488
489 ux500_pins_add(mop500_runtime_pins, ARRAY_SIZE(mop500_runtime_pins));
490
491 ux500_pins_add(mop500_runtime_pins_v60,
492 ARRAY_SIZE(mop500_runtime_pins_v60));
493
304 nmk_config_pins(hrefv60_pins, 494 nmk_config_pins(hrefv60_pins,
305 ARRAY_SIZE(hrefv60_pins)); 495 ARRAY_SIZE(hrefv60_pins));
496
497 switch (pinsfor) {
498 case PINS_FOR_U9500:
499 nmk_config_pins(u9500_pins, ARRAY_SIZE(u9500_pins));
500 break;
501
502 case PINS_FOR_DEFAULT:
503 nmk_config_pins(u8500_pins, ARRAY_SIZE(u8500_pins));
504 default:
505 break;
506 }
306} 507}
diff --git a/arch/arm/mach-ux500/board-mop500.h b/arch/arm/mach-ux500/board-mop500.h
index fdcfa8721bb4..91dc63fe101b 100644
--- a/arch/arm/mach-ux500/board-mop500.h
+++ b/arch/arm/mach-ux500/board-mop500.h
@@ -7,6 +7,9 @@
7#ifndef __BOARD_MOP500_H 7#ifndef __BOARD_MOP500_H
8#define __BOARD_MOP500_H 8#define __BOARD_MOP500_H
9 9
10/* For NOMADIK_NR_GPIO */
11#include <mach/irqs.h>
12
10/* Snowball specific GPIO assignments, this board has no GPIO expander */ 13/* Snowball specific GPIO assignments, this board has no GPIO expander */
11#define SNOWBALL_ACCEL_INT1_GPIO 163 14#define SNOWBALL_ACCEL_INT1_GPIO 163
12#define SNOWBALL_ACCEL_INT2_GPIO 164 15#define SNOWBALL_ACCEL_INT2_GPIO 164
@@ -73,6 +76,7 @@
73#define SNOWBALL_PME_ETH_GPIO MOP500_AB8500_PIN_GPIO(24) /* SYSCLKREQ7/GPIO24 */ 76#define SNOWBALL_PME_ETH_GPIO MOP500_AB8500_PIN_GPIO(24) /* SYSCLKREQ7/GPIO24 */
74#define SNOWBALL_EN_3V3_ETH_GPIO MOP500_AB8500_PIN_GPIO(26) /* GPIO26 */ 77#define SNOWBALL_EN_3V3_ETH_GPIO MOP500_AB8500_PIN_GPIO(26) /* GPIO26 */
75 78
79struct device;
76struct i2c_board_info; 80struct i2c_board_info;
77 81
78extern void mop500_sdi_init(struct device *parent); 82extern void mop500_sdi_init(struct device *parent);