diff mbox series

[2/2] ARM: mach-imx: imx6q: Set system_rev to show soc revision

Message ID 1606151291-288303-2-git-send-email-r.karszniewicz@phytec.de (mailing list archive)
State New, archived
Headers show
Series [1/2] ARM: mach-imx: imx6ul: Print SOC revision on boot and set system_rev | expand

Commit Message

Robert Karszniewicz Nov. 23, 2020, 5:08 p.m. UTC
From: Stefan Riedmueller <s.riedmueller@phytec.de>

The system_rev value is shown in /proc/cpuinfo as Revision. Make use of
this by showing the SOC Revision there.

Signed-off-by: Stefan Riedmueller <s.riedmueller@phytec.de>
Signed-off-by: Robert Karszniewicz <r.karszniewicz@phytec.de>
---
 arch/arm/mach-imx/mach-imx6q.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 703998ebb52e..4ec304de547a 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -15,6 +15,7 @@ 
 #include <linux/mfd/syscon/imx6q-iomuxc-gpr.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/system_info.h>
 
 #include "common.h"
 #include "cpuidle.h"
@@ -245,16 +246,19 @@  static void __init imx6q_axi_init(void)
 
 static void __init imx6q_init_machine(void)
 {
-	if (cpu_is_imx6q() && imx_get_soc_revision() >= IMX_CHIP_REVISION_2_0)
+	if (cpu_is_imx6q() && imx_get_soc_revision() >= IMX_CHIP_REVISION_2_0) {
 		/*
 		 * SoCs that identify as i.MX6Q >= rev 2.0 are really i.MX6QP.
 		 * Quirk: i.MX6QP revision = i.MX6Q revision - (1, 0),
 		 * e.g. i.MX6QP rev 1.1 identifies as i.MX6Q rev 2.1.
 		 */
 		imx_print_silicon_rev("i.MX6QP", imx_get_soc_revision() - 0x10);
-	else
+		system_rev = IMX_CHIP_REVISION_1_0;
+	} else {
 		imx_print_silicon_rev(cpu_is_imx6dl() ? "i.MX6DL" : "i.MX6Q",
 				imx_get_soc_revision());
+		system_rev = imx_get_soc_revision();
+	}
 
 	imx6q_enet_phy_init();