diff options
Diffstat (limited to 'arch/mips/alchemy/devboards/db1200/platform.c')
-rw-r--r-- | arch/mips/alchemy/devboards/db1200/platform.c | 153 |
1 files changed, 109 insertions, 44 deletions
diff --git a/arch/mips/alchemy/devboards/db1200/platform.c b/arch/mips/alchemy/devboards/db1200/platform.c index dda090bf74e6..c61867c93c4a 100644 --- a/arch/mips/alchemy/devboards/db1200/platform.c +++ b/arch/mips/alchemy/devboards/db1200/platform.c | |||
@@ -213,7 +213,12 @@ static struct resource db1200_ide_res[] = { | |||
213 | .start = DB1200_IDE_INT, | 213 | .start = DB1200_IDE_INT, |
214 | .end = DB1200_IDE_INT, | 214 | .end = DB1200_IDE_INT, |
215 | .flags = IORESOURCE_IRQ, | 215 | .flags = IORESOURCE_IRQ, |
216 | } | 216 | }, |
217 | [2] = { | ||
218 | .start = AU1200_DSCR_CMD0_DMA_REQ1, | ||
219 | .end = AU1200_DSCR_CMD0_DMA_REQ1, | ||
220 | .flags = IORESOURCE_DMA, | ||
221 | }, | ||
217 | }; | 222 | }; |
218 | 223 | ||
219 | static u64 ide_dmamask = DMA_BIT_MASK(32); | 224 | static u64 ide_dmamask = DMA_BIT_MASK(32); |
@@ -328,23 +333,85 @@ static struct led_classdev db1200_mmc_led = { | |||
328 | .brightness_set = db1200_mmcled_set, | 333 | .brightness_set = db1200_mmcled_set, |
329 | }; | 334 | }; |
330 | 335 | ||
331 | /* needed by arch/mips/alchemy/common/platform.c */ | 336 | static struct au1xmmc_platform_data db1200mmc_platdata = { |
332 | struct au1xmmc_platform_data au1xmmc_platdata[] = { | 337 | .cd_setup = db1200_mmc_cd_setup, |
338 | .set_power = db1200_mmc_set_power, | ||
339 | .card_inserted = db1200_mmc_card_inserted, | ||
340 | .card_readonly = db1200_mmc_card_readonly, | ||
341 | .led = &db1200_mmc_led, | ||
342 | }; | ||
343 | |||
344 | static struct resource au1200_mmc0_resources[] = { | ||
333 | [0] = { | 345 | [0] = { |
334 | .cd_setup = db1200_mmc_cd_setup, | 346 | .start = AU1100_SD0_PHYS_ADDR, |
335 | .set_power = db1200_mmc_set_power, | 347 | .end = AU1100_SD0_PHYS_ADDR + 0xfff, |
336 | .card_inserted = db1200_mmc_card_inserted, | 348 | .flags = IORESOURCE_MEM, |
337 | .card_readonly = db1200_mmc_card_readonly, | 349 | }, |
338 | .led = &db1200_mmc_led, | 350 | [1] = { |
351 | .start = AU1200_SD_INT, | ||
352 | .end = AU1200_SD_INT, | ||
353 | .flags = IORESOURCE_IRQ, | ||
354 | }, | ||
355 | [2] = { | ||
356 | .start = AU1200_DSCR_CMD0_SDMS_TX0, | ||
357 | .end = AU1200_DSCR_CMD0_SDMS_TX0, | ||
358 | .flags = IORESOURCE_DMA, | ||
359 | }, | ||
360 | [3] = { | ||
361 | .start = AU1200_DSCR_CMD0_SDMS_RX0, | ||
362 | .end = AU1200_DSCR_CMD0_SDMS_RX0, | ||
363 | .flags = IORESOURCE_DMA, | ||
364 | } | ||
365 | }; | ||
366 | |||
367 | static u64 au1xxx_mmc_dmamask = DMA_BIT_MASK(32); | ||
368 | |||
369 | static struct platform_device db1200_mmc0_dev = { | ||
370 | .name = "au1xxx-mmc", | ||
371 | .id = 0, | ||
372 | .dev = { | ||
373 | .dma_mask = &au1xxx_mmc_dmamask, | ||
374 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
375 | .platform_data = &db1200mmc_platdata, | ||
376 | }, | ||
377 | .num_resources = ARRAY_SIZE(au1200_mmc0_resources), | ||
378 | .resource = au1200_mmc0_resources, | ||
379 | }; | ||
380 | |||
381 | /**********************************************************************/ | ||
382 | |||
383 | static struct resource au1200_lcd_res[] = { | ||
384 | [0] = { | ||
385 | .start = AU1200_LCD_PHYS_ADDR, | ||
386 | .end = AU1200_LCD_PHYS_ADDR + 0x800 - 1, | ||
387 | .flags = IORESOURCE_MEM, | ||
388 | }, | ||
389 | [1] = { | ||
390 | .start = AU1200_LCD_INT, | ||
391 | .end = AU1200_LCD_INT, | ||
392 | .flags = IORESOURCE_IRQ, | ||
393 | } | ||
394 | }; | ||
395 | |||
396 | static u64 au1200_lcd_dmamask = DMA_BIT_MASK(32); | ||
397 | |||
398 | static struct platform_device au1200_lcd_dev = { | ||
399 | .name = "au1200-lcd", | ||
400 | .id = 0, | ||
401 | .dev = { | ||
402 | .dma_mask = &au1200_lcd_dmamask, | ||
403 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
339 | }, | 404 | }, |
405 | .num_resources = ARRAY_SIZE(au1200_lcd_res), | ||
406 | .resource = au1200_lcd_res, | ||
340 | }; | 407 | }; |
341 | 408 | ||
342 | /**********************************************************************/ | 409 | /**********************************************************************/ |
343 | 410 | ||
344 | static struct resource au1200_psc0_res[] = { | 411 | static struct resource au1200_psc0_res[] = { |
345 | [0] = { | 412 | [0] = { |
346 | .start = PSC0_PHYS_ADDR, | 413 | .start = AU1550_PSC0_PHYS_ADDR, |
347 | .end = PSC0_PHYS_ADDR + 0x000fffff, | 414 | .end = AU1550_PSC0_PHYS_ADDR + 0xfff, |
348 | .flags = IORESOURCE_MEM, | 415 | .flags = IORESOURCE_MEM, |
349 | }, | 416 | }, |
350 | [1] = { | 417 | [1] = { |
@@ -353,13 +420,13 @@ static struct resource au1200_psc0_res[] = { | |||
353 | .flags = IORESOURCE_IRQ, | 420 | .flags = IORESOURCE_IRQ, |
354 | }, | 421 | }, |
355 | [2] = { | 422 | [2] = { |
356 | .start = DSCR_CMD0_PSC0_TX, | 423 | .start = AU1200_DSCR_CMD0_PSC0_TX, |
357 | .end = DSCR_CMD0_PSC0_TX, | 424 | .end = AU1200_DSCR_CMD0_PSC0_TX, |
358 | .flags = IORESOURCE_DMA, | 425 | .flags = IORESOURCE_DMA, |
359 | }, | 426 | }, |
360 | [3] = { | 427 | [3] = { |
361 | .start = DSCR_CMD0_PSC0_RX, | 428 | .start = AU1200_DSCR_CMD0_PSC0_RX, |
362 | .end = DSCR_CMD0_PSC0_RX, | 429 | .end = AU1200_DSCR_CMD0_PSC0_RX, |
363 | .flags = IORESOURCE_DMA, | 430 | .flags = IORESOURCE_DMA, |
364 | }, | 431 | }, |
365 | }; | 432 | }; |
@@ -401,8 +468,8 @@ static struct platform_device db1200_spi_dev = { | |||
401 | 468 | ||
402 | static struct resource au1200_psc1_res[] = { | 469 | static struct resource au1200_psc1_res[] = { |
403 | [0] = { | 470 | [0] = { |
404 | .start = PSC1_PHYS_ADDR, | 471 | .start = AU1550_PSC1_PHYS_ADDR, |
405 | .end = PSC1_PHYS_ADDR + 0x000fffff, | 472 | .end = AU1550_PSC1_PHYS_ADDR + 0xfff, |
406 | .flags = IORESOURCE_MEM, | 473 | .flags = IORESOURCE_MEM, |
407 | }, | 474 | }, |
408 | [1] = { | 475 | [1] = { |
@@ -411,13 +478,13 @@ static struct resource au1200_psc1_res[] = { | |||
411 | .flags = IORESOURCE_IRQ, | 478 | .flags = IORESOURCE_IRQ, |
412 | }, | 479 | }, |
413 | [2] = { | 480 | [2] = { |
414 | .start = DSCR_CMD0_PSC1_TX, | 481 | .start = AU1200_DSCR_CMD0_PSC1_TX, |
415 | .end = DSCR_CMD0_PSC1_TX, | 482 | .end = AU1200_DSCR_CMD0_PSC1_TX, |
416 | .flags = IORESOURCE_DMA, | 483 | .flags = IORESOURCE_DMA, |
417 | }, | 484 | }, |
418 | [3] = { | 485 | [3] = { |
419 | .start = DSCR_CMD0_PSC1_RX, | 486 | .start = AU1200_DSCR_CMD0_PSC1_RX, |
420 | .end = DSCR_CMD0_PSC1_RX, | 487 | .end = AU1200_DSCR_CMD0_PSC1_RX, |
421 | .flags = IORESOURCE_DMA, | 488 | .flags = IORESOURCE_DMA, |
422 | }, | 489 | }, |
423 | }; | 490 | }; |
@@ -449,6 +516,8 @@ static struct platform_device db1200_audiodma_dev = { | |||
449 | static struct platform_device *db1200_devs[] __initdata = { | 516 | static struct platform_device *db1200_devs[] __initdata = { |
450 | NULL, /* PSC0, selected by S6.8 */ | 517 | NULL, /* PSC0, selected by S6.8 */ |
451 | &db1200_ide_dev, | 518 | &db1200_ide_dev, |
519 | &db1200_mmc0_dev, | ||
520 | &au1200_lcd_dev, | ||
452 | &db1200_eth_dev, | 521 | &db1200_eth_dev, |
453 | &db1200_rtc_dev, | 522 | &db1200_rtc_dev, |
454 | &db1200_nand_dev, | 523 | &db1200_nand_dev, |
@@ -526,32 +595,28 @@ static int __init db1200_dev_init(void) | |||
526 | 595 | ||
527 | /* Audio PSC clock is supplied externally. (FIXME: platdata!!) */ | 596 | /* Audio PSC clock is supplied externally. (FIXME: platdata!!) */ |
528 | __raw_writel(PSC_SEL_CLK_SERCLK, | 597 | __raw_writel(PSC_SEL_CLK_SERCLK, |
529 | (void __iomem *)KSEG1ADDR(PSC1_PHYS_ADDR) + PSC_SEL_OFFSET); | 598 | (void __iomem *)KSEG1ADDR(AU1550_PSC1_PHYS_ADDR) + PSC_SEL_OFFSET); |
530 | wmb(); | 599 | wmb(); |
531 | 600 | ||
532 | db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR, | 601 | db1x_register_pcmcia_socket( |
533 | PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1, | 602 | AU1000_PCMCIA_ATTR_PHYS_ADDR, |
534 | PCMCIA_MEM_PHYS_ADDR, | 603 | AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x000400000 - 1, |
535 | PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1, | 604 | AU1000_PCMCIA_MEM_PHYS_ADDR, |
536 | PCMCIA_IO_PHYS_ADDR, | 605 | AU1000_PCMCIA_MEM_PHYS_ADDR + 0x000400000 - 1, |
537 | PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1, | 606 | AU1000_PCMCIA_IO_PHYS_ADDR, |
538 | DB1200_PC0_INT, | 607 | AU1000_PCMCIA_IO_PHYS_ADDR + 0x000010000 - 1, |
539 | DB1200_PC0_INSERT_INT, | 608 | DB1200_PC0_INT, DB1200_PC0_INSERT_INT, |
540 | /*DB1200_PC0_STSCHG_INT*/0, | 609 | /*DB1200_PC0_STSCHG_INT*/0, DB1200_PC0_EJECT_INT, 0); |
541 | DB1200_PC0_EJECT_INT, | 610 | |
542 | 0); | 611 | db1x_register_pcmcia_socket( |
543 | 612 | AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004000000, | |
544 | db1x_register_pcmcia_socket(PCMCIA_ATTR_PHYS_ADDR + 0x004000000, | 613 | AU1000_PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1, |
545 | PCMCIA_ATTR_PHYS_ADDR + 0x004400000 - 1, | 614 | AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004000000, |
546 | PCMCIA_MEM_PHYS_ADDR + 0x004000000, | 615 | AU1000_PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1, |
547 | PCMCIA_MEM_PHYS_ADDR + 0x004400000 - 1, | 616 | AU1000_PCMCIA_IO_PHYS_ADDR + 0x004000000, |
548 | PCMCIA_IO_PHYS_ADDR + 0x004000000, | 617 | AU1000_PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1, |
549 | PCMCIA_IO_PHYS_ADDR + 0x004010000 - 1, | 618 | DB1200_PC1_INT, DB1200_PC1_INSERT_INT, |
550 | DB1200_PC1_INT, | 619 | /*DB1200_PC1_STSCHG_INT*/0, DB1200_PC1_EJECT_INT, 1); |
551 | DB1200_PC1_INSERT_INT, | ||
552 | /*DB1200_PC1_STSCHG_INT*/0, | ||
553 | DB1200_PC1_EJECT_INT, | ||
554 | 1); | ||
555 | 620 | ||
556 | swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1200_SWAPBOOT; | 621 | swapped = bcsr_read(BCSR_STATUS) & BCSR_STATUS_DB1200_SWAPBOOT; |
557 | db1x_register_norflash(64 << 20, 2, swapped); | 622 | db1x_register_norflash(64 << 20, 2, swapped); |