blob: c9308db361832d816dfe799d7ec075106327270f [file] [log] [blame]
Kukjin Kim501dae92010-01-14 08:23:53 +09001/* 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
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
19#include <asm/mach/arch.h>
20#include <asm/mach/irq.h>
21#include <mach/hardware.h>
22#include <mach/map.h>
23
24#include <plat/devs.h>
25
26 /* Serial port registrations */
27
28static struct resource s5p_uart0_resource[] = {
29 [0] = {
30 .start = S5P_PA_UART0,
Thomas Abraham6236b972011-02-15 14:35:47 +090031 .end = S5P_PA_UART0 + S5P_SZ_UART - 1,
Kukjin Kim501dae92010-01-14 08:23:53 +090032 .flags = IORESOURCE_MEM,
33 },
34 [1] = {
Thomas Abraham2a8d7bd2011-08-10 15:51:20 +053035 .start = IRQ_UART0,
36 .end = IRQ_UART0,
Kukjin Kim501dae92010-01-14 08:23:53 +090037 .flags = IORESOURCE_IRQ,
38 },
Kukjin Kim501dae92010-01-14 08:23:53 +090039};
40
41static struct resource s5p_uart1_resource[] = {
42 [0] = {
43 .start = S5P_PA_UART1,
Thomas Abraham6236b972011-02-15 14:35:47 +090044 .end = S5P_PA_UART1 + S5P_SZ_UART - 1,
Kukjin Kim501dae92010-01-14 08:23:53 +090045 .flags = IORESOURCE_MEM,
46 },
47 [1] = {
Thomas Abraham2a8d7bd2011-08-10 15:51:20 +053048 .start = IRQ_UART1,
49 .end = IRQ_UART1,
Kukjin Kim501dae92010-01-14 08:23:53 +090050 .flags = IORESOURCE_IRQ,
51 },
52};
53
54static struct resource s5p_uart2_resource[] = {
55 [0] = {
56 .start = S5P_PA_UART2,
Thomas Abraham6236b972011-02-15 14:35:47 +090057 .end = S5P_PA_UART2 + S5P_SZ_UART - 1,
Kukjin Kim501dae92010-01-14 08:23:53 +090058 .flags = IORESOURCE_MEM,
59 },
60 [1] = {
Thomas Abraham2a8d7bd2011-08-10 15:51:20 +053061 .start = IRQ_UART2,
62 .end = IRQ_UART2,
Kukjin Kim501dae92010-01-14 08:23:53 +090063 .flags = IORESOURCE_IRQ,
64 },
65};
66
67static struct resource s5p_uart3_resource[] = {
Kukjin Kim03843a12010-01-29 10:23:40 +090068#if CONFIG_SERIAL_SAMSUNG_UARTS > 3
Kukjin Kim501dae92010-01-14 08:23:53 +090069 [0] = {
70 .start = S5P_PA_UART3,
Thomas Abraham6236b972011-02-15 14:35:47 +090071 .end = S5P_PA_UART3 + S5P_SZ_UART - 1,
Kukjin Kim501dae92010-01-14 08:23:53 +090072 .flags = IORESOURCE_MEM,
73 },
74 [1] = {
Thomas Abraham2a8d7bd2011-08-10 15:51:20 +053075 .start = IRQ_UART3,
76 .end = IRQ_UART3,
Kukjin Kim501dae92010-01-14 08:23:53 +090077 .flags = IORESOURCE_IRQ,
78 },
Kukjin Kim03843a12010-01-29 10:23:40 +090079#endif
Kukjin Kim501dae92010-01-14 08:23:53 +090080};
81
Kukjin Kim2555e662010-09-01 15:13:44 +090082static struct resource s5p_uart4_resource[] = {
83#if CONFIG_SERIAL_SAMSUNG_UARTS > 4
84 [0] = {
85 .start = S5P_PA_UART4,
Thomas Abraham6236b972011-02-15 14:35:47 +090086 .end = S5P_PA_UART4 + S5P_SZ_UART - 1,
Kukjin Kim2555e662010-09-01 15:13:44 +090087 .flags = IORESOURCE_MEM,
88 },
89 [1] = {
Thomas Abraham2a8d7bd2011-08-10 15:51:20 +053090 .start = IRQ_UART4,
91 .end = IRQ_UART4,
Kukjin Kim2555e662010-09-01 15:13:44 +090092 .flags = IORESOURCE_IRQ,
93 },
94#endif
95};
96
97static struct resource s5p_uart5_resource[] = {
98#if CONFIG_SERIAL_SAMSUNG_UARTS > 5
99 [0] = {
100 .start = S5P_PA_UART5,
Thomas Abraham6236b972011-02-15 14:35:47 +0900101 .end = S5P_PA_UART5 + S5P_SZ_UART - 1,
Kukjin Kim2555e662010-09-01 15:13:44 +0900102 .flags = IORESOURCE_MEM,
103 },
104 [1] = {
Thomas Abraham2a8d7bd2011-08-10 15:51:20 +0530105 .start = IRQ_UART5,
106 .end = IRQ_UART5,
Kukjin Kim2555e662010-09-01 15:13:44 +0900107 .flags = IORESOURCE_IRQ,
108 },
109#endif
110};
111
Kukjin Kim501dae92010-01-14 08:23:53 +0900112struct s3c24xx_uart_resources s5p_uart_resources[] __initdata = {
113 [0] = {
114 .resources = s5p_uart0_resource,
115 .nr_resources = ARRAY_SIZE(s5p_uart0_resource),
116 },
117 [1] = {
118 .resources = s5p_uart1_resource,
119 .nr_resources = ARRAY_SIZE(s5p_uart1_resource),
120 },
121 [2] = {
122 .resources = s5p_uart2_resource,
123 .nr_resources = ARRAY_SIZE(s5p_uart2_resource),
124 },
125 [3] = {
126 .resources = s5p_uart3_resource,
127 .nr_resources = ARRAY_SIZE(s5p_uart3_resource),
128 },
Kukjin Kim2555e662010-09-01 15:13:44 +0900129 [4] = {
130 .resources = s5p_uart4_resource,
131 .nr_resources = ARRAY_SIZE(s5p_uart4_resource),
132 },
133 [5] = {
134 .resources = s5p_uart5_resource,
135 .nr_resources = ARRAY_SIZE(s5p_uart5_resource),
136 },
Kukjin Kim501dae92010-01-14 08:23:53 +0900137};