[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <74b4fbf0-89ca-7d70-cb58-4b83300dc881@broadcom.com>
Date: Tue, 8 Jan 2019 09:51:14 -0800
From: Ray Jui <ray.jui@...adcom.com>
To: Rafał Miłecki <zajec5@...il.com>,
Kishon Vijay Abraham I <kishon@...com>
Cc: linux-kernel@...r.kernel.org, Rob Herring <robh+dt@...nel.org>,
Mark Rutland <mark.rutland@....com>,
devicetree@...r.kernel.org, Hauke Mehrtens <hauke@...ke-m.de>,
bcm-kernel-feedback-list@...adcom.com,
Rafał Miłecki <rafal@...ecki.pl>
Subject: Re: [PATCH V2 1/2] dt-bindings: bcm-ns-usb2-phy: rework binding to
use CRU syscon
On 1/8/2019 4:39 AM, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@...ecki.pl>
>
> USB 2.0 PHY is a hardware block that happens to use two registers from
> the CRU block to setup a single PLL. It's not part of the CRU or DMU
> and so its binding shouldn't cover the whole DMU.
>
> The correct way of handling this is to reference CRU block node using a
> syscon. Document that & deprecate the old way.
>
> Signed-off-by: Rafał Miłecki <rafal@...ecki.pl>
> ---
> V2: use syscon@ in example (thanks Ray)
> ---
> .../devicetree/bindings/phy/bcm-ns-usb2-phy.txt | 27 ++++++++++++++++++----
> 1 file changed, 23 insertions(+), 4 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.txt b/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.txt
> index a7aee9ea8926..2cafee6b4a8b 100644
> --- a/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.txt
> +++ b/Documentation/devicetree/bindings/phy/bcm-ns-usb2-phy.txt
> @@ -2,19 +2,38 @@ Driver for Broadcom Northstar USB 2.0 PHY
>
> Required properties:
> - compatible: brcm,ns-usb2-phy
> -- reg: iomem address range of DMU (Device Management Unit)
> -- reg-names: "dmu", the only needed & supported reg right now
> +- syscon-cru: phandle to the CRU (Central Resource Unit) syscon
> - clocks: USB PHY reference clock
> - clock-names: "phy-ref-clk", the only needed & supported clock right now
>
> +Deprecated:
> +
> +PHY block should not claim the whole DMU so such a binding has been deprecated.
> +It only requires to access few CRU (a DMU subblock) registers and that should be
> +handled with a syscon since CRU is a MFD (Multi-Function Device).
> +
> +- reg: iomem address range of DMU (Device Management Unit)
> +- reg-names: "dmu", the only needed & supported reg right now
> +
> To initialize USB 2.0 PHY driver needs to setup PLL correctly. To do this it
> requires passing phandle to the USB PHY reference clock.
>
> Example:
> + dmu@...0c000 {
> + compatible = "simple-bus";
> + ranges = <0 0x1800c000 0x1000>;
> + #address-cells = <1>;
> + #size-cells = <1>;
> +
> + cru: syscon@100 {
> + compatible = "syscon", "simple-mfd";
> + reg = <0x100 0x1a4>;
> + };
> + };
> +
> usb2-phy {
> compatible = "brcm,ns-usb2-phy";
> - reg = <0x1800c000 0x1000>;
> - reg-names = "dmu";
> + syscon-cru = <&cru>;
> #phy-cells = <0>;
> clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>;
> clock-names = "phy-ref-clk";
>
Looks good to me!
Reviewed-by: Ray Jui <ray.jui@...adcom.com>
Powered by blists - more mailing lists