linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding
@ 2019-01-11  6:22 Anson Huang
  2019-01-11  6:22 ` [PATCH V2 2/3] ARM: imx: add i.MX7ULP SoC revision support Anson Huang
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Anson Huang @ 2019-01-11  6:22 UTC (permalink / raw)
  To: robh+dt, mark.rutland, shawnguo, s.hauer, kernel, Fabio Estevam,
	linux, devicetree, linux-kernel, linux-arm-kernel
  Cc: dl-linux-imx

Add i.MX7ULP system integration module (SIM) binding.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 .../bindings/arm/freescale/fsl,imx7ulp-sim.txt           | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/arm/freescale/fsl,imx7ulp-sim.txt

diff --git a/Documentation/devicetree/bindings/arm/freescale/fsl,imx7ulp-sim.txt b/Documentation/devicetree/bindings/arm/freescale/fsl,imx7ulp-sim.txt
new file mode 100644
index 0000000..7d0c7f0
--- /dev/null
+++ b/Documentation/devicetree/bindings/arm/freescale/fsl,imx7ulp-sim.txt
@@ -0,0 +1,16 @@
+Freescale i.MX7ULP System Integration Module
+----------------------------------------------
+The system integration module (SIM) provides system control and chip configuration
+registers. In this module, chip revision information is located in JTAG ID register,
+and a set of registers have been made available in DGO domain for SW use, with the
+objective to maintain its value between system resets.
+
+Required properties:
+- compatible:	Should be "fsl,imx7ulp-sim".
+- reg:		Specifies base physical address and size of the register sets.
+
+Example:
+sim: sim@410a3000 {
+	compatible = "fsl,imx7ulp-sim", "syscon";
+	reg = <0x410a3000 0x1000>;
+};
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V2 2/3] ARM: imx: add i.MX7ULP SoC revision support
  2019-01-11  6:22 [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding Anson Huang
@ 2019-01-11  6:22 ` Anson Huang
  2019-01-11  6:22 ` [PATCH V2 3/3] ARM: dts: imx7ulp: add sim node Anson Huang
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Anson Huang @ 2019-01-11  6:22 UTC (permalink / raw)
  To: robh+dt, mark.rutland, shawnguo, s.hauer, kernel, Fabio Estevam,
	linux, devicetree, linux-kernel, linux-arm-kernel
  Cc: dl-linux-imx

i.MX7ULP SoC's revision info is inside the SIM module,
bit[31:28] of JTAG_ID register defines revision as below
from B0:

0001        B0
0010        B1

This patch adds SoC revision support for i.MX7ULP, test
result as below:

root@imx7ulp-evk ~$ cat /sys/devices/soc0/revision
2.1

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 arch/arm/mach-imx/mach-imx7ulp.c | 39 +++++++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)

diff --git a/arch/arm/mach-imx/mach-imx7ulp.c b/arch/arm/mach-imx/mach-imx7ulp.c
index 19c5b30..11ac71a 100644
--- a/arch/arm/mach-imx/mach-imx7ulp.c
+++ b/arch/arm/mach-imx/mach-imx7ulp.c
@@ -6,18 +6,57 @@
  */
 
 #include <linux/irqchip.h>
+#include <linux/mfd/syscon.h>
 #include <linux/of_platform.h>
+#include <linux/regmap.h>
 #include <asm/mach/arch.h>
 
 #include "common.h"
 #include "cpuidle.h"
 #include "hardware.h"
 
+#define SIM_JTAG_ID_REG		0x8c
+
+static void __init imx7ulp_set_revision(void)
+{
+	struct regmap *sim;
+	u32 revision;
+
+	sim = syscon_regmap_lookup_by_compatible("fsl,imx7ulp-sim");
+	if (IS_ERR(sim)) {
+		pr_warn("failed to find fsl,imx7ulp-sim regmap!\n");
+		return;
+	}
+
+	if (regmap_read(sim, SIM_JTAG_ID_REG, &revision)) {
+		pr_warn("failed to read sim regmap!\n");
+		return;
+	}
+
+	/*
+	 * bit[31:28] of JTAG_ID register defines revision as below from B0:
+	 * 0001        B0
+	 * 0010        B1
+	 */
+	switch (revision >> 28) {
+	case 1:
+		imx_set_soc_revision(IMX_CHIP_REVISION_2_0);
+		break;
+	case 2:
+		imx_set_soc_revision(IMX_CHIP_REVISION_2_1);
+		break;
+	default:
+		imx_set_soc_revision(IMX_CHIP_REVISION_1_0);
+		break;
+	}
+}
+
 static void __init imx7ulp_init_machine(void)
 {
 	imx7ulp_pm_init();
 
 	mxc_set_cpu_type(MXC_CPU_IMX7ULP);
+	imx7ulp_set_revision();
 	of_platform_default_populate(NULL, NULL, imx_soc_device_init());
 }
 
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH V2 3/3] ARM: dts: imx7ulp: add sim node
  2019-01-11  6:22 [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding Anson Huang
  2019-01-11  6:22 ` [PATCH V2 2/3] ARM: imx: add i.MX7ULP SoC revision support Anson Huang
@ 2019-01-11  6:22 ` Anson Huang
  2019-01-15 21:40 ` [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding Rob Herring
  2019-01-16  1:57 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Anson Huang @ 2019-01-11  6:22 UTC (permalink / raw)
  To: robh+dt, mark.rutland, shawnguo, s.hauer, kernel, Fabio Estevam,
	linux, devicetree, linux-kernel, linux-arm-kernel
  Cc: dl-linux-imx

i.MX7ULP SoC revision info is inside the SIM mode's JTAG_ID
register, add sim node to support SoC revision check.

Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
---
 arch/arm/boot/dts/imx7ulp.dtsi | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/arch/arm/boot/dts/imx7ulp.dtsi b/arch/arm/boot/dts/imx7ulp.dtsi
index b86daf7..fca6e50 100644
--- a/arch/arm/boot/dts/imx7ulp.dtsi
+++ b/arch/arm/boot/dts/imx7ulp.dtsi
@@ -347,4 +347,17 @@
 			gpio-ranges = <&iomuxc1 0 96 32>;
 		};
 	};
+
+	m4aips1: bus@41080000 {
+		compatible = "simple-bus";
+		#address-cells = <1>;
+		#size-cells = <1>;
+		reg = <0x41080000 0x80000>;
+		ranges;
+
+		sim: sim@410a3000 {
+			compatible = "fsl,imx7ulp-sim", "syscon";
+			reg = <0x410a3000 0x1000>;
+		};
+	};
 };
-- 
2.7.4


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding
  2019-01-11  6:22 [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding Anson Huang
  2019-01-11  6:22 ` [PATCH V2 2/3] ARM: imx: add i.MX7ULP SoC revision support Anson Huang
  2019-01-11  6:22 ` [PATCH V2 3/3] ARM: dts: imx7ulp: add sim node Anson Huang
@ 2019-01-15 21:40 ` Rob Herring
  2019-01-16  1:57 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Rob Herring @ 2019-01-15 21:40 UTC (permalink / raw)
  To: Anson Huang
  Cc: mark.rutland, devicetree, s.hauer, linux, linux-kernel, robh+dt,
	dl-linux-imx, kernel, Fabio Estevam, shawnguo, linux-arm-kernel

On Fri, 11 Jan 2019 06:22:40 +0000, Anson Huang wrote:
> Add i.MX7ULP system integration module (SIM) binding.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>
> ---
>  .../bindings/arm/freescale/fsl,imx7ulp-sim.txt           | 16 ++++++++++++++++
>  1 file changed, 16 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/arm/freescale/fsl,imx7ulp-sim.txt
> 

Reviewed-by: Rob Herring <robh@kernel.org>

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding
  2019-01-11  6:22 [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding Anson Huang
                   ` (2 preceding siblings ...)
  2019-01-15 21:40 ` [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding Rob Herring
@ 2019-01-16  1:57 ` Shawn Guo
  3 siblings, 0 replies; 5+ messages in thread
From: Shawn Guo @ 2019-01-16  1:57 UTC (permalink / raw)
  To: Anson Huang
  Cc: mark.rutland, devicetree, s.hauer, linux, linux-kernel, robh+dt,
	dl-linux-imx, kernel, Fabio Estevam, linux-arm-kernel

On Fri, Jan 11, 2019 at 06:22:40AM +0000, Anson Huang wrote:
> Add i.MX7ULP system integration module (SIM) binding.
> 
> Signed-off-by: Anson Huang <Anson.Huang@nxp.com>

Applied all, thanks.

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2019-01-16  1:58 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-11  6:22 [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding Anson Huang
2019-01-11  6:22 ` [PATCH V2 2/3] ARM: imx: add i.MX7ULP SoC revision support Anson Huang
2019-01-11  6:22 ` [PATCH V2 3/3] ARM: dts: imx7ulp: add sim node Anson Huang
2019-01-15 21:40 ` [PATCH V2 1/3] dt-bindings: fsl: add imx7ulp system integration module binding Rob Herring
2019-01-16  1:57 ` Shawn Guo

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