Skip to contentSkip to conversation

ARM: mach-imx: imx6ul: Print SOC revision on boot and set system_rev

PATCH In review Robert Karszniewicz 2 participants 5 messages Nov 23, 2020 – Jan 5, 2021

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 ARM: mach-imx: imx6ul: Print SOC revision on boot and set system_rev

From: Stefan Riedmueller <[email protected]>

Add the print of the CPU type and SOC revision during boot and also set the system_rev variable to the SOC revision so the correct SOC revision will be shown in /proc/cpuinfo.

---
 arch/arm/mach-imx/mach-imx6ul.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-imx/mach-imx6ul.c +6 -0
index e018e716735f..9c92cc72b857 100644
@@ -11,9 +11,11 @@
 #include <linux/regmap.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/system_info.h>
 
 #include "common.h"
 #include "cpuidle.h"
+#include "hardware.h"
 
 static void __init imx6ul_enet_clk_init(void)
 {
@@ -55,6 +57,10 @@ static inline void imx6ul_enet_init(void)
 
 static void __init imx6ul_init_machine(void)
 {
+	system_rev = imx_get_soc_revision();
+	imx_print_silicon_rev(cpu_is_imx6ull() ? "i.MX6ULL" : "i.MX6UL",
+		system_rev);
+
 	of_platform_default_populate(NULL, NULL, NULL);
 	imx6ul_enet_init();
 	imx_anatop_init();
Signature · 7 lines
2.7.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#1 lore raw

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

From: Stefan Riedmueller <[email protected]>

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

---
 arch/arm/mach-imx/mach-imx6q.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
arch/arm/mach-imx/mach-imx6q.c +6 -2
index 703998ebb52e..4ec304de547a 100644
@@ -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();
 
Signature · 7 lines
2.7.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#3 lore raw
In reply to Robert Karszniewicz
Quoted 8 lines · Robert Karszniewicz

From: Stefan Riedmueller <[email protected]>

Add the print of the CPU type and SOC revision during boot and also set the system_rev variable to the SOC revision so the correct SOC revision will be shown in /proc/cpuinfo.

Considering we already have /sys/devices/soc0 providing these information, I do not this change is really necessary.

Shawn

Quoted 34 lines
---
 arch/arm/mach-imx/mach-imx6ul.c | 6 ++++++
 1 file changed, 6 insertions(+)
arch/arm/mach-imx/mach-imx6ul.c +6 -0
index e018e716735f..9c92cc72b857 100644
@@ -11,9 +11,11 @@
 #include <linux/regmap.h>
 #include <asm/mach/arch.h>
 #include <asm/mach/map.h>
+#include <asm/system_info.h>
 
 #include "common.h"
 #include "cpuidle.h"
+#include "hardware.h"
 
 static void __init imx6ul_enet_clk_init(void)
 {
@@ -55,6 +57,10 @@ static inline void imx6ul_enet_init(void)
 
 static void __init imx6ul_init_machine(void)
 {
+	system_rev = imx_get_soc_revision();
+	imx_print_silicon_rev(cpu_is_imx6ull() ? "i.MX6ULL" : "i.MX6UL",
+		system_rev);
+
 	of_platform_default_populate(NULL, NULL, NULL);
 	imx6ul_enet_init();
 	imx_anatop_init();
Signature · 1 line
2.7.4

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw
Quoted 7 lines · Shawn Guo
Quoted 6 lines · Robert Karszniewicz

From: Stefan Riedmueller <[email protected]>

Add the print of the CPU type and SOC revision during boot and also set the system_rev variable to the SOC revision so the correct SOC revision will be shown in /proc/cpuinfo.

Quoted 5 lines
Quoted 2 lines

Considering we already have /sys/devices/soc0 providing these information, I do not this change is really necessary.

Yes, I became aware of that, that's why I sent another patch which only prints the SOC revision:
[PATCH] ARM: mach-imx: imx6ul: Print SOC revision on boot
http://lists.infradead.org/pipermail/linux-arm-kernel/2020-December/624994.html

Thanks.

Quoted 25 lines

Shawn

Quoted 22 lines
---
  arch/arm/mach-imx/mach-imx6ul.c | 6 ++++++
  1 file changed, 6 insertions(+)
arch/arm/mach-imx/mach-imx6ul.c +2 -0
index e018e716735f..9c92cc72b857 100644
@@ -11,9 +11,11 @@
  #include <linux/regmap.h>
  #include <asm/mach/arch.h>
  #include <asm/mach/map.h>
+#include <asm/system_info.h>
 
  #include "common.h"
  #include "cpuidle.h"
+#include "hardware.h"
 
  static void __init imx6ul_enet_clk_init(void)
  {
@@ -55,6 +57,10 @@ static inline void imx6ul_enet_init(void)
 
Quoted 12 lines
Quoted 12 lines
arch/arm/mach-imx/mach-imx6ul.c +4 -0
  static void __init imx6ul_init_machine(void)
  {
+	system_rev = imx_get_soc_revision();
+	imx_print_silicon_rev(cpu_is_imx6ull() ? "i.MX6ULL" : "i.MX6UL",
+		system_rev);
+
  	of_platform_default_populate(NULL, NULL, NULL);
  	imx6ul_enet_init();
  	imx_anatop_init();
Signature · 1 line
2.7.4

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel