1 /* linux/arch/arm/plat-s3c24xx/dev-uart.c
2  *
3  * Copyright (c) 2004 Simtec Electronics
4  *	Ben Dooks <ben@simtec.co.uk>
5  *
6  * Base S3C24XX UART resource and platform 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/serial_core.h>
18 #include <linux/platform_device.h>
19 
20 #include <asm/mach/arch.h>
21 #include <asm/mach/map.h>
22 #include <asm/mach/irq.h>
23 #include <mach/hardware.h>
24 #include <mach/map.h>
25 
26 #include <plat/devs.h>
27 #include <plat/regs-serial.h>
28 
29 /* Serial port registrations */
30 
31 static struct resource s3c2410_uart0_resource[] = {
32 	[0] = {
33 		.start = S3C2410_PA_UART0,
34 		.end   = S3C2410_PA_UART0 + 0x3fff,
35 		.flags = IORESOURCE_MEM,
36 	},
37 	[1] = {
38 		.start = IRQ_S3CUART_RX0,
39 		.end   = IRQ_S3CUART_ERR0,
40 		.flags = IORESOURCE_IRQ,
41 	}
42 };
43 
44 static struct resource s3c2410_uart1_resource[] = {
45 	[0] = {
46 		.start = S3C2410_PA_UART1,
47 		.end   = S3C2410_PA_UART1 + 0x3fff,
48 		.flags = IORESOURCE_MEM,
49 	},
50 	[1] = {
51 		.start = IRQ_S3CUART_RX1,
52 		.end   = IRQ_S3CUART_ERR1,
53 		.flags = IORESOURCE_IRQ,
54 	}
55 };
56 
57 static struct resource s3c2410_uart2_resource[] = {
58 	[0] = {
59 		.start = S3C2410_PA_UART2,
60 		.end   = S3C2410_PA_UART2 + 0x3fff,
61 		.flags = IORESOURCE_MEM,
62 	},
63 	[1] = {
64 		.start = IRQ_S3CUART_RX2,
65 		.end   = IRQ_S3CUART_ERR2,
66 		.flags = IORESOURCE_IRQ,
67 	}
68 };
69 
70 static struct resource s3c2410_uart3_resource[] = {
71 	[0] = {
72 		.start = S3C2443_PA_UART3,
73 		.end   = S3C2443_PA_UART3 + 0x3fff,
74 		.flags = IORESOURCE_MEM,
75 	},
76 	[1] = {
77 		.start = IRQ_S3CUART_RX3,
78 		.end   = IRQ_S3CUART_ERR3,
79 		.flags = IORESOURCE_IRQ,
80 	},
81 };
82 
83 struct s3c24xx_uart_resources s3c2410_uart_resources[] __initdata = {
84 	[0] = {
85 		.resources	= s3c2410_uart0_resource,
86 		.nr_resources	= ARRAY_SIZE(s3c2410_uart0_resource),
87 	},
88 	[1] = {
89 		.resources	= s3c2410_uart1_resource,
90 		.nr_resources	= ARRAY_SIZE(s3c2410_uart1_resource),
91 	},
92 	[2] = {
93 		.resources	= s3c2410_uart2_resource,
94 		.nr_resources	= ARRAY_SIZE(s3c2410_uart2_resource),
95 	},
96 	[3] = {
97 		.resources	= s3c2410_uart3_resource,
98 		.nr_resources	= ARRAY_SIZE(s3c2410_uart3_resource),
99 	},
100 };
101