linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] ARM: dts: imx51: Add M4IF support
@ 2018-07-04 16:14 Fabio Estevam
  2018-07-04 16:14 ` [PATCH 2/2] ARM: imx51: Configure M4IF to avoid visual artifacts Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Fabio Estevam @ 2018-07-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

From: Fabio Estevam <fabio.estevam@nxp.com>

As per the i.MX51 Reference Manual the M4IF register region
starts at 0x83fd8000 and has a 4kB address range.

Add support for it.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 arch/arm/boot/dts/imx51.dtsi | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
index 66e4187..b417c39 100644
--- a/arch/arm/boot/dts/imx51.dtsi
+++ b/arch/arm/boot/dts/imx51.dtsi
@@ -531,6 +531,11 @@
 				status = "disabled";
 			};
 
+			m4if: m4if at 83fd8000 {
+				compatible = "fsl,imx51-m4if";
+				reg = <0x83fd8000 0x1000>;
+			};
+
 			weim: weim at 83fda000 {
 				#address-cells = <2>;
 				#size-cells = <1>;
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/2] ARM: imx51: Configure M4IF to avoid visual artifacts
  2018-07-04 16:14 [PATCH 1/2] ARM: dts: imx51: Add M4IF support Fabio Estevam
@ 2018-07-04 16:14 ` Fabio Estevam
  2018-07-04 18:26   ` Sergey Lapin
  2018-07-06 16:18   ` Lucas Stach
  2018-07-04 18:25 ` [PATCH 1/2] ARM: dts: imx51: Add M4IF support Sergey Lapin
  2018-07-06 16:17 ` Lucas Stach
  2 siblings, 2 replies; 7+ messages in thread
From: Fabio Estevam @ 2018-07-04 16:14 UTC (permalink / raw)
  To: linux-arm-kernel

From: Fabio Estevam <fabio.estevam@nxp.com>

Configure the M4IF registers as per the vendor bootloader
to avoid visual artifacts during video playback.

This way we don't need to rely on the bootloader configuration for
optimal IPU/VPU bus priorities.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
 arch/arm/mach-imx/mach-imx51.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)

diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-imx51.c
index 3835b6a..37ffdfa 100644
--- a/arch/arm/mach-imx/mach-imx51.c
+++ b/arch/arm/mach-imx/mach-imx51.c
@@ -12,6 +12,7 @@
 
 #include <linux/io.h>
 #include <linux/irq.h>
+#include <linux/of_address.h>
 #include <linux/of_irq.h>
 #include <linux/of_platform.h>
 #include <asm/mach/arch.h>
@@ -48,11 +49,37 @@ static void __init imx51_ipu_mipi_setup(void)
 	iounmap(hsc_addr);
 }
 
+static void __init imx51_m4if_setup(void)
+{
+	void __iomem *m4if_base;
+	struct device_node *np;
+
+	np = of_find_compatible_node(NULL, NULL, "fsl,imx51-m4if");
+	if (!np)
+		return;
+
+	m4if_base = of_iomap(np, 0);
+	if (!m4if_base) {
+		pr_err("Unable to map M4IF registers\n");
+		return;
+	}
+
+	/*
+	 * Configure VPU and IPU with higher priorities
+	 * in order to avoid artifacts during video playback
+	 */
+	writel_relaxed(0x00000203, m4if_base + 0x40);
+	writel_relaxed(0x00000000, m4if_base + 0x44);
+	writel_relaxed(0x00120125, m4if_base + 0x9c);
+	writel_relaxed(0x001901A3, m4if_base + 0x48);
+	iounmap(m4if_base);
+}
+
 static void __init imx51_dt_init(void)
 {
 	imx51_ipu_mipi_setup();
 	imx_src_init();
-
+	imx51_m4if_setup();
 	imx_aips_allow_unprivileged_access("fsl,imx51-aipstz");
 }
 
-- 
2.7.4

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ARM: dts: imx51: Add M4IF support
  2018-07-04 16:14 [PATCH 1/2] ARM: dts: imx51: Add M4IF support Fabio Estevam
  2018-07-04 16:14 ` [PATCH 2/2] ARM: imx51: Configure M4IF to avoid visual artifacts Fabio Estevam
@ 2018-07-04 18:25 ` Sergey Lapin
  2018-07-06 16:17 ` Lucas Stach
  2 siblings, 0 replies; 7+ messages in thread
From: Sergey Lapin @ 2018-07-04 18:25 UTC (permalink / raw)
  To: linux-arm-kernel

> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> As per the i.MX51 Reference Manual the M4IF register region
> starts at 0x83fd8000 and has a 4kB address range.
>
> Add support for it.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
>  arch/arm/boot/dts/imx51.dtsi | 5 +++++
>  1 file changed, 5 insertions(+)
>
> diff --git a/arch/arm/boot/dts/imx51.dtsi b/arch/arm/boot/dts/imx51.dtsi
> index 66e4187..b417c39 100644
> --- a/arch/arm/boot/dts/imx51.dtsi
> +++ b/arch/arm/boot/dts/imx51.dtsi
> @@ -531,6 +531,11 @@
>                                 status = "disabled";
>                         };
>
> +                       m4if: m4if at 83fd8000 {
> +                               compatible = "fsl,imx51-m4if";
> +                               reg = <0x83fd8000 0x1000>;
> +                       };
> +
>                         weim: weim at 83fda000 {
>                                 #address-cells = <2>;
>                                 #size-cells = <1>;
> --
> 2.7.4
>
Tested-by: Sergey Lapin <sergey.lapin@cogentembedded.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] ARM: imx51: Configure M4IF to avoid visual artifacts
  2018-07-04 16:14 ` [PATCH 2/2] ARM: imx51: Configure M4IF to avoid visual artifacts Fabio Estevam
@ 2018-07-04 18:26   ` Sergey Lapin
  2018-07-06 16:18   ` Lucas Stach
  1 sibling, 0 replies; 7+ messages in thread
From: Sergey Lapin @ 2018-07-04 18:26 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Jul 4, 2018 at 7:14 PM, Fabio Estevam <festevam@gmail.com> wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
>
> Configure the M4IF registers as per the vendor bootloader
> to avoid visual artifacts during video playback.
>
> This way we don't need to rely on the bootloader configuration for
> optimal IPU/VPU bus priorities.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Tested-by: Sergey Lapin <sergey.lapin@cogentembedded.com>

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ARM: dts: imx51: Add M4IF support
  2018-07-04 16:14 [PATCH 1/2] ARM: dts: imx51: Add M4IF support Fabio Estevam
  2018-07-04 16:14 ` [PATCH 2/2] ARM: imx51: Configure M4IF to avoid visual artifacts Fabio Estevam
  2018-07-04 18:25 ` [PATCH 1/2] ARM: dts: imx51: Add M4IF support Sergey Lapin
@ 2018-07-06 16:17 ` Lucas Stach
  2018-07-09 18:26   ` Fabio Estevam
  2 siblings, 1 reply; 7+ messages in thread
From: Lucas Stach @ 2018-07-06 16:17 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Fabio,

Am Mittwoch, den 04.07.2018, 13:14 -0300 schrieb Fabio Estevam:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> As per the i.MX51 Reference Manual the M4IF register region
> starts at 0x83fd8000 and has a 4kB address range.
> 
> Add support for it.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
> ---
> ?arch/arm/boot/dts/imx51.dtsi | 5 +++++
> ?1 file changed, 5 insertions(+)
> 
> diff --git a/arch/arm/boot/dts/imx51.dtsi
> b/arch/arm/boot/dts/imx51.dtsi
> index 66e4187..b417c39 100644
> --- a/arch/arm/boot/dts/imx51.dtsi
> +++ b/arch/arm/boot/dts/imx51.dtsi
> @@ -531,6 +531,11 @@
> ?				status = "disabled";
> ?			};
> ?
> +			m4if: m4if at 83fd8000 {
> +				compatible = "fsl,imx51-m4if";

Missing documentation for this compatible.

Regards,
Lucas

> +				reg = <0x83fd8000 0x1000>;
> +			};
> +
> ?			weim: weim at 83fda000 {
> ?				#address-cells = <2>;
> ?				#size-cells = <1>;

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 2/2] ARM: imx51: Configure M4IF to avoid visual artifacts
  2018-07-04 16:14 ` [PATCH 2/2] ARM: imx51: Configure M4IF to avoid visual artifacts Fabio Estevam
  2018-07-04 18:26   ` Sergey Lapin
@ 2018-07-06 16:18   ` Lucas Stach
  1 sibling, 0 replies; 7+ messages in thread
From: Lucas Stach @ 2018-07-06 16:18 UTC (permalink / raw)
  To: linux-arm-kernel

Am Mittwoch, den 04.07.2018, 13:14 -0300 schrieb Fabio Estevam:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> Configure the M4IF registers as per the vendor bootloader
> to avoid visual artifacts during video playback.
> 
> This way we don't need to rely on the bootloader configuration for
> optimal IPU/VPU bus priorities.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>

> ---
> ?arch/arm/mach-imx/mach-imx51.c | 29 ++++++++++++++++++++++++++++-
> ?1 file changed, 28 insertions(+), 1 deletion(-)
> 
> diff --git a/arch/arm/mach-imx/mach-imx51.c b/arch/arm/mach-imx/mach-
> imx51.c
> index 3835b6a..37ffdfa 100644
> --- a/arch/arm/mach-imx/mach-imx51.c
> +++ b/arch/arm/mach-imx/mach-imx51.c
> @@ -12,6 +12,7 @@
> ?
> ?#include <linux/io.h>
> ?#include <linux/irq.h>
> +#include <linux/of_address.h>
> ?#include <linux/of_irq.h>
> ?#include <linux/of_platform.h>
> ?#include <asm/mach/arch.h>
> @@ -48,11 +49,37 @@ static void __init imx51_ipu_mipi_setup(void)
> ?	iounmap(hsc_addr);
> ?}
> ?
> +static void __init imx51_m4if_setup(void)
> +{
> +	void __iomem *m4if_base;
> +	struct device_node *np;
> +
> +	np = of_find_compatible_node(NULL, NULL, "fsl,imx51-m4if");
> +	if (!np)
> +		return;
> +
> +	m4if_base = of_iomap(np, 0);
> +	if (!m4if_base) {
> +		pr_err("Unable to map M4IF registers\n");
> +		return;
> +	}
> +
> +	/*
> +	?* Configure VPU and IPU with higher priorities
> +	?* in order to avoid artifacts during video playback
> +	?*/
> +	writel_relaxed(0x00000203, m4if_base + 0x40);
> +	writel_relaxed(0x00000000, m4if_base + 0x44);
> +	writel_relaxed(0x00120125, m4if_base + 0x9c);
> +	writel_relaxed(0x001901A3, m4if_base + 0x48);
> +	iounmap(m4if_base);
> +}
> +
> ?static void __init imx51_dt_init(void)
> ?{
> ?	imx51_ipu_mipi_setup();
> ?	imx_src_init();
> -
> +	imx51_m4if_setup();
> ?	imx_aips_allow_unprivileged_access("fsl,imx51-aipstz");
> ?}
> ?

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/2] ARM: dts: imx51: Add M4IF support
  2018-07-06 16:17 ` Lucas Stach
@ 2018-07-09 18:26   ` Fabio Estevam
  0 siblings, 0 replies; 7+ messages in thread
From: Fabio Estevam @ 2018-07-09 18:26 UTC (permalink / raw)
  To: linux-arm-kernel

Hi Lucas,

On Fri, Jul 6, 2018 at 1:17 PM, Lucas Stach <l.stach@pengutronix.de> wrote:

>> +                     m4if: m4if at 83fd8000 {
>> +                             compatible = "fsl,imx51-m4if";
>
> Missing documentation for this compatible.

Just sent a v2 that includes the dt-bindings doc.

Thanks

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2018-07-09 18:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-07-04 16:14 [PATCH 1/2] ARM: dts: imx51: Add M4IF support Fabio Estevam
2018-07-04 16:14 ` [PATCH 2/2] ARM: imx51: Configure M4IF to avoid visual artifacts Fabio Estevam
2018-07-04 18:26   ` Sergey Lapin
2018-07-06 16:18   ` Lucas Stach
2018-07-04 18:25 ` [PATCH 1/2] ARM: dts: imx51: Add M4IF support Sergey Lapin
2018-07-06 16:17 ` Lucas Stach
2018-07-09 18:26   ` Fabio Estevam

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).