aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-pxa
diff options
context:
space:
mode:
authorIgor Grinberg <grinberg@compulab.co.il>2009-10-14 03:20:18 -0400
committerEric Miao <eric.y.miao@gmail.com>2009-11-30 20:03:05 -0500
commit55052ea23d09ebe71ebeadc054e828b37d4e0356 (patch)
tree9e37714db9ee60e8c1d467bcb7384771d21355de /arch/arm/mach-pxa
parent3fe6ccffcbc6c79512fe9bea5c10de75ae0c497e (diff)
[ARM] pxa/cm-x300: add revision difference handling
Different revisions of CM-X300 use different pins for several functions. Make the kernel aware of it. Signed-off-by: Igor Grinberg <grinberg@compulab.co.il> Signed-off-by: Mike Rapoport <mike@compulab.co.il> Signed-off-by: Eric Miao <eric.y.miao@gmail.com>
Diffstat (limited to 'arch/arm/mach-pxa')
-rw-r--r--arch/arm/mach-pxa/cm-x300.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c
index 7f2e87839a8f..07d7473344b7 100644
--- a/arch/arm/mach-pxa/cm-x300.c
+++ b/arch/arm/mach-pxa/cm-x300.c
@@ -137,7 +137,6 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
137 GPIO36_UART1_DTR, 137 GPIO36_UART1_DTR,
138 138
139 /* GPIOs */ 139 /* GPIOs */
140 GPIO79_GPIO, /* LED */
141 GPIO82_GPIO | MFP_PULL_HIGH, /* MMC CD */ 140 GPIO82_GPIO | MFP_PULL_HIGH, /* MMC CD */
142 GPIO85_GPIO, /* MMC WP */ 141 GPIO85_GPIO, /* MMC WP */
143 GPIO99_GPIO, /* Ethernet IRQ */ 142 GPIO99_GPIO, /* Ethernet IRQ */
@@ -153,6 +152,20 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
153 GPIO22_I2C_SDA, 152 GPIO22_I2C_SDA,
154}; 153};
155 154
155static mfp_cfg_t cm_x300_rev_lt130_mfp_cfg[] __initdata = {
156 /* GPIOs */
157 GPIO79_GPIO, /* LED */
158 GPIO77_GPIO, /* WiFi reset */
159 GPIO78_GPIO, /* BT reset */
160};
161
162static mfp_cfg_t cm_x300_rev_ge130_mfp_cfg[] __initdata = {
163 /* GPIOs */
164 GPIO76_GPIO, /* LED */
165 GPIO71_GPIO, /* WiFi reset */
166 GPIO70_GPIO, /* BT reset */
167};
168
156#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) 169#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
157static struct resource dm9000_resources[] = { 170static struct resource dm9000_resources[] = {
158 [0] = { 171 [0] = {
@@ -351,7 +364,6 @@ static struct gpio_led cm_x300_leds[] = {
351 [0] = { 364 [0] = {
352 .name = "cm-x300:green", 365 .name = "cm-x300:green",
353 .default_trigger = "heartbeat", 366 .default_trigger = "heartbeat",
354 .gpio = 79,
355 .active_low = 1, 367 .active_low = 1,
356 }, 368 },
357}; 369};
@@ -371,6 +383,11 @@ static struct platform_device cm_x300_led_device = {
371 383
372static void __init cm_x300_init_leds(void) 384static void __init cm_x300_init_leds(void)
373{ 385{
386 if (system_rev < 130)
387 cm_x300_leds[0].gpio = 79;
388 else
389 cm_x300_leds[0].gpio = 76;
390
374 platform_device_register(&cm_x300_led_device); 391 platform_device_register(&cm_x300_led_device);
375} 392}
376#else 393#else
@@ -433,11 +450,21 @@ static void __init cm_x300_init_rtc(void)
433static inline void cm_x300_init_rtc(void) {} 450static inline void cm_x300_init_rtc(void) {}
434#endif 451#endif
435 452
436static void __init cm_x300_init(void) 453static void __init cm_x300_init_mfp(void)
437{ 454{
438 /* board-processor specific GPIO initialization */ 455 /* board-processor specific GPIO initialization */
439 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_mfp_cfg)); 456 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_mfp_cfg));
440 457
458 if (system_rev < 130)
459 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_rev_lt130_mfp_cfg));
460 else
461 pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_rev_ge130_mfp_cfg));
462}
463
464static void __init cm_x300_init(void)
465{
466 cm_x300_init_mfp();
467
441 pxa_set_ffuart_info(NULL); 468 pxa_set_ffuart_info(NULL);
442 pxa_set_btuart_info(NULL); 469 pxa_set_btuart_info(NULL);
443 pxa_set_stuart_info(NULL); 470 pxa_set_stuart_info(NULL);