Skip to contentSkip to conversation

ARM: dts: imx51: Add M4IF support

PATCH New Fabio Estevam 3 participants 7 messages Jul 4, 2018 – Jul 9, 2018

Subsystems (4)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/2 ARM: dts: imx51: Add M4IF support

From: Fabio Estevam <[email protected]>

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

Add support for it.

---
 arch/arm/boot/dts/imx51.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/imx51.dtsi +5 -0
index 66e4187..b417c39 100644
@@ -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>;
Signature · 1 line
2.7.4
author reviewer
#1 lore raw

PATCH 2/2 ARM: imx51: Configure M4IF to avoid visual artifacts

From: Fabio Estevam <[email protected]>

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.

---
 arch/arm/mach-imx/mach-imx51.c | 29 ++++++++++++++++++++++++++++-
 1 file changed, 28 insertions(+), 1 deletion(-)
arch/arm/mach-imx/mach-imx51.c +28 -1
index 3835b6a..37ffdfa 100644
@@ -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");
 }
 
Signature · 1 line
2.7.4
#3 lore raw

PATCH 2/2 ARM: imx51: Configure M4IF to avoid visual artifacts

In reply to Fabio Estevam

Am Mittwoch, den 04.07.2018, 13:14 -0300 schrieb Fabio Estevam:

Quoted 9 lines

From: Fabio Estevam <[email protected]>

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.

Quoted 56 lines

---
?arch/arm/mach-imx/mach-imx51.c | 29 ++++++++++++++++++++++++++++- ?1 file changed, 28 insertions(+), 1 deletion(-)

arch/arm/mach-imx/mach- renamed from arch/arm/mach-imx/mach-imx51.c +0 -0

imx51.c
index 3835b6a..37ffdfa 100644

arch/arm/mach-imx/mach-imx51.c +0 -0
@@ -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>

arch/arm/mach-imx/mach-imx51.c +0 -0
@@ -48,11 +49,37 @@ static void __init imx51_ipu_mipi_setup(void)
 ?	iounmap(hsc_addr);
 ?}

?

arch/arm/mach-imx/mach-imx51.c +26 -0
+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();

arch/arm/mach-imx/mach-imx51.c +1 -1
-
+	imx51_m4if_setup();

? imx_aips_allow_unprivileged_access("fsl,imx51-aipstz");
?}
?

#4 lore raw

PATCH 1/2 ARM: dts: imx51: Add M4IF support

In reply to Fabio Estevam
Quoted 29 lines

From: Fabio Estevam <[email protected]>

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

Add support for it.

---
 arch/arm/boot/dts/imx51.dtsi | 5 +++++
 1 file changed, 5 insertions(+)
arch/arm/boot/dts/imx51.dtsi +5 -1
index 66e4187..b417c39 100644
@@ -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>;
--
Quoted 2 lines

2.7.4

#5 lore raw

PATCH 1/2 ARM: dts: imx51: Add M4IF support

In reply to Fabio Estevam

Hi Fabio,

Am Mittwoch, den 04.07.2018, 13:14 -0300 schrieb Fabio Estevam:

Quoted 21 lines

From: Fabio Estevam <[email protected]>

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

Add support for it.

---
?arch/arm/boot/dts/imx51.dtsi | 5 +++++
?1 file changed, 5 insertions(+)

arch/arm/boot/dts/imx51.dtsi +0 -0
index 66e4187..b417c39 100644
@@ -531,6 +531,11 @@
 ?				status = "disabled";
 ?			};

?

arch/arm/boot/dts/imx51.dtsi line 535

Quoted 2 lines
arch/arm/boot/dts/imx51.dtsi +2 -0
+			m4if: m4if at 83fd8000 {
+				compatible = "fsl,imx51-m4if";

Missing documentation for this compatible.

Regards,
Lucas

Quoted 6 lines
arch/arm/boot/dts/imx51.dtsi +3 -0
+				reg = <0x83fd8000 0x1000>;
+			};
+

? weim: weim at 83fda000 {
? #address-cells = <2>;
? #size-cells = <1>;

author reviewer
#6 lore raw

PATCH 1/2 ARM: dts: imx51: Add M4IF support

Hi Lucas,

Quoted 4 lines · Lucas Stach

arch/arm/boot/dts/imx51.dtsi line 535

Quoted 2 lines
arch/arm/boot/dts/imx51.dtsi +2 -0
+                     m4if: m4if at 83fd8000 {
+                             compatible = "fsl,imx51-m4if";

Missing documentation for this compatible.

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

Thanks