colibri-pxa270-evalboard.c 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. /*
  2. * linux/arch/arm/mach-pxa/colibri-pxa270-evalboard.c
  3. *
  4. * Support for Toradex PXA270 based Colibri Evaluation Carrier Board
  5. * Daniel Mack <daniel@caiaq.de>
  6. * Marek Vasut <marek.vasut@gmail.com>
  7. *
  8. * This program is free software; you can redistribute it and/or modify
  9. * it under the terms of the GNU General Public License version 2 as
  10. * published by the Free Software Foundation.
  11. */
  12. #include <linux/init.h>
  13. #include <linux/kernel.h>
  14. #include <linux/platform_device.h>
  15. #include <linux/sysdev.h>
  16. #include <linux/interrupt.h>
  17. #include <linux/gpio.h>
  18. #include <asm/mach-types.h>
  19. #include <mach/hardware.h>
  20. #include <asm/mach/arch.h>
  21. #include <mach/pxa27x.h>
  22. #include <mach/colibri.h>
  23. #include <mach/mmc.h>
  24. #include <mach/ohci.h>
  25. #include <mach/pxa27x-udc.h>
  26. #include "generic.h"
  27. #include "devices.h"
  28. /******************************************************************************
  29. * Pin configuration
  30. ******************************************************************************/
  31. static mfp_cfg_t colibri_pxa270_evalboard_pin_config[] __initdata = {
  32. /* MMC */
  33. GPIO32_MMC_CLK,
  34. GPIO92_MMC_DAT_0,
  35. GPIO109_MMC_DAT_1,
  36. GPIO110_MMC_DAT_2,
  37. GPIO111_MMC_DAT_3,
  38. GPIO112_MMC_CMD,
  39. GPIO0_GPIO, /* SD detect */
  40. /* FFUART */
  41. GPIO39_FFUART_TXD,
  42. GPIO34_FFUART_RXD,
  43. /* UHC */
  44. GPIO88_USBH1_PWR,
  45. GPIO89_USBH1_PEN,
  46. GPIO119_USBH2_PWR,
  47. GPIO120_USBH2_PEN,
  48. /* PCMCIA */
  49. GPIO85_nPCE_1,
  50. GPIO54_nPCE_2,
  51. GPIO55_nPREG,
  52. GPIO50_nPIOR,
  53. GPIO51_nPIOW,
  54. GPIO49_nPWE,
  55. GPIO48_nPOE,
  56. GPIO57_nIOIS16,
  57. GPIO56_nPWAIT,
  58. GPIO104_PSKTSEL,
  59. GPIO53_GPIO, /* RESET */
  60. GPIO83_GPIO, /* BVD1 */
  61. GPIO82_GPIO, /* BVD2 */
  62. GPIO1_GPIO, /* READY */
  63. GPIO84_GPIO, /* DETECT */
  64. GPIO107_GPIO, /* PPEN */
  65. };
  66. /******************************************************************************
  67. * SD/MMC card controller
  68. ******************************************************************************/
  69. #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
  70. static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
  71. .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
  72. .gpio_power = -1,
  73. .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT,
  74. .gpio_card_ro = -1,
  75. .detect_delay_ms = 200,
  76. };
  77. static void __init colibri_pxa270_mmc_init(void)
  78. {
  79. pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
  80. }
  81. #else
  82. static inline void colibri_pxa270_mmc_init(void) {}
  83. #endif
  84. /******************************************************************************
  85. * USB Host
  86. ******************************************************************************/
  87. #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
  88. static int colibri_pxa270_ohci_init(struct device *dev)
  89. {
  90. UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
  91. return 0;
  92. }
  93. static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
  94. .port_mode = PMM_PERPORT_MODE,
  95. .flags = ENABLE_PORT1 | ENABLE_PORT2 |
  96. POWER_CONTROL_LOW | POWER_SENSE_LOW,
  97. .init = colibri_pxa270_ohci_init,
  98. };
  99. static void __init colibri_pxa270_uhc_init(void)
  100. {
  101. pxa_set_ohci_info(&colibri_pxa270_ohci_info);
  102. }
  103. #else
  104. static inline void colibri_pxa270_uhc_init(void) {}
  105. #endif
  106. void __init colibri_pxa270_evalboard_init(void)
  107. {
  108. pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config));
  109. pxa_set_ffuart_info(NULL);
  110. pxa_set_btuart_info(NULL);
  111. pxa_set_stuart_info(NULL);
  112. colibri_pxa270_mmc_init();
  113. colibri_pxa270_uhc_init();
  114. }