serial.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /*
  2. * Copyright 2006-2007 Freescale Semiconductor, Inc. All Rights Reserved.
  3. * Copyright 2008 Juergen Beisert, kernel@pengutronix.de
  4. *
  5. * This program is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU General Public License
  7. * as published by the Free Software Foundation; either version 2
  8. * of the License, or (at your option) any later version.
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
  17. * MA 02110-1301, USA.
  18. */
  19. #include <linux/module.h>
  20. #include <linux/platform_device.h>
  21. #include <linux/serial.h>
  22. #include <mach/hardware.h>
  23. #include <mach/imx-uart.h>
  24. static struct resource uart0[] = {
  25. {
  26. .start = UART1_BASE_ADDR,
  27. .end = UART1_BASE_ADDR + 0x0B5,
  28. .flags = IORESOURCE_MEM,
  29. }, {
  30. .start = MXC_INT_UART1,
  31. .end = MXC_INT_UART1,
  32. .flags = IORESOURCE_IRQ,
  33. },
  34. };
  35. struct platform_device mxc_uart_device0 = {
  36. .name = "imx-uart",
  37. .id = 0,
  38. .resource = uart0,
  39. .num_resources = ARRAY_SIZE(uart0),
  40. };
  41. static struct resource uart1[] = {
  42. {
  43. .start = UART2_BASE_ADDR,
  44. .end = UART2_BASE_ADDR + 0x0B5,
  45. .flags = IORESOURCE_MEM,
  46. }, {
  47. .start = MXC_INT_UART2,
  48. .end = MXC_INT_UART2,
  49. .flags = IORESOURCE_IRQ,
  50. },
  51. };
  52. struct platform_device mxc_uart_device1 = {
  53. .name = "imx-uart",
  54. .id = 1,
  55. .resource = uart1,
  56. .num_resources = ARRAY_SIZE(uart1),
  57. };
  58. static struct resource uart2[] = {
  59. {
  60. .start = UART3_BASE_ADDR,
  61. .end = UART3_BASE_ADDR + 0x0B5,
  62. .flags = IORESOURCE_MEM,
  63. }, {
  64. .start = MXC_INT_UART3,
  65. .end = MXC_INT_UART3,
  66. .flags = IORESOURCE_IRQ,
  67. },
  68. };
  69. struct platform_device mxc_uart_device2 = {
  70. .name = "imx-uart",
  71. .id = 2,
  72. .resource = uart2,
  73. .num_resources = ARRAY_SIZE(uart2),
  74. };
  75. static struct resource uart3[] = {
  76. {
  77. .start = UART4_BASE_ADDR,
  78. .end = UART4_BASE_ADDR + 0x0B5,
  79. .flags = IORESOURCE_MEM,
  80. }, {
  81. .start = MXC_INT_UART4,
  82. .end = MXC_INT_UART4,
  83. .flags = IORESOURCE_IRQ,
  84. },
  85. };
  86. struct platform_device mxc_uart_device3 = {
  87. .name = "imx-uart",
  88. .id = 3,
  89. .resource = uart3,
  90. .num_resources = ARRAY_SIZE(uart3),
  91. };
  92. static struct resource uart4[] = {
  93. {
  94. .start = UART5_BASE_ADDR,
  95. .end = UART5_BASE_ADDR + 0x0B5,
  96. .flags = IORESOURCE_MEM,
  97. }, {
  98. .start = MXC_INT_UART5,
  99. .end = MXC_INT_UART5,
  100. .flags = IORESOURCE_IRQ,
  101. },
  102. };
  103. struct platform_device mxc_uart_device4 = {
  104. .name = "imx-uart",
  105. .id = 4,
  106. .resource = uart4,
  107. .num_resources = ARRAY_SIZE(uart4),
  108. };
  109. static struct resource uart5[] = {
  110. {
  111. .start = UART6_BASE_ADDR,
  112. .end = UART6_BASE_ADDR + 0x0B5,
  113. .flags = IORESOURCE_MEM,
  114. }, {
  115. .start = MXC_INT_UART6,
  116. .end = MXC_INT_UART6,
  117. .flags = IORESOURCE_IRQ,
  118. },
  119. };
  120. struct platform_device mxc_uart_device5 = {
  121. .name = "imx-uart",
  122. .id = 5,
  123. .resource = uart5,
  124. .num_resources = ARRAY_SIZE(uart5),
  125. };