aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-bf548/boards/cm_bf548.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mach-bf548/boards/cm_bf548.c')
-rw-r--r--arch/blackfin/mach-bf548/boards/cm_bf548.c166
1 files changed, 155 insertions, 11 deletions
diff --git a/arch/blackfin/mach-bf548/boards/cm_bf548.c b/arch/blackfin/mach-bf548/boards/cm_bf548.c
index 24192aaa9275..f53ad682530b 100644
--- a/arch/blackfin/mach-bf548/boards/cm_bf548.c
+++ b/arch/blackfin/mach-bf548/boards/cm_bf548.c
@@ -32,6 +32,7 @@
32#include <linux/platform_device.h> 32#include <linux/platform_device.h>
33#include <linux/mtd/mtd.h> 33#include <linux/mtd/mtd.h>
34#include <linux/mtd/partitions.h> 34#include <linux/mtd/partitions.h>
35#include <linux/mtd/physmap.h>
35#include <linux/spi/spi.h> 36#include <linux/spi/spi.h>
36#include <linux/spi/flash.h> 37#include <linux/spi/flash.h>
37#include <linux/irq.h> 38#include <linux/irq.h>
@@ -42,6 +43,7 @@
42#include <asm/gpio.h> 43#include <asm/gpio.h>
43#include <asm/nand.h> 44#include <asm/nand.h>
44#include <asm/portmux.h> 45#include <asm/portmux.h>
46#include <asm/bfin_sdh.h>
45#include <mach/bf54x_keys.h> 47#include <mach/bf54x_keys.h>
46#include <asm/dpmc.h> 48#include <asm/dpmc.h>
47#include <linux/input.h> 49#include <linux/input.h>
@@ -186,44 +188,107 @@ static struct platform_device bfin_uart_device = {
186#endif 188#endif
187 189
188#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 190#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
189static struct resource bfin_sir_resources[] = {
190#ifdef CONFIG_BFIN_SIR0 191#ifdef CONFIG_BFIN_SIR0
192static struct resource bfin_sir0_resources[] = {
191 { 193 {
192 .start = 0xFFC00400, 194 .start = 0xFFC00400,
193 .end = 0xFFC004FF, 195 .end = 0xFFC004FF,
194 .flags = IORESOURCE_MEM, 196 .flags = IORESOURCE_MEM,
195 }, 197 },
198 {
199 .start = IRQ_UART0_RX,
200 .end = IRQ_UART0_RX+1,
201 .flags = IORESOURCE_IRQ,
202 },
203 {
204 .start = CH_UART0_RX,
205 .end = CH_UART0_RX+1,
206 .flags = IORESOURCE_DMA,
207 },
208};
209static struct platform_device bfin_sir0_device = {
210 .name = "bfin_sir",
211 .id = 0,
212 .num_resources = ARRAY_SIZE(bfin_sir0_resources),
213 .resource = bfin_sir0_resources,
214};
196#endif 215#endif
197#ifdef CONFIG_BFIN_SIR1 216#ifdef CONFIG_BFIN_SIR1
217static struct resource bfin_sir1_resources[] = {
198 { 218 {
199 .start = 0xFFC02000, 219 .start = 0xFFC02000,
200 .end = 0xFFC020FF, 220 .end = 0xFFC020FF,
201 .flags = IORESOURCE_MEM, 221 .flags = IORESOURCE_MEM,
202 }, 222 },
223 {
224 .start = IRQ_UART1_RX,
225 .end = IRQ_UART1_RX+1,
226 .flags = IORESOURCE_IRQ,
227 },
228 {
229 .start = CH_UART1_RX,
230 .end = CH_UART1_RX+1,
231 .flags = IORESOURCE_DMA,
232 },
233};
234static struct platform_device bfin_sir1_device = {
235 .name = "bfin_sir",
236 .id = 1,
237 .num_resources = ARRAY_SIZE(bfin_sir1_resources),
238 .resource = bfin_sir1_resources,
239};
203#endif 240#endif
204#ifdef CONFIG_BFIN_SIR2 241#ifdef CONFIG_BFIN_SIR2
242static struct resource bfin_sir2_resources[] = {
205 { 243 {
206 .start = 0xFFC02100, 244 .start = 0xFFC02100,
207 .end = 0xFFC021FF, 245 .end = 0xFFC021FF,
208 .flags = IORESOURCE_MEM, 246 .flags = IORESOURCE_MEM,
209 }, 247 },
248 {
249 .start = IRQ_UART2_RX,
250 .end = IRQ_UART2_RX+1,
251 .flags = IORESOURCE_IRQ,
252 },
253 {
254 .start = CH_UART2_RX,
255 .end = CH_UART2_RX+1,
256 .flags = IORESOURCE_DMA,
257 },
258};
259static struct platform_device bfin_sir2_device = {
260 .name = "bfin_sir",
261 .id = 2,
262 .num_resources = ARRAY_SIZE(bfin_sir2_resources),
263 .resource = bfin_sir2_resources,
264};
210#endif 265#endif
211#ifdef CONFIG_BFIN_SIR3 266#ifdef CONFIG_BFIN_SIR3
267static struct resource bfin_sir3_resources[] = {
212 { 268 {
213 .start = 0xFFC03100, 269 .start = 0xFFC03100,
214 .end = 0xFFC031FF, 270 .end = 0xFFC031FF,
215 .flags = IORESOURCE_MEM, 271 .flags = IORESOURCE_MEM,
216 }, 272 },
217#endif 273 {
274 .start = IRQ_UART3_RX,
275 .end = IRQ_UART3_RX+1,
276 .flags = IORESOURCE_IRQ,
277 },
278 {
279 .start = CH_UART3_RX,
280 .end = CH_UART3_RX+1,
281 .flags = IORESOURCE_DMA,
282 },
218}; 283};
219 284static struct platform_device bfin_sir3_device = {
220static struct platform_device bfin_sir_device = {
221 .name = "bfin_sir", 285 .name = "bfin_sir",
222 .id = 0, 286 .id = 3,
223 .num_resources = ARRAY_SIZE(bfin_sir_resources), 287 .num_resources = ARRAY_SIZE(bfin_sir3_resources),
224 .resource = bfin_sir_resources, 288 .resource = bfin_sir3_resources,
225}; 289};
226#endif 290#endif
291#endif
227 292
228#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE) 293#if defined(CONFIG_SMSC911X) || defined(CONFIG_SMSC911X_MODULE)
229static struct resource smsc911x_resources[] = { 294static struct resource smsc911x_resources[] = {
@@ -271,8 +336,8 @@ static struct musb_hdrc_config musb_config = {
271 .dyn_fifo = 0, 336 .dyn_fifo = 0,
272 .soft_con = 1, 337 .soft_con = 1,
273 .dma = 1, 338 .dma = 1,
274 .num_eps = 7, 339 .num_eps = 8,
275 .dma_channels = 7, 340 .dma_channels = 8,
276 .gpio_vrsel = GPIO_PH6, 341 .gpio_vrsel = GPIO_PH6,
277}; 342};
278 343
@@ -302,6 +367,19 @@ static struct platform_device musb_device = {
302}; 367};
303#endif 368#endif
304 369
370static struct resource bfin_gpios_resources = {
371 .start = 0,
372 .end = MAX_BLACKFIN_GPIOS - 1,
373 .flags = IORESOURCE_IRQ,
374};
375
376static struct platform_device bfin_gpios_device = {
377 .name = "simple-gpio",
378 .id = -1,
379 .num_resources = 1,
380 .resource = &bfin_gpios_resources,
381};
382
305#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE) 383#if defined(CONFIG_PATA_BF54X) || defined(CONFIG_PATA_BF54X_MODULE)
306static struct resource bfin_atapi_resources[] = { 384static struct resource bfin_atapi_resources[] = {
307 { 385 {
@@ -372,9 +450,58 @@ static struct platform_device bf5xx_nand_device = {
372#endif 450#endif
373 451
374#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE) 452#if defined(CONFIG_SDH_BFIN) || defined(CONFIG_SDH_BFIN_MODULE)
453static struct bfin_sd_host bfin_sdh_data = {
454 .dma_chan = CH_SDH,
455 .irq_int0 = IRQ_SDH_MASK0,
456 .pin_req = {P_SD_D0, P_SD_D1, P_SD_D2, P_SD_D3, P_SD_CLK, P_SD_CMD, 0},
457};
458
375static struct platform_device bf54x_sdh_device = { 459static struct platform_device bf54x_sdh_device = {
376 .name = "bfin-sdh", 460 .name = "bfin-sdh",
377 .id = 0, 461 .id = 0,
462 .dev = {
463 .platform_data = &bfin_sdh_data,
464 },
465};
466#endif
467
468#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
469static struct mtd_partition para_partitions[] = {
470 {
471 .name = "bootloader(nor)",
472 .size = 0x40000,
473 .offset = 0,
474 }, {
475 .name = "linux kernel(nor)",
476 .size = 0x400000,
477 .offset = MTDPART_OFS_APPEND,
478 }, {
479 .name = "file system(nor)",
480 .size = MTDPART_SIZ_FULL,
481 .offset = MTDPART_OFS_APPEND,
482 }
483};
484
485static struct physmap_flash_data para_flash_data = {
486 .width = 2,
487 .parts = para_partitions,
488 .nr_parts = ARRAY_SIZE(para_partitions),
489};
490
491static struct resource para_flash_resource = {
492 .start = 0x20000000,
493 .end = 0x207fffff,
494 .flags = IORESOURCE_MEM,
495};
496
497static struct platform_device para_flash_device = {
498 .name = "physmap-flash",
499 .id = 0,
500 .dev = {
501 .platform_data = &para_flash_data,
502 },
503 .num_resources = 1,
504 .resource = &para_flash_resource,
378}; 505};
379#endif 506#endif
380 507
@@ -642,7 +769,18 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
642#endif 769#endif
643 770
644#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE) 771#if defined(CONFIG_BFIN_SIR) || defined(CONFIG_BFIN_SIR_MODULE)
645 &bfin_sir_device, 772#ifdef CONFIG_BFIN_SIR0
773 &bfin_sir0_device,
774#endif
775#ifdef CONFIG_BFIN_SIR1
776 &bfin_sir1_device,
777#endif
778#ifdef CONFIG_BFIN_SIR2
779 &bfin_sir2_device,
780#endif
781#ifdef CONFIG_BFIN_SIR3
782 &bfin_sir3_device,
783#endif
646#endif 784#endif
647 785
648#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE) 786#if defined(CONFIG_FB_BF54X_LQ043) || defined(CONFIG_FB_BF54X_LQ043_MODULE)
@@ -679,7 +817,7 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
679#endif 817#endif
680 818
681#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE) 819#if defined(CONFIG_I2C_BLACKFIN_TWI) || defined(CONFIG_I2C_BLACKFIN_TWI_MODULE)
682/* &i2c_bfin_twi0_device, */ 820 &i2c_bfin_twi0_device,
683#if !defined(CONFIG_BF542) 821#if !defined(CONFIG_BF542)
684 &i2c_bfin_twi1_device, 822 &i2c_bfin_twi1_device,
685#endif 823#endif
@@ -688,6 +826,12 @@ static struct platform_device *cm_bf548_devices[] __initdata = {
688#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE) 826#if defined(CONFIG_KEYBOARD_GPIO) || defined(CONFIG_KEYBOARD_GPIO_MODULE)
689 &bfin_device_gpiokeys, 827 &bfin_device_gpiokeys,
690#endif 828#endif
829
830#if defined(CONFIG_MTD_PHYSMAP) || defined(CONFIG_MTD_PHYSMAP_MODULE)
831 &para_flash_device,
832#endif
833
834 &bfin_gpios_device,
691}; 835};
692 836
693static int __init cm_bf548_init(void) 837static int __init cm_bf548_init(void)