LKML Archive on lore.kernel.org
 help / Atom feed
* [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider
@ 2018-11-29 22:13 Evan Green
  2018-11-29 22:13 ` [PATCH v1 1/4] dt-bindings: phy-qcom-qmp: Move #clock-cells to child Evan Green
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Evan Green @ 2018-11-29 22:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Rob Herring, Andy Gross
  Cc: Douglas Anderson, Stephen Boyd, Evan Green, devicetree,
	Rob Herring, linux-arm-msm, Can Guo, linux-kernel, Vivek Gautam,
	Manu Gautam, David Brown, Mark Rutland, linux-soc

This series fixes the QMP PHY bindings, which had specified #clock-cells
in the parent node, and had set it to 1. Putting it in the parent node is
wrong because the clock providers are the child nodes, so this change
moves it there. Having it set to 1 is also wrong, since nothing is ever
specified as to what should go in that cell. So this changes it to zero.
Finally, this change completes a little bit of code to actually allow these
exposed clocks to be pointed at in DT.

I had no idea how to fix up ipq8074.dtsi. It seems to be completely wrong in
that it doesn't specify #clock-cells at all, has no child nodes, and
specifies clock-output-names in the parent node. As far as I can tell this
doesn't work at all. But I can't add the child nodes myself because I don't know
1) how many there are, and 2) the registers in them. I also have no way to test it.

Speaking of testing, I was able to test this on sdm845, but haven't tested msm8996.

This patch sits atop the UFS device nodes series [1].

[1] https://lore.kernel.org/lkml/20181026173544.136037-1-evgreen@chromium.org/



Evan Green (4):
  dt-bindings: phy-qcom-qmp: Move #clock-cells to child
  arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells
  arm64: dts: qcom: sdm845: Fix QMP PHY #clock-cells
  phy: qcom-qmp: Expose provided clocks to DT

 .../devicetree/bindings/phy/qcom-qmp-phy.txt  | 11 ++++-----
 arch/arm64/boot/dts/qcom/msm8996.dtsi         |  6 +++--
 arch/arm64/boot/dts/qcom/sdm845.dtsi          |  4 ++--
 drivers/phy/qualcomm/phy-qcom-qmp.c           | 23 ++++++++++++++++++-
 4 files changed, 33 insertions(+), 11 deletions(-)

-- 
2.18.1


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

* [PATCH v1 1/4] dt-bindings: phy-qcom-qmp: Move #clock-cells to child
  2018-11-29 22:13 [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Evan Green
@ 2018-11-29 22:13 ` Evan Green
  2018-12-03 22:37   ` Stephen Boyd
  2018-11-29 22:13 ` [PATCH v1 2/4] arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells Evan Green
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 16+ messages in thread
From: Evan Green @ 2018-11-29 22:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Rob Herring, Andy Gross
  Cc: Douglas Anderson, Stephen Boyd, Evan Green, devicetree,
	Mark Rutland, linux-kernel

The phy-qcom-qmp bindings specified #clock-cells as 1. This was never used
because of_clk_add_provider() was never called, so there was no way anybody
could reference these clocks from DT. Furthermore, even if they could be
accessed, the bindings never specified what should go in that additional
cell.

Fix these incomplete and broken bindings. Move the #clock-cells into the
child node, since that is the actual clock provider, and not all
instances of qcom-qmp-phy are clock providers. Also set #clock-cells to
zero, since there's nothing to pass to it.

Signed-off-by: Evan Green <evgreen@chromium.org>
---

 .../devicetree/bindings/phy/qcom-qmp-phy.txt          | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt b/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
index f7b532125a4d9..41a1074228ba7 100644
--- a/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
+++ b/Documentation/devicetree/bindings/phy/qcom-qmp-phy.txt
@@ -25,10 +25,6 @@ Required properties:
   - For all others:
     - The reg-names property shouldn't be defined.
 
- - #clock-cells: must be 1 (PCIe and USB3 PHYs only)
-    - Phy pll outputs a bunch of clocks for Tx, Rx and Pipe
-      interface (for pipe based PHYs). These clock are then gate-controlled
-      by gcc.
  - #address-cells: must be 1
  - #size-cells: must be 1
  - ranges: must be present
@@ -106,6 +102,9 @@ Required properties for child node of PCIe and USB3 qmp phys:
 		- "pcie20_phy0_pipe_clk"	Pipe Clock parent
 			(or)
 		  "pcie20_phy1_pipe_clk"
+ - #clock-cells: must be 0
+    - Phy pll outputs pipe clocks for pipe based PHYs. These clocks are then
+      gate-controlled by the gcc.
 
 Required properties for child node of PHYs with lane reset, AKA:
 	"qcom,msm8996-qmp-pcie-phy"
@@ -118,7 +117,6 @@ Example:
 	phy@34000 {
 		compatible = "qcom,msm8996-qmp-pcie-phy";
 		reg = <0x34000 0x488>;
-		#clock-cells = <1>;
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges;
@@ -140,6 +138,7 @@ Example:
 			reg = <0x35000 0x130>,
 				<0x35200 0x200>,
 				<0x35400 0x1dc>;
+			#clock-cells = <0>;
 			#phy-cells = <0>;
 
 			clocks = <&gcc GCC_PCIE_0_PIPE_CLK>;
@@ -157,7 +156,6 @@ Example:
 	phy@88eb000 {
 		compatible = "qcom,sdm845-qmp-usb3-uni-phy";
 		reg = <0x88eb000 0x18c>;
-		#clock-cells = <1>;
 		#address-cells = <1>;
 		#size-cells = <1>;
 		ranges;
@@ -177,6 +175,7 @@ Example:
 			      <0x88eb400 0x1fc>,
 			      <0x88eb800 0x218>,
 			      <0x88eb600 0x70>;
+			#clock-cells = <0>;
 			#phy-cells = <0>;
 			clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>;
 			clock-names = "pipe0";
-- 
2.18.1


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

* [PATCH v1 2/4] arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells
  2018-11-29 22:13 [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Evan Green
  2018-11-29 22:13 ` [PATCH v1 1/4] dt-bindings: phy-qcom-qmp: Move #clock-cells to child Evan Green
@ 2018-11-29 22:13 ` Evan Green
  2018-12-03 22:37   ` Stephen Boyd
  2018-12-07  8:32   ` Vivek Gautam
  2018-11-29 22:13 ` [PATCH v1 3/4] arm64: dts: qcom: sdm845: " Evan Green
                   ` (2 subsequent siblings)
  4 siblings, 2 replies; 16+ messages in thread
From: Evan Green @ 2018-11-29 22:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Rob Herring, Andy Gross
  Cc: Douglas Anderson, Stephen Boyd, Evan Green, devicetree,
	linux-arm-msm, linux-kernel, David Brown, Mark Rutland,
	linux-soc

Move #clock-cells into the child node and set it to 0 to conform to the
proper binding specification.

Signed-off-by: Evan Green <evgreen@chromium.org>
---

 arch/arm64/boot/dts/qcom/msm8996.dtsi | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
index 13bb96444df00..4af740ca0880f 100644
--- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
+++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
@@ -767,7 +767,6 @@
 		phy@34000 {
 			compatible = "qcom,msm8996-qmp-pcie-phy";
 			reg = <0x34000 0x488>;
-			#clock-cells = <1>;
 			#address-cells = <1>;
 			#size-cells = <1>;
 			ranges;
@@ -790,6 +789,7 @@
 				reg = <0x035000 0x130>,
 					<0x035200 0x200>,
 					<0x035400 0x1dc>;
+				#clock-cells = <0>;
 				#phy-cells = <0>;
 
 				clock-output-names = "pcie_0_pipe_clk_src";
@@ -803,6 +803,7 @@
 				reg = <0x036000 0x130>,
 					<0x036200 0x200>,
 					<0x036400 0x1dc>;
+				#clock-cells = <0>;
 				#phy-cells = <0>;
 
 				clock-output-names = "pcie_1_pipe_clk_src";
@@ -816,6 +817,7 @@
 				reg = <0x037000 0x130>,
 					<0x037200 0x200>,
 					<0x037400 0x1dc>;
+				#clock-cells = <0>;
 				#phy-cells = <0>;
 
 				clock-output-names = "pcie_2_pipe_clk_src";
@@ -829,7 +831,6 @@
 		phy@7410000 {
 			compatible = "qcom,msm8996-qmp-usb3-phy";
 			reg = <0x7410000 0x1c4>;
-			#clock-cells = <1>;
 			#address-cells = <1>;
 			#size-cells = <1>;
 			ranges;
@@ -851,6 +852,7 @@
 				reg = <0x7410200 0x200>,
 					<0x7410400 0x130>,
 					<0x7410600 0x1a8>;
+				#clock-cells = <0>;
 				#phy-cells = <0>;
 
 				clock-output-names = "usb3_phy_pipe_clk_src";
-- 
2.18.1


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

* [PATCH v1 3/4] arm64: dts: qcom: sdm845: Fix QMP PHY #clock-cells
  2018-11-29 22:13 [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Evan Green
  2018-11-29 22:13 ` [PATCH v1 1/4] dt-bindings: phy-qcom-qmp: Move #clock-cells to child Evan Green
  2018-11-29 22:13 ` [PATCH v1 2/4] arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells Evan Green
@ 2018-11-29 22:13 ` " Evan Green
  2018-12-03 22:37   ` Stephen Boyd
  2018-11-29 22:13 ` [PATCH v1 4/4] phy: qcom-qmp: Expose provided clocks to DT Evan Green
  2018-12-04  8:12 ` [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Kishon Vijay Abraham I
  4 siblings, 1 reply; 16+ messages in thread
From: Evan Green @ 2018-11-29 22:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Rob Herring, Andy Gross
  Cc: Douglas Anderson, Stephen Boyd, Evan Green, devicetree,
	linux-arm-msm, linux-kernel, David Brown, Mark Rutland,
	linux-soc

Move #clock-cells into the child node for instances of the qcom-qmp-phy
nodes, and set it to zero, in accordance with the proper bindings. PHYs
that don't provide clocks don't have #clock-cells, and so are left alone.

Signed-off-by: Evan Green <evgreen@chromium.org>
---

 arch/arm64/boot/dts/qcom/sdm845.dtsi | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/arm64/boot/dts/qcom/sdm845.dtsi b/arch/arm64/boot/dts/qcom/sdm845.dtsi
index 61a7cee153eae..4582db5e86350 100644
--- a/arch/arm64/boot/dts/qcom/sdm845.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845.dtsi
@@ -1178,7 +1178,6 @@
 			      <0x88e8000 0x10>;
 			reg-names = "reg-base", "dp_com";
 			status = "disabled";
-			#clock-cells = <1>;
 			#address-cells = <1>;
 			#size-cells = <1>;
 			ranges;
@@ -1200,6 +1199,7 @@
 				      <0x88e9600 0x128>,
 				      <0x88e9800 0x200>,
 				      <0x88e9a00 0x100>;
+				#clock-cells = <0>;
 				#phy-cells = <0>;
 				clocks = <&gcc GCC_USB3_PRIM_PHY_PIPE_CLK>;
 				clock-names = "pipe0";
@@ -1211,7 +1211,6 @@
 			compatible = "qcom,sdm845-qmp-usb3-uni-phy";
 			reg = <0x88eb000 0x18c>;
 			status = "disabled";
-			#clock-cells = <1>;
 			#address-cells = <1>;
 			#size-cells = <1>;
 			ranges;
@@ -1231,6 +1230,7 @@
 				      <0x88eb400 0x1fc>,
 				      <0x88eb800 0x218>,
 				      <0x88e9600 0x70>;
+				#clock-cells = <0>;
 				#phy-cells = <0>;
 				clocks = <&gcc GCC_USB3_SEC_PHY_PIPE_CLK>;
 				clock-names = "pipe0";
-- 
2.18.1


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

* [PATCH v1 4/4] phy: qcom-qmp: Expose provided clocks to DT
  2018-11-29 22:13 [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Evan Green
                   ` (2 preceding siblings ...)
  2018-11-29 22:13 ` [PATCH v1 3/4] arm64: dts: qcom: sdm845: " Evan Green
@ 2018-11-29 22:13 ` Evan Green
  2018-12-03 22:38   ` Stephen Boyd
  2018-12-07  8:34   ` Vivek Gautam
  2018-12-04  8:12 ` [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Kishon Vijay Abraham I
  4 siblings, 2 replies; 16+ messages in thread
From: Evan Green @ 2018-11-29 22:13 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Rob Herring, Andy Gross
  Cc: Douglas Anderson, Stephen Boyd, Evan Green, Rob Herring, Can Guo,
	linux-kernel, Vivek Gautam, Manu Gautam

Register a simple clock provider for the PHY pipe clock sources so that
device tree users can point at these clocks via phandles to the lane
nodes.

Signed-off-by: Evan Green <evgreen@chromium.org>
---

 drivers/phy/qualcomm/phy-qcom-qmp.c | 23 ++++++++++++++++++++++-
 1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
index 8204d55e2d650..b4006818e1b65 100644
--- a/drivers/phy/qualcomm/phy-qcom-qmp.c
+++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
@@ -1542,6 +1542,11 @@ static int qcom_qmp_phy_clk_init(struct device *dev)
 	return devm_clk_bulk_get(dev, num, qmp->clks);
 }
 
+static void phy_pipe_clk_release_provider(void *res)
+{
+	of_clk_del_provider(res);
+}
+
 /*
  * Register a fixed rate pipe clock.
  *
@@ -1588,7 +1593,23 @@ static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np)
 	fixed->fixed_rate = 125000000;
 	fixed->hw.init = &init;
 
-	return devm_clk_hw_register(qmp->dev, &fixed->hw);
+	ret = devm_clk_hw_register(qmp->dev, &fixed->hw);
+	if (ret)
+		return ret;
+
+	ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &fixed->hw);
+	if (ret)
+		return ret;
+
+	/*
+	 * Roll a devm action because the clock provider is the child node, but
+	 * the child node is not actually a device.
+	 */
+	ret = devm_add_action(qmp->dev, phy_pipe_clk_release_provider, np);
+	if (ret)
+		phy_pipe_clk_release_provider(np);
+
+	return ret;
 }
 
 static const struct phy_ops qcom_qmp_phy_gen_ops = {
-- 
2.18.1


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

* Re: [PATCH v1 1/4] dt-bindings: phy-qcom-qmp: Move #clock-cells to child
  2018-11-29 22:13 ` [PATCH v1 1/4] dt-bindings: phy-qcom-qmp: Move #clock-cells to child Evan Green
@ 2018-12-03 22:37   ` Stephen Boyd
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Boyd @ 2018-12-03 22:37 UTC (permalink / raw)
  To: Andy Gross, Evan Green, Kishon Vijay Abraham I, Rob Herring
  Cc: Douglas Anderson, Evan Green, devicetree, Mark Rutland, linux-kernel

Quoting Evan Green (2018-11-29 14:13:54)
> The phy-qcom-qmp bindings specified #clock-cells as 1. This was never used
> because of_clk_add_provider() was never called, so there was no way anybody
> could reference these clocks from DT. Furthermore, even if they could be
> accessed, the bindings never specified what should go in that additional
> cell.
> 
> Fix these incomplete and broken bindings. Move the #clock-cells into the
> child node, since that is the actual clock provider, and not all
> instances of qcom-qmp-phy are clock providers. Also set #clock-cells to
> zero, since there's nothing to pass to it.
> 
> Signed-off-by: Evan Green <evgreen@chromium.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>


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

* Re: [PATCH v1 2/4] arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells
  2018-11-29 22:13 ` [PATCH v1 2/4] arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells Evan Green
@ 2018-12-03 22:37   ` Stephen Boyd
  2018-12-07  8:32   ` Vivek Gautam
  1 sibling, 0 replies; 16+ messages in thread
From: Stephen Boyd @ 2018-12-03 22:37 UTC (permalink / raw)
  To: Andy Gross, Evan Green, Kishon Vijay Abraham I, Rob Herring
  Cc: Douglas Anderson, Evan Green, devicetree, linux-arm-msm,
	linux-kernel, David Brown, Mark Rutland, linux-soc

Quoting Evan Green (2018-11-29 14:13:55)
> Move #clock-cells into the child node and set it to 0 to conform to the
> proper binding specification.
> 
> Signed-off-by: Evan Green <evgreen@chromium.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>


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

* Re: [PATCH v1 3/4] arm64: dts: qcom: sdm845: Fix QMP PHY #clock-cells
  2018-11-29 22:13 ` [PATCH v1 3/4] arm64: dts: qcom: sdm845: " Evan Green
@ 2018-12-03 22:37   ` Stephen Boyd
  0 siblings, 0 replies; 16+ messages in thread
From: Stephen Boyd @ 2018-12-03 22:37 UTC (permalink / raw)
  To: Andy Gross, Evan Green, Kishon Vijay Abraham I, Rob Herring
  Cc: Douglas Anderson, Evan Green, devicetree, linux-arm-msm,
	linux-kernel, David Brown, Mark Rutland, linux-soc

Quoting Evan Green (2018-11-29 14:13:56)
> Move #clock-cells into the child node for instances of the qcom-qmp-phy
> nodes, and set it to zero, in accordance with the proper bindings. PHYs
> that don't provide clocks don't have #clock-cells, and so are left alone.
> 
> Signed-off-by: Evan Green <evgreen@chromium.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>


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

* Re: [PATCH v1 4/4] phy: qcom-qmp: Expose provided clocks to DT
  2018-11-29 22:13 ` [PATCH v1 4/4] phy: qcom-qmp: Expose provided clocks to DT Evan Green
@ 2018-12-03 22:38   ` Stephen Boyd
  2018-12-03 23:12     ` Evan Green
  2018-12-07  8:34   ` Vivek Gautam
  1 sibling, 1 reply; 16+ messages in thread
From: Stephen Boyd @ 2018-12-03 22:38 UTC (permalink / raw)
  To: Andy Gross, Evan Green, Kishon Vijay Abraham I, Rob Herring
  Cc: Douglas Anderson, Evan Green, Rob Herring, Can Guo, linux-kernel,
	Vivek Gautam, Manu Gautam

Quoting Evan Green (2018-11-29 14:13:57)
> Register a simple clock provider for the PHY pipe clock sources so that
> device tree users can point at these clocks via phandles to the lane
> nodes.
> 
> Signed-off-by: Evan Green <evgreen@chromium.org>
> ---

Reviewed-by: Stephen Boyd <swboyd@chromium.org>


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

* Re: [PATCH v1 4/4] phy: qcom-qmp: Expose provided clocks to DT
  2018-12-03 22:38   ` Stephen Boyd
@ 2018-12-03 23:12     ` Evan Green
  0 siblings, 0 replies; 16+ messages in thread
From: Evan Green @ 2018-12-03 23:12 UTC (permalink / raw)
  To: swboyd
  Cc: Andy Gross, kishon, robh+dt, Doug Anderson, robh, cang,
	linux-kernel, vivek.gautam, Manu Gautam

On Mon, Dec 3, 2018 at 2:38 PM Stephen Boyd <swboyd@chromium.org> wrote:
>
> Quoting Evan Green (2018-11-29 14:13:57)
> > Register a simple clock provider for the PHY pipe clock sources so that
> > device tree users can point at these clocks via phandles to the lane
> > nodes.
> >
> > Signed-off-by: Evan Green <evgreen@chromium.org>
> > ---
>
> Reviewed-by: Stephen Boyd <swboyd@chromium.org>
>

Thanks! I meant to add you in the CC line on this series, sorry I missed that.
-Evan

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

* Re: [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider
  2018-11-29 22:13 [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Evan Green
                   ` (3 preceding siblings ...)
  2018-11-29 22:13 ` [PATCH v1 4/4] phy: qcom-qmp: Expose provided clocks to DT Evan Green
@ 2018-12-04  8:12 ` Kishon Vijay Abraham I
  2018-12-04 12:37   ` Vivek Gautam
  4 siblings, 1 reply; 16+ messages in thread
From: Kishon Vijay Abraham I @ 2018-12-04  8:12 UTC (permalink / raw)
  To: Evan Green, Rob Herring, Andy Gross, Vivek Gautam, David Brown
  Cc: Douglas Anderson, Stephen Boyd, devicetree, Rob Herring,
	linux-arm-msm, Can Guo, linux-kernel, Manu Gautam, Mark Rutland,
	linux-soc

Hi Andy Gross, David Brown, Vivek,

On 30/11/18 3:43 AM, Evan Green wrote:
> This series fixes the QMP PHY bindings, which had specified #clock-cells
> in the parent node, and had set it to 1. Putting it in the parent node is
> wrong because the clock providers are the child nodes, so this change
> moves it there. Having it set to 1 is also wrong, since nothing is ever
> specified as to what should go in that cell. So this changes it to zero.
> Finally, this change completes a little bit of code to actually allow these
> exposed clocks to be pointed at in DT.
> 
> I had no idea how to fix up ipq8074.dtsi. It seems to be completely wrong in
> that it doesn't specify #clock-cells at all, has no child nodes, and
> specifies clock-output-names in the parent node. As far as I can tell this
> doesn't work at all. But I can't add the child nodes myself because I don't know
> 1) how many there are, and 2) the registers in them. I also have no way to test it.
> 
> Speaking of testing, I was able to test this on sdm845, but haven't tested msm8996.

Can someone help test this series in msm8996?

Thanks
Kishon

> 
> This patch sits atop the UFS device nodes series [1].
> 
> [1] https://lore.kernel.org/lkml/20181026173544.136037-1-evgreen@chromium.org/
> 
> 
> 
> Evan Green (4):
>   dt-bindings: phy-qcom-qmp: Move #clock-cells to child
>   arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells
>   arm64: dts: qcom: sdm845: Fix QMP PHY #clock-cells
>   phy: qcom-qmp: Expose provided clocks to DT
> 
>  .../devicetree/bindings/phy/qcom-qmp-phy.txt  | 11 ++++-----
>  arch/arm64/boot/dts/qcom/msm8996.dtsi         |  6 +++--
>  arch/arm64/boot/dts/qcom/sdm845.dtsi          |  4 ++--
>  drivers/phy/qualcomm/phy-qcom-qmp.c           | 23 ++++++++++++++++++-
>  4 files changed, 33 insertions(+), 11 deletions(-)
> 

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

* Re: [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider
  2018-12-04  8:12 ` [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Kishon Vijay Abraham I
@ 2018-12-04 12:37   ` Vivek Gautam
  2018-12-07  4:43     ` Kishon Vijay Abraham I
  0 siblings, 1 reply; 16+ messages in thread
From: Vivek Gautam @ 2018-12-04 12:37 UTC (permalink / raw)
  To: kishon
  Cc: evgreen, robh+dt, Andy Gross, David Brown, Doug Anderson, swboyd,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring, linux-arm-msm, Can Guo, open list, Manu Gautam,
	Mark Rutland, open list:ARM/QUALCOMM SUPPORT

Hi Kishon,

On Tue, Dec 4, 2018 at 1:44 PM Kishon Vijay Abraham I <kishon@ti.com> wrote:
>
> Hi Andy Gross, David Brown, Vivek,
>
> On 30/11/18 3:43 AM, Evan Green wrote:
> > This series fixes the QMP PHY bindings, which had specified #clock-cells
> > in the parent node, and had set it to 1. Putting it in the parent node is
> > wrong because the clock providers are the child nodes, so this change
> > moves it there. Having it set to 1 is also wrong, since nothing is ever
> > specified as to what should go in that cell. So this changes it to zero.
> > Finally, this change completes a little bit of code to actually allow these
> > exposed clocks to be pointed at in DT.
> >
> > I had no idea how to fix up ipq8074.dtsi. It seems to be completely wrong in
> > that it doesn't specify #clock-cells at all, has no child nodes, and
> > specifies clock-output-names in the parent node. As far as I can tell this
> > doesn't work at all. But I can't add the child nodes myself because I don't know
> > 1) how many there are, and 2) the registers in them. I also have no way to test it.
> >
> > Speaking of testing, I was able to test this on sdm845, but haven't tested msm8996.
>
> Can someone help test this series in msm8996?

Sure, will give it a try tomorrow.

Thanks
Vivek

>
> Thanks
> Kishon
>
> >
> > This patch sits atop the UFS device nodes series [1].
> >
> > [1] https://lore.kernel.org/lkml/20181026173544.136037-1-evgreen@chromium.org/
> >
> >
> >
> > Evan Green (4):
> >   dt-bindings: phy-qcom-qmp: Move #clock-cells to child
> >   arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells
> >   arm64: dts: qcom: sdm845: Fix QMP PHY #clock-cells
> >   phy: qcom-qmp: Expose provided clocks to DT
> >
> >  .../devicetree/bindings/phy/qcom-qmp-phy.txt  | 11 ++++-----
> >  arch/arm64/boot/dts/qcom/msm8996.dtsi         |  6 +++--
> >  arch/arm64/boot/dts/qcom/sdm845.dtsi          |  4 ++--
> >  drivers/phy/qualcomm/phy-qcom-qmp.c           | 23 ++++++++++++++++++-
> >  4 files changed, 33 insertions(+), 11 deletions(-)
> >



-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* Re: [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider
  2018-12-04 12:37   ` Vivek Gautam
@ 2018-12-07  4:43     ` Kishon Vijay Abraham I
  2018-12-07  6:25       ` Vivek Gautam
  0 siblings, 1 reply; 16+ messages in thread
From: Kishon Vijay Abraham I @ 2018-12-07  4:43 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: evgreen, robh+dt, Andy Gross, David Brown, Doug Anderson, swboyd,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring, linux-arm-msm, Can Guo, open list, Manu Gautam,
	Mark Rutland, open list:ARM/QUALCOMM SUPPORT

Vivek,

On 04/12/18 6:07 PM, Vivek Gautam wrote:
> Hi Kishon,
> 
> On Tue, Dec 4, 2018 at 1:44 PM Kishon Vijay Abraham I <kishon@ti.com> wrote:
>>
>> Hi Andy Gross, David Brown, Vivek,
>>
>> On 30/11/18 3:43 AM, Evan Green wrote:
>>> This series fixes the QMP PHY bindings, which had specified #clock-cells
>>> in the parent node, and had set it to 1. Putting it in the parent node is
>>> wrong because the clock providers are the child nodes, so this change
>>> moves it there. Having it set to 1 is also wrong, since nothing is ever
>>> specified as to what should go in that cell. So this changes it to zero.
>>> Finally, this change completes a little bit of code to actually allow these
>>> exposed clocks to be pointed at in DT.
>>>
>>> I had no idea how to fix up ipq8074.dtsi. It seems to be completely wrong in
>>> that it doesn't specify #clock-cells at all, has no child nodes, and
>>> specifies clock-output-names in the parent node. As far as I can tell this
>>> doesn't work at all. But I can't add the child nodes myself because I don't know
>>> 1) how many there are, and 2) the registers in them. I also have no way to test it.
>>>
>>> Speaking of testing, I was able to test this on sdm845, but haven't tested msm8996.
>>
>> Can someone help test this series in msm8996?
> 
> Sure, will give it a try tomorrow.

I'm planning to close the merge by today. Can you test this series please?

Thanks
Kishon

> 
> Thanks
> Vivek
> 
>>
>> Thanks
>> Kishon
>>
>>>
>>> This patch sits atop the UFS device nodes series [1].
>>>
>>> [1] https://lore.kernel.org/lkml/20181026173544.136037-1-evgreen@chromium.org/
>>>
>>>
>>>
>>> Evan Green (4):
>>>   dt-bindings: phy-qcom-qmp: Move #clock-cells to child
>>>   arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells
>>>   arm64: dts: qcom: sdm845: Fix QMP PHY #clock-cells
>>>   phy: qcom-qmp: Expose provided clocks to DT
>>>
>>>  .../devicetree/bindings/phy/qcom-qmp-phy.txt  | 11 ++++-----
>>>  arch/arm64/boot/dts/qcom/msm8996.dtsi         |  6 +++--
>>>  arch/arm64/boot/dts/qcom/sdm845.dtsi          |  4 ++--
>>>  drivers/phy/qualcomm/phy-qcom-qmp.c           | 23 ++++++++++++++++++-
>>>  4 files changed, 33 insertions(+), 11 deletions(-)
>>>
> 
> 
> 

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

* Re: [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider
  2018-12-07  4:43     ` Kishon Vijay Abraham I
@ 2018-12-07  6:25       ` Vivek Gautam
  0 siblings, 0 replies; 16+ messages in thread
From: Vivek Gautam @ 2018-12-07  6:25 UTC (permalink / raw)
  To: kishon
  Cc: evgreen, robh+dt, Andy Gross, David Brown, Doug Anderson, swboyd,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	Rob Herring, linux-arm-msm, Can Guo, open list, Manu Gautam,
	Mark Rutland, open list:ARM/QUALCOMM SUPPORT

Hi,

On Fri, Dec 7, 2018 at 10:15 AM Kishon Vijay Abraham I <kishon@ti.com> wrote:
>
> Vivek,
>
> On 04/12/18 6:07 PM, Vivek Gautam wrote:
> > Hi Kishon,
> >
> > On Tue, Dec 4, 2018 at 1:44 PM Kishon Vijay Abraham I <kishon@ti.com> wrote:
> >>
> >> Hi Andy Gross, David Brown, Vivek,
> >>
> >> On 30/11/18 3:43 AM, Evan Green wrote:
> >>> This series fixes the QMP PHY bindings, which had specified #clock-cells
> >>> in the parent node, and had set it to 1. Putting it in the parent node is
> >>> wrong because the clock providers are the child nodes, so this change
> >>> moves it there. Having it set to 1 is also wrong, since nothing is ever
> >>> specified as to what should go in that cell. So this changes it to zero.
> >>> Finally, this change completes a little bit of code to actually allow these
> >>> exposed clocks to be pointed at in DT.
> >>>
> >>> I had no idea how to fix up ipq8074.dtsi. It seems to be completely wrong in
> >>> that it doesn't specify #clock-cells at all, has no child nodes, and
> >>> specifies clock-output-names in the parent node. As far as I can tell this
> >>> doesn't work at all. But I can't add the child nodes myself because I don't know
> >>> 1) how many there are, and 2) the registers in them. I also have no way to test it.
> >>>
> >>> Speaking of testing, I was able to test this on sdm845, but haven't tested msm8996.
> >>
> >> Can someone help test this series in msm8996?
> >
> > Sure, will give it a try tomorrow.
>
> I'm planning to close the merge by today. Can you test this series please?

Sorry, got held up with an issue yesterday. Will update you in couple of hours.

Thanks
Vivek

[snip]


-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* Re: [PATCH v1 2/4] arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells
  2018-11-29 22:13 ` [PATCH v1 2/4] arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells Evan Green
  2018-12-03 22:37   ` Stephen Boyd
@ 2018-12-07  8:32   ` Vivek Gautam
  1 sibling, 0 replies; 16+ messages in thread
From: Vivek Gautam @ 2018-12-07  8:32 UTC (permalink / raw)
  To: evgreen
  Cc: kishon, robh+dt, Andy Gross, Doug Anderson, swboyd,
	open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS,
	linux-arm-msm, open list, David Brown, Mark Rutland,
	open list:ARM/QUALCOMM SUPPORT

On Fri, Nov 30, 2018 at 3:45 AM Evan Green <evgreen@chromium.org> wrote:
>
> Move #clock-cells into the child node and set it to 0 to conform to the
> proper binding specification.
>
> Signed-off-by: Evan Green <evgreen@chromium.org>
> ---
>
>  arch/arm64/boot/dts/qcom/msm8996.dtsi | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/msm8996.dtsi b/arch/arm64/boot/dts/qcom/msm8996.dtsi
> index 13bb96444df00..4af740ca0880f 100644
> --- a/arch/arm64/boot/dts/qcom/msm8996.dtsi
> +++ b/arch/arm64/boot/dts/qcom/msm8996.dtsi
> @@ -767,7 +767,6 @@
>                 phy@34000 {
>                         compatible = "qcom,msm8996-qmp-pcie-phy";
>                         reg = <0x34000 0x488>;
> -                       #clock-cells = <1>;
>                         #address-cells = <1>;
>                         #size-cells = <1>;
>                         ranges;
> @@ -790,6 +789,7 @@
>                                 reg = <0x035000 0x130>,
>                                         <0x035200 0x200>,
>                                         <0x035400 0x1dc>;
> +                               #clock-cells = <0>;
>                                 #phy-cells = <0>;
>
>                                 clock-output-names = "pcie_0_pipe_clk_src";
> @@ -803,6 +803,7 @@
>                                 reg = <0x036000 0x130>,
>                                         <0x036200 0x200>,
>                                         <0x036400 0x1dc>;
> +                               #clock-cells = <0>;
>                                 #phy-cells = <0>;
>
>                                 clock-output-names = "pcie_1_pipe_clk_src";
> @@ -816,6 +817,7 @@
>                                 reg = <0x037000 0x130>,
>                                         <0x037200 0x200>,
>                                         <0x037400 0x1dc>;
> +                               #clock-cells = <0>;
>                                 #phy-cells = <0>;
>
>                                 clock-output-names = "pcie_2_pipe_clk_src";
> @@ -829,7 +831,6 @@
>                 phy@7410000 {
>                         compatible = "qcom,msm8996-qmp-usb3-phy";
>                         reg = <0x7410000 0x1c4>;
> -                       #clock-cells = <1>;
>                         #address-cells = <1>;
>                         #size-cells = <1>;
>                         ranges;
> @@ -851,6 +852,7 @@
>                                 reg = <0x7410200 0x200>,
>                                         <0x7410400 0x130>,
>                                         <0x7410600 0x1a8>;
> +                               #clock-cells = <0>;
>                                 #phy-cells = <0>;
>
>                                 clock-output-names = "usb3_phy_pipe_clk_src";
> --
> 2.18.1
>

Tested on db820c [1]
Tested-by: Vivek Gautam <vivek.gautam@codeaurora.org>

[1] https://github.com/vivekgautam1/linux/tree/origin/v4.20-rc5/db820c

BRs
Vivek

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

* Re: [PATCH v1 4/4] phy: qcom-qmp: Expose provided clocks to DT
  2018-11-29 22:13 ` [PATCH v1 4/4] phy: qcom-qmp: Expose provided clocks to DT Evan Green
  2018-12-03 22:38   ` Stephen Boyd
@ 2018-12-07  8:34   ` Vivek Gautam
  1 sibling, 0 replies; 16+ messages in thread
From: Vivek Gautam @ 2018-12-07  8:34 UTC (permalink / raw)
  To: evgreen
  Cc: kishon, robh+dt, Andy Gross, Doug Anderson, swboyd, Rob Herring,
	Can Guo, open list, Manu Gautam

On Fri, Nov 30, 2018 at 3:46 AM Evan Green <evgreen@chromium.org> wrote:
>
> Register a simple clock provider for the PHY pipe clock sources so that
> device tree users can point at these clocks via phandles to the lane
> nodes.
>
> Signed-off-by: Evan Green <evgreen@chromium.org>
> ---
>
>  drivers/phy/qualcomm/phy-qcom-qmp.c | 23 ++++++++++++++++++++++-
>  1 file changed, 22 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c
> index 8204d55e2d650..b4006818e1b65 100644
> --- a/drivers/phy/qualcomm/phy-qcom-qmp.c
> +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c
> @@ -1542,6 +1542,11 @@ static int qcom_qmp_phy_clk_init(struct device *dev)
>         return devm_clk_bulk_get(dev, num, qmp->clks);
>  }
>
> +static void phy_pipe_clk_release_provider(void *res)
> +{
> +       of_clk_del_provider(res);
> +}
> +
>  /*
>   * Register a fixed rate pipe clock.
>   *
> @@ -1588,7 +1593,23 @@ static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np)
>         fixed->fixed_rate = 125000000;
>         fixed->hw.init = &init;
>
> -       return devm_clk_hw_register(qmp->dev, &fixed->hw);
> +       ret = devm_clk_hw_register(qmp->dev, &fixed->hw);
> +       if (ret)
> +               return ret;
> +
> +       ret = of_clk_add_hw_provider(np, of_clk_hw_simple_get, &fixed->hw);
> +       if (ret)
> +               return ret;
> +
> +       /*
> +        * Roll a devm action because the clock provider is the child node, but
> +        * the child node is not actually a device.
> +        */
> +       ret = devm_add_action(qmp->dev, phy_pipe_clk_release_provider, np);
> +       if (ret)
> +               phy_pipe_clk_release_provider(np);
> +
> +       return ret;
>  }
>
>  static const struct phy_ops qcom_qmp_phy_gen_ops = {
> --
> 2.18.1
>

Tested on db820c [1]
Tested-by: Vivek Gautam <vivek.gautam@codeaurora.org>

[1] https://github.com/vivekgautam1/linux/tree/origin/v4.20-rc5/db820c

BRs
Vivek

-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member
of Code Aurora Forum, hosted by The Linux Foundation

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

end of thread, back to index

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-29 22:13 [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Evan Green
2018-11-29 22:13 ` [PATCH v1 1/4] dt-bindings: phy-qcom-qmp: Move #clock-cells to child Evan Green
2018-12-03 22:37   ` Stephen Boyd
2018-11-29 22:13 ` [PATCH v1 2/4] arm64: dts: qcom: msm8996: Fix QMP PHY #clock-cells Evan Green
2018-12-03 22:37   ` Stephen Boyd
2018-12-07  8:32   ` Vivek Gautam
2018-11-29 22:13 ` [PATCH v1 3/4] arm64: dts: qcom: sdm845: " Evan Green
2018-12-03 22:37   ` Stephen Boyd
2018-11-29 22:13 ` [PATCH v1 4/4] phy: qcom-qmp: Expose provided clocks to DT Evan Green
2018-12-03 22:38   ` Stephen Boyd
2018-12-03 23:12     ` Evan Green
2018-12-07  8:34   ` Vivek Gautam
2018-12-04  8:12 ` [PATCH v1 0/4] phy: qcom-qmp: Fix clock-cells binding and provider Kishon Vijay Abraham I
2018-12-04 12:37   ` Vivek Gautam
2018-12-07  4:43     ` Kishon Vijay Abraham I
2018-12-07  6:25       ` Vivek Gautam

LKML Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/lkml/0 lkml/git/0.git
	git clone --mirror https://lore.kernel.org/lkml/1 lkml/git/1.git
	git clone --mirror https://lore.kernel.org/lkml/2 lkml/git/2.git
	git clone --mirror https://lore.kernel.org/lkml/3 lkml/git/3.git
	git clone --mirror https://lore.kernel.org/lkml/4 lkml/git/4.git
	git clone --mirror https://lore.kernel.org/lkml/5 lkml/git/5.git
	git clone --mirror https://lore.kernel.org/lkml/6 lkml/git/6.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 lkml lkml/ https://lore.kernel.org/lkml \
		linux-kernel@vger.kernel.org linux-kernel@archiver.kernel.org
	public-inbox-index lkml


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-kernel


AGPL code for this site: git clone https://public-inbox.org/ public-inbox