Commit 55052ea2 authored by Igor Grinberg's avatar Igor Grinberg Committed by Eric Miao

[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: default avatarIgor Grinberg <grinberg@compulab.co.il>
Signed-off-by: default avatarMike Rapoport <mike@compulab.co.il>
Signed-off-by: default avatarEric Miao <eric.y.miao@gmail.com>
parent 3fe6ccff
...@@ -137,7 +137,6 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { ...@@ -137,7 +137,6 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
GPIO36_UART1_DTR, GPIO36_UART1_DTR,
/* GPIOs */ /* GPIOs */
GPIO79_GPIO, /* LED */
GPIO82_GPIO | MFP_PULL_HIGH, /* MMC CD */ GPIO82_GPIO | MFP_PULL_HIGH, /* MMC CD */
GPIO85_GPIO, /* MMC WP */ GPIO85_GPIO, /* MMC WP */
GPIO99_GPIO, /* Ethernet IRQ */ GPIO99_GPIO, /* Ethernet IRQ */
...@@ -153,6 +152,20 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { ...@@ -153,6 +152,20 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = {
GPIO22_I2C_SDA, GPIO22_I2C_SDA,
}; };
static mfp_cfg_t cm_x300_rev_lt130_mfp_cfg[] __initdata = {
/* GPIOs */
GPIO79_GPIO, /* LED */
GPIO77_GPIO, /* WiFi reset */
GPIO78_GPIO, /* BT reset */
};
static mfp_cfg_t cm_x300_rev_ge130_mfp_cfg[] __initdata = {
/* GPIOs */
GPIO76_GPIO, /* LED */
GPIO71_GPIO, /* WiFi reset */
GPIO70_GPIO, /* BT reset */
};
#if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE) #if defined(CONFIG_DM9000) || defined(CONFIG_DM9000_MODULE)
static struct resource dm9000_resources[] = { static struct resource dm9000_resources[] = {
[0] = { [0] = {
...@@ -351,7 +364,6 @@ static struct gpio_led cm_x300_leds[] = { ...@@ -351,7 +364,6 @@ static struct gpio_led cm_x300_leds[] = {
[0] = { [0] = {
.name = "cm-x300:green", .name = "cm-x300:green",
.default_trigger = "heartbeat", .default_trigger = "heartbeat",
.gpio = 79,
.active_low = 1, .active_low = 1,
}, },
}; };
...@@ -371,6 +383,11 @@ static struct platform_device cm_x300_led_device = { ...@@ -371,6 +383,11 @@ static struct platform_device cm_x300_led_device = {
static void __init cm_x300_init_leds(void) static void __init cm_x300_init_leds(void)
{ {
if (system_rev < 130)
cm_x300_leds[0].gpio = 79;
else
cm_x300_leds[0].gpio = 76;
platform_device_register(&cm_x300_led_device); platform_device_register(&cm_x300_led_device);
} }
#else #else
...@@ -433,11 +450,21 @@ static void __init cm_x300_init_rtc(void) ...@@ -433,11 +450,21 @@ static void __init cm_x300_init_rtc(void)
static inline void cm_x300_init_rtc(void) {} static inline void cm_x300_init_rtc(void) {}
#endif #endif
static void __init cm_x300_init(void) static void __init cm_x300_init_mfp(void)
{ {
/* board-processor specific GPIO initialization */ /* board-processor specific GPIO initialization */
pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_mfp_cfg)); pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_mfp_cfg));
if (system_rev < 130)
pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_rev_lt130_mfp_cfg));
else
pxa3xx_mfp_config(ARRAY_AND_SIZE(cm_x300_rev_ge130_mfp_cfg));
}
static void __init cm_x300_init(void)
{
cm_x300_init_mfp();
pxa_set_ffuart_info(NULL); pxa_set_ffuart_info(NULL);
pxa_set_btuart_info(NULL); pxa_set_btuart_info(NULL);
pxa_set_stuart_info(NULL); pxa_set_stuart_info(NULL);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment