* [PATCH 2/2] media: coda: Use iram_alloc() for codadx6 too.
2012-11-05 15:59 [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM Javier Martin
@ 2012-11-05 15:59 ` Javier Martin
2012-11-06 11:37 ` [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM Guennadi Liakhovetski
2012-11-16 12:48 ` Sascha Hauer
2 siblings, 0 replies; 6+ messages in thread
From: Javier Martin @ 2012-11-05 15:59 UTC (permalink / raw)
To: linux-arm-kernel
Use this helper function instead of hardcoding the
physical address of the IRAM in the i.MX27.
Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
---
drivers/media/video/Kconfig | 2 +-
drivers/media/video/coda.c | 18 ++++++++++--------
2 files changed, 11 insertions(+), 9 deletions(-)
diff --git a/drivers/media/video/Kconfig b/drivers/media/video/Kconfig
index ecab6ef..0b5f785 100644
--- a/drivers/media/video/Kconfig
+++ b/drivers/media/video/Kconfig
@@ -1229,7 +1229,7 @@ config VIDEO_CODA
depends on VIDEO_DEV && VIDEO_V4L2 && ARCH_MXC
select VIDEOBUF2_DMA_CONTIG
select V4L2_MEM2MEM_DEV
- select IRAM_ALLOC if SOC_IMX53
+ select IRAM_ALLOC
---help---
Coda is a range of video codec IPs that supports
H.264, MPEG-4, and other video formats.
diff --git a/drivers/media/video/coda.c b/drivers/media/video/coda.c
index 7febcd9..96ecb3f 100644
--- a/drivers/media/video/coda.c
+++ b/drivers/media/video/coda.c
@@ -43,6 +43,7 @@
#define CODA_PARA_BUF_SIZE (10 * 1024)
#define CODA_ISRAM_SIZE (2048 * 2)
#define CODA7_IRAM_SIZE 0x14000 /* 81920 bytes */
+#define CODADX6_IRAM_SIZE 45056
#define CODA_MAX_FRAMEBUFFERS 2
@@ -1919,6 +1920,8 @@ static int __devinit coda_probe(struct platform_device *pdev)
const struct of_device_id *of_id =
of_match_device(of_match_ptr(coda_dt_ids), &pdev->dev);
const struct platform_device_id *pdev_id;
+ void __iomem *iram_vaddr;
+ unsigned long iram_size;
struct coda_dev *dev;
struct resource *res;
int ret, irq;
@@ -2016,16 +2019,15 @@ static int __devinit coda_probe(struct platform_device *pdev)
}
if (dev->devtype->product == CODA_DX6) {
- dev->iram_paddr = 0xffff4c00;
+ iram_size = CODADX6_IRAM_SIZE;
} else {
- void __iomem *iram_vaddr;
+ iram_size = CODA7_IRAM_SIZE;
+ }
- iram_vaddr = iram_alloc(CODA7_IRAM_SIZE,
- &dev->iram_paddr);
- if (!iram_vaddr) {
- dev_err(&pdev->dev, "unable to alloc iram\n");
- return -ENOMEM;
- }
+ iram_vaddr = iram_alloc(iram_size, &dev->iram_paddr);
+ if (!iram_vaddr) {
+ dev_err(&pdev->dev, "unable to alloc iram\n");
+ return -ENOMEM;
}
platform_set_drvdata(pdev, dev);
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM.
2012-11-05 15:59 [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM Javier Martin
2012-11-05 15:59 ` [PATCH 2/2] media: coda: Use iram_alloc() for codadx6 too Javier Martin
@ 2012-11-06 11:37 ` Guennadi Liakhovetski
2012-11-06 12:41 ` Sascha Hauer
2012-11-16 12:48 ` Sascha Hauer
2 siblings, 1 reply; 6+ messages in thread
From: Guennadi Liakhovetski @ 2012-11-06 11:37 UTC (permalink / raw)
To: linux-arm-kernel
Hi Javier
On Mon, 5 Nov 2012, Javier Martin wrote:
> Add support for IRAM to i.MX27 non-DT platforms using
> iram_init() function.
I'm not sure this belongs in a camera driver. Can IRAM not be used for
anything else? I'll check the i.MX27 datasheet when I'm back home after
the conference, so far this seems a bit odd.
Thanks
Guennadi
>
> Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
> ---
> arch/arm/mach-imx/mm-imx27.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
> index e7e24af..fd2416d 100644
> --- a/arch/arm/mach-imx/mm-imx27.c
> +++ b/arch/arm/mach-imx/mm-imx27.c
> @@ -27,6 +27,7 @@
> #include <asm/pgtable.h>
> #include <asm/mach/map.h>
> #include <mach/iomux-v1.h>
> +#include <mach/iram.h>
>
> /* MX27 memory map definition */
> static struct map_desc imx27_io_desc[] __initdata = {
> @@ -94,4 +95,6 @@ void __init imx27_soc_init(void)
> /* imx27 has the imx21 type audmux */
> platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
> ARRAY_SIZE(imx27_audmux_res));
> + /* imx27 has an iram of 46080 bytes size */
> + iram_init(MX27_IRAM_BASE_ADDR, 46080);
> }
> --
> 1.7.9.5
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-media" in
> the body of a message to majordomo at vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
---
Guennadi Liakhovetski, Ph.D.
Freelance Open-Source Software Developer
http://www.open-technology.de/
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM.
2012-11-06 11:37 ` [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM Guennadi Liakhovetski
@ 2012-11-06 12:41 ` Sascha Hauer
0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2012-11-06 12:41 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Nov 06, 2012 at 12:37:35PM +0100, Guennadi Liakhovetski wrote:
> Hi Javier
>
> On Mon, 5 Nov 2012, Javier Martin wrote:
>
> > Add support for IRAM to i.MX27 non-DT platforms using
> > iram_init() function.
>
> I'm not sure this belongs in a camera driver. Can IRAM not be used for
> anything else? I'll check the i.MX27 datasheet when I'm back home after
> the conference, so far this seems a bit odd.
This patch just adds the sram pool to the system in i.MX27 code, the
patch is not camera specific.
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM.
2012-11-05 15:59 [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM Javier Martin
2012-11-05 15:59 ` [PATCH 2/2] media: coda: Use iram_alloc() for codadx6 too Javier Martin
2012-11-06 11:37 ` [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM Guennadi Liakhovetski
@ 2012-11-16 12:48 ` Sascha Hauer
2012-11-22 8:23 ` javier Martin
2 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2012-11-16 12:48 UTC (permalink / raw)
To: linux-arm-kernel
On Mon, Nov 05, 2012 at 04:59:44PM +0100, Javier Martin wrote:
> Add support for IRAM to i.MX27 non-DT platforms using
> iram_init() function.
>
> Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
> ---
> arch/arm/mach-imx/mm-imx27.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
> index e7e24af..fd2416d 100644
> --- a/arch/arm/mach-imx/mm-imx27.c
> +++ b/arch/arm/mach-imx/mm-imx27.c
> @@ -27,6 +27,7 @@
> #include <asm/pgtable.h>
> #include <asm/mach/map.h>
> #include <mach/iomux-v1.h>
> +#include <mach/iram.h>
>
> /* MX27 memory map definition */
> static struct map_desc imx27_io_desc[] __initdata = {
> @@ -94,4 +95,6 @@ void __init imx27_soc_init(void)
> /* imx27 has the imx21 type audmux */
> platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
> ARRAY_SIZE(imx27_audmux_res));
> + /* imx27 has an iram of 46080 bytes size */
> + iram_init(MX27_IRAM_BASE_ADDR, 46080);
For this rather Philipps sram allocater patches should be used. This
would also solve the problem that mach/iram.h cannot be accessed anymore
in current -next. Fabio already sent a patch addressing this, but I
think we should go for a proper fix rather than just moving iram.h
to include/linux/
Sascha
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: i.MX27: Add platform support for IRAM.
2012-11-16 12:48 ` Sascha Hauer
@ 2012-11-22 8:23 ` javier Martin
0 siblings, 0 replies; 6+ messages in thread
From: javier Martin @ 2012-11-22 8:23 UTC (permalink / raw)
To: linux-arm-kernel
On 16 November 2012 13:48, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Mon, Nov 05, 2012 at 04:59:44PM +0100, Javier Martin wrote:
>> Add support for IRAM to i.MX27 non-DT platforms using
>> iram_init() function.
>>
>> Signed-off-by: Javier Martin <javier.martin@vista-silicon.com>
>> ---
>> arch/arm/mach-imx/mm-imx27.c | 3 +++
>> 1 file changed, 3 insertions(+)
>>
>> diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
>> index e7e24af..fd2416d 100644
>> --- a/arch/arm/mach-imx/mm-imx27.c
>> +++ b/arch/arm/mach-imx/mm-imx27.c
>> @@ -27,6 +27,7 @@
>> #include <asm/pgtable.h>
>> #include <asm/mach/map.h>
>> #include <mach/iomux-v1.h>
>> +#include <mach/iram.h>
>>
>> /* MX27 memory map definition */
>> static struct map_desc imx27_io_desc[] __initdata = {
>> @@ -94,4 +95,6 @@ void __init imx27_soc_init(void)
>> /* imx27 has the imx21 type audmux */
>> platform_device_register_simple("imx21-audmux", 0, imx27_audmux_res,
>> ARRAY_SIZE(imx27_audmux_res));
>> + /* imx27 has an iram of 46080 bytes size */
>> + iram_init(MX27_IRAM_BASE_ADDR, 46080);
>
> For this rather Philipps sram allocater patches should be used. This
> would also solve the problem that mach/iram.h cannot be accessed anymore
> in current -next. Fabio already sent a patch addressing this, but I
> think we should go for a proper fix rather than just moving iram.h
> to include/linux/
Fine, I'll take a look at Philipps' patches.
Regards.
--
Javier Martin
Vista Silicon S.L.
CDTUC - FASE C - Oficina S-345
Avda de los Castros s/n
39005- Santander. Cantabria. Spain
+34 942 25 32 60
www.vista-silicon.com
^ permalink raw reply [flat|nested] 6+ messages in thread