All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] dt-bindings: mfd: brcm,cru: add clkset syscon
@ 2021-09-13  8:00 ` Rafał Miłecki
  0 siblings, 0 replies; 24+ messages in thread
From: Rafał Miłecki @ 2021-09-13  8:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Lee Jones, Rob Herring
  Cc: linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

CRU has a shared register that is used e.g. to control USB 2.0 PHY block
access. It's a single 32 b register. Document it as syscon so it can be
used with a regmap.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 Documentation/devicetree/bindings/mfd/brcm,cru.yaml | 8 ++++++++
 Documentation/devicetree/bindings/mfd/syscon.yaml   | 1 +
 2 files changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/brcm,cru.yaml b/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
index fc1317ab3226..bf4e585d3c18 100644
--- a/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
+++ b/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
@@ -39,6 +39,9 @@ patternProperties:
   '^clock-controller@[a-f0-9]+$':
     $ref: ../clock/brcm,iproc-clocks.yaml
 
+  '^syscon@[a-f0-9]+$':
+    $ref: syscon.yaml
+
   '^thermal@[a-f0-9]+$':
     $ref: ../thermal/brcm,ns-thermal.yaml
 
@@ -73,6 +76,11 @@ examples:
                                  "iprocfast", "sata1", "sata2";
         };
 
+        syscon@180 {
+            compatible = "brcm,cru-clkset", "syscon";
+            reg = <0x180 0x4>;
+        };
+
         pinctrl {
             compatible = "brcm,bcm4708-pinmux";
             offset = <0x1c0>;
diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index abe3fd817e0b..0dcffc273c2b 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -38,6 +38,7 @@ properties:
               - allwinner,sun8i-h3-system-controller
               - allwinner,sun8i-v3s-system-controller
               - allwinner,sun50i-a64-system-controller
+              - brcm,cru-clkset
               - hisilicon,dsa-subctrl
               - hisilicon,hi6220-sramctrl
               - hisilicon,pcie-sas-subctrl
-- 
2.26.2


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

* [PATCH 1/4] dt-bindings: mfd: brcm,cru: add clkset syscon
@ 2021-09-13  8:00 ` Rafał Miłecki
  0 siblings, 0 replies; 24+ messages in thread
From: Rafał Miłecki @ 2021-09-13  8:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Lee Jones, Rob Herring
  Cc: linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

CRU has a shared register that is used e.g. to control USB 2.0 PHY block
access. It's a single 32 b register. Document it as syscon so it can be
used with a regmap.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 Documentation/devicetree/bindings/mfd/brcm,cru.yaml | 8 ++++++++
 Documentation/devicetree/bindings/mfd/syscon.yaml   | 1 +
 2 files changed, 9 insertions(+)

diff --git a/Documentation/devicetree/bindings/mfd/brcm,cru.yaml b/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
index fc1317ab3226..bf4e585d3c18 100644
--- a/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
+++ b/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
@@ -39,6 +39,9 @@ patternProperties:
   '^clock-controller@[a-f0-9]+$':
     $ref: ../clock/brcm,iproc-clocks.yaml
 
+  '^syscon@[a-f0-9]+$':
+    $ref: syscon.yaml
+
   '^thermal@[a-f0-9]+$':
     $ref: ../thermal/brcm,ns-thermal.yaml
 
@@ -73,6 +76,11 @@ examples:
                                  "iprocfast", "sata1", "sata2";
         };
 
+        syscon@180 {
+            compatible = "brcm,cru-clkset", "syscon";
+            reg = <0x180 0x4>;
+        };
+
         pinctrl {
             compatible = "brcm,bcm4708-pinmux";
             offset = <0x1c0>;
diff --git a/Documentation/devicetree/bindings/mfd/syscon.yaml b/Documentation/devicetree/bindings/mfd/syscon.yaml
index abe3fd817e0b..0dcffc273c2b 100644
--- a/Documentation/devicetree/bindings/mfd/syscon.yaml
+++ b/Documentation/devicetree/bindings/mfd/syscon.yaml
@@ -38,6 +38,7 @@ properties:
               - allwinner,sun8i-h3-system-controller
               - allwinner,sun8i-v3s-system-controller
               - allwinner,sun50i-a64-system-controller
+              - brcm,cru-clkset
               - hisilicon,dsa-subctrl
               - hisilicon,hi6220-sramctrl
               - hisilicon,pcie-sas-subctrl
-- 
2.26.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 2/4] dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block
  2021-09-13  8:00 ` Rafał Miłecki
@ 2021-09-13  8:00   ` Rafał Miłecki
  -1 siblings, 0 replies; 24+ messages in thread
From: Rafał Miłecki @ 2021-09-13  8:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Lee Jones, Rob Herring
  Cc: linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

The old binding was covering the whole DMU block space (DMU block
contains CRU block which contains USB PHY). It was a bad design,
overkill and a non-generic solution.

Northstar's USB 2.0 PHY is a small block (part of the CRU MFD) and
binding should be designed to represent that properly. Rework the
binding to map just PHY with the "reg" property and use syscon to
reference shared register that controls block access.

The old binding is deprecated now.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../bindings/phy/bcm-ns-usb2-phy.yaml         | 25 ++++++++++++++-----
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.yaml
index 05b4dcd80019..426101530a21 100644
--- a/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.yaml
@@ -18,13 +18,21 @@ properties:
     const: brcm,ns-usb2-phy
 
   reg:
-    items:
-      - description: iomem address range of DMU (Device Management Unit)
+    anyOf:
+      - maxItems: 1
+        description: PHY control register
+      - maxItems: 1
+        description: iomem address range of DMU (Device Management Unit)
+        deprecated: true
 
   reg-names:
     items:
       - const: dmu
 
+  brcm,syscon-clkset:
+    description: phandle to syscon for clkset register
+    $ref: /schemas/types.yaml#/definitions/phandle
+
   clocks:
     items:
       - description: USB PHY reference clock
@@ -39,20 +47,25 @@ properties:
 required:
   - compatible
   - reg
-  - reg-names
   - clocks
   - clock-names
   - "#phy-cells"
 
+oneOf:
+  - required:
+      - brcm,syscon-clkset
+  - required:
+      - reg-names
+
 additionalProperties: false
 
 examples:
   - |
     #include <dt-bindings/clock/bcm-nsp.h>
-    phy@1800c000 {
+    phy@1800c164 {
         compatible = "brcm,ns-usb2-phy";
-        reg = <0x1800c000 0x1000>;
-        reg-names = "dmu";
+        reg = <0x1800c164 0x4>;
+        brcm,syscon-clkset = <&clkset>;
         clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>;
         clock-names = "phy-ref-clk";
         #phy-cells = <0>;
-- 
2.26.2


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

* [PATCH 2/4] dt-bindings: phy: brcm, ns-usb2-phy: bind just a PHY block
@ 2021-09-13  8:00   ` Rafał Miłecki
  0 siblings, 0 replies; 24+ messages in thread
From: Rafał Miłecki @ 2021-09-13  8:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Lee Jones, Rob Herring
  Cc: linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

The old binding was covering the whole DMU block space (DMU block
contains CRU block which contains USB PHY). It was a bad design,
overkill and a non-generic solution.

Northstar's USB 2.0 PHY is a small block (part of the CRU MFD) and
binding should be designed to represent that properly. Rework the
binding to map just PHY with the "reg" property and use syscon to
reference shared register that controls block access.

The old binding is deprecated now.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../bindings/phy/bcm-ns-usb2-phy.yaml         | 25 ++++++++++++++-----
 1 file changed, 19 insertions(+), 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.yaml b/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.yaml
index 05b4dcd80019..426101530a21 100644
--- a/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.yaml
+++ b/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.yaml
@@ -18,13 +18,21 @@ properties:
     const: brcm,ns-usb2-phy
 
   reg:
-    items:
-      - description: iomem address range of DMU (Device Management Unit)
+    anyOf:
+      - maxItems: 1
+        description: PHY control register
+      - maxItems: 1
+        description: iomem address range of DMU (Device Management Unit)
+        deprecated: true
 
   reg-names:
     items:
       - const: dmu
 
+  brcm,syscon-clkset:
+    description: phandle to syscon for clkset register
+    $ref: /schemas/types.yaml#/definitions/phandle
+
   clocks:
     items:
       - description: USB PHY reference clock
@@ -39,20 +47,25 @@ properties:
 required:
   - compatible
   - reg
-  - reg-names
   - clocks
   - clock-names
   - "#phy-cells"
 
+oneOf:
+  - required:
+      - brcm,syscon-clkset
+  - required:
+      - reg-names
+
 additionalProperties: false
 
 examples:
   - |
     #include <dt-bindings/clock/bcm-nsp.h>
-    phy@1800c000 {
+    phy@1800c164 {
         compatible = "brcm,ns-usb2-phy";
-        reg = <0x1800c000 0x1000>;
-        reg-names = "dmu";
+        reg = <0x1800c164 0x4>;
+        brcm,syscon-clkset = <&clkset>;
         clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>;
         clock-names = "phy-ref-clk";
         #phy-cells = <0>;
-- 
2.26.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
  2021-09-13  8:00 ` Rafał Miłecki
@ 2021-09-13  8:00   ` Rafał Miłecki
  -1 siblings, 0 replies; 24+ messages in thread
From: Rafał Miłecki @ 2021-09-13  8:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Lee Jones, Rob Herring
  Cc: linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

Northstar's USB 2.0 PHY is part of the CRU MFD.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/brcm,cru.yaml b/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
index bf4e585d3c18..262284ae80f1 100644
--- a/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
+++ b/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
@@ -39,6 +39,9 @@ patternProperties:
   '^clock-controller@[a-f0-9]+$':
     $ref: ../clock/brcm,iproc-clocks.yaml
 
+  '^phy@[a-f0-9]+$':
+    $ref: ../phy/bcm-ns-usb2-phy.yaml
+
   '^syscon@[a-f0-9]+$':
     $ref: syscon.yaml
 
@@ -52,6 +55,7 @@ required:
 
 examples:
   - |
+    #include <dt-bindings/clock/bcm-nsp.h>
     cru-bus@1800c100 {
         compatible = "brcm,ns-cru", "simple-mfd";
         reg = <0x1800c100 0x1d0>;
@@ -76,7 +80,16 @@ examples:
                                  "iprocfast", "sata1", "sata2";
         };
 
-        syscon@180 {
+        phy@164 {
+            compatible = "brcm,ns-usb2-phy";
+            reg = <0x164 0x4>;
+            brcm,syscon-clkset = <&clkset>;
+            clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>;
+            clock-names = "phy-ref-clk";
+            #phy-cells = <0>;
+        };
+
+        clkset: syscon@180 {
             compatible = "brcm,cru-clkset", "syscon";
             reg = <0x180 0x4>;
         };
-- 
2.26.2


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

* [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
@ 2021-09-13  8:00   ` Rafał Miłecki
  0 siblings, 0 replies; 24+ messages in thread
From: Rafał Miłecki @ 2021-09-13  8:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Lee Jones, Rob Herring
  Cc: linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

Northstar's USB 2.0 PHY is part of the CRU MFD.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/Documentation/devicetree/bindings/mfd/brcm,cru.yaml b/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
index bf4e585d3c18..262284ae80f1 100644
--- a/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
+++ b/Documentation/devicetree/bindings/mfd/brcm,cru.yaml
@@ -39,6 +39,9 @@ patternProperties:
   '^clock-controller@[a-f0-9]+$':
     $ref: ../clock/brcm,iproc-clocks.yaml
 
+  '^phy@[a-f0-9]+$':
+    $ref: ../phy/bcm-ns-usb2-phy.yaml
+
   '^syscon@[a-f0-9]+$':
     $ref: syscon.yaml
 
@@ -52,6 +55,7 @@ required:
 
 examples:
   - |
+    #include <dt-bindings/clock/bcm-nsp.h>
     cru-bus@1800c100 {
         compatible = "brcm,ns-cru", "simple-mfd";
         reg = <0x1800c100 0x1d0>;
@@ -76,7 +80,16 @@ examples:
                                  "iprocfast", "sata1", "sata2";
         };
 
-        syscon@180 {
+        phy@164 {
+            compatible = "brcm,ns-usb2-phy";
+            reg = <0x164 0x4>;
+            brcm,syscon-clkset = <&clkset>;
+            clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>;
+            clock-names = "phy-ref-clk";
+            #phy-cells = <0>;
+        };
+
+        clkset: syscon@180 {
             compatible = "brcm,cru-clkset", "syscon";
             reg = <0x180 0x4>;
         };
-- 
2.26.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* [PATCH 4/4] phy: bcm-ns-usb2: support updated DT binding with PHY reg space
  2021-09-13  8:00 ` Rafał Miłecki
@ 2021-09-13  8:00   ` Rafał Miłecki
  -1 siblings, 0 replies; 24+ messages in thread
From: Rafał Miłecki @ 2021-09-13  8:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Lee Jones, Rob Herring
  Cc: linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

Updated DT binding maps just a PHY's register space instead of the whole
DMU block. Accessing a common CRU reg is handled using syscon &
regmap.

The old binding has been deprecated and remains supported as a fallback
method.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/phy/broadcom/phy-bcm-ns-usb2.c | 52 +++++++++++++++++++++-----
 1 file changed, 43 insertions(+), 9 deletions(-)

diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb2.c b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
index 4b015b8a71c3..98d32729a45d 100644
--- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c
+++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
@@ -9,17 +9,23 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/err.h>
+#include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/phy/phy.h>
 #include <linux/platform_device.h>
+#include <linux/regmap.h>
 #include <linux/slab.h>
 
 struct bcm_ns_usb2 {
 	struct device *dev;
 	struct clk *ref_clk;
 	struct phy *phy;
+	struct regmap *clkset;
+	void __iomem *base;
+
+	/* Deprecated binding */
 	void __iomem *dmu;
 };
 
@@ -27,7 +33,6 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
 {
 	struct bcm_ns_usb2 *usb2 = phy_get_drvdata(phy);
 	struct device *dev = usb2->dev;
-	void __iomem *dmu = usb2->dmu;
 	u32 ref_clk_rate, usb2ctl, usb_pll_ndiv, usb_pll_pdiv;
 	int err = 0;
 
@@ -44,7 +49,10 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
 		goto err_clk_off;
 	}
 
-	usb2ctl = readl(dmu + BCMA_DMU_CRU_USB2_CONTROL);
+	if (usb2->base)
+		usb2ctl = readl(usb2->base);
+	else
+		usb2ctl = readl(usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
 
 	if (usb2ctl & BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_PDIV_MASK) {
 		usb_pll_pdiv = usb2ctl;
@@ -58,15 +66,24 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
 	usb_pll_ndiv = (1920000000 * usb_pll_pdiv) / ref_clk_rate;
 
 	/* Unlock DMU PLL settings with some magic value */
-	writel(0x0000ea68, dmu + BCMA_DMU_CRU_CLKSET_KEY);
+	if (usb2->clkset)
+		regmap_write(usb2->clkset, 0, 0x0000ea68);
+	else
+		writel(0x0000ea68, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
 
 	/* Write USB 2.0 PLL control setting */
 	usb2ctl &= ~BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_MASK;
 	usb2ctl |= usb_pll_ndiv << BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_SHIFT;
-	writel(usb2ctl, dmu + BCMA_DMU_CRU_USB2_CONTROL);
+	if (usb2->base)
+		writel(usb2ctl, usb2->base);
+	else
+		writel(usb2ctl, usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
 
 	/* Lock DMU PLL settings */
-	writel(0x00000000, dmu + BCMA_DMU_CRU_CLKSET_KEY);
+	if (usb2->clkset)
+		regmap_write(usb2->clkset, 0, 0x00000000);
+	else
+		writel(0x00000000, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
 
 err_clk_off:
 	clk_disable_unprepare(usb2->ref_clk);
@@ -90,10 +107,27 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	usb2->dev = dev;
 
-	usb2->dmu = devm_platform_ioremap_resource_byname(pdev, "dmu");
-	if (IS_ERR(usb2->dmu)) {
-		dev_err(dev, "Failed to map DMU regs\n");
-		return PTR_ERR(usb2->dmu);
+	if (of_find_property(dev->of_node, "brcm,syscon-clkset", NULL)) {
+		usb2->base = devm_platform_ioremap_resource(pdev, 0);
+		if (IS_ERR(usb2->base)) {
+			dev_err(dev, "Failed to map control reg\n");
+			return PTR_ERR(usb2->base);
+		}
+
+		usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node,
+							       "brcm,syscon-clkset");
+		if (IS_ERR(usb2->clkset)) {
+			dev_err(dev, "Failed to lookup clkset regmap\n");
+			return PTR_ERR(usb2->clkset);
+		}
+	} else {
+		usb2->dmu = devm_platform_ioremap_resource_byname(pdev, "dmu");
+		if (IS_ERR(usb2->dmu)) {
+			dev_err(dev, "Failed to map DMU regs\n");
+			return PTR_ERR(usb2->dmu);
+		}
+
+		dev_warn(dev, "using deprecated DT binding\n");
 	}
 
 	usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk");
-- 
2.26.2


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

* [PATCH 4/4] phy: bcm-ns-usb2: support updated DT binding with PHY reg space
@ 2021-09-13  8:00   ` Rafał Miłecki
  0 siblings, 0 replies; 24+ messages in thread
From: Rafał Miłecki @ 2021-09-13  8:00 UTC (permalink / raw)
  To: Kishon Vijay Abraham I, Vinod Koul, Lee Jones, Rob Herring
  Cc: linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

From: Rafał Miłecki <rafal@milecki.pl>

Updated DT binding maps just a PHY's register space instead of the whole
DMU block. Accessing a common CRU reg is handled using syscon &
regmap.

The old binding has been deprecated and remains supported as a fallback
method.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
---
 drivers/phy/broadcom/phy-bcm-ns-usb2.c | 52 +++++++++++++++++++++-----
 1 file changed, 43 insertions(+), 9 deletions(-)

diff --git a/drivers/phy/broadcom/phy-bcm-ns-usb2.c b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
index 4b015b8a71c3..98d32729a45d 100644
--- a/drivers/phy/broadcom/phy-bcm-ns-usb2.c
+++ b/drivers/phy/broadcom/phy-bcm-ns-usb2.c
@@ -9,17 +9,23 @@
 #include <linux/clk.h>
 #include <linux/delay.h>
 #include <linux/err.h>
+#include <linux/mfd/syscon.h>
 #include <linux/module.h>
 #include <linux/of_address.h>
 #include <linux/of_platform.h>
 #include <linux/phy/phy.h>
 #include <linux/platform_device.h>
+#include <linux/regmap.h>
 #include <linux/slab.h>
 
 struct bcm_ns_usb2 {
 	struct device *dev;
 	struct clk *ref_clk;
 	struct phy *phy;
+	struct regmap *clkset;
+	void __iomem *base;
+
+	/* Deprecated binding */
 	void __iomem *dmu;
 };
 
@@ -27,7 +33,6 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
 {
 	struct bcm_ns_usb2 *usb2 = phy_get_drvdata(phy);
 	struct device *dev = usb2->dev;
-	void __iomem *dmu = usb2->dmu;
 	u32 ref_clk_rate, usb2ctl, usb_pll_ndiv, usb_pll_pdiv;
 	int err = 0;
 
@@ -44,7 +49,10 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
 		goto err_clk_off;
 	}
 
-	usb2ctl = readl(dmu + BCMA_DMU_CRU_USB2_CONTROL);
+	if (usb2->base)
+		usb2ctl = readl(usb2->base);
+	else
+		usb2ctl = readl(usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
 
 	if (usb2ctl & BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_PDIV_MASK) {
 		usb_pll_pdiv = usb2ctl;
@@ -58,15 +66,24 @@ static int bcm_ns_usb2_phy_init(struct phy *phy)
 	usb_pll_ndiv = (1920000000 * usb_pll_pdiv) / ref_clk_rate;
 
 	/* Unlock DMU PLL settings with some magic value */
-	writel(0x0000ea68, dmu + BCMA_DMU_CRU_CLKSET_KEY);
+	if (usb2->clkset)
+		regmap_write(usb2->clkset, 0, 0x0000ea68);
+	else
+		writel(0x0000ea68, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
 
 	/* Write USB 2.0 PLL control setting */
 	usb2ctl &= ~BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_MASK;
 	usb2ctl |= usb_pll_ndiv << BCMA_DMU_CRU_USB2_CONTROL_USB_PLL_NDIV_SHIFT;
-	writel(usb2ctl, dmu + BCMA_DMU_CRU_USB2_CONTROL);
+	if (usb2->base)
+		writel(usb2ctl, usb2->base);
+	else
+		writel(usb2ctl, usb2->dmu + BCMA_DMU_CRU_USB2_CONTROL);
 
 	/* Lock DMU PLL settings */
-	writel(0x00000000, dmu + BCMA_DMU_CRU_CLKSET_KEY);
+	if (usb2->clkset)
+		regmap_write(usb2->clkset, 0, 0x00000000);
+	else
+		writel(0x00000000, usb2->dmu + BCMA_DMU_CRU_CLKSET_KEY);
 
 err_clk_off:
 	clk_disable_unprepare(usb2->ref_clk);
@@ -90,10 +107,27 @@ static int bcm_ns_usb2_probe(struct platform_device *pdev)
 		return -ENOMEM;
 	usb2->dev = dev;
 
-	usb2->dmu = devm_platform_ioremap_resource_byname(pdev, "dmu");
-	if (IS_ERR(usb2->dmu)) {
-		dev_err(dev, "Failed to map DMU regs\n");
-		return PTR_ERR(usb2->dmu);
+	if (of_find_property(dev->of_node, "brcm,syscon-clkset", NULL)) {
+		usb2->base = devm_platform_ioremap_resource(pdev, 0);
+		if (IS_ERR(usb2->base)) {
+			dev_err(dev, "Failed to map control reg\n");
+			return PTR_ERR(usb2->base);
+		}
+
+		usb2->clkset = syscon_regmap_lookup_by_phandle(dev->of_node,
+							       "brcm,syscon-clkset");
+		if (IS_ERR(usb2->clkset)) {
+			dev_err(dev, "Failed to lookup clkset regmap\n");
+			return PTR_ERR(usb2->clkset);
+		}
+	} else {
+		usb2->dmu = devm_platform_ioremap_resource_byname(pdev, "dmu");
+		if (IS_ERR(usb2->dmu)) {
+			dev_err(dev, "Failed to map DMU regs\n");
+			return PTR_ERR(usb2->dmu);
+		}
+
+		dev_warn(dev, "using deprecated DT binding\n");
 	}
 
 	usb2->ref_clk = devm_clk_get(dev, "phy-ref-clk");
-- 
2.26.2


-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 1/4] dt-bindings: mfd: brcm,cru: add clkset syscon
  2021-09-13  8:00 ` Rafał Miłecki
@ 2021-09-21 20:19   ` Rob Herring
  -1 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2021-09-21 20:19 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Rafał Miłecki, Vinod Koul, Kishon Vijay Abraham I,
	Rob Herring, Florian Fainelli, devicetree, linux-phy, Lee Jones,
	Chunfeng Yun

On Mon, 13 Sep 2021 10:00:21 +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> CRU has a shared register that is used e.g. to control USB 2.0 PHY block
> access. It's a single 32 b register. Document it as syscon so it can be
> used with a regmap.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  Documentation/devicetree/bindings/mfd/brcm,cru.yaml | 8 ++++++++
>  Documentation/devicetree/bindings/mfd/syscon.yaml   | 1 +
>  2 files changed, 9 insertions(+)
> 

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

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

* Re: [PATCH 1/4] dt-bindings: mfd: brcm,cru: add clkset syscon
@ 2021-09-21 20:19   ` Rob Herring
  0 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2021-09-21 20:19 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Rafał Miłecki, Vinod Koul, Kishon Vijay Abraham I,
	Rob Herring, Florian Fainelli, devicetree, linux-phy, Lee Jones,
	Chunfeng Yun

On Mon, 13 Sep 2021 10:00:21 +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> CRU has a shared register that is used e.g. to control USB 2.0 PHY block
> access. It's a single 32 b register. Document it as syscon so it can be
> used with a regmap.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  Documentation/devicetree/bindings/mfd/brcm,cru.yaml | 8 ++++++++
>  Documentation/devicetree/bindings/mfd/syscon.yaml   | 1 +
>  2 files changed, 9 insertions(+)
> 

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

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 2/4] dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block
  2021-09-13  8:00   ` [PATCH 2/4] dt-bindings: phy: brcm, ns-usb2-phy: " Rafał Miłecki
@ 2021-09-21 20:19     ` Rob Herring
  -1 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2021-09-21 20:19 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-phy, Rob Herring, Vinod Koul, Kishon Vijay Abraham I,
	Lee Jones, devicetree, Rafał Miłecki, Florian Fainelli,
	Chunfeng Yun

On Mon, 13 Sep 2021 10:00:22 +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> The old binding was covering the whole DMU block space (DMU block
> contains CRU block which contains USB PHY). It was a bad design,
> overkill and a non-generic solution.
> 
> Northstar's USB 2.0 PHY is a small block (part of the CRU MFD) and
> binding should be designed to represent that properly. Rework the
> binding to map just PHY with the "reg" property and use syscon to
> reference shared register that controls block access.
> 
> The old binding is deprecated now.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../bindings/phy/bcm-ns-usb2-phy.yaml         | 25 ++++++++++++++-----
>  1 file changed, 19 insertions(+), 6 deletions(-)
> 

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

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

* Re: [PATCH 2/4] dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block
@ 2021-09-21 20:19     ` Rob Herring
  0 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2021-09-21 20:19 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-phy, Rob Herring, Vinod Koul, Kishon Vijay Abraham I,
	Lee Jones, devicetree, Rafał Miłecki, Florian Fainelli,
	Chunfeng Yun

On Mon, 13 Sep 2021 10:00:22 +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> The old binding was covering the whole DMU block space (DMU block
> contains CRU block which contains USB PHY). It was a bad design,
> overkill and a non-generic solution.
> 
> Northstar's USB 2.0 PHY is a small block (part of the CRU MFD) and
> binding should be designed to represent that properly. Rework the
> binding to map just PHY with the "reg" property and use syscon to
> reference shared register that controls block access.
> 
> The old binding is deprecated now.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../bindings/phy/bcm-ns-usb2-phy.yaml         | 25 ++++++++++++++-----
>  1 file changed, 19 insertions(+), 6 deletions(-)
> 

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

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
  2021-09-13  8:00   ` Rafał Miłecki
@ 2021-09-21 20:19     ` Rob Herring
  -1 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2021-09-21 20:19 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-phy, Chunfeng Yun, devicetree, Kishon Vijay Abraham I,
	Rafał Miłecki, Vinod Koul, Rob Herring, Lee Jones,
	Florian Fainelli

On Mon, 13 Sep 2021 10:00:23 +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Northstar's USB 2.0 PHY is part of the CRU MFD.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 

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

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

* Re: [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
@ 2021-09-21 20:19     ` Rob Herring
  0 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2021-09-21 20:19 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: linux-phy, Chunfeng Yun, devicetree, Kishon Vijay Abraham I,
	Rafał Miłecki, Vinod Koul, Rob Herring, Lee Jones,
	Florian Fainelli

On Mon, 13 Sep 2021 10:00:23 +0200, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Northstar's USB 2.0 PHY is part of the CRU MFD.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)
> 

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

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 1/4] dt-bindings: mfd: brcm,cru: add clkset syscon
  2021-09-13  8:00 ` Rafał Miłecki
@ 2021-09-22  7:57   ` Lee Jones
  -1 siblings, 0 replies; 24+ messages in thread
From: Lee Jones @ 2021-09-22  7:57 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Kishon Vijay Abraham I, Vinod Koul, Rob Herring, linux-phy,
	Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On Mon, 13 Sep 2021, Rafał Miłecki wrote:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> CRU has a shared register that is used e.g. to control USB 2.0 PHY block
> access. It's a single 32 b register. Document it as syscon so it can be
> used with a regmap.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  Documentation/devicetree/bindings/mfd/brcm,cru.yaml | 8 ++++++++
>  Documentation/devicetree/bindings/mfd/syscon.yaml   | 1 +
>  2 files changed, 9 insertions(+)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 1/4] dt-bindings: mfd: brcm,cru: add clkset syscon
@ 2021-09-22  7:57   ` Lee Jones
  0 siblings, 0 replies; 24+ messages in thread
From: Lee Jones @ 2021-09-22  7:57 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Kishon Vijay Abraham I, Vinod Koul, Rob Herring, linux-phy,
	Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On Mon, 13 Sep 2021, Rafał Miłecki wrote:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> CRU has a shared register that is used e.g. to control USB 2.0 PHY block
> access. It's a single 32 b register. Document it as syscon so it can be
> used with a regmap.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  Documentation/devicetree/bindings/mfd/brcm,cru.yaml | 8 ++++++++
>  Documentation/devicetree/bindings/mfd/syscon.yaml   | 1 +
>  2 files changed, 9 insertions(+)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
  2021-09-13  8:00   ` Rafał Miłecki
@ 2021-09-22  7:57     ` Lee Jones
  -1 siblings, 0 replies; 24+ messages in thread
From: Lee Jones @ 2021-09-22  7:57 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Kishon Vijay Abraham I, Vinod Koul, Rob Herring, linux-phy,
	Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On Mon, 13 Sep 2021, Rafał Miłecki wrote:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Northstar's USB 2.0 PHY is part of the CRU MFD.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
@ 2021-09-22  7:57     ` Lee Jones
  0 siblings, 0 replies; 24+ messages in thread
From: Lee Jones @ 2021-09-22  7:57 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Kishon Vijay Abraham I, Vinod Koul, Rob Herring, linux-phy,
	Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On Mon, 13 Sep 2021, Rafał Miłecki wrote:

> From: Rafał Miłecki <rafal@milecki.pl>
> 
> Northstar's USB 2.0 PHY is part of the CRU MFD.
> 
> Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> ---
>  .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
>  1 file changed, 14 insertions(+), 1 deletion(-)

Applied, thanks.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
  2021-09-22  7:57     ` Lee Jones
@ 2021-09-23 15:01       ` Rob Herring
  -1 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2021-09-23 15:01 UTC (permalink / raw)
  To: Lee Jones
  Cc: Rafał Miłecki, Kishon Vijay Abraham I, Vinod Koul,
	linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On Wed, Sep 22, 2021 at 2:58 AM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Mon, 13 Sep 2021, Rafał Miłecki wrote:
>
> > From: Rafał Miłecki <rafal@milecki.pl>
> >
> > Northstar's USB 2.0 PHY is part of the CRU MFD.
> >
> > Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> > ---
> >  .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
> >  1 file changed, 14 insertions(+), 1 deletion(-)
>
> Applied, thanks.

Hopefully this works without patch 2???

Rob

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

* Re: [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
@ 2021-09-23 15:01       ` Rob Herring
  0 siblings, 0 replies; 24+ messages in thread
From: Rob Herring @ 2021-09-23 15:01 UTC (permalink / raw)
  To: Lee Jones
  Cc: Rafał Miłecki, Kishon Vijay Abraham I, Vinod Koul,
	linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On Wed, Sep 22, 2021 at 2:58 AM Lee Jones <lee.jones@linaro.org> wrote:
>
> On Mon, 13 Sep 2021, Rafał Miłecki wrote:
>
> > From: Rafał Miłecki <rafal@milecki.pl>
> >
> > Northstar's USB 2.0 PHY is part of the CRU MFD.
> >
> > Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> > ---
> >  .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
> >  1 file changed, 14 insertions(+), 1 deletion(-)
>
> Applied, thanks.

Hopefully this works without patch 2???

Rob

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
  2021-09-23 15:01       ` Rob Herring
@ 2021-09-23 20:06         ` Lee Jones
  -1 siblings, 0 replies; 24+ messages in thread
From: Lee Jones @ 2021-09-23 20:06 UTC (permalink / raw)
  To: Rob Herring
  Cc: Rafał Miłecki, Kishon Vijay Abraham I, Vinod Koul,
	linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On Thu, 23 Sep 2021, Rob Herring wrote:

> On Wed, Sep 22, 2021 at 2:58 AM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > On Mon, 13 Sep 2021, Rafał Miłecki wrote:
> >
> > > From: Rafał Miłecki <rafal@milecki.pl>
> > >
> > > Northstar's USB 2.0 PHY is part of the CRU MFD.
> > >
> > > Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> > > ---
> > >  .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
> > >  1 file changed, 14 insertions(+), 1 deletion(-)
> >
> > Applied, thanks.
> 
> Hopefully this works without patch 2???

What do you mean by 'works'?

It's documentation.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

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

* Re: [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY
@ 2021-09-23 20:06         ` Lee Jones
  0 siblings, 0 replies; 24+ messages in thread
From: Lee Jones @ 2021-09-23 20:06 UTC (permalink / raw)
  To: Rob Herring
  Cc: Rafał Miłecki, Kishon Vijay Abraham I, Vinod Koul,
	linux-phy, Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On Thu, 23 Sep 2021, Rob Herring wrote:

> On Wed, Sep 22, 2021 at 2:58 AM Lee Jones <lee.jones@linaro.org> wrote:
> >
> > On Mon, 13 Sep 2021, Rafał Miłecki wrote:
> >
> > > From: Rafał Miłecki <rafal@milecki.pl>
> > >
> > > Northstar's USB 2.0 PHY is part of the CRU MFD.
> > >
> > > Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
> > > ---
> > >  .../devicetree/bindings/mfd/brcm,cru.yaml         | 15 ++++++++++++++-
> > >  1 file changed, 14 insertions(+), 1 deletion(-)
> >
> > Applied, thanks.
> 
> Hopefully this works without patch 2???

What do you mean by 'works'?

It's documentation.

-- 
Lee Jones [李琼斯]
Senior Technical Lead - Developer Services
Linaro.org │ Open source software for Arm SoCs
Follow Linaro: Facebook | Twitter | Blog

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

* Re: [PATCH 2/4] dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block
  2021-09-13  8:00   ` [PATCH 2/4] dt-bindings: phy: brcm, ns-usb2-phy: " Rafał Miłecki
@ 2021-10-01 10:08     ` Vinod Koul
  -1 siblings, 0 replies; 24+ messages in thread
From: Vinod Koul @ 2021-10-01 10:08 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Kishon Vijay Abraham I, Lee Jones, Rob Herring, linux-phy,
	Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On 13-09-21, 10:00, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> The old binding was covering the whole DMU block space (DMU block
> contains CRU block which contains USB PHY). It was a bad design,
> overkill and a non-generic solution.
> 
> Northstar's USB 2.0 PHY is a small block (part of the CRU MFD) and
> binding should be designed to represent that properly. Rework the
> binding to map just PHY with the "reg" property and use syscon to
> reference shared register that controls block access.
> 
> The old binding is deprecated now.

Applied, thanks

-- 
~Vinod

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

* Re: [PATCH 2/4] dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block
@ 2021-10-01 10:08     ` Vinod Koul
  0 siblings, 0 replies; 24+ messages in thread
From: Vinod Koul @ 2021-10-01 10:08 UTC (permalink / raw)
  To: Rafał Miłecki
  Cc: Kishon Vijay Abraham I, Lee Jones, Rob Herring, linux-phy,
	Florian Fainelli, Chunfeng Yun, devicetree,
	Rafał Miłecki

On 13-09-21, 10:00, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.pl>
> 
> The old binding was covering the whole DMU block space (DMU block
> contains CRU block which contains USB PHY). It was a bad design,
> overkill and a non-generic solution.
> 
> Northstar's USB 2.0 PHY is a small block (part of the CRU MFD) and
> binding should be designed to represent that properly. Rework the
> binding to map just PHY with the "reg" property and use syscon to
> reference shared register that controls block access.
> 
> The old binding is deprecated now.

Applied, thanks

-- 
~Vinod

-- 
linux-phy mailing list
linux-phy@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/linux-phy

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

end of thread, other threads:[~2021-10-01 10:08 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-13  8:00 [PATCH 1/4] dt-bindings: mfd: brcm,cru: add clkset syscon Rafał Miłecki
2021-09-13  8:00 ` Rafał Miłecki
2021-09-13  8:00 ` [PATCH 2/4] dt-bindings: phy: brcm,ns-usb2-phy: bind just a PHY block Rafał Miłecki
2021-09-13  8:00   ` [PATCH 2/4] dt-bindings: phy: brcm, ns-usb2-phy: " Rafał Miłecki
2021-09-21 20:19   ` [PATCH 2/4] dt-bindings: phy: brcm,ns-usb2-phy: " Rob Herring
2021-09-21 20:19     ` Rob Herring
2021-10-01 10:08   ` Vinod Koul
2021-10-01 10:08     ` Vinod Koul
2021-09-13  8:00 ` [PATCH 3/4] dt-bindings: mfd: brcm,cru: add USB 2.0 PHY Rafał Miłecki
2021-09-13  8:00   ` Rafał Miłecki
2021-09-21 20:19   ` Rob Herring
2021-09-21 20:19     ` Rob Herring
2021-09-22  7:57   ` Lee Jones
2021-09-22  7:57     ` Lee Jones
2021-09-23 15:01     ` Rob Herring
2021-09-23 15:01       ` Rob Herring
2021-09-23 20:06       ` Lee Jones
2021-09-23 20:06         ` Lee Jones
2021-09-13  8:00 ` [PATCH 4/4] phy: bcm-ns-usb2: support updated DT binding with PHY reg space Rafał Miłecki
2021-09-13  8:00   ` Rafał Miłecki
2021-09-21 20:19 ` [PATCH 1/4] dt-bindings: mfd: brcm,cru: add clkset syscon Rob Herring
2021-09-21 20:19   ` Rob Herring
2021-09-22  7:57 ` Lee Jones
2021-09-22  7:57   ` Lee Jones

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.