diff options
Diffstat (limited to 'arch/arm/mach-pxa/cm-x300.c')
| -rw-r--r-- | arch/arm/mach-pxa/cm-x300.c | 55 |
1 files changed, 54 insertions, 1 deletions
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index a9f48b1cb54a..465da26591bd 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
| @@ -21,18 +21,20 @@ | |||
| 21 | #include <linux/gpio.h> | 21 | #include <linux/gpio.h> |
| 22 | #include <linux/dm9000.h> | 22 | #include <linux/dm9000.h> |
| 23 | #include <linux/leds.h> | 23 | #include <linux/leds.h> |
| 24 | #include <linux/rtc-v3020.h> | ||
| 24 | 25 | ||
| 25 | #include <linux/i2c.h> | 26 | #include <linux/i2c.h> |
| 26 | #include <linux/i2c/pca953x.h> | 27 | #include <linux/i2c/pca953x.h> |
| 27 | 28 | ||
| 28 | #include <asm/mach-types.h> | 29 | #include <asm/mach-types.h> |
| 29 | #include <asm/mach/arch.h> | 30 | #include <asm/mach/arch.h> |
| 31 | #include <asm/setup.h> | ||
| 30 | 32 | ||
| 31 | #include <mach/pxa300.h> | 33 | #include <mach/pxa300.h> |
| 32 | #include <mach/pxafb.h> | 34 | #include <mach/pxafb.h> |
| 33 | #include <mach/mmc.h> | 35 | #include <mach/mmc.h> |
| 34 | #include <mach/ohci.h> | 36 | #include <mach/ohci.h> |
| 35 | #include <mach/i2c.h> | 37 | #include <plat/i2c.h> |
| 36 | #include <mach/pxa3xx_nand.h> | 38 | #include <mach/pxa3xx_nand.h> |
| 37 | 39 | ||
| 38 | #include <asm/mach/map.h> | 40 | #include <asm/mach/map.h> |
| @@ -46,6 +48,11 @@ | |||
| 46 | 48 | ||
| 47 | #define CM_X300_MMC2_IRQ IRQ_GPIO(GPIO82_MMC2_IRQ) | 49 | #define CM_X300_MMC2_IRQ IRQ_GPIO(GPIO82_MMC2_IRQ) |
| 48 | 50 | ||
| 51 | #define GPIO95_RTC_CS (95) | ||
| 52 | #define GPIO96_RTC_WR (96) | ||
| 53 | #define GPIO97_RTC_RD (97) | ||
| 54 | #define GPIO98_RTC_IO (98) | ||
| 55 | |||
| 49 | static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { | 56 | static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { |
| 50 | /* LCD */ | 57 | /* LCD */ |
| 51 | GPIO54_LCD_LDD_0, | 58 | GPIO54_LCD_LDD_0, |
| @@ -135,6 +142,12 @@ static mfp_cfg_t cm_x300_mfp_cfg[] __initdata = { | |||
| 135 | GPIO85_GPIO, /* MMC WP */ | 142 | GPIO85_GPIO, /* MMC WP */ |
| 136 | GPIO99_GPIO, /* Ethernet IRQ */ | 143 | GPIO99_GPIO, /* Ethernet IRQ */ |
| 137 | 144 | ||
| 145 | /* RTC GPIOs */ | ||
| 146 | GPIO95_GPIO, /* RTC CS */ | ||
| 147 | GPIO96_GPIO, /* RTC WR */ | ||
| 148 | GPIO97_GPIO, /* RTC RD */ | ||
| 149 | GPIO98_GPIO, /* RTC IO */ | ||
| 150 | |||
| 138 | /* Standard I2C */ | 151 | /* Standard I2C */ |
| 139 | GPIO21_I2C_SCL, | 152 | GPIO21_I2C_SCL, |
| 140 | GPIO22_I2C_SDA, | 153 | GPIO22_I2C_SDA, |
| @@ -265,6 +278,7 @@ static struct mtd_partition cm_x300_nand_partitions[] = { | |||
| 265 | 278 | ||
| 266 | static struct pxa3xx_nand_platform_data cm_x300_nand_info = { | 279 | static struct pxa3xx_nand_platform_data cm_x300_nand_info = { |
| 267 | .enable_arbiter = 1, | 280 | .enable_arbiter = 1, |
| 281 | .keep_config = 1, | ||
| 268 | .parts = cm_x300_nand_partitions, | 282 | .parts = cm_x300_nand_partitions, |
| 269 | .nr_parts = ARRAY_SIZE(cm_x300_nand_partitions), | 283 | .nr_parts = ARRAY_SIZE(cm_x300_nand_partitions), |
| 270 | }; | 284 | }; |
| @@ -441,6 +455,31 @@ static void __init cm_x300_init_i2c(void) | |||
| 441 | static inline void cm_x300_init_i2c(void) {} | 455 | static inline void cm_x300_init_i2c(void) {} |
| 442 | #endif | 456 | #endif |
| 443 | 457 | ||
| 458 | #if defined(CONFIG_RTC_DRV_V3020) || defined(CONFIG_RTC_DRV_V3020_MODULE) | ||
| 459 | struct v3020_platform_data cm_x300_v3020_pdata = { | ||
| 460 | .use_gpio = 1, | ||
| 461 | .gpio_cs = GPIO95_RTC_CS, | ||
| 462 | .gpio_wr = GPIO96_RTC_WR, | ||
| 463 | .gpio_rd = GPIO97_RTC_RD, | ||
| 464 | .gpio_io = GPIO98_RTC_IO, | ||
| 465 | }; | ||
| 466 | |||
| 467 | static struct platform_device cm_x300_rtc_device = { | ||
| 468 | .name = "v3020", | ||
| 469 | .id = -1, | ||
| 470 | .dev = { | ||
| 471 | .platform_data = &cm_x300_v3020_pdata, | ||
| 472 | } | ||
| 473 | }; | ||
| 474 | |||
| 475 | static void __init cm_x300_init_rtc(void) | ||
| 476 | { | ||
| 477 | platform_device_register(&cm_x300_rtc_device); | ||
| 478 | } | ||
| 479 | #else | ||
| 480 | static inline void cm_x300_init_rtc(void) {} | ||
| 481 | #endif | ||
| 482 | |||
| 444 | static void __init cm_x300_init(void) | 483 | static void __init cm_x300_init(void) |
| 445 | { | 484 | { |
| 446 | /* board-processor specific GPIO initialization */ | 485 | /* board-processor specific GPIO initialization */ |
| @@ -453,6 +492,19 @@ static void __init cm_x300_init(void) | |||
| 453 | cm_x300_init_nand(); | 492 | cm_x300_init_nand(); |
| 454 | cm_x300_init_leds(); | 493 | cm_x300_init_leds(); |
| 455 | cm_x300_init_i2c(); | 494 | cm_x300_init_i2c(); |
| 495 | cm_x300_init_rtc(); | ||
| 496 | } | ||
| 497 | |||
| 498 | static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, | ||
| 499 | char **cmdline, struct meminfo *mi) | ||
| 500 | { | ||
| 501 | mi->nr_banks = 2; | ||
| 502 | mi->bank[0].start = 0xa0000000; | ||
| 503 | mi->bank[0].node = 0; | ||
| 504 | mi->bank[0].size = (64*1024*1024); | ||
| 505 | mi->bank[1].start = 0xc0000000; | ||
| 506 | mi->bank[1].node = 0; | ||
| 507 | mi->bank[1].size = (64*1024*1024); | ||
| 456 | } | 508 | } |
| 457 | 509 | ||
| 458 | MACHINE_START(CM_X300, "CM-X300 module") | 510 | MACHINE_START(CM_X300, "CM-X300 module") |
| @@ -463,4 +515,5 @@ MACHINE_START(CM_X300, "CM-X300 module") | |||
| 463 | .init_irq = pxa3xx_init_irq, | 515 | .init_irq = pxa3xx_init_irq, |
| 464 | .timer = &pxa_timer, | 516 | .timer = &pxa_timer, |
| 465 | .init_machine = cm_x300_init, | 517 | .init_machine = cm_x300_init, |
| 518 | .fixup = cm_x300_fixup, | ||
| 466 | MACHINE_END | 519 | MACHINE_END |
