serial.c 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  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. #include "devices.h"
  25. static struct resource uart0[] = {
  26. {
  27. .start = UART1_BASE_ADDR,
  28. .end = UART1_BASE_ADDR + 0x0B5,
  29. .flags = IORESOURCE_MEM,
  30. }, {
  31. .start = MXC_INT_UART1,
  32. .end = MXC_INT_UART1,
  33. .flags = IORESOURCE_IRQ,
  34. },
  35. };
  36. struct platform_device mxc_uart_device0 = {
  37. .name = "imx-uart",
  38. .id = 0,
  39. .resource = uart0,
  40. .num_resources = ARRAY_SIZE(uart0),
  41. };
  42. static struct resource uart1[] = {
  43. {
  44. .start = UART2_BASE_ADDR,
  45. .end = UART2_BASE_ADDR + 0x0B5,
  46. .flags = IORESOURCE_MEM,
  47. }, {
  48. .start = MXC_INT_UART2,
  49. .end = MXC_INT_UART2,
  50. .flags = IORESOURCE_IRQ,
  51. },
  52. };
  53. struct platform_device mxc_uart_device1 = {
  54. .name = "imx-uart",
  55. .id = 1,
  56. .resource = uart1,
  57. .num_resources = ARRAY_SIZE(uart1),
  58. };
  59. static struct resource uart2[] = {
  60. {
  61. .start = UART3_BASE_ADDR,
  62. .end = UART3_BASE_ADDR + 0x0B5,
  63. .flags = IORESOURCE_MEM,
  64. }, {
  65. .start = MXC_INT_UART3,
  66. .end = MXC_INT_UART3,
  67. .flags = IORESOURCE_IRQ,
  68. },
  69. };
  70. struct platform_device mxc_uart_device2 = {
  71. .name = "imx-uart",
  72. .id = 2,
  73. .resource = uart2,
  74. .num_resources = ARRAY_SIZE(uart2),
  75. };
  76. static struct resource uart3[] = {
  77. {
  78. .start = UART4_BASE_ADDR,
  79. .end = UART4_BASE_ADDR + 0x0B5,
  80. .flags = IORESOURCE_MEM,
  81. }, {
  82. .start = MXC_INT_UART4,
  83. .end = MXC_INT_UART4,
  84. .flags = IORESOURCE_IRQ,
  85. },
  86. };
  87. struct platform_device mxc_uart_device3 = {
  88. .name = "imx-uart",
  89. .id = 3,
  90. .resource = uart3,
  91. .num_resources = ARRAY_SIZE(uart3),
  92. };
  93. #ifdef CONFIG_MACH_MX27
  94. static struct resource uart4[] = {
  95. {
  96. .start = UART5_BASE_ADDR,
  97. .end = UART5_BASE_ADDR + 0x0B5,
  98. .flags = IORESOURCE_MEM,
  99. }, {
  100. .start = MXC_INT_UART5,
  101. .end = MXC_INT_UART5,
  102. .flags = IORESOURCE_IRQ,
  103. },
  104. };
  105. struct platform_device mxc_uart_device4 = {
  106. .name = "imx-uart",
  107. .id = 4,
  108. .resource = uart4,
  109. .num_resources = ARRAY_SIZE(uart4),
  110. };
  111. static struct resource uart5[] = {
  112. {
  113. .start = UART6_BASE_ADDR,
  114. .end = UART6_BASE_ADDR + 0x0B5,
  115. .flags = IORESOURCE_MEM,
  116. }, {
  117. .start = MXC_INT_UART6,
  118. .end = MXC_INT_UART6,
  119. .flags = IORESOURCE_IRQ,
  120. },
  121. };
  122. struct platform_device mxc_uart_device5 = {
  123. .name = "imx-uart",
  124. .id = 5,
  125. .resource = uart5,
  126. .num_resources = ARRAY_SIZE(uart5),
  127. };
  128. #endif