dev-uart.c 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. /* linux/arch/arm/plat-s5pc1xx/dev-uart.c
  2. *
  3. * Copyright 2009 Samsung Electronics Co.
  4. * Byungho Min <bhmin@samsung.com>
  5. *
  6. * Based on plat-s3c64xx/dev-uart.c
  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. */
  13. #include <linux/kernel.h>
  14. #include <linux/types.h>
  15. #include <linux/interrupt.h>
  16. #include <linux/list.h>
  17. #include <linux/platform_device.h>
  18. #include <asm/mach/arch.h>
  19. #include <asm/mach/irq.h>
  20. #include <mach/hardware.h>
  21. #include <mach/map.h>
  22. #include <plat/devs.h>
  23. /* Serial port registrations */
  24. /* 64xx uarts are closer together */
  25. static struct resource s5pc1xx_uart0_resource[] = {
  26. [0] = {
  27. .start = S3C_PA_UART0,
  28. .end = S3C_PA_UART0 + 0x100,
  29. .flags = IORESOURCE_MEM,
  30. },
  31. [1] = {
  32. .start = IRQ_S3CUART_RX0,
  33. .end = IRQ_S3CUART_RX0,
  34. .flags = IORESOURCE_IRQ,
  35. },
  36. [2] = {
  37. .start = IRQ_S3CUART_TX0,
  38. .end = IRQ_S3CUART_TX0,
  39. .flags = IORESOURCE_IRQ,
  40. },
  41. [3] = {
  42. .start = IRQ_S3CUART_ERR0,
  43. .end = IRQ_S3CUART_ERR0,
  44. .flags = IORESOURCE_IRQ,
  45. }
  46. };
  47. static struct resource s5pc1xx_uart1_resource[] = {
  48. [0] = {
  49. .start = S3C_PA_UART1,
  50. .end = S3C_PA_UART1 + 0x100,
  51. .flags = IORESOURCE_MEM,
  52. },
  53. [1] = {
  54. .start = IRQ_S3CUART_RX1,
  55. .end = IRQ_S3CUART_RX1,
  56. .flags = IORESOURCE_IRQ,
  57. },
  58. [2] = {
  59. .start = IRQ_S3CUART_TX1,
  60. .end = IRQ_S3CUART_TX1,
  61. .flags = IORESOURCE_IRQ,
  62. },
  63. [3] = {
  64. .start = IRQ_S3CUART_ERR1,
  65. .end = IRQ_S3CUART_ERR1,
  66. .flags = IORESOURCE_IRQ,
  67. },
  68. };
  69. static struct resource s5pc1xx_uart2_resource[] = {
  70. [0] = {
  71. .start = S3C_PA_UART2,
  72. .end = S3C_PA_UART2 + 0x100,
  73. .flags = IORESOURCE_MEM,
  74. },
  75. [1] = {
  76. .start = IRQ_S3CUART_RX2,
  77. .end = IRQ_S3CUART_RX2,
  78. .flags = IORESOURCE_IRQ,
  79. },
  80. [2] = {
  81. .start = IRQ_S3CUART_TX2,
  82. .end = IRQ_S3CUART_TX2,
  83. .flags = IORESOURCE_IRQ,
  84. },
  85. [3] = {
  86. .start = IRQ_S3CUART_ERR2,
  87. .end = IRQ_S3CUART_ERR2,
  88. .flags = IORESOURCE_IRQ,
  89. },
  90. };
  91. static struct resource s5pc1xx_uart3_resource[] = {
  92. [0] = {
  93. .start = S3C_PA_UART3,
  94. .end = S3C_PA_UART3 + 0x100,
  95. .flags = IORESOURCE_MEM,
  96. },
  97. [1] = {
  98. .start = IRQ_S3CUART_RX3,
  99. .end = IRQ_S3CUART_RX3,
  100. .flags = IORESOURCE_IRQ,
  101. },
  102. [2] = {
  103. .start = IRQ_S3CUART_TX3,
  104. .end = IRQ_S3CUART_TX3,
  105. .flags = IORESOURCE_IRQ,
  106. },
  107. [3] = {
  108. .start = IRQ_S3CUART_ERR3,
  109. .end = IRQ_S3CUART_ERR3,
  110. .flags = IORESOURCE_IRQ,
  111. },
  112. };
  113. struct s3c24xx_uart_resources s5pc1xx_uart_resources[] __initdata = {
  114. [0] = {
  115. .resources = s5pc1xx_uart0_resource,
  116. .nr_resources = ARRAY_SIZE(s5pc1xx_uart0_resource),
  117. },
  118. [1] = {
  119. .resources = s5pc1xx_uart1_resource,
  120. .nr_resources = ARRAY_SIZE(s5pc1xx_uart1_resource),
  121. },
  122. [2] = {
  123. .resources = s5pc1xx_uart2_resource,
  124. .nr_resources = ARRAY_SIZE(s5pc1xx_uart2_resource),
  125. },
  126. [3] = {
  127. .resources = s5pc1xx_uart3_resource,
  128. .nr_resources = ARRAY_SIZE(s5pc1xx_uart3_resource),
  129. },
  130. };
  131. /* uart devices */
  132. static struct platform_device s3c24xx_uart_device0 = {
  133. .id = 0,
  134. };
  135. static struct platform_device s3c24xx_uart_device1 = {
  136. .id = 1,
  137. };
  138. static struct platform_device s3c24xx_uart_device2 = {
  139. .id = 2,
  140. };
  141. static struct platform_device s3c24xx_uart_device3 = {
  142. .id = 3,
  143. };
  144. struct platform_device *s3c24xx_uart_src[4] = {
  145. &s3c24xx_uart_device0,
  146. &s3c24xx_uart_device1,
  147. &s3c24xx_uart_device2,
  148. &s3c24xx_uart_device3,
  149. };
  150. struct platform_device *s3c24xx_uart_devs[4] = {
  151. };