Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 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 | |
| 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 | |
| 28 | static struct resource s5p_uart0_resource[] = { |
| 29 | [0] = { |
| 30 | .start = S5P_PA_UART0, |
Thomas Abraham | 6236b97 | 2011-02-15 14:35:47 +0900 | [diff] [blame] | 31 | .end = S5P_PA_UART0 + S5P_SZ_UART - 1, |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 32 | .flags = IORESOURCE_MEM, |
| 33 | }, |
| 34 | [1] = { |
Thomas Abraham | 2a8d7bd | 2011-08-10 15:51:20 +0530 | [diff] [blame] | 35 | .start = IRQ_UART0, |
| 36 | .end = IRQ_UART0, |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 37 | .flags = IORESOURCE_IRQ, |
| 38 | }, |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 39 | }; |
| 40 | |
| 41 | static struct resource s5p_uart1_resource[] = { |
| 42 | [0] = { |
| 43 | .start = S5P_PA_UART1, |
Thomas Abraham | 6236b97 | 2011-02-15 14:35:47 +0900 | [diff] [blame] | 44 | .end = S5P_PA_UART1 + S5P_SZ_UART - 1, |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 45 | .flags = IORESOURCE_MEM, |
| 46 | }, |
| 47 | [1] = { |
Thomas Abraham | 2a8d7bd | 2011-08-10 15:51:20 +0530 | [diff] [blame] | 48 | .start = IRQ_UART1, |
| 49 | .end = IRQ_UART1, |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 50 | .flags = IORESOURCE_IRQ, |
| 51 | }, |
| 52 | }; |
| 53 | |
| 54 | static struct resource s5p_uart2_resource[] = { |
| 55 | [0] = { |
| 56 | .start = S5P_PA_UART2, |
Thomas Abraham | 6236b97 | 2011-02-15 14:35:47 +0900 | [diff] [blame] | 57 | .end = S5P_PA_UART2 + S5P_SZ_UART - 1, |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 58 | .flags = IORESOURCE_MEM, |
| 59 | }, |
| 60 | [1] = { |
Thomas Abraham | 2a8d7bd | 2011-08-10 15:51:20 +0530 | [diff] [blame] | 61 | .start = IRQ_UART2, |
| 62 | .end = IRQ_UART2, |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 63 | .flags = IORESOURCE_IRQ, |
| 64 | }, |
| 65 | }; |
| 66 | |
| 67 | static struct resource s5p_uart3_resource[] = { |
Kukjin Kim | 03843a1 | 2010-01-29 10:23:40 +0900 | [diff] [blame] | 68 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 3 |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 69 | [0] = { |
| 70 | .start = S5P_PA_UART3, |
Thomas Abraham | 6236b97 | 2011-02-15 14:35:47 +0900 | [diff] [blame] | 71 | .end = S5P_PA_UART3 + S5P_SZ_UART - 1, |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 72 | .flags = IORESOURCE_MEM, |
| 73 | }, |
| 74 | [1] = { |
Thomas Abraham | 2a8d7bd | 2011-08-10 15:51:20 +0530 | [diff] [blame] | 75 | .start = IRQ_UART3, |
| 76 | .end = IRQ_UART3, |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 77 | .flags = IORESOURCE_IRQ, |
| 78 | }, |
Kukjin Kim | 03843a1 | 2010-01-29 10:23:40 +0900 | [diff] [blame] | 79 | #endif |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 80 | }; |
| 81 | |
Kukjin Kim | 2555e66 | 2010-09-01 15:13:44 +0900 | [diff] [blame] | 82 | static struct resource s5p_uart4_resource[] = { |
| 83 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 4 |
| 84 | [0] = { |
| 85 | .start = S5P_PA_UART4, |
Thomas Abraham | 6236b97 | 2011-02-15 14:35:47 +0900 | [diff] [blame] | 86 | .end = S5P_PA_UART4 + S5P_SZ_UART - 1, |
Kukjin Kim | 2555e66 | 2010-09-01 15:13:44 +0900 | [diff] [blame] | 87 | .flags = IORESOURCE_MEM, |
| 88 | }, |
| 89 | [1] = { |
Thomas Abraham | 2a8d7bd | 2011-08-10 15:51:20 +0530 | [diff] [blame] | 90 | .start = IRQ_UART4, |
| 91 | .end = IRQ_UART4, |
Kukjin Kim | 2555e66 | 2010-09-01 15:13:44 +0900 | [diff] [blame] | 92 | .flags = IORESOURCE_IRQ, |
| 93 | }, |
| 94 | #endif |
| 95 | }; |
| 96 | |
| 97 | static struct resource s5p_uart5_resource[] = { |
| 98 | #if CONFIG_SERIAL_SAMSUNG_UARTS > 5 |
| 99 | [0] = { |
| 100 | .start = S5P_PA_UART5, |
Thomas Abraham | 6236b97 | 2011-02-15 14:35:47 +0900 | [diff] [blame] | 101 | .end = S5P_PA_UART5 + S5P_SZ_UART - 1, |
Kukjin Kim | 2555e66 | 2010-09-01 15:13:44 +0900 | [diff] [blame] | 102 | .flags = IORESOURCE_MEM, |
| 103 | }, |
| 104 | [1] = { |
Thomas Abraham | 2a8d7bd | 2011-08-10 15:51:20 +0530 | [diff] [blame] | 105 | .start = IRQ_UART5, |
| 106 | .end = IRQ_UART5, |
Kukjin Kim | 2555e66 | 2010-09-01 15:13:44 +0900 | [diff] [blame] | 107 | .flags = IORESOURCE_IRQ, |
| 108 | }, |
| 109 | #endif |
| 110 | }; |
| 111 | |
Kukjin Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 112 | struct 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 Kim | 2555e66 | 2010-09-01 15:13:44 +0900 | [diff] [blame] | 129 | [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 Kim | 501dae9 | 2010-01-14 08:23:53 +0900 | [diff] [blame] | 137 | }; |