aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uio
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/uio')
-rw-r--r--drivers/uio/Kconfig1
-rw-r--r--drivers/uio/uio_pruss.c24
2 files changed, 18 insertions, 7 deletions
diff --git a/drivers/uio/Kconfig b/drivers/uio/Kconfig
index 82e2b89d4480..f56d185790ea 100644
--- a/drivers/uio/Kconfig
+++ b/drivers/uio/Kconfig
@@ -113,6 +113,7 @@ config UIO_NETX
113config UIO_PRUSS 113config UIO_PRUSS
114 tristate "Texas Instruments PRUSS driver" 114 tristate "Texas Instruments PRUSS driver"
115 depends on ARCH_DAVINCI_DA850 115 depends on ARCH_DAVINCI_DA850
116 select GENERIC_ALLOCATOR
116 help 117 help
117 PRUSS driver for OMAPL138/DA850/AM18XX devices 118 PRUSS driver for OMAPL138/DA850/AM18XX devices
118 PRUSS driver requires user space components, examples and user space 119 PRUSS driver requires user space components, examples and user space
diff --git a/drivers/uio/uio_pruss.c b/drivers/uio/uio_pruss.c
index cce0f78341cc..6e2ab007fe9c 100644
--- a/drivers/uio/uio_pruss.c
+++ b/drivers/uio/uio_pruss.c
@@ -25,7 +25,7 @@
25#include <linux/clk.h> 25#include <linux/clk.h>
26#include <linux/dma-mapping.h> 26#include <linux/dma-mapping.h>
27#include <linux/slab.h> 27#include <linux/slab.h>
28#include <mach/sram.h> 28#include <linux/genalloc.h>
29 29
30#define DRV_NAME "pruss_uio" 30#define DRV_NAME "pruss_uio"
31#define DRV_VERSION "1.0" 31#define DRV_VERSION "1.0"
@@ -65,10 +65,11 @@ struct uio_pruss_dev {
65 dma_addr_t sram_paddr; 65 dma_addr_t sram_paddr;
66 dma_addr_t ddr_paddr; 66 dma_addr_t ddr_paddr;
67 void __iomem *prussio_vaddr; 67 void __iomem *prussio_vaddr;
68 void *sram_vaddr; 68 unsigned long sram_vaddr;
69 void *ddr_vaddr; 69 void *ddr_vaddr;
70 unsigned int hostirq_start; 70 unsigned int hostirq_start;
71 unsigned int pintc_base; 71 unsigned int pintc_base;
72 struct gen_pool *sram_pool;
72}; 73};
73 74
74static irqreturn_t pruss_handler(int irq, struct uio_info *info) 75static irqreturn_t pruss_handler(int irq, struct uio_info *info)
@@ -106,7 +107,9 @@ static void pruss_cleanup(struct platform_device *dev,
106 gdev->ddr_paddr); 107 gdev->ddr_paddr);
107 } 108 }
108 if (gdev->sram_vaddr) 109 if (gdev->sram_vaddr)
109 sram_free(gdev->sram_vaddr, sram_pool_sz); 110 gen_pool_free(gdev->sram_pool,
111 gdev->sram_vaddr,
112 sram_pool_sz);
110 kfree(gdev->info); 113 kfree(gdev->info);
111 clk_put(gdev->pruss_clk); 114 clk_put(gdev->pruss_clk);
112 kfree(gdev); 115 kfree(gdev);
@@ -152,10 +155,17 @@ static int pruss_probe(struct platform_device *dev)
152 goto out_free; 155 goto out_free;
153 } 156 }
154 157
155 gdev->sram_vaddr = sram_alloc(sram_pool_sz, &(gdev->sram_paddr)); 158 if (pdata->sram_pool) {
156 if (!gdev->sram_vaddr) { 159 gdev->sram_pool = pdata->sram_pool;
157 dev_err(&dev->dev, "Could not allocate SRAM pool\n"); 160 gdev->sram_vaddr =
158 goto out_free; 161 gen_pool_alloc(gdev->sram_pool, sram_pool_sz);
162 if (!gdev->sram_vaddr) {
163 dev_err(&dev->dev, "Could not allocate SRAM pool\n");
164 goto out_free;
165 }
166 gdev->sram_paddr =
167 gen_pool_virt_to_phys(gdev->sram_pool,
168 gdev->sram_vaddr);
159 } 169 }
160 170
161 gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz, 171 gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz,