aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf538
diff options
context:
space:
mode:
authorSonic Zhang <sonic.zhang@analog.com>2009-09-09 06:46:19 -0400
committerMike Frysinger <vapier@gentoo.org>2010-03-09 00:30:45 -0500
commit6bd1fbea2e8bff9346a5afb44ca948b4e4ed74a5 (patch)
tree87019fd6c4fb46bc64d6f0ddaaac32179a6af7e6 /arch/blackfin/mach-bf538
parent57d54889cd00db2752994b389ba714138652e60c (diff)
Blackfin: move on-chip UART resources to boards files
Rather than keeping the pins in the actual driver and worrying about a mess of Kconfig options, declare all the desired pin resources in the boards file. This lets people easily select the specific pins/ports for the normal UART as well as GPIOs for CTS/RTS. Signed-off-by: Sonic Zhang <sonic.zhang@analog.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/mach-bf538')
-rw-r--r--arch/blackfin/mach-bf538/boards/ezkit.c145
1 files changed, 132 insertions, 13 deletions
diff --git a/arch/blackfin/mach-bf538/boards/ezkit.c b/arch/blackfin/mach-bf538/boards/ezkit.c
index c296bb1ed50..1912bc4555a 100644
--- a/arch/blackfin/mach-bf538/boards/ezkit.c
+++ b/arch/blackfin/mach-bf538/boards/ezkit.c
@@ -41,37 +41,148 @@ static struct platform_device rtc_device = {
41#endif 41#endif
42 42
43#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 43#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
44static struct resource bfin_uart_resources[] = {
45#ifdef CONFIG_SERIAL_BFIN_UART0 44#ifdef CONFIG_SERIAL_BFIN_UART0
45static struct resource bfin_uart0_resources[] = {
46 { 46 {
47 .start = 0xFFC00400, 47 .start = UART0_THR,
48 .end = 0xFFC004FF, 48 .end = UART0_GCTL+2,
49 .flags = IORESOURCE_MEM, 49 .flags = IORESOURCE_MEM,
50 }, 50 },
51 {
52 .start = IRQ_UART0_RX,
53 .end = IRQ_UART0_RX+1,
54 .flags = IORESOURCE_IRQ,
55 },
56 {
57 .start = IRQ_UART0_ERROR,
58 .end = IRQ_UART0_ERROR,
59 .flags = IORESOURCE_IRQ,
60 },
61 {
62 .start = CH_UART0_TX,
63 .end = CH_UART0_TX,
64 .flags = IORESOURCE_DMA,
65 },
66 {
67 .start = CH_UART0_RX,
68 .end = CH_UART0_RX,
69 .flags = IORESOURCE_DMA,
70 },
71#ifdef CONFIG_BFIN_UART0_CTSRTS
72 { /* CTS pin */
73 .start = GPIO_PG7,
74 .end = GPIO_PG7,
75 .flags = IORESOURCE_IO,
76 },
77 { /* RTS pin */
78 .start = GPIO_PG6,
79 .end = GPIO_PG6,
80 .flags = IORESOURCE_IO,
81 },
82#endif
83};
84
85unsigned short bfin_uart0_peripherals[] = {
86 P_UART0_TX, P_UART0_RX, 0
87};
88
89static struct platform_device bfin_uart0_device = {
90 .name = "bfin-uart",
91 .id = 0,
92 .num_resources = ARRAY_SIZE(bfin_uart0_resources),
93 .resource = bfin_uart0_resources,
94 .dev = {
95 .platform_data = &bfin_uart0_peripherals, /* Passed to driver */
96 },
97};
51#endif 98#endif
52#ifdef CONFIG_SERIAL_BFIN_UART1 99#ifdef CONFIG_SERIAL_BFIN_UART1
100static struct resource bfin_uart1_resources[] = {
53 { 101 {
54 .start = 0xFFC02000, 102 .start = UART1_THR,
55 .end = 0xFFC020FF, 103 .end = UART1_GCTL+2,
56 .flags = IORESOURCE_MEM, 104 .flags = IORESOURCE_MEM,
57 }, 105 },
106 {
107 .start = IRQ_UART1_RX,
108 .end = IRQ_UART1_RX+1,
109 .flags = IORESOURCE_IRQ,
110 },
111 {
112 .start = IRQ_UART1_ERROR,
113 .end = IRQ_UART1_ERROR,
114 .flags = IORESOURCE_IRQ,
115 },
116 {
117 .start = CH_UART1_TX,
118 .end = CH_UART1_TX,
119 .flags = IORESOURCE_DMA,
120 },
121 {
122 .start = CH_UART1_RX,
123 .end = CH_UART1_RX,
124 .flags = IORESOURCE_DMA,
125 },
126};
127
128unsigned short bfin_uart1_peripherals[] = {
129 P_UART1_TX, P_UART1_RX, 0
130};
131
132static struct platform_device bfin_uart1_device = {
133 .name = "bfin-uart",
134 .id = 1,
135 .num_resources = ARRAY_SIZE(bfin_uart1_resources),
136 .resource = bfin_uart1_resources,
137 .dev = {
138 .platform_data = &bfin_uart1_peripherals, /* Passed to driver */
139 },
140};
58#endif 141#endif
59#ifdef CONFIG_SERIAL_BFIN_UART2 142#ifdef CONFIG_SERIAL_BFIN_UART2
143static struct resource bfin_uart2_resources[] = {
60 { 144 {
61 .start = 0xFFC02100, 145 .start = UART2_THR,
62 .end = 0xFFC021FF, 146 .end = UART2_GCTL+2,
63 .flags = IORESOURCE_MEM, 147 .flags = IORESOURCE_MEM,
64 }, 148 },
65#endif 149 {
150 .start = IRQ_UART2_RX,
151 .end = IRQ_UART2_RX+1,
152 .flags = IORESOURCE_IRQ,
153 },
154 {
155 .start = IRQ_UART2_ERROR,
156 .end = IRQ_UART2_ERROR,
157 .flags = IORESOURCE_IRQ,
158 },
159 {
160 .start = CH_UART2_TX,
161 .end = CH_UART2_TX,
162 .flags = IORESOURCE_DMA,
163 },
164 {
165 .start = CH_UART2_RX,
166 .end = CH_UART2_RX,
167 .flags = IORESOURCE_DMA,
168 },
66}; 169};
67 170
68static struct platform_device bfin_uart_device = { 171unsigned short bfin_uart2_peripherals[] = {
172 P_UART2_TX, P_UART2_RX, 0
173};
174
175static struct platform_device bfin_uart2_device = {
69 .name = "bfin-uart", 176 .name = "bfin-uart",
70 .id = 1, 177 .id = 2,
71 .num_resources = ARRAY_SIZE(bfin_uart_resources), 178 .num_resources = ARRAY_SIZE(bfin_uart2_resources),
72 .resource = bfin_uart_resources, 179 .resource = bfin_uart2_resources,
180 .dev = {
181 .platform_data = &bfin_uart2_peripherals, /* Passed to driver */
182 },
73}; 183};
74#endif 184#endif
185#endif
75 186
76#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 187#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
77#ifdef CONFIG_BFIN_SIR0 188#ifdef CONFIG_BFIN_SIR0
@@ -622,7 +733,15 @@ static struct platform_device *cm_bf538_devices[] __initdata = {
622#endif 733#endif
623 734
624#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) 735#if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE)
625 &bfin_uart_device, 736#ifdef CONFIG_SERIAL_BFIN_UART0
737 &bfin_uart0_device,
738#endif
739#ifdef CONFIG_SERIAL_BFIN_UART1
740 &bfin_uart1_device,
741#endif
742#ifdef CONFIG_SERIAL_BFIN_UART2
743 &bfin_uart2_device,
744#endif
626#endif 745#endif
627 746
628#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE) 747#if defined(CONFIG_SPI_BFIN) || defined(CONFIG_SPI_BFIN_MODULE)