colibri-pxa270-evalboard.c 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  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. };
  49. /******************************************************************************
  50. * SD/MMC card controller
  51. ******************************************************************************/
  52. #if defined(CONFIG_MMC_PXA) || defined(CONFIG_MMC_PXA_MODULE)
  53. static struct pxamci_platform_data colibri_pxa270_mci_platform_data = {
  54. .ocr_mask = MMC_VDD_32_33 | MMC_VDD_33_34,
  55. .gpio_power = -1,
  56. .gpio_card_detect = GPIO0_COLIBRI_PXA270_SD_DETECT,
  57. .gpio_card_ro = -1,
  58. .detect_delay_ms = 200,
  59. };
  60. static void __init colibri_pxa270_mmc_init(void)
  61. {
  62. pxa_set_mci_info(&colibri_pxa270_mci_platform_data);
  63. }
  64. #else
  65. static inline void colibri_pxa270_mmc_init(void) {}
  66. #endif
  67. /******************************************************************************
  68. * USB Host
  69. ******************************************************************************/
  70. #if defined(CONFIG_USB_OHCI_HCD) || defined(CONFIG_USB_OHCI_HCD_MODULE)
  71. static int colibri_pxa270_ohci_init(struct device *dev)
  72. {
  73. UP2OCR = UP2OCR_HXS | UP2OCR_HXOE | UP2OCR_DPPDE | UP2OCR_DMPDE;
  74. return 0;
  75. }
  76. static struct pxaohci_platform_data colibri_pxa270_ohci_info = {
  77. .port_mode = PMM_PERPORT_MODE,
  78. .flags = ENABLE_PORT1 | ENABLE_PORT2 |
  79. POWER_CONTROL_LOW | POWER_SENSE_LOW,
  80. .init = colibri_pxa270_ohci_init,
  81. };
  82. static void __init colibri_pxa270_uhc_init(void)
  83. {
  84. pxa_set_ohci_info(&colibri_pxa270_ohci_info);
  85. }
  86. #else
  87. static inline void colibri_pxa270_uhc_init(void) {}
  88. #endif
  89. void __init colibri_pxa270_evalboard_init(void)
  90. {
  91. pxa2xx_mfp_config(ARRAY_AND_SIZE(colibri_pxa270_evalboard_pin_config));
  92. pxa_set_ffuart_info(NULL);
  93. pxa_set_btuart_info(NULL);
  94. pxa_set_stuart_info(NULL);
  95. colibri_pxa270_mmc_init();
  96. colibri_pxa270_uhc_init();
  97. }