linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk
@ 2018-03-14 13:53 Peter Ujfalusi
  2018-03-14 13:53 ` [PATCH v2 1/6] ARM: omap2+: control: add support for auxiliary control module instances Peter Ujfalusi
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-03-14 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

Hi,

Changes since v1 (sent by Tero):
- Rebased on linux-next
- Split the dts and binding document patch
- Tested it on omap5-uevm that the HPPLL of twl6040 is working (xtal clock is
  suplied)

The v1 of this series was sent about two years ago:
http://linux-arm-kernel.infradead.narkive.com/hBBbM4D7/patch-0-5-arm-omap5-add-support-for-fref-xtal-clk

but for some reason it was not applied back then, but I have been rolling it on
top of linux-next ever since.

Regards,
Peter
---
Peter Ujfalusi (1):
  ARM: dts: omap5-board-common: Add phandle for mclk clock for twl6040

Tero Kristo (5):
  ARM: omap2+: control: add support for auxiliary control module
    instances
  dt-bindings: omap5: ctrl: Support for control module wkup pad config
  ARM: dts: omap5: add support for control module wkup pad config
  ARM: OMAP5: control: add support for control module wkup pad config
  ARM: dts: omap5: add fref_xtal_ck support

 .../devicetree/bindings/arm/omap/ctrl.txt          |  1 +
 arch/arm/boot/dts/omap5-board-common.dtsi          |  4 ++--
 arch/arm/boot/dts/omap5.dtsi                       | 22 ++++++++++++++++++++++
 arch/arm/boot/dts/omap54xx-clocks.dtsi             | 10 ++++++++++
 arch/arm/mach-omap2/control.c                      | 20 ++++++++++++++++----
 include/linux/clk/ti.h                             |  1 +
 6 files changed, 52 insertions(+), 6 deletions(-)

-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH v2 1/6] ARM: omap2+: control: add support for auxiliary control module instances
  2018-03-14 13:53 [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Peter Ujfalusi
@ 2018-03-14 13:53 ` Peter Ujfalusi
  2018-03-14 13:53 ` [PATCH v2 2/6] dt-bindings: omap5: ctrl: Support for control module wkup pad config Peter Ujfalusi
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-03-14 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tero Kristo <t-kristo@ti.com>

Control module can have multiple instances in a system, each with separate
address space and features. Add base support for these auxiliary instances,
with support for syscon and clock mappings under them.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/mach-omap2/control.c | 15 +++++++++++----
 include/linux/clk/ti.h        |  1 +
 2 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index bd8089ff929f..632adb2b7d03 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -623,6 +623,7 @@ void __init omap3_ctrl_init(void)
 
 struct control_init_data {
 	int index;
+	void __iomem *mem;
 	s16 offset;
 };
 
@@ -660,15 +661,21 @@ int __init omap2_control_base_init(void)
 	struct device_node *np;
 	const struct of_device_id *match;
 	struct control_init_data *data;
+	void __iomem *mem;
 
 	for_each_matching_node_and_match(np, omap_scrm_dt_match_table, &match) {
 		data = (struct control_init_data *)match->data;
 
-		omap2_ctrl_base = of_iomap(np, 0);
-		if (!omap2_ctrl_base)
+		mem = of_iomap(np, 0);
+		if (!mem)
 			return -ENOMEM;
 
-		omap2_ctrl_offset = data->offset;
+		if (data->index == TI_CLKM_CTRL) {
+			omap2_ctrl_base = mem;
+			omap2_ctrl_offset = data->offset;
+		}
+
+		data->mem = mem;
 	}
 
 	return 0;
@@ -713,7 +720,7 @@ int __init omap_control_init(void)
 		} else {
 			/* No scm_conf found, direct access */
 			ret = omap2_clk_provider_init(np, data->index, NULL,
-						      omap2_ctrl_base);
+						      data->mem);
 			if (ret)
 				return ret;
 		}
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h
index d18da839b810..7e3bceee3489 100644
--- a/include/linux/clk/ti.h
+++ b/include/linux/clk/ti.h
@@ -203,6 +203,7 @@ enum {
 	TI_CLKM_PRM,
 	TI_CLKM_SCRM,
 	TI_CLKM_CTRL,
+	TI_CLKM_CTRL_AUX,
 	TI_CLKM_PLLSS,
 	CLK_MAX_MEMMAPS
 };
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH v2 2/6] dt-bindings: omap5: ctrl: Support for control module wkup pad config
  2018-03-14 13:53 [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Peter Ujfalusi
  2018-03-14 13:53 ` [PATCH v2 1/6] ARM: omap2+: control: add support for auxiliary control module instances Peter Ujfalusi
@ 2018-03-14 13:53 ` Peter Ujfalusi
  2018-03-14 13:53 ` [PATCH v2 3/6] ARM: dts: omap5: add support " Peter Ujfalusi
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-03-14 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tero Kristo <t-kristo@ti.com>

The pad configuration area under control module wkup has some miscellaneous
config registers, that are not pinmux related.
Add new compatible string for this section of control module.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
---
 Documentation/devicetree/bindings/arm/omap/ctrl.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/arm/omap/ctrl.txt b/Documentation/devicetree/bindings/arm/omap/ctrl.txt
index ce8dabf8c0f9..f35b77920786 100644
--- a/Documentation/devicetree/bindings/arm/omap/ctrl.txt
+++ b/Documentation/devicetree/bindings/arm/omap/ctrl.txt
@@ -25,6 +25,7 @@ Required properties:
 		"ti,omap4-scm-padconf-wkup"
 		"ti,omap5-scm-core"
 		"ti,omap5-scm-padconf-core"
+		"ti,omap5-scm-wkup-pad-conf"
 		"ti,dra7-scm-core"
 - reg:		Contains Control Module register address range
 		(base address and length)
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH v2 3/6] ARM: dts: omap5: add support for control module wkup pad config
  2018-03-14 13:53 [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Peter Ujfalusi
  2018-03-14 13:53 ` [PATCH v2 1/6] ARM: omap2+: control: add support for auxiliary control module instances Peter Ujfalusi
  2018-03-14 13:53 ` [PATCH v2 2/6] dt-bindings: omap5: ctrl: Support for control module wkup pad config Peter Ujfalusi
@ 2018-03-14 13:53 ` Peter Ujfalusi
  2018-03-14 13:53 ` [PATCH v2 4/6] ARM: OMAP5: control: " Peter Ujfalusi
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-03-14 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tero Kristo <t-kristo@ti.com>

The pad configuration area under control module wkup has some miscellaneous
config registers, that are not pinmux related. Add a separate area for
these, and add support for syscon / clocks under this new area.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/boot/dts/omap5.dtsi | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index 511606c17a04..732b61a0e990 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -287,6 +287,28 @@
 				pinctrl-single,register-width = <16>;
 				pinctrl-single,function-mask = <0x7fff>;
 			};
+
+			omap5_scm_wkup_pad_conf: omap5_scm_wkup_pad_conf at cda0 {
+				compatible = "ti,omap5-scm-wkup-pad-conf",
+					     "simple-bus";
+				reg = <0xcda0 0x60>;
+				#address-cells = <1>;
+				#size-cells = <1>;
+				ranges = <0 0xcda0 0x60>;
+
+				scm_wkup_pad_conf: scm_conf at 0 {
+					compatible = "syscon", "simple-bus";
+					reg = <0x0 0x60>;
+					#address-cells = <1>;
+					#size-cells = <1>;
+					ranges = <0 0x0 0x60>;
+
+					scm_wkup_pad_conf_clocks: clocks at 0 {
+						#address-cells = <1>;
+						#size-cells = <0>;
+					};
+				};
+			};
 		};
 
 		ocmcram: ocmcram at 40300000 {
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH v2 4/6] ARM: OMAP5: control: add support for control module wkup pad config
  2018-03-14 13:53 [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Peter Ujfalusi
                   ` (2 preceding siblings ...)
  2018-03-14 13:53 ` [PATCH v2 3/6] ARM: dts: omap5: add support " Peter Ujfalusi
@ 2018-03-14 13:53 ` Peter Ujfalusi
  2018-03-14 13:53 ` [PATCH v2 5/6] ARM: dts: omap5: add fref_xtal_ck support Peter Ujfalusi
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-03-14 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tero Kristo <t-kristo@ti.com>

Match the new compatible string in the control module driver. The base
infra maps the required syscon ranges and clock registers if available.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/mach-omap2/control.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/mach-omap2/control.c b/arch/arm/mach-omap2/control.c
index 632adb2b7d03..180da403639e 100644
--- a/arch/arm/mach-omap2/control.c
+++ b/arch/arm/mach-omap2/control.c
@@ -636,6 +636,10 @@ static const struct control_init_data omap2_ctrl_data = {
 	.offset = -OMAP2_CONTROL_GENERAL,
 };
 
+static const struct control_init_data ctrl_aux_data = {
+	.index = TI_CLKM_CTRL_AUX,
+};
+
 static const struct of_device_id omap_scrm_dt_match_table[] = {
 	{ .compatible = "ti,am3-scm", .data = &ctrl_data },
 	{ .compatible = "ti,am4-scm", .data = &ctrl_data },
@@ -645,6 +649,7 @@ static const struct of_device_id omap_scrm_dt_match_table[] = {
 	{ .compatible = "ti,dm816-scrm", .data = &ctrl_data },
 	{ .compatible = "ti,omap4-scm-core", .data = &ctrl_data },
 	{ .compatible = "ti,omap5-scm-core", .data = &ctrl_data },
+	{ .compatible = "ti,omap5-scm-wkup-pad-conf", .data = &ctrl_aux_data },
 	{ .compatible = "ti,dra7-scm-core", .data = &ctrl_data },
 	{ }
 };
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH v2 5/6] ARM: dts: omap5: add fref_xtal_ck support
  2018-03-14 13:53 [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Peter Ujfalusi
                   ` (3 preceding siblings ...)
  2018-03-14 13:53 ` [PATCH v2 4/6] ARM: OMAP5: control: " Peter Ujfalusi
@ 2018-03-14 13:53 ` Peter Ujfalusi
  2018-03-14 13:53 ` [PATCH v2 6/6] ARM: dts: omap5-board-common: Add phandle for mclk clock for twl6040 Peter Ujfalusi
  2018-03-20 15:09 ` [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Tony Lindgren
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-03-14 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

From: Tero Kristo <t-kristo@ti.com>

The clock is directly sourced from sys_clkin, and provides an external
output clock for (typically) TWL6040 chip.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Tested-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/boot/dts/omap54xx-clocks.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/omap54xx-clocks.dtsi b/arch/arm/boot/dts/omap54xx-clocks.dtsi
index 9619a746d657..ecc5573d264c 100644
--- a/arch/arm/boot/dts/omap54xx-clocks.dtsi
+++ b/arch/arm/boot/dts/omap54xx-clocks.dtsi
@@ -1179,3 +1179,13 @@
 		};
 	};
 };
+
+&scm_wkup_pad_conf_clocks {
+	fref_xtal_ck: fref_xtal_ck {
+		#clock-cells = <0>;
+		compatible = "ti,gate-clock";
+		clocks = <&sys_clkin>;
+		ti,bit-shift = <28>;
+		reg = <0x14>;
+	};
+};
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH v2 6/6] ARM: dts: omap5-board-common: Add phandle for mclk clock for twl6040
  2018-03-14 13:53 [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Peter Ujfalusi
                   ` (4 preceding siblings ...)
  2018-03-14 13:53 ` [PATCH v2 5/6] ARM: dts: omap5: add fref_xtal_ck support Peter Ujfalusi
@ 2018-03-14 13:53 ` Peter Ujfalusi
  2018-03-20 15:09 ` [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Tony Lindgren
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-03-14 13:53 UTC (permalink / raw)
  To: linux-arm-kernel

The xref_xtal clock is used by twl6040 as mclk. It is needed for the HPPLL
internally.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 arch/arm/boot/dts/omap5-board-common.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm/boot/dts/omap5-board-common.dtsi b/arch/arm/boot/dts/omap5-board-common.dtsi
index 1b20838bb9a4..3b2244560c28 100644
--- a/arch/arm/boot/dts/omap5-board-common.dtsi
+++ b/arch/arm/boot/dts/omap5-board-common.dtsi
@@ -659,8 +659,8 @@
 		v2v1-supply = <&smps9_reg>;
 		enable-active-high;
 
-		clocks = <&clk32kgaudio>;
-		clock-names = "clk32k";
+		clocks = <&clk32kgaudio>, <&fref_xtal_ck>;
+		clock-names = "clk32k", "mclk";
 	};
 };
 
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

* [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk
  2018-03-14 13:53 [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Peter Ujfalusi
                   ` (5 preceding siblings ...)
  2018-03-14 13:53 ` [PATCH v2 6/6] ARM: dts: omap5-board-common: Add phandle for mclk clock for twl6040 Peter Ujfalusi
@ 2018-03-20 15:09 ` Tony Lindgren
  6 siblings, 0 replies; 8+ messages in thread
From: Tony Lindgren @ 2018-03-20 15:09 UTC (permalink / raw)
  To: linux-arm-kernel

* Peter Ujfalusi <peter.ujfalusi@ti.com> [180314 06:54]:
> Hi,
> 
> Changes since v1 (sent by Tero):
> - Rebased on linux-next
> - Split the dts and binding document patch
> - Tested it on omap5-uevm that the HPPLL of twl6040 is working (xtal clock is
>   suplied)
> 
> The v1 of this series was sent about two years ago:
> http://linux-arm-kernel.infradead.narkive.com/hBBbM4D7/patch-0-5-arm-omap5-add-support-for-fref-xtal-clk
> 
> but for some reason it was not applied back then, but I have been rolling it on
> top of linux-next ever since.

OK applying into omap-for-v4.17/soc and omap-for-v4.17/dt thanks.

Regards,

Tony

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

end of thread, other threads:[~2018-03-20 15:09 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-03-14 13:53 [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Peter Ujfalusi
2018-03-14 13:53 ` [PATCH v2 1/6] ARM: omap2+: control: add support for auxiliary control module instances Peter Ujfalusi
2018-03-14 13:53 ` [PATCH v2 2/6] dt-bindings: omap5: ctrl: Support for control module wkup pad config Peter Ujfalusi
2018-03-14 13:53 ` [PATCH v2 3/6] ARM: dts: omap5: add support " Peter Ujfalusi
2018-03-14 13:53 ` [PATCH v2 4/6] ARM: OMAP5: control: " Peter Ujfalusi
2018-03-14 13:53 ` [PATCH v2 5/6] ARM: dts: omap5: add fref_xtal_ck support Peter Ujfalusi
2018-03-14 13:53 ` [PATCH v2 6/6] ARM: dts: omap5-board-common: Add phandle for mclk clock for twl6040 Peter Ujfalusi
2018-03-20 15:09 ` [PATCH v2 0/6] ARM: OMAP5: add support for fref-xtal-clk Tony Lindgren

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