dev-uart.c 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. /* linux/arch/arm/plat-s5p/dev-uart.c
  2. *
  3. * Copyright (c) 2009 Samsung Electronics Co., Ltd.
  4. * http://www.samsung.com/
  5. *
  6. * Base S5P UART resource and device definitions
  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. #include <linux/kernel.h>
  13. #include <linux/types.h>
  14. #include <linux/interrupt.h>
  15. #include <linux/list.h>
  16. #include <linux/platform_device.h>
  17. #include <asm/mach/arch.h>
  18. #include <asm/mach/irq.h>
  19. #include <mach/hardware.h>
  20. #include <mach/map.h>
  21. #include <plat/devs.h>
  22. /* Serial port registrations */
  23. static struct resource s5p_uart0_resource[] = {
  24. [0] = {
  25. .start = S5P_PA_UART0,
  26. .end = S5P_PA_UART0 + S5P_SZ_UART - 1,
  27. .flags = IORESOURCE_MEM,
  28. },
  29. [1] = {
  30. .start = IRQ_UART0,
  31. .end = IRQ_UART0,
  32. .flags = IORESOURCE_IRQ,
  33. },
  34. };
  35. static struct resource s5p_uart1_resource[] = {
  36. [0] = {
  37. .start = S5P_PA_UART1,
  38. .end = S5P_PA_UART1 + S5P_SZ_UART - 1,
  39. .flags = IORESOURCE_MEM,
  40. },
  41. [1] = {
  42. .start = IRQ_UART1,
  43. .end = IRQ_UART1,
  44. .flags = IORESOURCE_IRQ,
  45. },
  46. };
  47. static struct resource s5p_uart2_resource[] = {
  48. [0] = {
  49. .start = S5P_PA_UART2,
  50. .end = S5P_PA_UART2 + S5P_SZ_UART - 1,
  51. .flags = IORESOURCE_MEM,
  52. },
  53. [1] = {
  54. .start = IRQ_UART2,
  55. .end = IRQ_UART2,
  56. .flags = IORESOURCE_IRQ,
  57. },
  58. };
  59. static struct resource s5p_uart3_resource[] = {
  60. #if CONFIG_SERIAL_SAMSUNG_UARTS > 3
  61. [0] = {
  62. .start = S5P_PA_UART3,
  63. .end = S5P_PA_UART3 + S5P_SZ_UART - 1,
  64. .flags = IORESOURCE_MEM,
  65. },
  66. [1] = {
  67. .start = IRQ_UART3,
  68. .end = IRQ_UART3,
  69. .flags = IORESOURCE_IRQ,
  70. },
  71. #endif
  72. };
  73. static struct resource s5p_uart4_resource[] = {
  74. #if CONFIG_SERIAL_SAMSUNG_UARTS > 4
  75. [0] = {
  76. .start = S5P_PA_UART4,
  77. .end = S5P_PA_UART4 + S5P_SZ_UART - 1,
  78. .flags = IORESOURCE_MEM,
  79. },
  80. [1] = {
  81. .start = IRQ_UART4,
  82. .end = IRQ_UART4,
  83. .flags = IORESOURCE_IRQ,
  84. },
  85. #endif
  86. };
  87. static struct resource s5p_uart5_resource[] = {
  88. #if CONFIG_SERIAL_SAMSUNG_UARTS > 5
  89. [0] = {
  90. .start = S5P_PA_UART5,
  91. .end = S5P_PA_UART5 + S5P_SZ_UART - 1,
  92. .flags = IORESOURCE_MEM,
  93. },
  94. [1] = {
  95. .start = IRQ_UART5,
  96. .end = IRQ_UART5,
  97. .flags = IORESOURCE_IRQ,
  98. },
  99. #endif
  100. };
  101. struct s3c24xx_uart_resources s5p_uart_resources[] __initdata = {
  102. [0] = {
  103. .resources = s5p_uart0_resource,
  104. .nr_resources = ARRAY_SIZE(s5p_uart0_resource),
  105. },
  106. [1] = {
  107. .resources = s5p_uart1_resource,
  108. .nr_resources = ARRAY_SIZE(s5p_uart1_resource),
  109. },
  110. [2] = {
  111. .resources = s5p_uart2_resource,
  112. .nr_resources = ARRAY_SIZE(s5p_uart2_resource),
  113. },
  114. [3] = {
  115. .resources = s5p_uart3_resource,
  116. .nr_resources = ARRAY_SIZE(s5p_uart3_resource),
  117. },
  118. [4] = {
  119. .resources = s5p_uart4_resource,
  120. .nr_resources = ARRAY_SIZE(s5p_uart4_resource),
  121. },
  122. [5] = {
  123. .resources = s5p_uart5_resource,
  124. .nr_resources = ARRAY_SIZE(s5p_uart5_resource),
  125. },
  126. };