diff options
Diffstat (limited to 'arch/arm/mach-pxa/cm-x300.c')
-rw-r--r-- | arch/arm/mach-pxa/cm-x300.c | 79 |
1 files changed, 77 insertions, 2 deletions
diff --git a/arch/arm/mach-pxa/cm-x300.c b/arch/arm/mach-pxa/cm-x300.c index c70e6c2f4e7c..922b1075b9de 100644 --- a/arch/arm/mach-pxa/cm-x300.c +++ b/arch/arm/mach-pxa/cm-x300.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/init.h> | 19 | #include <linux/init.h> |
20 | #include <linux/delay.h> | 20 | #include <linux/delay.h> |
21 | #include <linux/platform_device.h> | 21 | #include <linux/platform_device.h> |
22 | #include <linux/clk.h> | ||
22 | 23 | ||
23 | #include <linux/gpio.h> | 24 | #include <linux/gpio.h> |
24 | #include <linux/dm9000.h> | 25 | #include <linux/dm9000.h> |
@@ -50,6 +51,7 @@ | |||
50 | #include <plat/i2c.h> | 51 | #include <plat/i2c.h> |
51 | #include <plat/pxa3xx_nand.h> | 52 | #include <plat/pxa3xx_nand.h> |
52 | #include <mach/audio.h> | 53 | #include <mach/audio.h> |
54 | #include <mach/pxa3xx-u2d.h> | ||
53 | 55 | ||
54 | #include <asm/mach/map.h> | 56 | #include <asm/mach/map.h> |
55 | 57 | ||
@@ -68,6 +70,8 @@ | |||
68 | #define GPIO97_RTC_RD (97) | 70 | #define GPIO97_RTC_RD (97) |
69 | #define GPIO98_RTC_IO (98) | 71 | #define GPIO98_RTC_IO (98) |
70 | 72 | ||
73 | #define GPIO_ULPI_PHY_RST (127) | ||
74 | |||
71 | static mfp_cfg_t cm_x3xx_mfp_cfg[] __initdata = { | 75 | static mfp_cfg_t cm_x3xx_mfp_cfg[] __initdata = { |
72 | /* LCD */ | 76 | /* LCD */ |
73 | GPIO54_LCD_LDD_0, | 77 | GPIO54_LCD_LDD_0, |
@@ -472,6 +476,78 @@ static void __init cm_x300_init_mmc(void) | |||
472 | static inline void cm_x300_init_mmc(void) {} | 476 | static inline void cm_x300_init_mmc(void) {} |
473 | #endif | 477 | #endif |
474 | 478 | ||
479 | #if defined(CONFIG_PXA310_ULPI) | ||
480 | static struct clk *pout_clk; | ||
481 | |||
482 | static int cm_x300_ulpi_phy_reset(void) | ||
483 | { | ||
484 | int err; | ||
485 | |||
486 | /* reset the PHY */ | ||
487 | err = gpio_request(GPIO_ULPI_PHY_RST, "ulpi reset"); | ||
488 | if (err) { | ||
489 | pr_err("%s: failed to request ULPI reset GPIO: %d\n", | ||
490 | __func__, err); | ||
491 | return err; | ||
492 | } | ||
493 | |||
494 | gpio_direction_output(GPIO_ULPI_PHY_RST, 0); | ||
495 | msleep(10); | ||
496 | gpio_set_value(GPIO_ULPI_PHY_RST, 1); | ||
497 | msleep(10); | ||
498 | |||
499 | gpio_free(GPIO_ULPI_PHY_RST); | ||
500 | |||
501 | return 0; | ||
502 | } | ||
503 | |||
504 | static inline int cm_x300_u2d_init(struct device *dev) | ||
505 | { | ||
506 | int err = 0; | ||
507 | |||
508 | if (cpu_is_pxa310()) { | ||
509 | /* CLK_POUT is connected to the ULPI PHY */ | ||
510 | pout_clk = clk_get(NULL, "CLK_POUT"); | ||
511 | if (IS_ERR(pout_clk)) { | ||
512 | err = PTR_ERR(pout_clk); | ||
513 | pr_err("%s: failed to get CLK_POUT: %d\n", | ||
514 | __func__, err); | ||
515 | return err; | ||
516 | } | ||
517 | clk_enable(pout_clk); | ||
518 | |||
519 | err = cm_x300_ulpi_phy_reset(); | ||
520 | if (err) { | ||
521 | clk_disable(pout_clk); | ||
522 | clk_put(pout_clk); | ||
523 | } | ||
524 | } | ||
525 | |||
526 | return err; | ||
527 | } | ||
528 | |||
529 | static void cm_x300_u2d_exit(struct device *dev) | ||
530 | { | ||
531 | if (cpu_is_pxa310()) { | ||
532 | clk_disable(pout_clk); | ||
533 | clk_put(pout_clk); | ||
534 | } | ||
535 | } | ||
536 | |||
537 | static struct pxa3xx_u2d_platform_data cm_x300_u2d_platform_data = { | ||
538 | .ulpi_mode = ULPI_SER_6PIN, | ||
539 | .init = cm_x300_u2d_init, | ||
540 | .exit = cm_x300_u2d_exit, | ||
541 | }; | ||
542 | |||
543 | static void cm_x300_init_u2d(void) | ||
544 | { | ||
545 | pxa3xx_set_u2d_info(&cm_x300_u2d_platform_data); | ||
546 | } | ||
547 | #else | ||
548 | static inline void cm_x300_init_u2d(void) {} | ||
549 | #endif | ||
550 | |||
475 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) | 551 | #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE) |
476 | static int cm_x300_ohci_init(struct device *dev) | 552 | static int cm_x300_ohci_init(struct device *dev) |
477 | { | 553 | { |
@@ -754,6 +830,7 @@ static void __init cm_x300_init(void) | |||
754 | cm_x300_init_da9030(); | 830 | cm_x300_init_da9030(); |
755 | cm_x300_init_dm9000(); | 831 | cm_x300_init_dm9000(); |
756 | cm_x300_init_lcd(); | 832 | cm_x300_init_lcd(); |
833 | cm_x300_init_u2d(); | ||
757 | cm_x300_init_ohci(); | 834 | cm_x300_init_ohci(); |
758 | cm_x300_init_mmc(); | 835 | cm_x300_init_mmc(); |
759 | cm_x300_init_nand(); | 836 | cm_x300_init_nand(); |
@@ -779,9 +856,7 @@ static void __init cm_x300_fixup(struct machine_desc *mdesc, struct tag *tags, | |||
779 | } | 856 | } |
780 | 857 | ||
781 | MACHINE_START(CM_X300, "CM-X300 module") | 858 | MACHINE_START(CM_X300, "CM-X300 module") |
782 | .phys_io = 0x40000000, | ||
783 | .boot_params = 0xa0000100, | 859 | .boot_params = 0xa0000100, |
784 | .io_pg_offst = (io_p2v(0x40000000) >> 18) & 0xfffc, | ||
785 | .map_io = pxa_map_io, | 860 | .map_io = pxa_map_io, |
786 | .init_irq = pxa3xx_init_irq, | 861 | .init_irq = pxa3xx_init_irq, |
787 | .timer = &pxa_timer, | 862 | .timer = &pxa_timer, |