aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci/devices-da8xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/arm/mach-davinci/devices-da8xx.c')
-rw-r--r--arch/arm/mach-davinci/devices-da8xx.c92
1 files changed, 89 insertions, 3 deletions
diff --git a/arch/arm/mach-davinci/devices-da8xx.c b/arch/arm/mach-davinci/devices-da8xx.c
index fc50243b1481..bf572525175d 100644
--- a/arch/arm/mach-davinci/devices-da8xx.c
+++ b/arch/arm/mach-davinci/devices-da8xx.c
@@ -12,7 +12,7 @@
12 */ 12 */
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/platform_device.h> 14#include <linux/platform_device.h>
15#include <linux/dma-mapping.h> 15#include <linux/dma-contiguous.h>
16#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
17#include <linux/ahci_platform.h> 17#include <linux/ahci_platform.h>
18#include <linux/clk.h> 18#include <linux/clk.h>
@@ -664,7 +664,7 @@ static struct resource da8xx_mmcsd0_resources[] = {
664}; 664};
665 665
666static struct platform_device da8xx_mmcsd0_device = { 666static struct platform_device da8xx_mmcsd0_device = {
667 .name = "davinci_mmc", 667 .name = "da830-mmc",
668 .id = 0, 668 .id = 0,
669 .num_resources = ARRAY_SIZE(da8xx_mmcsd0_resources), 669 .num_resources = ARRAY_SIZE(da8xx_mmcsd0_resources),
670 .resource = da8xx_mmcsd0_resources, 670 .resource = da8xx_mmcsd0_resources,
@@ -701,7 +701,7 @@ static struct resource da850_mmcsd1_resources[] = {
701}; 701};
702 702
703static struct platform_device da850_mmcsd1_device = { 703static struct platform_device da850_mmcsd1_device = {
704 .name = "davinci_mmc", 704 .name = "da830-mmc",
705 .id = 1, 705 .id = 1,
706 .num_resources = ARRAY_SIZE(da850_mmcsd1_resources), 706 .num_resources = ARRAY_SIZE(da850_mmcsd1_resources),
707 .resource = da850_mmcsd1_resources, 707 .resource = da850_mmcsd1_resources,
@@ -714,6 +714,92 @@ int __init da850_register_mmcsd1(struct davinci_mmc_config *config)
714} 714}
715#endif 715#endif
716 716
717static struct resource da8xx_rproc_resources[] = {
718 { /* DSP boot address */
719 .start = DA8XX_SYSCFG0_BASE + DA8XX_HOST1CFG_REG,
720 .end = DA8XX_SYSCFG0_BASE + DA8XX_HOST1CFG_REG + 3,
721 .flags = IORESOURCE_MEM,
722 },
723 { /* DSP interrupt registers */
724 .start = DA8XX_SYSCFG0_BASE + DA8XX_CHIPSIG_REG,
725 .end = DA8XX_SYSCFG0_BASE + DA8XX_CHIPSIG_REG + 7,
726 .flags = IORESOURCE_MEM,
727 },
728 { /* dsp irq */
729 .start = IRQ_DA8XX_CHIPINT0,
730 .end = IRQ_DA8XX_CHIPINT0,
731 .flags = IORESOURCE_IRQ,
732 },
733};
734
735static struct platform_device da8xx_dsp = {
736 .name = "davinci-rproc",
737 .dev = {
738 .coherent_dma_mask = DMA_BIT_MASK(32),
739 },
740 .num_resources = ARRAY_SIZE(da8xx_rproc_resources),
741 .resource = da8xx_rproc_resources,
742};
743
744#if IS_ENABLED(CONFIG_DA8XX_REMOTEPROC)
745
746static phys_addr_t rproc_base __initdata;
747static unsigned long rproc_size __initdata;
748
749static int __init early_rproc_mem(char *p)
750{
751 char *endp;
752
753 if (p == NULL)
754 return 0;
755
756 rproc_size = memparse(p, &endp);
757 if (*endp == '@')
758 rproc_base = memparse(endp + 1, NULL);
759
760 return 0;
761}
762early_param("rproc_mem", early_rproc_mem);
763
764void __init da8xx_rproc_reserve_cma(void)
765{
766 int ret;
767
768 if (!rproc_base || !rproc_size) {
769 pr_err("%s: 'rproc_mem=nn@address' badly specified\n"
770 " 'nn' and 'address' must both be non-zero\n",
771 __func__);
772
773 return;
774 }
775
776 pr_info("%s: reserving 0x%lx @ 0x%lx...\n",
777 __func__, rproc_size, (unsigned long)rproc_base);
778
779 ret = dma_declare_contiguous(&da8xx_dsp.dev, rproc_size, rproc_base, 0);
780 if (ret)
781 pr_err("%s: dma_declare_contiguous failed %d\n", __func__, ret);
782}
783
784#else
785
786void __init da8xx_rproc_reserve_cma(void)
787{
788}
789
790#endif
791
792int __init da8xx_register_rproc(void)
793{
794 int ret;
795
796 ret = platform_device_register(&da8xx_dsp);
797 if (ret)
798 pr_err("%s: can't register DSP device: %d\n", __func__, ret);
799
800 return ret;
801};
802
717static struct resource da8xx_rtc_resources[] = { 803static struct resource da8xx_rtc_resources[] = {
718 { 804 {
719 .start = DA8XX_RTC_BASE, 805 .start = DA8XX_RTC_BASE,