devices.c 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. /*
  2. * Copyright 2009 Amit Kucheria <amit.kucheria@canonical.com>
  3. *
  4. * The code contained herein is licensed under the GNU General Public
  5. * License. You may obtain a copy of the GNU General Public License
  6. * Version 2 or later at the following locations:
  7. *
  8. * http://www.opensource.org/licenses/gpl-license.html
  9. * http://www.gnu.org/copyleft/gpl.html
  10. */
  11. #include <linux/platform_device.h>
  12. #include <mach/hardware.h>
  13. #include <mach/imx-uart.h>
  14. static struct resource uart0[] = {
  15. {
  16. .start = MX51_UART1_BASE_ADDR,
  17. .end = MX51_UART1_BASE_ADDR + 0xfff,
  18. .flags = IORESOURCE_MEM,
  19. }, {
  20. .start = MX51_MXC_INT_UART1,
  21. .end = MX51_MXC_INT_UART1,
  22. .flags = IORESOURCE_IRQ,
  23. },
  24. };
  25. struct platform_device mxc_uart_device0 = {
  26. .name = "imx-uart",
  27. .id = 0,
  28. .resource = uart0,
  29. .num_resources = ARRAY_SIZE(uart0),
  30. };
  31. static struct resource uart1[] = {
  32. {
  33. .start = MX51_UART2_BASE_ADDR,
  34. .end = MX51_UART2_BASE_ADDR + 0xfff,
  35. .flags = IORESOURCE_MEM,
  36. }, {
  37. .start = MX51_MXC_INT_UART2,
  38. .end = MX51_MXC_INT_UART2,
  39. .flags = IORESOURCE_IRQ,
  40. },
  41. };
  42. struct platform_device mxc_uart_device1 = {
  43. .name = "imx-uart",
  44. .id = 1,
  45. .resource = uart1,
  46. .num_resources = ARRAY_SIZE(uart1),
  47. };
  48. static struct resource uart2[] = {
  49. {
  50. .start = MX51_UART3_BASE_ADDR,
  51. .end = MX51_UART3_BASE_ADDR + 0xfff,
  52. .flags = IORESOURCE_MEM,
  53. }, {
  54. .start = MX51_MXC_INT_UART3,
  55. .end = MX51_MXC_INT_UART3,
  56. .flags = IORESOURCE_IRQ,
  57. },
  58. };
  59. struct platform_device mxc_uart_device2 = {
  60. .name = "imx-uart",
  61. .id = 2,
  62. .resource = uart2,
  63. .num_resources = ARRAY_SIZE(uart2),
  64. };
  65. static struct resource mxc_fec_resources[] = {
  66. {
  67. .start = MX51_MXC_FEC_BASE_ADDR,
  68. .end = MX51_MXC_FEC_BASE_ADDR + 0xfff,
  69. .flags = IORESOURCE_MEM,
  70. }, {
  71. .start = MX51_MXC_INT_FEC,
  72. .end = MX51_MXC_INT_FEC,
  73. .flags = IORESOURCE_IRQ,
  74. },
  75. };
  76. struct platform_device mxc_fec_device = {
  77. .name = "fec",
  78. .id = 0,
  79. .num_resources = ARRAY_SIZE(mxc_fec_resources),
  80. .resource = mxc_fec_resources,
  81. };
  82. /* Dummy definition to allow compiling in AVIC and TZIC simultaneously */
  83. int __init mxc_register_gpios(void)
  84. {
  85. return 0;
  86. }