aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/uio/uio_pruss.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 15:05:15 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2012-12-12 15:05:15 -0500
commitd027db132b395dabfac208e52a7e510e441bb9d2 (patch)
tree24b055b2385f9848e77e646ce475991d8675c3c4 /drivers/uio/uio_pruss.c
parentd01e4afdbb65e030fd6f1f96c30a558e2eb0f279 (diff)
parent5faf7cbb848da827f6ea1458b5a1c26a44e7510a (diff)
Merge tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc
Pull ARM SoC updates from Olof Johansson: "This contains the bulk of new SoC development for this merge window. Two new platforms have been added, the sunxi platforms (Allwinner A1x SoCs) by Maxime Ripard, and a generic Broadcom platform for a new series of ARMv7 platforms from them, where the hope is that we can keep the platform code generic enough to have them all share one mach directory. The new Broadcom platform is contributed by Christian Daudt. Highbank has grown support for Calxeda's next generation of hardware, ECX-2000. clps711x has seen a lot of cleanup from Alexander Shiyan, and he's also taken on maintainership of the platform. Beyond this there has been a bunch of work from a number of people on converting more platforms to IRQ domains, pinctrl conversion, cleanup and general feature enablement across most of the active platforms." Fix up trivial conflicts as per Olof. * tag 'soc' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc: (174 commits) mfd: vexpress-sysreg: Remove LEDs code irqchip: irq-sunxi: Add terminating entry for sunxi_irq_dt_ids clocksource: sunxi_timer: Add terminating entry for sunxi_timer_dt_ids irq: versatile: delete dangling variable ARM: sunxi: add missing include for mdelay() ARM: EXYNOS: Avoid early use of of_machine_is_compatible() ARM: dts: add node for PL330 MDMA1 controller for exynos4 ARM: EXYNOS: Add support for secondary CPU bring-up on Exynos4412 ARM: EXYNOS: add UART3 to DEBUG_LL ports ARM: S3C24XX: Add clkdev entry for camif-upll clock ARM: SAMSUNG: Add s3c24xx/s3c64xx CAMIF GPIO setup helpers ARM: sunxi: Add missing sun4i.dtsi file pinctrl: samsung: Do not initialise statics to 0 ARM i.MX6: remove gate_mask from pllv3 ARM i.MX6: Fix ethernet PLL clocks ARM i.MX6: rename PLLs according to datasheet ARM i.MX6: Add pwm support ARM i.MX51: Add pwm support ARM i.MX53: Add pwm support ARM: mx5: Replace clk_register_clkdev with clock DT lookup ...
Diffstat (limited to 'drivers/uio/uio_pruss.c')
-rw-r--r--drivers/uio/uio_pruss.c24
1 files changed, 17 insertions, 7 deletions
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,