Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 340021
b: refs/heads/master
c: 2eb2478
h: refs/heads/master
i:
  340019: 61567c8
v: v3
  • Loading branch information
Matt Porter authored and Sekhar Nori committed Oct 27, 2012
1 parent 84c05ca commit bd93fad
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 76d57ce6ef6060f611c14675249b7300a3c96368
refs/heads/master: 2eb2478d471e45e1d0c8bb3defbf82bf7204e13d
1 change: 1 addition & 0 deletions trunk/drivers/uio/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ config UIO_NETX
config UIO_PRUSS
tristate "Texas Instruments PRUSS driver"
depends on ARCH_DAVINCI_DA850
select GENERIC_ALLOCATOR
help
PRUSS driver for OMAPL138/DA850/AM18XX devices
PRUSS driver requires user space components, examples and user space
Expand Down
24 changes: 17 additions & 7 deletions trunk/drivers/uio/uio_pruss.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
#include <linux/clk.h>
#include <linux/dma-mapping.h>
#include <linux/slab.h>
#include <mach/sram.h>
#include <linux/genalloc.h>

#define DRV_NAME "pruss_uio"
#define DRV_VERSION "1.0"
Expand Down Expand Up @@ -65,10 +65,11 @@ struct uio_pruss_dev {
dma_addr_t sram_paddr;
dma_addr_t ddr_paddr;
void __iomem *prussio_vaddr;
void *sram_vaddr;
unsigned long sram_vaddr;
void *ddr_vaddr;
unsigned int hostirq_start;
unsigned int pintc_base;
struct gen_pool *sram_pool;
};

static irqreturn_t pruss_handler(int irq, struct uio_info *info)
Expand Down Expand Up @@ -106,7 +107,9 @@ static void pruss_cleanup(struct platform_device *dev,
gdev->ddr_paddr);
}
if (gdev->sram_vaddr)
sram_free(gdev->sram_vaddr, sram_pool_sz);
gen_pool_free(gdev->sram_pool,
gdev->sram_vaddr,
sram_pool_sz);
kfree(gdev->info);
clk_put(gdev->pruss_clk);
kfree(gdev);
Expand Down Expand Up @@ -152,10 +155,17 @@ static int __devinit pruss_probe(struct platform_device *dev)
goto out_free;
}

gdev->sram_vaddr = sram_alloc(sram_pool_sz, &(gdev->sram_paddr));
if (!gdev->sram_vaddr) {
dev_err(&dev->dev, "Could not allocate SRAM pool\n");
goto out_free;
if (pdata->sram_pool) {
gdev->sram_pool = pdata->sram_pool;
gdev->sram_vaddr =
gen_pool_alloc(gdev->sram_pool, sram_pool_sz);
if (!gdev->sram_vaddr) {
dev_err(&dev->dev, "Could not allocate SRAM pool\n");
goto out_free;
}
gdev->sram_paddr =
gen_pool_virt_to_phys(gdev->sram_pool,
gdev->sram_vaddr);
}

gdev->ddr_vaddr = dma_alloc_coherent(&dev->dev, extram_pool_sz,
Expand Down
3 changes: 2 additions & 1 deletion trunk/include/linux/platform_data/uio_pruss.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@

/* To configure the PRUSS INTC base offset for UIO driver */
struct uio_pruss_pdata {
u32 pintc_base;
u32 pintc_base;
struct gen_pool *sram_pool;
};
#endif /* _UIO_PRUSS_H_ */

0 comments on commit bd93fad

Please sign in to comment.