diff options
Diffstat (limited to 'arch/arm/mach-davinci/devices-da8xx.c')
| -rw-r--r-- | arch/arm/mach-davinci/devices-da8xx.c | 108 |
1 files changed, 74 insertions, 34 deletions
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c index bd2f72b414bc..2d5502d84a22 100644 --- a/arch/arm/mach-davinci/devices-da8xx.c +++ b/arch/arm/mach-davinci/devices-da8xx.c | |||
| @@ -22,6 +22,7 @@ | |||
| 22 | #include <mach/time.h> | 22 | #include <mach/time.h> |
| 23 | #include <mach/da8xx.h> | 23 | #include <mach/da8xx.h> |
| 24 | #include <mach/cpuidle.h> | 24 | #include <mach/cpuidle.h> |
| 25 | #include <mach/sram.h> | ||
| 25 | 26 | ||
| 26 | #include "clock.h" | 27 | #include "clock.h" |
| 27 | #include "asp.h" | 28 | #include "asp.h" |
| @@ -32,6 +33,7 @@ | |||
| 32 | #define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */ | 33 | #define DA8XX_WDOG_BASE 0x01c21000 /* DA8XX_TIMER64P1_BASE */ |
| 33 | #define DA8XX_I2C0_BASE 0x01c22000 | 34 | #define DA8XX_I2C0_BASE 0x01c22000 |
| 34 | #define DA8XX_RTC_BASE 0x01c23000 | 35 | #define DA8XX_RTC_BASE 0x01c23000 |
| 36 | #define DA8XX_PRUSS_MEM_BASE 0x01c30000 | ||
| 35 | #define DA8XX_MMCSD0_BASE 0x01c40000 | 37 | #define DA8XX_MMCSD0_BASE 0x01c40000 |
| 36 | #define DA8XX_SPI0_BASE 0x01c41000 | 38 | #define DA8XX_SPI0_BASE 0x01c41000 |
| 37 | #define DA830_SPI1_BASE 0x01e12000 | 39 | #define DA830_SPI1_BASE 0x01e12000 |
| @@ -518,29 +520,78 @@ void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata) | |||
| 518 | } | 520 | } |
| 519 | } | 521 | } |
| 520 | 522 | ||
| 521 | static const struct display_panel disp_panel = { | 523 | static struct resource da8xx_pruss_resources[] = { |
| 522 | QVGA, | 524 | { |
| 523 | 16, | 525 | .start = DA8XX_PRUSS_MEM_BASE, |
| 524 | 16, | 526 | .end = DA8XX_PRUSS_MEM_BASE + 0xFFFF, |
| 525 | COLOR_ACTIVE, | 527 | .flags = IORESOURCE_MEM, |
| 528 | }, | ||
| 529 | { | ||
| 530 | .start = IRQ_DA8XX_EVTOUT0, | ||
| 531 | .end = IRQ_DA8XX_EVTOUT0, | ||
| 532 | .flags = IORESOURCE_IRQ, | ||
| 533 | }, | ||
| 534 | { | ||
| 535 | .start = IRQ_DA8XX_EVTOUT1, | ||
| 536 | .end = IRQ_DA8XX_EVTOUT1, | ||
| 537 | .flags = IORESOURCE_IRQ, | ||
| 538 | }, | ||
| 539 | { | ||
| 540 | .start = IRQ_DA8XX_EVTOUT2, | ||
| 541 | .end = IRQ_DA8XX_EVTOUT2, | ||
| 542 | .flags = IORESOURCE_IRQ, | ||
| 543 | }, | ||
| 544 | { | ||
| 545 | .start = IRQ_DA8XX_EVTOUT3, | ||
| 546 | .end = IRQ_DA8XX_EVTOUT3, | ||
| 547 | .flags = IORESOURCE_IRQ, | ||
| 548 | }, | ||
| 549 | { | ||
| 550 | .start = IRQ_DA8XX_EVTOUT4, | ||
| 551 | .end = IRQ_DA8XX_EVTOUT4, | ||
| 552 | .flags = IORESOURCE_IRQ, | ||
| 553 | }, | ||
| 554 | { | ||
| 555 | .start = IRQ_DA8XX_EVTOUT5, | ||
| 556 | .end = IRQ_DA8XX_EVTOUT5, | ||
| 557 | .flags = IORESOURCE_IRQ, | ||
| 558 | }, | ||
| 559 | { | ||
| 560 | .start = IRQ_DA8XX_EVTOUT6, | ||
| 561 | .end = IRQ_DA8XX_EVTOUT6, | ||
| 562 | .flags = IORESOURCE_IRQ, | ||
| 563 | }, | ||
| 564 | { | ||
| 565 | .start = IRQ_DA8XX_EVTOUT7, | ||
| 566 | .end = IRQ_DA8XX_EVTOUT7, | ||
| 567 | .flags = IORESOURCE_IRQ, | ||
| 568 | }, | ||
| 569 | }; | ||
| 570 | |||
| 571 | static struct uio_pruss_pdata da8xx_uio_pruss_pdata = { | ||
| 572 | .pintc_base = 0x4000, | ||
| 573 | }; | ||
| 574 | |||
| 575 | static struct platform_device da8xx_uio_pruss_dev = { | ||
| 576 | .name = "pruss_uio", | ||
| 577 | .id = -1, | ||
| 578 | .num_resources = ARRAY_SIZE(da8xx_pruss_resources), | ||
| 579 | .resource = da8xx_pruss_resources, | ||
| 580 | .dev = { | ||
| 581 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
| 582 | .platform_data = &da8xx_uio_pruss_pdata, | ||
| 583 | } | ||
| 526 | }; | 584 | }; |
| 527 | 585 | ||
| 586 | int __init da8xx_register_uio_pruss(void) | ||
| 587 | { | ||
| 588 | da8xx_uio_pruss_pdata.sram_pool = sram_get_gen_pool(); | ||
| 589 | return platform_device_register(&da8xx_uio_pruss_dev); | ||
| 590 | } | ||
| 591 | |||
| 528 | static struct lcd_ctrl_config lcd_cfg = { | 592 | static struct lcd_ctrl_config lcd_cfg = { |
| 529 | &disp_panel, | 593 | .panel_shade = COLOR_ACTIVE, |
| 530 | .ac_bias = 255, | ||
| 531 | .ac_bias_intrpt = 0, | ||
| 532 | .dma_burst_sz = 16, | ||
| 533 | .bpp = 16, | 594 | .bpp = 16, |
| 534 | .fdd = 255, | ||
| 535 | .tft_alt_mode = 0, | ||
| 536 | .stn_565_mode = 0, | ||
| 537 | .mono_8bit_mode = 0, | ||
| 538 | .invert_line_clock = 1, | ||
| 539 | .invert_frm_clock = 1, | ||
| 540 | .sync_edge = 0, | ||
| 541 | .sync_ctrl = 1, | ||
| 542 | .raster_order = 0, | ||
| 543 | .fifo_th = 6, | ||
| 544 | }; | 595 | }; |
| 545 | 596 | ||
| 546 | struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata = { | 597 | struct da8xx_lcdc_platform_data sharp_lcd035q3dg01_pdata = { |
| @@ -674,7 +725,7 @@ static struct resource da8xx_rtc_resources[] = { | |||
| 674 | }; | 725 | }; |
| 675 | 726 | ||
| 676 | static struct platform_device da8xx_rtc_device = { | 727 | static struct platform_device da8xx_rtc_device = { |
| 677 | .name = "omap_rtc", | 728 | .name = "da830-rtc", |
| 678 | .id = -1, | 729 | .id = -1, |
| 679 | .num_resources = ARRAY_SIZE(da8xx_rtc_resources), | 730 | .num_resources = ARRAY_SIZE(da8xx_rtc_resources), |
| 680 | .resource = da8xx_rtc_resources, | 731 | .resource = da8xx_rtc_resources, |
| @@ -683,17 +734,6 @@ static struct platform_device da8xx_rtc_device = { | |||
| 683 | int da8xx_register_rtc(void) | 734 | int da8xx_register_rtc(void) |
| 684 | { | 735 | { |
| 685 | int ret; | 736 | int ret; |
| 686 | void __iomem *base; | ||
| 687 | |||
| 688 | base = ioremap(DA8XX_RTC_BASE, SZ_4K); | ||
| 689 | if (WARN_ON(!base)) | ||
| 690 | return -ENOMEM; | ||
| 691 | |||
| 692 | /* Unlock the rtc's registers */ | ||
| 693 | __raw_writel(0x83e70b13, base + 0x6c); | ||
| 694 | __raw_writel(0x95a4f1e0, base + 0x70); | ||
| 695 | |||
| 696 | iounmap(base); | ||
| 697 | 737 | ||
| 698 | ret = platform_device_register(&da8xx_rtc_device); | 738 | ret = platform_device_register(&da8xx_rtc_device); |
| 699 | if (!ret) | 739 | if (!ret) |
| @@ -900,7 +940,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr) | |||
| 900 | if (IS_ERR(da850_sata_clk)) | 940 | if (IS_ERR(da850_sata_clk)) |
| 901 | return PTR_ERR(da850_sata_clk); | 941 | return PTR_ERR(da850_sata_clk); |
| 902 | 942 | ||
| 903 | ret = clk_enable(da850_sata_clk); | 943 | ret = clk_prepare_enable(da850_sata_clk); |
| 904 | if (ret) | 944 | if (ret) |
| 905 | goto err0; | 945 | goto err0; |
| 906 | 946 | ||
| @@ -931,7 +971,7 @@ static int da850_sata_init(struct device *dev, void __iomem *addr) | |||
| 931 | return 0; | 971 | return 0; |
| 932 | 972 | ||
| 933 | err1: | 973 | err1: |
| 934 | clk_disable(da850_sata_clk); | 974 | clk_disable_unprepare(da850_sata_clk); |
| 935 | err0: | 975 | err0: |
| 936 | clk_put(da850_sata_clk); | 976 | clk_put(da850_sata_clk); |
| 937 | return ret; | 977 | return ret; |
| @@ -939,7 +979,7 @@ err0: | |||
| 939 | 979 | ||
| 940 | static void da850_sata_exit(struct device *dev) | 980 | static void da850_sata_exit(struct device *dev) |
| 941 | { | 981 | { |
| 942 | clk_disable(da850_sata_clk); | 982 | clk_disable_unprepare(da850_sata_clk); |
| 943 | clk_put(da850_sata_clk); | 983 | clk_put(da850_sata_clk); |
| 944 | } | 984 | } |
| 945 | 985 | ||
