diff options
Diffstat (limited to 'arch/blackfin/mach-bf548/boards/cm_bf548.c')
-rw-r--r-- | arch/blackfin/mach-bf548/boards/cm_bf548.c | 399 |
1 files changed, 385 insertions, 14 deletions
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c index ccdcd6da2e9f..f60c333fec66 100644 --- a/arch/blackfin/mach-bf548/boards/cm_bf548.c +++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c | |||
@@ -127,44 +127,211 @@ static struct platform_device rtc_device = { | |||
127 | #endif | 127 | #endif |
128 | 128 | ||
129 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 129 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
130 | static struct resource bfin_uart_resources[] = { | ||
131 | #ifdef CONFIG_SERIAL_BFIN_UART0 | 130 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
131 | static struct resource bfin_uart0_resources[] = { | ||
132 | { | 132 | { |
133 | .start = 0xFFC00400, | 133 | .start = UART0_DLL, |
134 | .end = 0xFFC004FF, | 134 | .end = UART0_RBR+2, |
135 | .flags = IORESOURCE_MEM, | 135 | .flags = IORESOURCE_MEM, |
136 | }, | 136 | }, |
137 | { | ||
138 | .start = IRQ_UART0_RX, | ||
139 | .end = IRQ_UART0_RX+1, | ||
140 | .flags = IORESOURCE_IRQ, | ||
141 | }, | ||
142 | { | ||
143 | .start = IRQ_UART0_ERROR, | ||
144 | .end = IRQ_UART0_ERROR, | ||
145 | .flags = IORESOURCE_IRQ, | ||
146 | }, | ||
147 | { | ||
148 | .start = CH_UART0_TX, | ||
149 | .end = CH_UART0_TX, | ||
150 | .flags = IORESOURCE_DMA, | ||
151 | }, | ||
152 | { | ||
153 | .start = CH_UART0_RX, | ||
154 | .end = CH_UART0_RX, | ||
155 | .flags = IORESOURCE_DMA, | ||
156 | }, | ||
157 | }; | ||
158 | |||
159 | unsigned short bfin_uart0_peripherals[] = { | ||
160 | P_UART0_TX, P_UART0_RX, 0 | ||
161 | }; | ||
162 | |||
163 | static struct platform_device bfin_uart0_device = { | ||
164 | .name = "bfin-uart", | ||
165 | .id = 0, | ||
166 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), | ||
167 | .resource = bfin_uart0_resources, | ||
168 | .dev = { | ||
169 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
170 | }, | ||
171 | }; | ||
137 | #endif | 172 | #endif |
138 | #ifdef CONFIG_SERIAL_BFIN_UART1 | 173 | #ifdef CONFIG_SERIAL_BFIN_UART1 |
174 | static struct resource bfin_uart1_resources[] = { | ||
139 | { | 175 | { |
140 | .start = 0xFFC02000, | 176 | .start = UART1_DLL, |
141 | .end = 0xFFC020FF, | 177 | .end = UART1_RBR+2, |
142 | .flags = IORESOURCE_MEM, | 178 | .flags = IORESOURCE_MEM, |
143 | }, | 179 | }, |
180 | { | ||
181 | .start = IRQ_UART1_RX, | ||
182 | .end = IRQ_UART1_RX+1, | ||
183 | .flags = IORESOURCE_IRQ, | ||
184 | }, | ||
185 | { | ||
186 | .start = IRQ_UART1_ERROR, | ||
187 | .end = IRQ_UART1_ERROR, | ||
188 | .flags = IORESOURCE_IRQ, | ||
189 | }, | ||
190 | { | ||
191 | .start = CH_UART1_TX, | ||
192 | .end = CH_UART1_TX, | ||
193 | .flags = IORESOURCE_DMA, | ||
194 | }, | ||
195 | { | ||
196 | .start = CH_UART1_RX, | ||
197 | .end = CH_UART1_RX, | ||
198 | .flags = IORESOURCE_DMA, | ||
199 | }, | ||
200 | #ifdef CONFIG_BFIN_UART1_CTSRTS | ||
201 | { /* CTS pin -- 0 means not supported */ | ||
202 | .start = GPIO_PE10, | ||
203 | .end = GPIO_PE10, | ||
204 | .flags = IORESOURCE_IO, | ||
205 | }, | ||
206 | { /* RTS pin -- 0 means not supported */ | ||
207 | .start = GPIO_PE9, | ||
208 | .end = GPIO_PE9, | ||
209 | .flags = IORESOURCE_IO, | ||
210 | }, | ||
211 | #endif | ||
212 | }; | ||
213 | |||
214 | unsigned short bfin_uart1_peripherals[] = { | ||
215 | P_UART1_TX, P_UART1_RX, | ||
216 | #ifdef CONFIG_BFIN_UART1_CTSRTS | ||
217 | P_UART1_RTS, P_UART1_CTS, | ||
218 | #endif | ||
219 | 0 | ||
220 | }; | ||
221 | |||
222 | static struct platform_device bfin_uart1_device = { | ||
223 | .name = "bfin-uart", | ||
224 | .id = 1, | ||
225 | .num_resources = ARRAY_SIZE(bfin_uart1_resources), | ||
226 | .resource = bfin_uart1_resources, | ||
227 | .dev = { | ||
228 | .platform_data = &bfin_uart1_peripherals, /* Passed to driver */ | ||
229 | }, | ||
230 | }; | ||
144 | #endif | 231 | #endif |
145 | #ifdef CONFIG_SERIAL_BFIN_UART2 | 232 | #ifdef CONFIG_SERIAL_BFIN_UART2 |
233 | static struct resource bfin_uart2_resources[] = { | ||
146 | { | 234 | { |
147 | .start = 0xFFC02100, | 235 | .start = UART2_DLL, |
148 | .end = 0xFFC021FF, | 236 | .end = UART2_RBR+2, |
149 | .flags = IORESOURCE_MEM, | 237 | .flags = IORESOURCE_MEM, |
150 | }, | 238 | }, |
239 | { | ||
240 | .start = IRQ_UART2_RX, | ||
241 | .end = IRQ_UART2_RX+1, | ||
242 | .flags = IORESOURCE_IRQ, | ||
243 | }, | ||
244 | { | ||
245 | .start = IRQ_UART2_ERROR, | ||
246 | .end = IRQ_UART2_ERROR, | ||
247 | .flags = IORESOURCE_IRQ, | ||
248 | }, | ||
249 | { | ||
250 | .start = CH_UART2_TX, | ||
251 | .end = CH_UART2_TX, | ||
252 | .flags = IORESOURCE_DMA, | ||
253 | }, | ||
254 | { | ||
255 | .start = CH_UART2_RX, | ||
256 | .end = CH_UART2_RX, | ||
257 | .flags = IORESOURCE_DMA, | ||
258 | }, | ||
259 | }; | ||
260 | |||
261 | unsigned short bfin_uart2_peripherals[] = { | ||
262 | P_UART2_TX, P_UART2_RX, 0 | ||
263 | }; | ||
264 | |||
265 | static struct platform_device bfin_uart2_device = { | ||
266 | .name = "bfin-uart", | ||
267 | .id = 2, | ||
268 | .num_resources = ARRAY_SIZE(bfin_uart2_resources), | ||
269 | .resource = bfin_uart2_resources, | ||
270 | .dev = { | ||
271 | .platform_data = &bfin_uart2_peripherals, /* Passed to driver */ | ||
272 | }, | ||
273 | }; | ||
151 | #endif | 274 | #endif |
152 | #ifdef CONFIG_SERIAL_BFIN_UART3 | 275 | #ifdef CONFIG_SERIAL_BFIN_UART3 |
276 | static struct resource bfin_uart3_resources[] = { | ||
153 | { | 277 | { |
154 | .start = 0xFFC03100, | 278 | .start = UART3_DLL, |
155 | .end = 0xFFC031FF, | 279 | .end = UART3_RBR+2, |
156 | .flags = IORESOURCE_MEM, | 280 | .flags = IORESOURCE_MEM, |
157 | }, | 281 | }, |
282 | { | ||
283 | .start = IRQ_UART3_RX, | ||
284 | .end = IRQ_UART3_RX+1, | ||
285 | .flags = IORESOURCE_IRQ, | ||
286 | }, | ||
287 | { | ||
288 | .start = IRQ_UART3_ERROR, | ||
289 | .end = IRQ_UART3_ERROR, | ||
290 | .flags = IORESOURCE_IRQ, | ||
291 | }, | ||
292 | { | ||
293 | .start = CH_UART3_TX, | ||
294 | .end = CH_UART3_TX, | ||
295 | .flags = IORESOURCE_DMA, | ||
296 | }, | ||
297 | { | ||
298 | .start = CH_UART3_RX, | ||
299 | .end = CH_UART3_RX, | ||
300 | .flags = IORESOURCE_DMA, | ||
301 | }, | ||
302 | #ifdef CONFIG_BFIN_UART3_CTSRTS | ||
303 | { /* CTS pin -- 0 means not supported */ | ||
304 | .start = GPIO_PB3, | ||
305 | .end = GPIO_PB3, | ||
306 | .flags = IORESOURCE_IO, | ||
307 | }, | ||
308 | { /* RTS pin -- 0 means not supported */ | ||
309 | .start = GPIO_PB2, | ||
310 | .end = GPIO_PB2, | ||
311 | .flags = IORESOURCE_IO, | ||
312 | }, | ||
158 | #endif | 313 | #endif |
159 | }; | 314 | }; |
160 | 315 | ||
161 | static struct platform_device bfin_uart_device = { | 316 | unsigned short bfin_uart3_peripherals[] = { |
317 | P_UART3_TX, P_UART3_RX, | ||
318 | #ifdef CONFIG_BFIN_UART3_CTSRTS | ||
319 | P_UART3_RTS, P_UART3_CTS, | ||
320 | #endif | ||
321 | 0 | ||
322 | }; | ||
323 | |||
324 | static struct platform_device bfin_uart3_device = { | ||
162 | .name = "bfin-uart", | 325 | .name = "bfin-uart", |
163 | .id = 1, | 326 | .id = 3, |
164 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 327 | .num_resources = ARRAY_SIZE(bfin_uart3_resources), |
165 | .resource = bfin_uart_resources, | 328 | .resource = bfin_uart3_resources, |
329 | .dev = { | ||
330 | .platform_data = &bfin_uart3_peripherals, /* Passed to driver */ | ||
331 | }, | ||
166 | }; | 332 | }; |
167 | #endif | 333 | #endif |
334 | #endif | ||
168 | 335 | ||
169 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 336 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
170 | #ifdef CONFIG_BFIN_SIR0 | 337 | #ifdef CONFIG_BFIN_SIR0 |
@@ -359,6 +526,145 @@ static struct platform_device musb_device = { | |||
359 | }; | 526 | }; |
360 | #endif | 527 | #endif |
361 | 528 | ||
529 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
530 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
531 | static struct resource bfin_sport0_uart_resources[] = { | ||
532 | { | ||
533 | .start = SPORT0_TCR1, | ||
534 | .end = SPORT0_MRCS3+4, | ||
535 | .flags = IORESOURCE_MEM, | ||
536 | }, | ||
537 | { | ||
538 | .start = IRQ_SPORT0_RX, | ||
539 | .end = IRQ_SPORT0_RX+1, | ||
540 | .flags = IORESOURCE_IRQ, | ||
541 | }, | ||
542 | { | ||
543 | .start = IRQ_SPORT0_ERROR, | ||
544 | .end = IRQ_SPORT0_ERROR, | ||
545 | .flags = IORESOURCE_IRQ, | ||
546 | }, | ||
547 | }; | ||
548 | |||
549 | unsigned short bfin_sport0_peripherals[] = { | ||
550 | P_SPORT0_TFS, P_SPORT0_DTPRI, P_SPORT0_TSCLK, P_SPORT0_RFS, | ||
551 | P_SPORT0_DRPRI, P_SPORT0_RSCLK, P_SPORT0_DRSEC, P_SPORT0_DTSEC, 0 | ||
552 | }; | ||
553 | |||
554 | static struct platform_device bfin_sport0_uart_device = { | ||
555 | .name = "bfin-sport-uart", | ||
556 | .id = 0, | ||
557 | .num_resources = ARRAY_SIZE(bfin_sport0_uart_resources), | ||
558 | .resource = bfin_sport0_uart_resources, | ||
559 | .dev = { | ||
560 | .platform_data = &bfin_sport0_peripherals, /* Passed to driver */ | ||
561 | }, | ||
562 | }; | ||
563 | #endif | ||
564 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
565 | static struct resource bfin_sport1_uart_resources[] = { | ||
566 | { | ||
567 | .start = SPORT1_TCR1, | ||
568 | .end = SPORT1_MRCS3+4, | ||
569 | .flags = IORESOURCE_MEM, | ||
570 | }, | ||
571 | { | ||
572 | .start = IRQ_SPORT1_RX, | ||
573 | .end = IRQ_SPORT1_RX+1, | ||
574 | .flags = IORESOURCE_IRQ, | ||
575 | }, | ||
576 | { | ||
577 | .start = IRQ_SPORT1_ERROR, | ||
578 | .end = IRQ_SPORT1_ERROR, | ||
579 | .flags = IORESOURCE_IRQ, | ||
580 | }, | ||
581 | }; | ||
582 | |||
583 | unsigned short bfin_sport1_peripherals[] = { | ||
584 | P_SPORT1_TFS, P_SPORT1_DTPRI, P_SPORT1_TSCLK, P_SPORT1_RFS, | ||
585 | P_SPORT1_DRPRI, P_SPORT1_RSCLK, P_SPORT1_DRSEC, P_SPORT1_DTSEC, 0 | ||
586 | }; | ||
587 | |||
588 | static struct platform_device bfin_sport1_uart_device = { | ||
589 | .name = "bfin-sport-uart", | ||
590 | .id = 1, | ||
591 | .num_resources = ARRAY_SIZE(bfin_sport1_uart_resources), | ||
592 | .resource = bfin_sport1_uart_resources, | ||
593 | .dev = { | ||
594 | .platform_data = &bfin_sport1_peripherals, /* Passed to driver */ | ||
595 | }, | ||
596 | }; | ||
597 | #endif | ||
598 | #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART | ||
599 | static struct resource bfin_sport2_uart_resources[] = { | ||
600 | { | ||
601 | .start = SPORT2_TCR1, | ||
602 | .end = SPORT2_MRCS3+4, | ||
603 | .flags = IORESOURCE_MEM, | ||
604 | }, | ||
605 | { | ||
606 | .start = IRQ_SPORT2_RX, | ||
607 | .end = IRQ_SPORT2_RX+1, | ||
608 | .flags = IORESOURCE_IRQ, | ||
609 | }, | ||
610 | { | ||
611 | .start = IRQ_SPORT2_ERROR, | ||
612 | .end = IRQ_SPORT2_ERROR, | ||
613 | .flags = IORESOURCE_IRQ, | ||
614 | }, | ||
615 | }; | ||
616 | |||
617 | unsigned short bfin_sport2_peripherals[] = { | ||
618 | P_SPORT2_TFS, P_SPORT2_DTPRI, P_SPORT2_TSCLK, P_SPORT2_RFS, | ||
619 | P_SPORT2_DRPRI, P_SPORT2_RSCLK, P_SPORT2_DRSEC, P_SPORT2_DTSEC, 0 | ||
620 | }; | ||
621 | |||
622 | static struct platform_device bfin_sport2_uart_device = { | ||
623 | .name = "bfin-sport-uart", | ||
624 | .id = 2, | ||
625 | .num_resources = ARRAY_SIZE(bfin_sport2_uart_resources), | ||
626 | .resource = bfin_sport2_uart_resources, | ||
627 | .dev = { | ||
628 | .platform_data = &bfin_sport2_peripherals, /* Passed to driver */ | ||
629 | }, | ||
630 | }; | ||
631 | #endif | ||
632 | #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART | ||
633 | static struct resource bfin_sport3_uart_resources[] = { | ||
634 | { | ||
635 | .start = SPORT3_TCR1, | ||
636 | .end = SPORT3_MRCS3+4, | ||
637 | .flags = IORESOURCE_MEM, | ||
638 | }, | ||
639 | { | ||
640 | .start = IRQ_SPORT3_RX, | ||
641 | .end = IRQ_SPORT3_RX+1, | ||
642 | .flags = IORESOURCE_IRQ, | ||
643 | }, | ||
644 | { | ||
645 | .start = IRQ_SPORT3_ERROR, | ||
646 | .end = IRQ_SPORT3_ERROR, | ||
647 | .flags = IORESOURCE_IRQ, | ||
648 | }, | ||
649 | }; | ||
650 | |||
651 | unsigned short bfin_sport3_peripherals[] = { | ||
652 | P_SPORT3_TFS, P_SPORT3_DTPRI, P_SPORT3_TSCLK, P_SPORT3_RFS, | ||
653 | P_SPORT3_DRPRI, P_SPORT3_RSCLK, P_SPORT3_DRSEC, P_SPORT3_DTSEC, 0 | ||
654 | }; | ||
655 | |||
656 | static struct platform_device bfin_sport3_uart_device = { | ||
657 | .name = "bfin-sport-uart", | ||
658 | .id = 3, | ||
659 | .num_resources = ARRAY_SIZE(bfin_sport3_uart_resources), | ||
660 | .resource = bfin_sport3_uart_resources, | ||
661 | .dev = { | ||
662 | .platform_data = &bfin_sport3_peripherals, /* Passed to driver */ | ||
663 | }, | ||
664 | }; | ||
665 | #endif | ||
666 | #endif | ||
667 | |||
362 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) | 668 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) |
363 | static struct resource bfin_atapi_resources[] = { | 669 | static struct resource bfin_atapi_resources[] = { |
364 | { | 670 | { |
@@ -752,7 +1058,18 @@ static struct platform_device *cm_bf548_devices[] __initdata = { | |||
752 | #endif | 1058 | #endif |
753 | 1059 | ||
754 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 1060 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
755 | &bfin_uart_device, | 1061 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
1062 | &bfin_uart0_device, | ||
1063 | #endif | ||
1064 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
1065 | &bfin_uart1_device, | ||
1066 | #endif | ||
1067 | #ifdef CONFIG_SERIAL_BFIN_UART2 | ||
1068 | &bfin_uart2_device, | ||
1069 | #endif | ||
1070 | #ifdef CONFIG_SERIAL_BFIN_UART3 | ||
1071 | &bfin_uart3_device, | ||
1072 | #endif | ||
756 | #endif | 1073 | #endif |
757 | 1074 | ||
758 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 1075 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
@@ -782,6 +1099,21 @@ static struct platform_device *cm_bf548_devices[] __initdata = { | |||
782 | &musb_device, | 1099 | &musb_device, |
783 | #endif | 1100 | #endif |
784 | 1101 | ||
1102 | #if defined(CONFIG_SERIAL_BFIN_SPORT) || defined(CONFIG_SERIAL_BFIN_SPORT_MODULE) | ||
1103 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
1104 | &bfin_sport0_uart_device, | ||
1105 | #endif | ||
1106 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
1107 | &bfin_sport1_uart_device, | ||
1108 | #endif | ||
1109 | #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART | ||
1110 | &bfin_sport2_uart_device, | ||
1111 | #endif | ||
1112 | #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART | ||
1113 | &bfin_sport3_uart_device, | ||
1114 | #endif | ||
1115 | #endif | ||
1116 | |||
785 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) | 1117 | #if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) |
786 | &bfin_atapi_device, | 1118 | &bfin_atapi_device, |
787 | #endif | 1119 | #endif |
@@ -833,3 +1165,42 @@ static int __init cm_bf548_init(void) | |||
833 | } | 1165 | } |
834 | 1166 | ||
835 | arch_initcall(cm_bf548_init); | 1167 | arch_initcall(cm_bf548_init); |
1168 | |||
1169 | static struct platform_device *cm_bf548_early_devices[] __initdata = { | ||
1170 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
1171 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
1172 | &bfin_uart0_device, | ||
1173 | #endif | ||
1174 | #ifdef CONFIG_SERIAL_BFIN_UART1 | ||
1175 | &bfin_uart1_device, | ||
1176 | #endif | ||
1177 | #ifdef CONFIG_SERIAL_BFIN_UART2 | ||
1178 | &bfin_uart2_device, | ||
1179 | #endif | ||
1180 | #ifdef CONFIG_SERIAL_BFIN_UART3 | ||
1181 | &bfin_uart3_device, | ||
1182 | #endif | ||
1183 | #endif | ||
1184 | |||
1185 | #if defined(CONFIG_SERIAL_BFIN_SPORT_CONSOLE) | ||
1186 | #ifdef CONFIG_SERIAL_BFIN_SPORT0_UART | ||
1187 | &bfin_sport0_uart_device, | ||
1188 | #endif | ||
1189 | #ifdef CONFIG_SERIAL_BFIN_SPORT1_UART | ||
1190 | &bfin_sport1_uart_device, | ||
1191 | #endif | ||
1192 | #ifdef CONFIG_SERIAL_BFIN_SPORT2_UART | ||
1193 | &bfin_sport2_uart_device, | ||
1194 | #endif | ||
1195 | #ifdef CONFIG_SERIAL_BFIN_SPORT3_UART | ||
1196 | &bfin_sport3_uart_device, | ||
1197 | #endif | ||
1198 | #endif | ||
1199 | }; | ||
1200 | |||
1201 | void __init native_machine_early_platform_add_devices(void) | ||
1202 | { | ||
1203 | printk(KERN_INFO "register early platform devices\n"); | ||
1204 | early_platform_add_devices(cm_bf548_early_devices, | ||
1205 | ARRAY_SIZE(cm_bf548_early_devices)); | ||
1206 | } | ||