* [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file
@ 2012-11-19 14:07 Fabio Estevam
2012-11-19 14:07 ` [PATCH v3 2/3] ARM: mx27: Align IIM registers with Reference Manual Fabio Estevam
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-11-19 14:07 UTC (permalink / raw)
To: linux-arm-kernel
Do not reserve VPU DMA pool on board file as this can be done via CMA.
The motivation for doing this is to allow to register the VPU driver via a common
SoC file instead of per board.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- No changes. Newly introduced on this series
arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 21 ++-------------------
1 file changed, 2 insertions(+), 19 deletions(-)
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index b744226..801b797 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -264,7 +264,7 @@ static void __init visstrim_camera_init(void)
static void __init visstrim_reserve(void)
{
/* reserve 4 MiB for mx2-camera */
- mx2_camera_base = arm_memblock_steal(3 * MX2_CAMERA_BUF_SIZE,
+ mx2_camera_base = arm_memblock_steal(2 * MX2_CAMERA_BUF_SIZE,
MX2_CAMERA_BUF_SIZE);
}
@@ -434,23 +434,6 @@ static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = {
.flags = IMX_SSI_DMA | IMX_SSI_SYN,
};
-/* coda */
-
-static void __init visstrim_coda_init(void)
-{
- struct platform_device *pdev;
- int dma;
-
- pdev = imx27_add_coda();
- dma = dma_declare_coherent_memory(&pdev->dev,
- mx2_camera_base + MX2_CAMERA_BUF_SIZE,
- mx2_camera_base + MX2_CAMERA_BUF_SIZE,
- MX2_CAMERA_BUF_SIZE,
- DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
- if (!(dma & DMA_MEMORY_MAP))
- return;
-}
-
/* DMA deinterlace */
static struct platform_device visstrim_deinterlace = {
.name = "m2m-deinterlace",
@@ -548,7 +531,7 @@ static void __init visstrim_m10_board_init(void)
gpio_led_register_device(0, &visstrim_m10_led_data);
visstrim_deinterlace_init();
visstrim_camera_init();
- visstrim_coda_init();
+ imx27_add_coda();
}
static void __init visstrim_m10_timer_init(void)
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 2/3] ARM: mx27: Align IIM registers with Reference Manual
2012-11-19 14:07 [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file Fabio Estevam
@ 2012-11-19 14:07 ` Fabio Estevam
2012-11-19 14:07 ` [PATCH v3 3/3] ARM: mx27: Add VPU support Fabio Estevam
2012-11-22 8:14 ` [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file Sascha Hauer
2 siblings, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-11-19 14:07 UTC (permalink / raw)
To: linux-arm-kernel
Align IIM registers with mx27 Reference Manual.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- No changes. Newly introduced on this series
arch/arm/mach-imx/iim.h | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/arch/arm/mach-imx/iim.h b/arch/arm/mach-imx/iim.h
index 315bffa..d1d6f35 100644
--- a/arch/arm/mach-imx/iim.h
+++ b/arch/arm/mach-imx/iim.h
@@ -36,11 +36,11 @@
#define MXC_IIMSCS1 0x0030
#define MXC_IIMSCS2 0x0034
#define MXC_IIMSCS3 0x0038
-#define MXC_IIMFBAC0 0x0800
-#define MXC_IIMJAC 0x0804
-#define MXC_IIMHWV1 0x0808
-#define MXC_IIMHWV2 0x080C
-#define MXC_IIMHAB0 0x0810
+#define MXC_IIMFBAC0 0x003C
+#define MXC_IIMWORD1_BANK0 0x0804
+#define MXC_IIMWORD2_BANK0 0x0808
+#define MXC_IIMWORD3_BANK0 0x080C
+#define MXC_IIMWORD4_BANK0 0x0810
#define MXC_IIMHAB1 0x0814
/* Definitions for i.MX27 TO2 */
#define MXC_IIMMAC 0x0814
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 3/3] ARM: mx27: Add VPU support
2012-11-19 14:07 [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file Fabio Estevam
2012-11-19 14:07 ` [PATCH v3 2/3] ARM: mx27: Align IIM registers with Reference Manual Fabio Estevam
@ 2012-11-19 14:07 ` Fabio Estevam
2012-11-22 8:14 ` [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file Sascha Hauer
2 siblings, 0 replies; 5+ messages in thread
From: Fabio Estevam @ 2012-11-19 14:07 UTC (permalink / raw)
To: linux-arm-kernel
mx27 has a VPU (Video Processing Unit) block that allows doing H264/MPEG4
decoding and encoding in hardware.
Add support for it in a common SoC file instead of per board file.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
Changes since v2:
- Do not register VPU for mx27lite version
Changes since v1:
- Call imx27_add_coda() on a common mx27 location instead of pe
arch/arm/mach-imx/iim.h | 2 ++
arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 1 -
arch/arm/mach-imx/mm-imx27.c | 21 ++++++++++++++++++++-
3 files changed, 22 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-imx/iim.h b/arch/arm/mach-imx/iim.h
index d1d6f35..afe4bc1 100644
--- a/arch/arm/mach-imx/iim.h
+++ b/arch/arm/mach-imx/iim.h
@@ -74,4 +74,6 @@
#define MXC_IIMHWV2_BP_SDMA (0x1 << 6)
#define MXC_IIMHWV2_SCM_DCM (0x1 << 5)
+#define MXC_IIM_CHIPANDMEDIA_DISABLE (0x1 << 7)
+
#endif /* __ASM_ARCH_MXC_IIM_H__ */
diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
index 801b797..25303a8 100644
--- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
+++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
@@ -531,7 +531,6 @@ static void __init visstrim_m10_board_init(void)
gpio_led_register_device(0, &visstrim_m10_led_data);
visstrim_deinterlace_init();
visstrim_camera_init();
- imx27_add_coda();
}
static void __init visstrim_m10_timer_init(void)
diff --git a/arch/arm/mach-imx/mm-imx27.c b/arch/arm/mach-imx/mm-imx27.c
index 4f1be65..0a8b9d4 100644
--- a/arch/arm/mach-imx/mm-imx27.c
+++ b/arch/arm/mach-imx/mm-imx27.c
@@ -25,9 +25,10 @@
#include <asm/mach/map.h>
#include "common.h"
-#include "devices/devices-common.h"
+#include "devices-imx27.h"
#include "hardware.h"
#include "iomux-v1.h"
+#include "iim.h"
/* MX27 memory map definition */
static struct map_desc imx27_io_desc[] __initdata = {
@@ -80,6 +81,20 @@ static const struct resource imx27_audmux_res[] __initconst = {
DEFINE_RES_MEM(MX27_AUDMUX_BASE_ADDR, SZ_4K),
};
+static int cpu_is_mx27l(void)
+{
+ int fuse;
+ fuse = __raw_readl(MX27_IO_ADDRESS(MX27_IIM_BASE_ADDR +
+ MXC_IIMWORD3_BANK0));
+
+ fuse &= MXC_IIM_CHIPANDMEDIA_DISABLE;
+
+ if (fuse)
+ return 1;
+ else
+ return 0;
+}
+
void __init imx27_soc_init(void)
{
mxc_device_init();
@@ -98,4 +113,8 @@ 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));
+
+ /* MX27L variant does not have VPU, so do not register VPU for it */
+ if (!cpu_is_mx27l())
+ imx27_add_coda();
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file
2012-11-19 14:07 [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file Fabio Estevam
2012-11-19 14:07 ` [PATCH v3 2/3] ARM: mx27: Align IIM registers with Reference Manual Fabio Estevam
2012-11-19 14:07 ` [PATCH v3 3/3] ARM: mx27: Add VPU support Fabio Estevam
@ 2012-11-22 8:14 ` Sascha Hauer
2012-11-22 8:21 ` javier Martin
2 siblings, 1 reply; 5+ messages in thread
From: Sascha Hauer @ 2012-11-22 8:14 UTC (permalink / raw)
To: linux-arm-kernel
Javier,
Are you ok with this patch?
Sascha
On Mon, Nov 19, 2012 at 12:07:05PM -0200, Fabio Estevam wrote:
> Do not reserve VPU DMA pool on board file as this can be done via CMA.
>
> The motivation for doing this is to allow to register the VPU driver via a common
> SoC file instead of per board.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> Changes since v2:
> - No changes. Newly introduced on this series
>
> arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 21 ++-------------------
> 1 file changed, 2 insertions(+), 19 deletions(-)
>
> diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> index b744226..801b797 100644
> --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
> @@ -264,7 +264,7 @@ static void __init visstrim_camera_init(void)
> static void __init visstrim_reserve(void)
> {
> /* reserve 4 MiB for mx2-camera */
> - mx2_camera_base = arm_memblock_steal(3 * MX2_CAMERA_BUF_SIZE,
> + mx2_camera_base = arm_memblock_steal(2 * MX2_CAMERA_BUF_SIZE,
> MX2_CAMERA_BUF_SIZE);
> }
>
> @@ -434,23 +434,6 @@ static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = {
> .flags = IMX_SSI_DMA | IMX_SSI_SYN,
> };
>
> -/* coda */
> -
> -static void __init visstrim_coda_init(void)
> -{
> - struct platform_device *pdev;
> - int dma;
> -
> - pdev = imx27_add_coda();
> - dma = dma_declare_coherent_memory(&pdev->dev,
> - mx2_camera_base + MX2_CAMERA_BUF_SIZE,
> - mx2_camera_base + MX2_CAMERA_BUF_SIZE,
> - MX2_CAMERA_BUF_SIZE,
> - DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
> - if (!(dma & DMA_MEMORY_MAP))
> - return;
> -}
> -
> /* DMA deinterlace */
> static struct platform_device visstrim_deinterlace = {
> .name = "m2m-deinterlace",
> @@ -548,7 +531,7 @@ static void __init visstrim_m10_board_init(void)
> gpio_led_register_device(0, &visstrim_m10_led_data);
> visstrim_deinterlace_init();
> visstrim_camera_init();
> - visstrim_coda_init();
> + imx27_add_coda();
> }
>
> static void __init visstrim_m10_timer_init(void)
> --
> 1.7.9.5
>
>
>
--
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] 5+ messages in thread
* [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file
2012-11-22 8:14 ` [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file Sascha Hauer
@ 2012-11-22 8:21 ` javier Martin
0 siblings, 0 replies; 5+ messages in thread
From: javier Martin @ 2012-11-22 8:21 UTC (permalink / raw)
To: linux-arm-kernel
Hi,
On 22 November 2012 09:14, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> Javier,
>
> Are you ok with this patch?
I don't fully agree with it.
> Sascha
>
> On Mon, Nov 19, 2012 at 12:07:05PM -0200, Fabio Estevam wrote:
>> Do not reserve VPU DMA pool on board file as this can be done via CMA.
>>
>> The motivation for doing this is to allow to register the VPU driver via a common
>> SoC file instead of per board.
>>
>> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
>> ---
>> Changes since v2:
>> - No changes. Newly introduced on this series
>>
>> arch/arm/mach-imx/mach-imx27_visstrim_m10.c | 21 ++-------------------
>> 1 file changed, 2 insertions(+), 19 deletions(-)
>>
>> diff --git a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
>> index b744226..801b797 100644
>> --- a/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
>> +++ b/arch/arm/mach-imx/mach-imx27_visstrim_m10.c
>> @@ -264,7 +264,7 @@ static void __init visstrim_camera_init(void)
>> static void __init visstrim_reserve(void)
>> {
>> /* reserve 4 MiB for mx2-camera */
>> - mx2_camera_base = arm_memblock_steal(3 * MX2_CAMERA_BUF_SIZE,
>> + mx2_camera_base = arm_memblock_steal(2 * MX2_CAMERA_BUF_SIZE,
>> MX2_CAMERA_BUF_SIZE);
>> }
You can't reduce the size of the reserved memory pool without removing
every reference to (mx2_camera_base + 2 * MX2_CAMERA_BUF_SIZE) in
dma_declare_coherent_memory() calls. Otherwise we'll be trying to use
memory outside the pool.
Alternatively, and provided CMA works properly in i.MX27, which is
something I have not tested, you could just remove visstrim_reserve()
callback and every reference to dma_declare_coherent_memory().
>> @@ -434,23 +434,6 @@ static const struct imx_ssi_platform_data visstrim_m10_ssi_pdata __initconst = {
>> .flags = IMX_SSI_DMA | IMX_SSI_SYN,
>> };
>>
>> -/* coda */
>> -
>> -static void __init visstrim_coda_init(void)
>> -{
>> - struct platform_device *pdev;
>> - int dma;
>> -
>> - pdev = imx27_add_coda();
>> - dma = dma_declare_coherent_memory(&pdev->dev,
>> - mx2_camera_base + MX2_CAMERA_BUF_SIZE,
>> - mx2_camera_base + MX2_CAMERA_BUF_SIZE,
>> - MX2_CAMERA_BUF_SIZE,
>> - DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
>> - if (!(dma & DMA_MEMORY_MAP))
>> - return;
>> -}
>> -
>> /* DMA deinterlace */
>> static struct platform_device visstrim_deinterlace = {
>> .name = "m2m-deinterlace",
>> @@ -548,7 +531,7 @@ static void __init visstrim_m10_board_init(void)
>> gpio_led_register_device(0, &visstrim_m10_led_data);
>> visstrim_deinterlace_init();
>> visstrim_camera_init();
>> - visstrim_coda_init();
>> + imx27_add_coda();
>> }
>>
>> static void __init visstrim_m10_timer_init(void)
>> --
>> 1.7.9.5
>>
>>
>>
>
> --
> 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 |
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] 5+ messages in thread
end of thread, other threads:[~2012-11-22 8:21 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-19 14:07 [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file Fabio Estevam
2012-11-19 14:07 ` [PATCH v3 2/3] ARM: mx27: Align IIM registers with Reference Manual Fabio Estevam
2012-11-19 14:07 ` [PATCH v3 3/3] ARM: mx27: Add VPU support Fabio Estevam
2012-11-22 8:14 ` [PATCH v3 1/3] ARM: imx27_visstrim_m10: Do not reserve VPU DMA pool on board file Sascha Hauer
2012-11-22 8:21 ` javier Martin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).