]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commitdiff
ARM: davinci: da8xx: add DA850 PRUSS support
authorMatt Porter <mporter@ti.com>
Mon, 8 Oct 2012 13:53:08 +0000 (09:53 -0400)
committerSekhar Nori <nsekhar@ti.com>
Sat, 27 Oct 2012 10:58:36 +0000 (16:28 +0530)
Adds PRUSS clock support and registration helper for the
uio_pruss device.

Signed-off-by: Matt Porter <mporter@ti.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
arch/arm/mach-davinci/da850.c
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/include/mach/da8xx.h

index 41d2cabbcf3356bf834e2fd8cf3a1b57d5e59a6a..68c5fe01857cad4bfb97191b43a0e7f67ade4f78 100644 (file)
@@ -212,6 +212,12 @@ static struct clk tptc2_clk = {
        .flags          = ALWAYS_ENABLED,
 };
 
+static struct clk pruss_clk = {
+       .name           = "pruss",
+       .parent         = &pll0_sysclk2,
+       .lpsc           = DA8XX_LPSC0_PRUSS,
+};
+
 static struct clk uart0_clk = {
        .name           = "uart0",
        .parent         = &pll0_sysclk2,
@@ -385,6 +391,7 @@ static struct clk_lookup da850_clks[] = {
        CLK(NULL,               "tptc1",        &tptc1_clk),
        CLK(NULL,               "tpcc1",        &tpcc1_clk),
        CLK(NULL,               "tptc2",        &tptc2_clk),
+       CLK("pruss_uio",        "pruss",        &pruss_clk),
        CLK(NULL,               "uart0",        &uart0_clk),
        CLK(NULL,               "uart1",        &uart1_clk),
        CLK(NULL,               "uart2",        &uart2_clk),
index d53612f12c52cfce5332996ba495899cff0e48b4..46c9a0c09ae5d83e6895edde655e9581656e93bf 100644 (file)
@@ -22,6 +22,7 @@
 #include <mach/time.h>
 #include <mach/da8xx.h>
 #include <mach/cpuidle.h>
+#include <mach/sram.h>
 
 #include "clock.h"
 #include "asp.h"
@@ -32,6 +33,7 @@
 #define DA8XX_WDOG_BASE                        0x01c21000 /* DA8XX_TIMER64P1_BASE */
 #define DA8XX_I2C0_BASE                        0x01c22000
 #define DA8XX_RTC_BASE                 0x01c23000
+#define DA8XX_PRUSS_MEM_BASE           0x01c30000
 #define DA8XX_MMCSD0_BASE              0x01c40000
 #define DA8XX_SPI0_BASE                        0x01c41000
 #define DA830_SPI1_BASE                        0x01e12000
@@ -518,6 +520,75 @@ void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
        }
 }
 
+static struct resource da8xx_pruss_resources[] = {
+       {
+               .start  = DA8XX_PRUSS_MEM_BASE,
+               .end    = DA8XX_PRUSS_MEM_BASE + 0xFFFF,
+               .flags  = IORESOURCE_MEM,
+       },
+       {
+               .start  = IRQ_DA8XX_EVTOUT0,
+               .end    = IRQ_DA8XX_EVTOUT0,
+               .flags  = IORESOURCE_IRQ,
+       },
+       {
+               .start  = IRQ_DA8XX_EVTOUT1,
+               .end    = IRQ_DA8XX_EVTOUT1,
+               .flags  = IORESOURCE_IRQ,
+       },
+       {
+               .start  = IRQ_DA8XX_EVTOUT2,
+               .end    = IRQ_DA8XX_EVTOUT2,
+               .flags  = IORESOURCE_IRQ,
+       },
+       {
+               .start  = IRQ_DA8XX_EVTOUT3,
+               .end    = IRQ_DA8XX_EVTOUT3,
+               .flags  = IORESOURCE_IRQ,
+       },
+       {
+               .start  = IRQ_DA8XX_EVTOUT4,
+               .end    = IRQ_DA8XX_EVTOUT4,
+               .flags  = IORESOURCE_IRQ,
+       },
+       {
+               .start  = IRQ_DA8XX_EVTOUT5,
+               .end    = IRQ_DA8XX_EVTOUT5,
+               .flags  = IORESOURCE_IRQ,
+       },
+       {
+               .start  = IRQ_DA8XX_EVTOUT6,
+               .end    = IRQ_DA8XX_EVTOUT6,
+               .flags  = IORESOURCE_IRQ,
+       },
+       {
+               .start  = IRQ_DA8XX_EVTOUT7,
+               .end    = IRQ_DA8XX_EVTOUT7,
+               .flags  = IORESOURCE_IRQ,
+       },
+};
+
+static struct uio_pruss_pdata da8xx_uio_pruss_pdata = {
+       .pintc_base     = 0x4000,
+};
+
+static struct platform_device da8xx_uio_pruss_dev = {
+       .name           = "pruss_uio",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(da8xx_pruss_resources),
+       .resource       = da8xx_pruss_resources,
+       .dev            = {
+               .coherent_dma_mask      = DMA_BIT_MASK(32),
+               .platform_data          = &da8xx_uio_pruss_pdata,
+       }
+};
+
+int __init da8xx_register_uio_pruss(void)
+{
+       da8xx_uio_pruss_pdata.sram_pool = sram_get_gen_pool();
+       return platform_device_register(&da8xx_uio_pruss_dev);
+}
+
 static const struct display_panel disp_panel = {
        QVGA,
        16,
index 97bc7006bfc63e4a07f4edccd8212ee6804c3bd6..700d311c6854f0abc3054d4a732fbf8fc522a418 100644 (file)
@@ -26,6 +26,7 @@
 #include <linux/platform_data/mmc-davinci.h>
 #include <linux/platform_data/usb-davinci.h>
 #include <linux/platform_data/spi-davinci.h>
+#include <linux/platform_data/uio_pruss.h>
 
 #include <media/davinci/vpif_types.h>
 
@@ -87,6 +88,7 @@ int da8xx_register_watchdog(void);
 int da8xx_register_usb20(unsigned mA, unsigned potpgt);
 int da8xx_register_usb11(struct da8xx_ohci_root_hub *pdata);
 int da8xx_register_emac(void);
+int da8xx_register_uio_pruss(void);
 int da8xx_register_lcdc(struct da8xx_lcdc_platform_data *pdata);
 int da8xx_register_mmcsd0(struct davinci_mmc_config *config);
 int da850_register_mmcsd1(struct davinci_mmc_config *config);