* [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage
@ 2012-10-10 3:29 Fabio Estevam
2012-10-10 3:29 ` [PATCH 2/2] ARM: mx27_3ds: Add VPU support Fabio Estevam
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Fabio Estevam @ 2012-10-10 3:29 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@freescale.com>
Reserve dedicated memory block for camera usage.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-imx/mach-mx27_3ds.c | 32 +++++++++++++++++++++++++++++++-
1 file changed, 31 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index 05996f3..d3b9a60 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -30,6 +30,7 @@
#include <linux/spi/spi.h>
#include <linux/regulator/machine.h>
#include <linux/spi/l4f00242t03.h>
+#include <asm/memblock.h>
#include <media/soc_camera.h>
@@ -165,6 +166,9 @@ static const int mx27pdk_pins[] __initconst = {
PC19_PF_SSI4_CLK,
};
+static phys_addr_t mx2_camera_base __initdata;
+#define MX27PDK_CAM_BUF_SIZE SZ_8M
+
static struct gpio mx27_3ds_camera_gpios[] = {
{ CSI_PWRDWN, GPIOF_OUT_INIT_HIGH, "camera-power" },
{ CSI_RESET, GPIOF_OUT_INIT_HIGH, "camera-reset" },
@@ -478,6 +482,24 @@ static const struct mx2_camera_platform_data mx27_3ds_cam_pdata __initconst = {
.clk = 26000000,
};
+static void __init mx27pdk_init_camera(void)
+{
+ struct platform_device *pdev;
+ int dma;
+
+ pdev = imx27_add_mx2_camera(&mx27_3ds_cam_pdata);
+
+ if (IS_ERR(pdev))
+ return;
+
+ dma = dma_declare_coherent_memory(&pdev->dev,
+ mx2_camera_base, mx2_camera_base,
+ MX27PDK_CAM_BUF_SIZE,
+ DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
+ if (!(dma & DMA_MEMORY_MAP))
+ return;
+}
+
static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
.bitrate = 100000,
};
@@ -527,7 +549,7 @@ static void __init mx27pdk_init(void)
iclink_ov2640.power = NULL;
}
- imx27_add_mx2_camera(&mx27_3ds_cam_pdata);
+ mx27pdk_init_camera();
imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata);
imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
@@ -542,6 +564,13 @@ static struct sys_timer mx27pdk_timer = {
.init = mx27pdk_timer_init,
};
+static void __init mx27pdk_reserve(void)
+{
+ /* reserve MX27_3DS_CAMERA_BUF_SIZE bytes for mx2-camera */
+ mx2_camera_base = arm_memblock_steal(MX27PDK_CAM_BUF_SIZE,
+ MX27PDK_CAM_BUF_SIZE);
+}
+
MACHINE_START(MX27_3DS, "Freescale MX27PDK")
/* maintainer: Freescale Semiconductor, Inc. */
.atag_offset = 0x100,
@@ -551,5 +580,6 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
.handle_irq = imx27_handle_irq,
.timer = &mx27pdk_timer,
.init_machine = mx27pdk_init,
+ .reserve = mx27pdk_reserve,
.restart = mxc_restart,
MACHINE_END
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/2] ARM: mx27_3ds: Add VPU support
2012-10-10 3:29 [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage Fabio Estevam
@ 2012-10-10 3:29 ` Fabio Estevam
2012-10-10 6:51 ` [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage Gaëtan Carlier
2012-10-10 7:52 ` Sascha Hauer
2 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2012-10-10 3:29 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@freescale.com>
mx27 has a VPU (Video Processing Unit) block that allows doing H264/MPEG4
decoding and encoding in hardware.
Add support for it.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-imx/mach-mx27_3ds.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)
diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
index d3b9a60..3ef8548 100644
--- a/arch/arm/mach-imx/mach-mx27_3ds.c
+++ b/arch/arm/mach-imx/mach-mx27_3ds.c
@@ -500,6 +500,21 @@ static void __init mx27pdk_init_camera(void)
return;
}
+static void __init mx27pdk_init_vpu(void)
+{
+ struct platform_device *pdev;
+ int dma;
+
+ pdev = imx27_add_coda();
+ dma = dma_declare_coherent_memory(&pdev->dev,
+ mx2_camera_base + MX27PDK_CAM_BUF_SIZE,
+ mx2_camera_base + MX27PDK_CAM_BUF_SIZE,
+ MX27PDK_CAM_BUF_SIZE,
+ DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
+ if (!(dma & DMA_MEMORY_MAP))
+ return;
+}
+
static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
.bitrate = 100000,
};
@@ -553,6 +568,7 @@ static void __init mx27pdk_init(void)
imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata);
imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
+ mx27pdk_init_vpu();
}
static void __init mx27pdk_timer_init(void)
@@ -567,7 +583,7 @@ static struct sys_timer mx27pdk_timer = {
static void __init mx27pdk_reserve(void)
{
/* reserve MX27_3DS_CAMERA_BUF_SIZE bytes for mx2-camera */
- mx2_camera_base = arm_memblock_steal(MX27PDK_CAM_BUF_SIZE,
+ mx2_camera_base = arm_memblock_steal(3 * MX27PDK_CAM_BUF_SIZE,
MX27PDK_CAM_BUF_SIZE);
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage
2012-10-10 3:29 [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage Fabio Estevam
2012-10-10 3:29 ` [PATCH 2/2] ARM: mx27_3ds: Add VPU support Fabio Estevam
@ 2012-10-10 6:51 ` Gaëtan Carlier
2012-10-10 7:52 ` Sascha Hauer
2 siblings, 0 replies; 6+ messages in thread
From: Gaëtan Carlier @ 2012-10-10 6:51 UTC (permalink / raw)
To: linux-arm-kernel
Hi Fabio,
On 10/10/2012 05:29 AM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Reserve dedicated memory block for camera usage.
Why camera need to have a dedicated memory block reserved in the
platform file ?
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/mach-imx/mach-mx27_3ds.c | 32 +++++++++++++++++++++++++++++++-
> 1 file changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
> index 05996f3..d3b9a60 100644
> --- a/arch/arm/mach-imx/mach-mx27_3ds.c
> +++ b/arch/arm/mach-imx/mach-mx27_3ds.c
> @@ -30,6 +30,7 @@
> #include <linux/spi/spi.h>
> #include <linux/regulator/machine.h>
> #include <linux/spi/l4f00242t03.h>
> +#include <asm/memblock.h>
>
> #include <media/soc_camera.h>
>
> @@ -165,6 +166,9 @@ static const int mx27pdk_pins[] __initconst = {
> PC19_PF_SSI4_CLK,
> };
>
> +static phys_addr_t mx2_camera_base __initdata;
> +#define MX27PDK_CAM_BUF_SIZE SZ_8M
> +
> static struct gpio mx27_3ds_camera_gpios[] = {
> { CSI_PWRDWN, GPIOF_OUT_INIT_HIGH, "camera-power" },
> { CSI_RESET, GPIOF_OUT_INIT_HIGH, "camera-reset" },
> @@ -478,6 +482,24 @@ static const struct mx2_camera_platform_data mx27_3ds_cam_pdata __initconst = {
> .clk = 26000000,
> };
>
> +static void __init mx27pdk_init_camera(void)
> +{
> + struct platform_device *pdev;
> + int dma;
> +
> + pdev = imx27_add_mx2_camera(&mx27_3ds_cam_pdata);
> +
> + if (IS_ERR(pdev))
> + return;
> +
> + dma = dma_declare_coherent_memory(&pdev->dev,
> + mx2_camera_base, mx2_camera_base,
> + MX27PDK_CAM_BUF_SIZE,
> + DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
> + if (!(dma & DMA_MEMORY_MAP))
> + return;
> +}
> +
> static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
> .bitrate = 100000,
> };
> @@ -527,7 +549,7 @@ static void __init mx27pdk_init(void)
> iclink_ov2640.power = NULL;
> }
>
> - imx27_add_mx2_camera(&mx27_3ds_cam_pdata);
> + mx27pdk_init_camera();
> imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata);
>
> imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
> @@ -542,6 +564,13 @@ static struct sys_timer mx27pdk_timer = {
> .init = mx27pdk_timer_init,
> };
>
> +static void __init mx27pdk_reserve(void)
> +{
> + /* reserve MX27_3DS_CAMERA_BUF_SIZE bytes for mx2-camera */
> + mx2_camera_base = arm_memblock_steal(MX27PDK_CAM_BUF_SIZE,
> + MX27PDK_CAM_BUF_SIZE);
> +}
> +
> MACHINE_START(MX27_3DS, "Freescale MX27PDK")
> /* maintainer: Freescale Semiconductor, Inc. */
> .atag_offset = 0x100,
> @@ -551,5 +580,6 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
> .handle_irq = imx27_handle_irq,
> .timer = &mx27pdk_timer,
> .init_machine = mx27pdk_init,
> + .reserve = mx27pdk_reserve,
> .restart = mxc_restart,
> MACHINE_END
>
Thank you.
Best regards,
Ga?tan Carlier.
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage
2012-10-10 3:29 [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage Fabio Estevam
2012-10-10 3:29 ` [PATCH 2/2] ARM: mx27_3ds: Add VPU support Fabio Estevam
2012-10-10 6:51 ` [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage Gaëtan Carlier
@ 2012-10-10 7:52 ` Sascha Hauer
2012-10-16 4:08 ` Fabio Estevam
2 siblings, 1 reply; 6+ messages in thread
From: Sascha Hauer @ 2012-10-10 7:52 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Oct 10, 2012 at 12:29:29AM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Reserve dedicated memory block for camera usage.
Why not use CMA?
Sascha
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> arch/arm/mach-imx/mach-mx27_3ds.c | 32 +++++++++++++++++++++++++++++++-
> 1 file changed, 31 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm/mach-imx/mach-mx27_3ds.c b/arch/arm/mach-imx/mach-mx27_3ds.c
> index 05996f3..d3b9a60 100644
> --- a/arch/arm/mach-imx/mach-mx27_3ds.c
> +++ b/arch/arm/mach-imx/mach-mx27_3ds.c
> @@ -30,6 +30,7 @@
> #include <linux/spi/spi.h>
> #include <linux/regulator/machine.h>
> #include <linux/spi/l4f00242t03.h>
> +#include <asm/memblock.h>
>
> #include <media/soc_camera.h>
>
> @@ -165,6 +166,9 @@ static const int mx27pdk_pins[] __initconst = {
> PC19_PF_SSI4_CLK,
> };
>
> +static phys_addr_t mx2_camera_base __initdata;
> +#define MX27PDK_CAM_BUF_SIZE SZ_8M
> +
> static struct gpio mx27_3ds_camera_gpios[] = {
> { CSI_PWRDWN, GPIOF_OUT_INIT_HIGH, "camera-power" },
> { CSI_RESET, GPIOF_OUT_INIT_HIGH, "camera-reset" },
> @@ -478,6 +482,24 @@ static const struct mx2_camera_platform_data mx27_3ds_cam_pdata __initconst = {
> .clk = 26000000,
> };
>
> +static void __init mx27pdk_init_camera(void)
> +{
> + struct platform_device *pdev;
> + int dma;
> +
> + pdev = imx27_add_mx2_camera(&mx27_3ds_cam_pdata);
> +
> + if (IS_ERR(pdev))
> + return;
> +
> + dma = dma_declare_coherent_memory(&pdev->dev,
> + mx2_camera_base, mx2_camera_base,
> + MX27PDK_CAM_BUF_SIZE,
> + DMA_MEMORY_MAP | DMA_MEMORY_EXCLUSIVE);
> + if (!(dma & DMA_MEMORY_MAP))
> + return;
> +}
> +
> static const struct imxi2c_platform_data mx27_3ds_i2c0_data __initconst = {
> .bitrate = 100000,
> };
> @@ -527,7 +549,7 @@ static void __init mx27pdk_init(void)
> iclink_ov2640.power = NULL;
> }
>
> - imx27_add_mx2_camera(&mx27_3ds_cam_pdata);
> + mx27pdk_init_camera();
> imx27_add_imx_ssi(0, &mx27_3ds_ssi_pdata);
>
> imx_add_platform_device("imx_mc13783", 0, NULL, 0, NULL, 0);
> @@ -542,6 +564,13 @@ static struct sys_timer mx27pdk_timer = {
> .init = mx27pdk_timer_init,
> };
>
> +static void __init mx27pdk_reserve(void)
> +{
> + /* reserve MX27_3DS_CAMERA_BUF_SIZE bytes for mx2-camera */
> + mx2_camera_base = arm_memblock_steal(MX27PDK_CAM_BUF_SIZE,
> + MX27PDK_CAM_BUF_SIZE);
> +}
> +
> MACHINE_START(MX27_3DS, "Freescale MX27PDK")
> /* maintainer: Freescale Semiconductor, Inc. */
> .atag_offset = 0x100,
> @@ -551,5 +580,6 @@ MACHINE_START(MX27_3DS, "Freescale MX27PDK")
> .handle_irq = imx27_handle_irq,
> .timer = &mx27pdk_timer,
> .init_machine = mx27pdk_init,
> + .reserve = mx27pdk_reserve,
> .restart = mxc_restart,
> MACHINE_END
> --
> 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] 6+ messages in thread
* [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage
2012-10-10 7:52 ` Sascha Hauer
@ 2012-10-16 4:08 ` Fabio Estevam
2012-10-16 7:13 ` Sascha Hauer
0 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2012-10-16 4:08 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Oct 10, 2012 at 4:52 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> On Wed, Oct 10, 2012 at 12:29:29AM -0300, Fabio Estevam wrote:
>> From: Fabio Estevam <fabio.estevam@freescale.com>
>>
>> Reserve dedicated memory block for camera usage.
>
> Why not use CMA?
Sorry, not familiar with CMA. Could you please point to some board
file/driver that makes use of it?
Regards,
Fabio Estevam
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage
2012-10-16 4:08 ` Fabio Estevam
@ 2012-10-16 7:13 ` Sascha Hauer
0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2012-10-16 7:13 UTC (permalink / raw)
To: linux-arm-kernel
On Tue, Oct 16, 2012 at 01:08:57AM -0300, Fabio Estevam wrote:
> On Wed, Oct 10, 2012 at 4:52 AM, Sascha Hauer <s.hauer@pengutronix.de> wrote:
> > On Wed, Oct 10, 2012 at 12:29:29AM -0300, Fabio Estevam wrote:
> >> From: Fabio Estevam <fabio.estevam@freescale.com>
> >>
> >> Reserve dedicated memory block for camera usage.
> >
> > Why not use CMA?
>
> Sorry, not familiar with CMA. Could you please point to some board
> file/driver that makes use of it?
You just have to enable it. The driver then can use dma_alloc_* as it
used to.
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
end of thread, other threads:[~2012-10-16 7:13 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-10 3:29 [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage Fabio Estevam
2012-10-10 3:29 ` [PATCH 2/2] ARM: mx27_3ds: Add VPU support Fabio Estevam
2012-10-10 6:51 ` [PATCH 1/2] ARM: mx27_3ds: Reserve memory for camera usage Gaëtan Carlier
2012-10-10 7:52 ` Sascha Hauer
2012-10-16 4:08 ` Fabio Estevam
2012-10-16 7:13 ` Sascha Hauer
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.