Merge branch 'v6v7' into devel
[linux/fpc-iii.git] / arch / arm / plat-s5p / dev-uart.c
blobafaf87fdb93e6faf6062069cfde89ad6dab710e0
1 /* linux/arch/arm/plat-s5p/dev-uart.c
3 * Copyright (c) 2009 Samsung Electronics Co., Ltd.
4 * http://www.samsung.com/
6 * Base S5P UART resource and device definitions
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.
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>
19 #include <asm/mach/arch.h>
20 #include <asm/mach/irq.h>
21 #include <mach/hardware.h>
22 #include <mach/map.h>
24 #include <plat/devs.h>
26 /* Serial port registrations */
28 static struct resource s5p_uart0_resource[] = {
29 [0] = {
30 .start = S5P_PA_UART0,
31 .end = S5P_PA_UART0 + S5P_SZ_UART - 1,
32 .flags = IORESOURCE_MEM,
34 [1] = {
35 .start = IRQ_S5P_UART_RX0,
36 .end = IRQ_S5P_UART_RX0,
37 .flags = IORESOURCE_IRQ,
39 [2] = {
40 .start = IRQ_S5P_UART_TX0,
41 .end = IRQ_S5P_UART_TX0,
42 .flags = IORESOURCE_IRQ,
44 [3] = {
45 .start = IRQ_S5P_UART_ERR0,
46 .end = IRQ_S5P_UART_ERR0,
47 .flags = IORESOURCE_IRQ,
51 static struct resource s5p_uart1_resource[] = {
52 [0] = {
53 .start = S5P_PA_UART1,
54 .end = S5P_PA_UART1 + S5P_SZ_UART - 1,
55 .flags = IORESOURCE_MEM,
57 [1] = {
58 .start = IRQ_S5P_UART_RX1,
59 .end = IRQ_S5P_UART_RX1,
60 .flags = IORESOURCE_IRQ,
62 [2] = {
63 .start = IRQ_S5P_UART_TX1,
64 .end = IRQ_S5P_UART_TX1,
65 .flags = IORESOURCE_IRQ,
67 [3] = {
68 .start = IRQ_S5P_UART_ERR1,
69 .end = IRQ_S5P_UART_ERR1,
70 .flags = IORESOURCE_IRQ,
74 static struct resource s5p_uart2_resource[] = {
75 [0] = {
76 .start = S5P_PA_UART2,
77 .end = S5P_PA_UART2 + S5P_SZ_UART - 1,
78 .flags = IORESOURCE_MEM,
80 [1] = {
81 .start = IRQ_S5P_UART_RX2,
82 .end = IRQ_S5P_UART_RX2,
83 .flags = IORESOURCE_IRQ,
85 [2] = {
86 .start = IRQ_S5P_UART_TX2,
87 .end = IRQ_S5P_UART_TX2,
88 .flags = IORESOURCE_IRQ,
90 [3] = {
91 .start = IRQ_S5P_UART_ERR2,
92 .end = IRQ_S5P_UART_ERR2,
93 .flags = IORESOURCE_IRQ,
97 static struct resource s5p_uart3_resource[] = {
98 #if CONFIG_SERIAL_SAMSUNG_UARTS > 3
99 [0] = {
100 .start = S5P_PA_UART3,
101 .end = S5P_PA_UART3 + S5P_SZ_UART - 1,
102 .flags = IORESOURCE_MEM,
104 [1] = {
105 .start = IRQ_S5P_UART_RX3,
106 .end = IRQ_S5P_UART_RX3,
107 .flags = IORESOURCE_IRQ,
109 [2] = {
110 .start = IRQ_S5P_UART_TX3,
111 .end = IRQ_S5P_UART_TX3,
112 .flags = IORESOURCE_IRQ,
114 [3] = {
115 .start = IRQ_S5P_UART_ERR3,
116 .end = IRQ_S5P_UART_ERR3,
117 .flags = IORESOURCE_IRQ,
119 #endif
122 static struct resource s5p_uart4_resource[] = {
123 #if CONFIG_SERIAL_SAMSUNG_UARTS > 4
124 [0] = {
125 .start = S5P_PA_UART4,
126 .end = S5P_PA_UART4 + S5P_SZ_UART - 1,
127 .flags = IORESOURCE_MEM,
129 [1] = {
130 .start = IRQ_S5P_UART_RX4,
131 .end = IRQ_S5P_UART_RX4,
132 .flags = IORESOURCE_IRQ,
134 [2] = {
135 .start = IRQ_S5P_UART_TX4,
136 .end = IRQ_S5P_UART_TX4,
137 .flags = IORESOURCE_IRQ,
139 [3] = {
140 .start = IRQ_S5P_UART_ERR4,
141 .end = IRQ_S5P_UART_ERR4,
142 .flags = IORESOURCE_IRQ,
144 #endif
147 static struct resource s5p_uart5_resource[] = {
148 #if CONFIG_SERIAL_SAMSUNG_UARTS > 5
149 [0] = {
150 .start = S5P_PA_UART5,
151 .end = S5P_PA_UART5 + S5P_SZ_UART - 1,
152 .flags = IORESOURCE_MEM,
154 [1] = {
155 .start = IRQ_S5P_UART_RX5,
156 .end = IRQ_S5P_UART_RX5,
157 .flags = IORESOURCE_IRQ,
159 [2] = {
160 .start = IRQ_S5P_UART_TX5,
161 .end = IRQ_S5P_UART_TX5,
162 .flags = IORESOURCE_IRQ,
164 [3] = {
165 .start = IRQ_S5P_UART_ERR5,
166 .end = IRQ_S5P_UART_ERR5,
167 .flags = IORESOURCE_IRQ,
169 #endif
172 struct s3c24xx_uart_resources s5p_uart_resources[] __initdata = {
173 [0] = {
174 .resources = s5p_uart0_resource,
175 .nr_resources = ARRAY_SIZE(s5p_uart0_resource),
177 [1] = {
178 .resources = s5p_uart1_resource,
179 .nr_resources = ARRAY_SIZE(s5p_uart1_resource),
181 [2] = {
182 .resources = s5p_uart2_resource,
183 .nr_resources = ARRAY_SIZE(s5p_uart2_resource),
185 [3] = {
186 .resources = s5p_uart3_resource,
187 .nr_resources = ARRAY_SIZE(s5p_uart3_resource),
189 [4] = {
190 .resources = s5p_uart4_resource,
191 .nr_resources = ARRAY_SIZE(s5p_uart4_resource),
193 [5] = {
194 .resources = s5p_uart5_resource,
195 .nr_resources = ARRAY_SIZE(s5p_uart5_resource),