diff options
Diffstat (limited to 'arch/blackfin/mach-bf533/boards/ip0x.c')
-rw-r--r-- | arch/blackfin/mach-bf533/boards/ip0x.c | 63 |
1 files changed, 55 insertions, 8 deletions
diff --git a/arch/blackfin/mach-bf533/boards/ip0x.c b/arch/blackfin/mach-bf533/boards/ip0x.c index 8ec42ba35b9e..7349970db978 100644 --- a/arch/blackfin/mach-bf533/boards/ip0x.c +++ b/arch/blackfin/mach-bf533/boards/ip0x.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/usb/isp1362.h> | 19 | #include <linux/usb/isp1362.h> |
20 | #endif | 20 | #endif |
21 | #include <asm/irq.h> | 21 | #include <asm/irq.h> |
22 | #include <asm/dma.h> | ||
22 | #include <asm/bfin5xx_spi.h> | 23 | #include <asm/bfin5xx_spi.h> |
23 | #include <asm/portmux.h> | 24 | #include <asm/portmux.h> |
24 | 25 | ||
@@ -143,21 +144,50 @@ static struct platform_device spi_bfin_master_device = { | |||
143 | #endif /* spi master and devices */ | 144 | #endif /* spi master and devices */ |
144 | 145 | ||
145 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 146 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
146 | static struct resource bfin_uart_resources[] = { | 147 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
148 | static struct resource bfin_uart0_resources[] = { | ||
147 | { | 149 | { |
148 | .start = 0xFFC00400, | 150 | .start = BFIN_UART_THR, |
149 | .end = 0xFFC004FF, | 151 | .end = BFIN_UART_GCTL+2, |
150 | .flags = IORESOURCE_MEM, | 152 | .flags = IORESOURCE_MEM, |
151 | }, | 153 | }, |
154 | { | ||
155 | .start = IRQ_UART0_RX, | ||
156 | .end = IRQ_UART0_RX + 1, | ||
157 | .flags = IORESOURCE_IRQ, | ||
158 | }, | ||
159 | { | ||
160 | .start = IRQ_UART0_ERROR, | ||
161 | .end = IRQ_UART0_ERROR, | ||
162 | .flags = IORESOURCE_IRQ, | ||
163 | }, | ||
164 | { | ||
165 | .start = CH_UART0_TX, | ||
166 | .end = CH_UART0_TX, | ||
167 | .flags = IORESOURCE_DMA, | ||
168 | }, | ||
169 | { | ||
170 | .start = CH_UART0_RX, | ||
171 | .end = CH_UART0_RX, | ||
172 | .flags = IORESOURCE_DMA, | ||
173 | }, | ||
174 | }; | ||
175 | |||
176 | unsigned short bfin_uart0_peripherals[] = { | ||
177 | P_UART0_TX, P_UART0_RX, 0 | ||
152 | }; | 178 | }; |
153 | 179 | ||
154 | static struct platform_device bfin_uart_device = { | 180 | static struct platform_device bfin_uart0_device = { |
155 | .name = "bfin-uart", | 181 | .name = "bfin-uart", |
156 | .id = 1, | 182 | .id = 0, |
157 | .num_resources = ARRAY_SIZE(bfin_uart_resources), | 183 | .num_resources = ARRAY_SIZE(bfin_uart0_resources), |
158 | .resource = bfin_uart_resources, | 184 | .resource = bfin_uart0_resources, |
185 | .dev = { | ||
186 | .platform_data = &bfin_uart0_peripherals, /* Passed to driver */ | ||
187 | }, | ||
159 | }; | 188 | }; |
160 | #endif | 189 | #endif |
190 | #endif | ||
161 | 191 | ||
162 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 192 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
163 | #ifdef CONFIG_BFIN_SIR0 | 193 | #ifdef CONFIG_BFIN_SIR0 |
@@ -241,7 +271,9 @@ static struct platform_device *ip0x_devices[] __initdata = { | |||
241 | #endif | 271 | #endif |
242 | 272 | ||
243 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) | 273 | #if defined(CONFIG_SERIAL_BFIN) || defined(CONFIG_SERIAL_BFIN_MODULE) |
244 | &bfin_uart_device, | 274 | #ifdef CONFIG_SERIAL_BFIN_UART0 |
275 | &bfin_uart0_device, | ||
276 | #endif | ||
245 | #endif | 277 | #endif |
246 | 278 | ||
247 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) | 279 | #if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) |
@@ -276,3 +308,18 @@ static int __init ip0x_init(void) | |||
276 | } | 308 | } |
277 | 309 | ||
278 | arch_initcall(ip0x_init); | 310 | arch_initcall(ip0x_init); |
311 | |||
312 | static struct platform_device *ip0x_early_devices[] __initdata = { | ||
313 | #if defined(CONFIG_SERIAL_BFIN_CONSOLE) || defined(CONFIG_EARLY_PRINTK) | ||
314 | #ifdef CONFIG_SERIAL_BFIN_UART0 | ||
315 | &bfin_uart0_device, | ||
316 | #endif | ||
317 | #endif | ||
318 | }; | ||
319 | |||
320 | void __init native_machine_early_platform_add_devices(void) | ||
321 | { | ||
322 | printk(KERN_INFO "register early platform devices\n"); | ||
323 | early_platform_add_devices(ip0x_early_devices, | ||
324 | ARRAY_SIZE(ip0x_early_devices)); | ||
325 | } | ||