devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: "Rafał Miłecki" <zajec5@gmail.com>
Cc: "Kishon Vijay Abraham I" <kishon@ti.com>,
	linux-kernel@vger.kernel.org,
	"Mark Rutland" <mark.rutland@arm.com>,
	devicetree@vger.kernel.org, "Hauke Mehrtens" <hauke@hauke-m.de>,
	bcm-kernel-feedback-list@broadcom.com,
	"Rafał Miłecki" <rafal@milecki.pl>
Subject: Re: [PATCH V2 1/2] dt-bindings: bcm-ns-usb2-phy: rework binding to use CRU syscon
Date: Tue, 15 Jan 2019 14:53:00 -0600	[thread overview]
Message-ID: <20190115205300.GA6754@bogus> (raw)
In-Reply-To: <20190108123907.19816-1-zajec5@gmail.com>

On Tue, Jan 08, 2019 at 01:39:06PM +0100, Rafał Miłecki wrote:
> From: Rafał Miłecki <rafal@milecki.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@milecki.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@1800c000 {
> +		compatible = "simple-bus";

DMU sounds like some sort of block, not just a bus.

> +		ranges = <0 0x1800c000 0x1000>;
> +		#address-cells = <1>;
> +		#size-cells = <1>;
> +
> +		cru: syscon@100 {
> +			compatible = "syscon", "simple-mfd";

Those 2 compatibles alone are not valid. And 'simple-mfd' implies child 
nodes.

Without any knowledge of what else is in the DMU, I can't give any 
advice as to what this should look like instead.

> +			reg = <0x100 0x1a4>;
> +		};
> +	};
> +
>  	usb2-phy {
>  		compatible = "brcm,ns-usb2-phy";
> -		reg = <0x1800c000 0x1000>;
> -		reg-names = "dmu";
> +		syscon-cru = <&cru>;

No need for this. Make it a child of cru node.

There's not a contiguous range of phy registers? If there are, keep 
'reg' even if Linux doesn't (currently) use it.

>  		#phy-cells = <0>;
>  		clocks = <&genpll BCM_NSP_GENPLL_USB_PHY_REF_CLK>;
>  		clock-names = "phy-ref-clk";
> -- 
> 2.13.7
> 

      parent reply	other threads:[~2019-01-15 20:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-07  8:25 [PATCH 1/2] dt-bindings: bcm-ns-usb2-phy: rework binding to use CRU syscon Rafał Miłecki
2019-01-07  8:25 ` [PATCH 2/2] phy: bcm-ns-usb2: support updated DT binding with the " Rafał Miłecki
2019-01-07 18:47   ` Ray Jui
2019-01-07 18:44 ` [PATCH 1/2] dt-bindings: bcm-ns-usb2-phy: rework binding to use " Ray Jui
2019-01-08 12:39 ` [PATCH V2 " Rafał Miłecki
2019-01-08 12:39   ` [PATCH V2 2/2] phy: bcm-ns-usb2: support updated DT binding with the " Rafał Miłecki
2019-01-08 17:53     ` Ray Jui
2019-01-08 17:51   ` [PATCH V2 1/2] dt-bindings: bcm-ns-usb2-phy: rework binding to use " Ray Jui
2019-01-15 20:53   ` Rob Herring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190115205300.GA6754@bogus \
    --to=robh@kernel.org \
    --cc=bcm-kernel-feedback-list@broadcom.com \
    --cc=devicetree@vger.kernel.org \
    --cc=hauke@hauke-m.de \
    --cc=kishon@ti.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=rafal@milecki.pl \
    --cc=zajec5@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).