summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorSammy He <r62914@freescale.com>2011-05-31 17:48:12 +0800
committerSammy He <r62914@freescale.com>2011-05-31 17:48:12 +0800
commit2a4c8b981c7bf66bb5cd487bf3723d1a7b459a0d (patch)
treed6bb14f71addf694f56ffff37cd196aae54a34af /drivers
parentda24805060e30cc9af105f561768e3b3ffadd3c6 (diff)
ENGR00144306-1 VPU: remove VPU IRAM config and add iram info to plat data.
One kernel image is requested, however, we need to enable iram for performance improvement on mx53, and disable it on mx51 due to known issue. So use platform data to pass vpu iram disable/enable flag. And considering requested iram size also can be different per requirement, iram size is also set in platform data. Signed-off-by: Sammy He <r62914@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mxc/vpu/Kconfig8
-rw-r--r--drivers/mxc/vpu/mxc_vpu.c20
2 files changed, 9 insertions, 19 deletions
diff --git a/drivers/mxc/vpu/Kconfig b/drivers/mxc/vpu/Kconfig
index 37e55e03d2f2..144a4c20b26f 100644
--- a/drivers/mxc/vpu/Kconfig
+++ b/drivers/mxc/vpu/Kconfig
@@ -12,14 +12,6 @@ config MXC_VPU
The VPU codec device provides codec function for H.264/MPEG4/H.263,
as well as MPEG2/VC-1/DivX on some platforms.
-config MXC_VPU_IRAM
- tristate "Use IRAM as temporary buffer for VPU to enhance performace"
- depends on (ARCH_MX37 || ARCH_MX5)
- default y
- ---help---
- The VPU can use internal RAM as temporary buffer to save external
- memroy bandwith, thus to enhance video performance.
-
config MXC_VPU_DEBUG
bool "MXC VPU debugging"
depends on MXC_VPU != n
diff --git a/drivers/mxc/vpu/mxc_vpu.c b/drivers/mxc/vpu/mxc_vpu.c
index afac6d95e8c3..6f7f30a86a27 100644
--- a/drivers/mxc/vpu/mxc_vpu.c
+++ b/drivers/mxc/vpu/mxc_vpu.c
@@ -594,13 +594,13 @@ static int vpu_dev_probe(struct platform_device *pdev)
vpu_plat = pdev->dev.platform_data;
- if (VPU_IRAM_SIZE)
- iram_alloc(VPU_IRAM_SIZE, &addr);
+ if (vpu_plat && vpu_plat->iram_enable && vpu_plat->iram_size)
+ iram_alloc(vpu_plat->iram_size, &addr);
if (addr == 0)
iram.start = iram.end = 0;
else {
iram.start = addr;
- iram.end = addr + VPU_IRAM_SIZE - 1;
+ iram.end = addr + vpu_plat->iram_size - 1;
}
if (cpu_is_mx32()) {
@@ -683,8 +683,8 @@ static int vpu_dev_remove(struct platform_device *pdev)
destroy_workqueue(vpu_data.workqueue);
iounmap(vpu_base);
- if (VPU_IRAM_SIZE)
- iram_free(iram.start, VPU_IRAM_SIZE);
+ if (vpu_plat && vpu_plat->iram_enable && vpu_plat->iram_size)
+ iram_free(iram.start, vpu_plat->iram_size);
return 0;
}
@@ -729,9 +729,8 @@ static int vpu_suspend(struct platform_device *pdev, pm_message_t state)
clk_disable(vpu_clk);
}
- if (cpu_is_mx37() || cpu_is_mx51() || cpu_is_mx53())
- if (vpu_plat->pg)
- vpu_plat->pg(1);
+ if ((cpu_is_mx37() || cpu_is_mx51()) && vpu_plat->pg)
+ vpu_plat->pg(1);
return 0;
@@ -745,9 +744,8 @@ static int vpu_resume(struct platform_device *pdev)
{
int i;
- if (cpu_is_mx37() || cpu_is_mx51() || cpu_is_mx53())
- if (vpu_plat->pg)
- vpu_plat->pg(0);
+ if ((cpu_is_mx37() || cpu_is_mx51()) && vpu_plat->pg)
+ vpu_plat->pg(0);
if (cpu_is_mx53())
goto recover_clk;