ARM:DA850:pruss: Add platform specific changes for DA850 in UIO PRUSS driver
authorAmit Shah <amit.shah@ti.com>
Wed, 16 Nov 2011 15:32:30 +0000 (21:02 +0530)
committerVaibhav Hiremath <hvaibhav@ti.com>
Mon, 23 Jan 2012 19:14:37 +0000 (00:44 +0530)
PRU specific resources like RAM base address, PRUSS clock, IRQs for DA8XX, uio_pruss driver register were added.

Signed-off-by: Amit Shah <amit.shah@ti.com>
Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
arch/arm/mach-davinci/board-da850-evm.c
arch/arm/mach-davinci/da850.c
arch/arm/mach-davinci/devices-da8xx.c
arch/arm/mach-davinci/include/mach/da8xx.h

index c5d808a0793fd41448bb90043bfafe338fcdbba4..f04467100bdb5c0f7168f78ca7639edb42c1ff37 100644 (file)
@@ -1249,6 +1249,17 @@ static __init int da850_wl12xx_init(void)
 
 #define DA850EVM_SATA_REFCLKPN_RATE    (100 * 1000 * 1000)
 
+#ifdef CONFIG_UIO_PRUSS
+struct uio_pruss_pdata da8xx_pruss_uio_pdata = {
+       .pintc_base     = 0x4000,
+};
+
+       ret = da8xx_register_pruss_uio(&da8xx_pruss_uio_pdata);
+       if (ret)
+               pr_warning("%s: pruss_uio initialization failed: %d\n",
+                               __func__, ret);
+#endif
+
 static __init void da850_evm_init(void)
 {
        int ret;
index 547b222d0ca4581b735184f98eba36d27b137a2c..c7e9839475d1a6f0e874cf350dd1e284519811c6 100644 (file)
@@ -240,6 +240,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,
@@ -411,6 +417,7 @@ static struct clk_lookup da850_clks[] = {
        CLK(NULL,               "tpcc1",        &tpcc1_clk),
        CLK(NULL,               "tptc2",        &tptc2_clk),
        CLK(NULL,               "uart0",        &uart0_clk),
+       CLK(NULL,               "pruss",        &pruss_clk),
        CLK(NULL,               "uart1",        &uart1_clk),
        CLK(NULL,               "uart2",        &uart2_clk),
        CLK(NULL,               "aintc",        &aintc_clk),
@@ -747,7 +754,7 @@ static struct map_desc da850_io_desc[] = {
        },
        {
                .virtual        = SRAM_VIRT,
-               .pfn            = __phys_to_pfn(DA8XX_ARM_RAM_BASE),
+               .pfn            = __phys_to_pfn(DA8XX_SHARED_RAM_BASE),
                .length         = SZ_8K,
                .type           = MT_DEVICE
        },
@@ -1120,7 +1127,8 @@ static struct davinci_soc_info davinci_soc_info_da850 = {
        .serial_dev             = &da8xx_serial_device,
        .emac_pdata             = &da8xx_emac_pdata,
        .sram_phys              = DA8XX_ARM_RAM_BASE,
-       .sram_len               = SZ_8K,
+       .sram_dma               = DA8XX_SHARED_RAM_BASE,
+       .sram_len               = SZ_128K,
        .reset_device           = &da8xx_wdt_device,
 };
 
index 98959de98c9d2e25e214c858c6f85e45c6ff8976..b89923859bbaba7873f27b61e70829bb00fbe91b 100644 (file)
@@ -519,6 +519,71 @@ void __init da8xx_register_mcasp(int id, struct snd_platform_data *pdata)
        }
 }
 
+#define DA8XX_PRUSS_MEM_BASE           0x01C30000
+
+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 platform_device da8xx_pruss_uio_dev = {
+       .name           = "pruss_uio",
+       .id             = -1,
+       .num_resources  = ARRAY_SIZE(da8xx_pruss_resources),
+       .resource       = da8xx_pruss_resources,
+       .dev     =      {
+               .coherent_dma_mask = 0xffffffff,
+       }
+};
+
+int __init da8xx_register_pruss_uio(struct uio_pruss_pdata *config)
+{
+       da8xx_pruss_uio_dev.dev.platform_data = config;
+       return platform_device_register(&da8xx_pruss_uio_dev);
+
 static const struct display_panel disp_panel = {
        QVGA,
        16,
index 2b2240ece8293d14f729eaa33cf193fd8b4a0907..f9a577d84209d86eb98a46ca55baabf07ff0c7c6 100644 (file)
@@ -16,6 +16,7 @@
 #include <linux/platform_device.h>
 #include <linux/davinci_emac.h>
 #include <linux/spi/spi.h>
+#include <linux/platform_data/uio_pruss.h>
 
 #include <mach/serial.h>
 #include <mach/edma.h>
@@ -69,6 +70,7 @@ extern unsigned int da850_max_speed;
 #define DA8XX_AEMIF_CS3_BASE   0x62000000
 #define DA8XX_AEMIF_CTL_BASE   0x68000000
 #define DA8XX_ARM_RAM_BASE     0xffff0000
+#define DA8XX_SHARED_RAM_BASE  0x80000000
 
 void __init da830_init(void);
 void __init da850_init(void);
@@ -81,6 +83,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_pruss_uio(struct uio_pruss_pdata *config);
 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);