Skip to contentSkip to conversation

armv8: ls1028a: disable multimedia feature when not supported

PATCH Superseded Wen He 2 participants 2 messages Nov 14, 2019 – Nov 15, 2019 Arm (32-bit)

v2 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Wen He

author
#0 lore raw

PATCH v2 1/1 armv8: ls1028a: disable multimedia feature when not supported

From: Yuantian Tang <[email protected]>

Ls1028a has 4 personalities: Ls1028a, Ls1027a, Ls1017a and Ls1018a. Both Ls1027a and Ls1017a personalities are lower functionality version which doesn't support the multimedia subsystems, like LCD, GPU.

To disable multimedia feature on non-multimedia version, set the status property to disabled in dts nodes.

---
change in v2:
- use LS instead of the ls in commit message.

 arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +21 -0
index 19917b207a..ef0e2095a6 100644
@@ -401,6 +401,24 @@ void fdt_fixup_remove_jr(void *blob)
 }
 #endif
 
+static void fdt_disable_multimedia(void *blob, unsigned int svr)
+{
+	int off;
+
+	if (!((svr >> 10) & 0x1))
+		return;
+
+	/* Disable eDP/LCD node */
+	off = fdt_node_offset_by_compatible(blob, -1, "arm,mali-dp500");
+	if (off != -FDT_ERR_NOTFOUND)
+		fdt_status_disabled(blob, off);
+
+	/* Disable GPU node */
+	off = fdt_node_offset_by_compatible(blob, -1, "fsl,ls1028a-gpu");
+	if (off != -FDT_ERR_NOTFOUND)
+		fdt_status_disabled(blob, off);
+}
+
 void ft_cpu_setup(void *blob, bd_t *bd)
 {
 	struct ccsr_gur __iomem *gur = (void *)(CONFIG_SYS_FSL_GUTS_ADDR);
@@ -462,4 +480,7 @@ void ft_cpu_setup(void *blob, bd_t *bd)
 #ifdef CONFIG_HAS_FEATURE_ENHANCED_MSI
 	fdt_fixup_msi(blob);
 #endif
+#ifdef CONFIG_ARCH_LS1028A
+	fdt_disable_multimedia(blob, svr);
+#endif
 }
Signature · 1 line
2.17.1
#1 lore raw

PATCH v2 1/1 armv8: ls1028a: disable multimedia feature when not supported

Quoted 10 lines

-----Original Message-----
From: U-Boot <[email protected]> On Behalf Of Wen He
Sent: Thursday, November 14, 2019 12:39 PM
To: u-boot at lists.denx.de
Cc: Andy Tang <[email protected]>
Subject: [U-Boot] [v2] armv8: ls1028a: disable multimedia feature when not supported

Quoted 6 lines

From: Yuantian Tang <[email protected]>

Ls1028a has 4 personalities: Ls1028a, Ls1027a, Ls1017a and Ls1018a. Both Ls1027a and Ls1017a personalities are lower functionality version which doesn't support the multimedia subsystems, like LCD, GPU.

Please use LS

Quoted 18 lines

To disable multimedia feature on non-multimedia version, set the status property to disabled in dts nodes.

---
change in v2:
- use LS instead of the ls in commit message.

arch/arm/cpu/armv8/fsl-layerscape/fdt.c | 21 +++++++++++++++++++++

1 file changed, 21 insertions(+)
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +0 -0
index 19917b207a..ef0e2095a6 100644

arch/arm/cpu/armv8/fsl-layerscape/fdt.c void fdt_fixup_remove_jr(void *blob) } #endif · line 405

Quoted 5 lines
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +4 -0
@@ -401,6 +401,24 @@ void fdt_fixup_remove_jr(void *blob)  }  #endif
 
+static void fdt_disable_multimedia(void *blob, unsigned int svr) {
+	int off;
+
+	if (!((svr >> 10) & 0x1))

Don't use magic numbers

Quoted 23 lines
arch/arm/cpu/armv8/fsl-layerscape/fdt.c +13 -0
+		return;
+
+	/* Disable eDP/LCD node */
+	off = fdt_node_offset_by_compatible(blob, -1, "arm,mali-dp500");
+	if (off != -FDT_ERR_NOTFOUND)
+		fdt_status_disabled(blob, off);
+
+	/* Disable GPU node */
+	off = fdt_node_offset_by_compatible(blob, -1, "fsl,ls1028a-gpu");
+	if (off != -FDT_ERR_NOTFOUND)
+		fdt_status_disabled(blob, off);
+}
+
 void ft_cpu_setup(void *blob, bd_t *bd)  {
 	struct ccsr_gur __iomem *gur = (void
 *)(CONFIG_SYS_FSL_GUTS_ADDR); @@ -462,4 +480,7 @@ void

ft_cpu_setup(void *blob, bd_t *bd) #ifdef
CONFIG_HAS_FEATURE_ENHANCED_MSI

	fdt_fixup_msi(blob);

#endif

arch/arm/cpu/armv8/fsl-layerscape/fdt.c +3 -0
+#ifdef CONFIG_ARCH_LS1028A
+	fdt_disable_multimedia(blob, svr);
+#endif
Quoted 3 lines

}
--
2.17.1

-priyankajain