devices.c 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120
  1. /*
  2. * Copyright 2009 Amit Kucheria <amit.kucheria@canonical.com>
  3. * Copyright (C) 2010 Freescale Semiconductor, Inc.
  4. *
  5. * The code contained herein is licensed under the GNU General Public
  6. * License. You may obtain a copy of the GNU General Public License
  7. * Version 2 or later at the following locations:
  8. *
  9. * http://www.opensource.org/licenses/gpl-license.html
  10. * http://www.gnu.org/copyleft/gpl.html
  11. */
  12. #include <linux/platform_device.h>
  13. #include <linux/dma-mapping.h>
  14. #include <mach/hardware.h>
  15. #include <mach/imx-uart.h>
  16. #include <mach/irqs.h>
  17. static struct resource mxc_hsi2c_resources[] = {
  18. {
  19. .start = MX51_HSI2C_DMA_BASE_ADDR,
  20. .end = MX51_HSI2C_DMA_BASE_ADDR + SZ_16K - 1,
  21. .flags = IORESOURCE_MEM,
  22. },
  23. {
  24. .start = MX51_MXC_INT_HS_I2C,
  25. .end = MX51_MXC_INT_HS_I2C,
  26. .flags = IORESOURCE_IRQ,
  27. },
  28. };
  29. struct platform_device mxc_hsi2c_device = {
  30. .name = "imx-i2c",
  31. .id = 2,
  32. .num_resources = ARRAY_SIZE(mxc_hsi2c_resources),
  33. .resource = mxc_hsi2c_resources
  34. };
  35. static u64 usb_dma_mask = DMA_BIT_MASK(32);
  36. static struct resource usbotg_resources[] = {
  37. {
  38. .start = MX51_OTG_BASE_ADDR,
  39. .end = MX51_OTG_BASE_ADDR + 0x1ff,
  40. .flags = IORESOURCE_MEM,
  41. },
  42. {
  43. .start = MX51_MXC_INT_USB_OTG,
  44. .flags = IORESOURCE_IRQ,
  45. },
  46. };
  47. /* OTG gadget device */
  48. struct platform_device mxc_usbdr_udc_device = {
  49. .name = "fsl-usb2-udc",
  50. .id = -1,
  51. .num_resources = ARRAY_SIZE(usbotg_resources),
  52. .resource = usbotg_resources,
  53. .dev = {
  54. .dma_mask = &usb_dma_mask,
  55. .coherent_dma_mask = DMA_BIT_MASK(32),
  56. },
  57. };
  58. struct platform_device mxc_usbdr_host_device = {
  59. .name = "mxc-ehci",
  60. .id = 0,
  61. .num_resources = ARRAY_SIZE(usbotg_resources),
  62. .resource = usbotg_resources,
  63. .dev = {
  64. .dma_mask = &usb_dma_mask,
  65. .coherent_dma_mask = DMA_BIT_MASK(32),
  66. },
  67. };
  68. static struct resource usbh1_resources[] = {
  69. {
  70. .start = MX51_OTG_BASE_ADDR + 0x200,
  71. .end = MX51_OTG_BASE_ADDR + 0x200 + 0x1ff,
  72. .flags = IORESOURCE_MEM,
  73. },
  74. {
  75. .start = MX51_MXC_INT_USB_H1,
  76. .flags = IORESOURCE_IRQ,
  77. },
  78. };
  79. struct platform_device mxc_usbh1_device = {
  80. .name = "mxc-ehci",
  81. .id = 1,
  82. .num_resources = ARRAY_SIZE(usbh1_resources),
  83. .resource = usbh1_resources,
  84. .dev = {
  85. .dma_mask = &usb_dma_mask,
  86. .coherent_dma_mask = DMA_BIT_MASK(32),
  87. },
  88. };
  89. static struct resource usbh2_resources[] = {
  90. {
  91. .start = MX51_OTG_BASE_ADDR + 0x400,
  92. .end = MX51_OTG_BASE_ADDR + 0x400 + 0x1ff,
  93. .flags = IORESOURCE_MEM,
  94. },
  95. {
  96. .start = MX51_MXC_INT_USB_H2,
  97. .flags = IORESOURCE_IRQ,
  98. },
  99. };
  100. struct platform_device mxc_usbh2_device = {
  101. .name = "mxc-ehci",
  102. .id = 2,
  103. .num_resources = ARRAY_SIZE(usbh2_resources),
  104. .resource = usbh2_resources,
  105. .dev = {
  106. .dma_mask = &usb_dma_mask,
  107. .coherent_dma_mask = DMA_BIT_MASK(32),
  108. },
  109. };