ohci and ehci-platform clks, phy and dt support
Subsystems (4)
v4 cover ohci and ehci-platform clks, phy and dt support
Hi All,
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
Changes since v3:
-Address all of Alan Stern's review comments
-Properly use put_clk in probe error path
-Don't do hcd_put until after power_off as power_off may use private hcd data
Regards,
Hans
PATCH v4 1/2 ohci-platform: Add support for devicetree instantiation
Add support for ohci-platform instantiation from devicetree, including optionally getting clks and a phy from devicetree, and enabling / disabling those on power_on / off.
This should allow using ohci-platform from devicetree in various cases. Specifically after this commit it can be used for the ohci controller found on Allwinner sunxi SoCs.
--- .../devicetree/bindings/usb/mmio-ohci.txt | 22 +++ drivers/usb/host/ohci-platform.c | 164 ++++++++++++++++++--- 2 files changed, 162 insertions(+), 24 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/mmio-ohci.txt
Documentation/devicetree/bindings/usb/mmio-ohci.txt new file +22 -0
@@ -0,0 +1,22 @@ +Generic MMIO OHCI controller + +Required properties: +- compatible : "mmio-ohci" +- reg : ohci controller register range (address and length) +- interrupts : ohci controller interrupt + +Optional properties: +- clocks : a list of phandle + clock specifier pairs +- phys : phandle + phy specifier pair +- phy-names : "usb" + +Example: + + ohci0: ohci at 0x01c14400 { + compatible = "mmio-ohci"; + reg = <0x01c14400 0x100>; + interrupts = <64>; + clocks = <&usb_clk 6>, <&ahb_gates 2>; + phys = <&usbphy 1>; + phy-names = "usb"; + };
drivers/usb/host/ohci-platform.c +140 -24
254 lines not on this page · raw message
Signature · 1 line
1.8.4.2
PATCH v4 1/2 ohci-platform: Add support for devicetree instantiation
Quoted 70 lines · Hans de Goede
Add support for ohci-platform instantiation from devicetree, including optionally getting clks and a phy from devicetree, and enabling / disabling those on
power_on/ off.This should allow using ohci-platform from devicetree in various cases. Specifically after this commit it can be used for the ohci controller found on Allwinner sunxi SoCs.
Signed-off-by Hans de Goede <[email protected]>--- .../devicetree/bindings/usb/mmio-ohci.txt | 22 +++ drivers/usb/host/ohci-platform.c | 164 ++++++++++++++++++--- 2 files changed, 162 insertions(+), 24 deletions(-)create mode 100644
Documentation/devicetree/bindings/usb/mmio-ohci.txtDocumentation/devicetree/bindings/usb/mmio-ohci.txt new file +22
-0@@ -0,0 +1,22 @@ +Generic MMIO OHCI controller + +Required properties: +- compatible : "mmio-ohci" +- reg : ohci controller register range (address and length) +- interrupts : ohci controller interrupt + +Optional properties: +- clocks : a list of phandle + clock specifier pairs +- phys : phandle + phy specifier pair +- phy-names : "usb" + +Example: + + ohci0: ohci at 0x01c14400 { + compatible = "mmio-ohci"; + reg = <0x01c14400 0x100>; + interrupts = <64>; + clocks = <&usb_clk 6>, <&ahb_gates 2>; + phys = <&usbphy 1>; + phy-names = "usb"; + };... <snip> ....
Documentation/devicetree/bindings/usb/mmio-ohci.txt new file +20
-0@@ -83,17 +156,40 @@ static int ohci_platform_probe(struct platform_device *dev) return -ENXIO; } + hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev, + dev_name(&dev->dev)); + if (!hcd) + return -ENOMEM; + + platform_set_drvdata(dev, hcd); + dev->dev.platform_data = pdata; + priv = hcd_to_ohci_priv(hcd); + + if (pdata == &ohci_platform_defaults && dev->dev.of_node) { + priv->phy = devm_phy_get(&dev->dev, "usb"); + if (IS_ERR(priv->phy)) { + err = PTR_ERR(priv->phy); + if (err == -EPROBE_DEFER) + goto err_put_hcd; + priv->phy = NULL; + } + + for (clk = 0; clk < OHCI_MAX_CLKS; clk++) { + priv->clks[clk] = of_clk_get(dev->dev.of_node, clk);
Documentation/devicetree/bindings/usb/mmio-ohci.txt static int ohci_platform_probe(struct platform_device *dev) · line 188
Quoted 10 lines
Documentation/devicetree/bindings/usb/mmio-ohci.txt new file +9
-0+ if (IS_ERR(priv->clks[clk])) { + err = PTR_ERR(priv->clks[clk]); + if (err == -EPROBE_DEFER) + goto err_put_clks; + priv->clks[clk] = NULL; + break; + } + } + }
Given that you have limited the clock parsing to OHCI_MAX_CLKS, there should be some kind of warning/error message if the DT contains more than OHCI_MAX_CLKS - otherwise you have silent failures when the clocks aren't configured.
There is also no note in the binding to indicate this limitation and you shouldn't expect people writing DT files to go digging through the source to check for this.
Regards
Tony P
PATCH v4 1/2 ohci-platform: Add support for devicetree instantiation
Hi,
Thanks for the review. Note I did my best to ensure my patches would not break vt8500 support, but if you could run some tests with them that would be great.
Quoted 74 lines · Tony Prisk
Quoted 73 lines · Hans de Goede
Add support for ohci-platform instantiation from devicetree, including optionally getting clks and a phy from devicetree, and enabling / disabling those on
power_on/ off.This should allow using ohci-platform from devicetree in various cases. Specifically after this commit it can be used for the ohci controller found on Allwinner sunxi SoCs.
Signed-off-by Hans de Goede <[email protected]>--- .../devicetree/bindings/usb/mmio-ohci.txt | 22 +++ drivers/usb/host/ohci-platform.c | 164 ++++++++++++++++++--- 2 files changed, 162 insertions(+), 24 deletions(-)create mode 100644
Documentation/devicetree/bindings/usb/mmio-ohci.txtDocumentation/devicetree/bindings/usb/mmio-ohci.txt new file +22
-0@@ -0,0 +1,22 @@ +Generic MMIO OHCI controller + +Required properties: +- compatible : "mmio-ohci" +- reg : ohci controller register range (address and length) +- interrupts : ohci controller interrupt + +Optional properties: +- clocks : a list of phandle + clock specifier pairs +- phys : phandle + phy specifier pair +- phy-names : "usb" + +Example: + + ohci0: ohci at 0x01c14400 { + compatible = "mmio-ohci"; + reg = <0x01c14400 0x100>; + interrupts = <64>; + clocks = <&usb_clk 6>, <&ahb_gates 2>; + phys = <&usbphy 1>; + phy-names = "usb"; + };... <snip> ....
Documentation/devicetree/bindings/usb/mmio-ohci.txt new file +24
-0@@ -83,17 +156,40 @@ static int ohci_platform_probe(struct platform_device *dev) return -ENXIO; } + hcd = usb_create_hcd(&ohci_platform_hc_driver, &dev->dev, + dev_name(&dev->dev)); + if (!hcd) + return -ENOMEM; + + platform_set_drvdata(dev, hcd); + dev->dev.platform_data = pdata; + priv = hcd_to_ohci_priv(hcd); + + if (pdata == &ohci_platform_defaults && dev->dev.of_node) { + priv->phy = devm_phy_get(&dev->dev, "usb"); + if (IS_ERR(priv->phy)) { + err = PTR_ERR(priv->phy); + if (err == -EPROBE_DEFER) + goto err_put_hcd; + priv->phy = NULL; + } + + for (clk = 0; clk < OHCI_MAX_CLKS; clk++) { + priv->clks[clk] = of_clk_get(dev->dev.of_node, clk); + if (IS_ERR(priv->clks[clk])) { + err = PTR_ERR(priv->clks[clk]); + if (err == -EPROBE_DEFER) + goto err_put_clks;
Quoted 8 lines
Documentation/devicetree/bindings/usb/mmio-ohci.txt static int ohci_platform_probe(struct platform_device *dev) · line 187
Quoted 6 lines
Documentation/devicetree/bindings/usb/mmio-ohci.txt new file +5
-0+ priv->clks[clk] = NULL; + break; + } + } + }Given that you have limited the clock parsing to
OHCI_MAX_CLKS, there should be some kind of warning/error message if the DT contains more thanOHCI_MAX_CLKS- otherwise you have silent failures when the clocks aren't configured.
Adding such a test would be non trivial, and is just not worth it IMHO. There is one special case of a controller with 3 clocks, all others have 0-2 clocks, there are 0 known controllers with > 3 clocks. And if one shows up then the person writing the dts will figure this out quickly enough, and using old kernels with newer dts files has never been a supported scenario.
Quoted 1 line
There is also no note in the binding to indicate this limitation and you shouldn't expect people writing DT files to go digging through the source to check for this.
I've been told by several people that dt-binding documentation should never contain implementation details, since it is supposed to be platform agnostic, etc. So people writing dts files who need to know implementation details, are actually expected to look into the implementation. And in my experience with re-using some existing drivers for other SoC's, that is exactly what one always ends up doing.
Regards,
Hans
PATCH v4 2/2 ehci-platform: Add support for clks and phy passed through devicetree
In reply to Hans de GoedeCurrently ehci-platform is only used in combination with devicetree when used with some Via socs. By extending it to (optionally) get clks and a phy from devicetree, and enabling / disabling those on power_on / off, it can be used more generically. Specifically after this commit it can be used for the ehci controller on Allwinner sunxi SoCs.
Somehow we've ended up with 2 device-bindings documents for ehci-platform.c, this patch renames and updates one to mmio-ehci.txt to reflect that this is a generic ehci driver, and removes the other.
--- .../devicetree/bindings/usb/mmio-ehci.txt | 22 +++ .../devicetree/bindings/usb/via,vt8500-ehci.txt | 15 --- .../devicetree/bindings/usb/vt8500-ehci.txt | 12 -- drivers/usb/host/ehci-platform.c | 149 +++++++++++++++++---- 4 files changed, 145 insertions(+), 53 deletions(-) create mode 100644 Documentation/devicetree/bindings/usb/mmio-ehci.txt delete mode 100644 Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt delete mode 100644 Documentation/devicetree/bindings/usb/vt8500-ehci.txt
Documentation/devicetree/bindings/usb/mmio-ehci.txt new file +22 -0
@@ -0,0 +1,22 @@ +Generic MMIO EHCI controller + +Required properties: +- compatible : "via,vt8500-ehci", "wm,prizm-ehci", or "mmio-ehci" +- reg : ehci controller register range (address and length) +- interrupts : ehci controller interrupt + +Optional properties: +- clocks : a list of phandle + clock specifier pairs +- phys : phandle + phy specifier pair +- phy-names : "usb" + +Example: + + ehci at d8007900 { + compatible = "via,vt8500-ehci", "mmio-ehci"; + reg = <0xd8007900 0x200>; + interrupts = <43>; + clocks = <&usb_clk 6>, <&ahb_gates 2>; + phys = <&usbphy 1>; + phy-names = "usb"; + };
Documentation/devicetree/bindings/usb/via,vt8500-ehci.txt deleted +0 -15
@@ -1,15 +0,0 @@ -VIA/Wondermedia VT8500 EHCI Controller ------------------------------------------------------ - -Required properties: -- compatible : "via,vt8500-ehci" -- reg : Should contain 1 register ranges(address and length) -- interrupts : ehci controller interrupt - -Example: - - ehci at d8007900 { - compatible = "via,vt8500-ehci"; - reg = <0xd8007900 0x200>; - interrupts = <43>; - };
Documentation/devicetree/bindings/usb/vt8500-ehci.txt deleted +0 -12
@@ -1,12 +0,0 @@ -VIA VT8500 and Wondermedia WM8xxx SoC USB controllers. - -Required properties: - - compatible: Should be "via,vt8500-ehci" or "wm,prizm-ehci". - - reg: Address range of the ehci registers. size should be 0x200 - - interrupts: Should contain the ehci interrupt. - -usb: ehci at D8007100 { - compatible = "wm,prizm-ehci", "usb-ehci"; - reg = <0xD8007100 0x200>; - interrupts = <1>; -};
drivers/usb/host/ehci-platform.c +123 -26
244 lines not on this page · raw message
Signature · 1 line
1.8.4.2
v4 cover ohci and ehci-platform clks, phy and dt support
In reply to Hans de GoedeHello.
Quoted 2 lines · Hans de Goede
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
I see you've decided to completely ignore my opinion. NAK, FWIW.
Quoted 7 lines
Changes since v3:
(quoted diff) +0
-3-Address all of Alan Stern's review comments -Properly use put_clk in probe error path -Don't do hcd_put until after power_off as power_off may use private hcd dataRegards,
Hans
WBR, Sergei
v4 cover ohci and ehci-platform clks, phy and dt support
Hi,
Quoted 8 lines · Sergei Shtylyov
Hello.
Quoted 2 lines · Hans de Goede
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
I see you've decided to completely ignore my opinion. NAK, FWIW.
I'm sorry but the whole prefix thing has become a thing of -ETOOMUCHBIKESHEDDING, everyone except you seems to be fine with mmio and and one point in time we need to make a decision and move forward.
Regards,
Hans
v4 cover ohci and ehci-platform clks, phy and dt support
Quoted 5 lines · Hans de Goede
Quoted 4 lines · Sergei Shtylyov
Hello.
On 01/11/2014 01:46 AM, Hans de Goede wrote:
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
I see you've decided to completely ignore my opinion. NAK, FWIW.
I'm sorry but the whole prefix thing has become a thing of
-ETOOMUCHBIKESHEDDING, everyone except you seems to be fine with mmio and and one point in time we need to make a decision and move forward.
FWIW I agree with your decision - not that I think that matters to anyone :-)
But it would have been nice if you summarized the discussion in the cover letter, including the reason behind your decision. Just so that Sergei and other reviewers would see that you didn't actually ignore any opinion. You just didn't agree, and you had your reasons to do so.
Bj?rn
v4 cover ohci and ehci-platform clks, phy and dt support
Hello.
Quoted 11 lines · Bj?rn Mork
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
I see you've decided to completely ignore my opinion. NAK, FWIW.
I'm sorry but the whole prefix thing has become a thing of
-ETOOMUCHBIKESHEDDING, everyone except you seems to be fine with mmio and and one point in time we need to make a decision and move forward.FWIW I agree with your decision - not that I think that matters to anyone :-)
It matters at least to me, potential user of this stuff. It's a pity that
I haven't done this myself (in fact, I had other idea than this: writing a specific driver for my platform). As they say "if you want it done right, do it yourself".
Quoted 2 lines
But it would have been nice if you summarized the discussion in the cover letter, including the reason behind your decision. Just so that
The reason seems quite clear: Hans wants it to be merged really fast.
Quoted 2 lines
Sergei and other reviewers would see that you didn't actually ignore any opinion. You just didn't agree, and you had your reasons to do so.
Hans hasn't replied to my last mail, so I felt ignored, yes.
Quoted 1 line
Bj?rn
WBR, Sergei
v4 cover ohci and ehci-platform clks, phy and dt support
Quoted 4 lines · Sergei Shtylyov
Quoted 2 lines
FWIW I agree with your decision - not that I think that matters to anyone :-)
It matters at least to me, potential user of this stuff.
Sorry for not being clear about what "that" was referring to.
What I meant to say was: "not that I think *my opinion on the subject* matters to anyone."
Bj?rn
v4 cover ohci and ehci-platform clks, phy and dt support
In reply to Hans de GoedeQuoted 7 lines · Hans de Goede
Quoted 4 lines
Quoted 2 lines
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
I see you've decided to completely ignore my opinion. NAK, FWIW.
I'm sorry but the whole prefix thing has become a thing of
-ETOOMUCHBIKESHEDDING, everyone except you seems to be fine with mmio
Everyone being couple of people reading this thread? Of which only one
being familiar with the real [EO]HCI hardware? :-)
The name is just plain stupid if you want to know my real opinion.
And you've posted v3 with this name used first only what, 1.5 days ago?
Quoted 2 lines
and and one point in time we
need to make a decision and move forward.
I see the first version of your patches posted on January 6th, today is
11th (just starting here). You must be in a very big hurry to get this merged, I see. :-)
Serious changes like this are not really done at such pace. Only the stuff
that someone else has to painfully fix up later... :-(
Quoted 3 lines
Regards,
Hans
WBR, Sergei
v4 cover ohci and ehci-platform clks, phy and dt support
Hi,
Quoted 11 lines · Sergei Shtylyov
Quoted 7 lines · Hans de Goede
Quoted 4 lines
Quoted 2 lines
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
I see you've decided to completely ignore my opinion. NAK, FWIW.
I'm sorry but the whole prefix thing has become a thing of
-ETOOMUCHBIKESHEDDING, everyone except you seems to be fine with mmioEveryone being couple of people reading this thread? Of which only one being familiar with the real [EO]HCI hardware? :-)
You are aware that I've worked on qemu's USB emulation for 3 years full-time, including things like making the ehci emulation Windows XP compatible and many other hcd emulation fixes?
And Alan Stern's credentials speak for themselves.
Comments like this do not really help to get your own comments taken serious.
Quoted 1 line
The name is just plain stupid if you want to know my real opinion.
Your opinion has been noted, but so far your entire objection seems to be you not liking the name and now calling it stupid, while there have been actually *technical* arguments against the other prefixes.
Quoted 6 lines
And you've posted v3 with this name used first only what, 1.5 days ago?
Quoted 2 lines
and and one point in time we
need to make a decision and move forward.I see the first version of your patches posted on January 6th, today is 11th (just starting here). You must be in a very big hurry to get this merged, I see. :-)
This is not about being in a hurry, this is about not wanting to waste time on what is quickly turning into pure bike-shedding.
Quoted 1 line
Serious changes like this are not really done at such pace. Only the stuff that someone else has to painfully fix up later... :-(
If you're suggestion that the mmio- prefix will cause breakage later now is your time to actually make an actual technical argument. "just plain stupid" does not help to get your comments taken serious.
Regards,
Hans
v4 cover ohci and ehci-platform clks, phy and dt support
Hello.
Quoted 9 lines · Hans de Goede
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
I see you've decided to completely ignore my opinion. NAK, FWIW.
I'm sorry but the whole prefix thing has become a thing of
-ETOOMUCHBIKESHEDDING,
everyone except you seems to be fine with mmio
Quoted 6 lines
Quoted 2 lines
Everyone being couple of people reading this thread? Of which only one
being familiar with the real [EO]HCI hardware? :-)You are aware that I've worked on qemu's USB emulation for 3 years full-time, including things like making the ehci emulation Windows XP compatible and many other hcd emulation fixes?
Then you should have known that all [EO]HCI controllers use MMIO, and it's
pointless to call them "MMIO [EO]HCI controller" in your title and in your "compatible" prop. Because you plainly create an impression that there's some other kind of [EO]HCI controllers out there, e.g. I/O mapped (for which a separate binding would be needed?).
Quoted 1 line
And Alan Stern's credentials speak for themselves.
Yes, I meant Alan by [EO]HCI expert. He's not DT expert, unfortunately, AFAIK.
Quoted 1 line
Comments like this do not really help to get your own comments taken serious.
Well, if nothing else helps... :-(
Quoted 5 lines
Quoted 1 line
The name is just plain stupid if you want to know my real opinion.
Your opinion has been noted, but so far your entire objection seems to be you not liking the name and now calling it stupid, while there have been actually *technical* arguments against the other prefixes.
I didn't hear your reply to my last mail which laid out some plan of
dealing with ehci-ppc-of.c. Your "technical" argument against using "usb-ehci" didn't really make much sense to me and I told you why and what to do to get things right. You chose to not even reply to this and instead post "100% fready for merge" patchset.
Sigh, it's a pity Alistair Popple's patches [1], [2] didn't get merged. He
simply disappeared somewhere.
Quoted 11 lines
Quoted 8 lines
And you've posted v3 with this name used first only what, 1.5 days ago?
Quoted 2 lines
and and one point in time we
need to make a decision and move forward.I see the first version of your patches posted on January 6th, today is
11th (just starting here). You must be in a very big hurry to get this merged, I see. :-)This is not about being in a hurry, this is about not wanting to waste time on what is quickly turning into pure bike-shedding.
Do you think calling other people's opinions "pure bike-shedding" helps
the discussion?
Quoted 6 lines
Quoted 2 lines
Serious changes like this are not really done at such pace. Only the
stuff that someone else has to painfully fix up later... :-(If you're suggestion that the mmio- prefix will cause breakage later now is your time to actually make an actual technical argument. "just plain stupid" does not help to get your comments taken serious.
The worst thing is once the bindings get merged, they're "set in stone"
and it won't be easy to fix, if at all possible... :-(
Quoted 3 lines
Regards,
Hans
[1] http://marc.info/?l=linux-usb&m=138508645219604
[2] http://marc.info/?l=linuxppc-embedded&m=138508628409947
Alan Stern
maintainerv4 cover ohci and ehci-platform clks, phy and dt support
In reply to Hans de GoedeQuoted 7 lines · Hans de Goede
Hi,
Quoted 4 lines · Sergei Shtylyov
Hello.
On 01/11/2014 01:46 AM, Hans de Goede wrote:
Quoted 8 lines
Quoted 4 lines
Quoted 2 lines
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
I see you've decided to completely ignore my opinion. NAK, FWIW.
I'm sorry but the whole prefix thing has become a thing of
-ETOOMUCHBIKESHEDDING, everyone except you seems to be fine with mmio and and one point in time we need to make a decision and move forward.
If this isn't beating a dead horse... Maybe everyone can agree on a name like ohci-generic or generic-ohci. That seems like a pretty good description of the hardware that the platform driver can handle.
Alan Stern
v4 cover ohci and ehci-platform clks, phy and dt support
Quoted 12 lines · Alan Stern
Quoted 10 lines · Hans de Goede
Hi,
Quoted 7 lines · Sergei Shtylyov
Hello.
Quoted 2 lines · Hans de Goede
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set, this version should be 100% ready for merging upstream.
I see you've decided to completely ignore my opinion. NAK, FWIW.
Quoted 8 lines
Quoted 3 lines
I'm sorry but the whole prefix thing has become a thing of
-ETOOMUCHBIKESHEDDING, everyone except you seems to be fine with mmio and and one point in time we need to make a decision and move forward.If this isn't beating a dead horse... Maybe everyone can agree on a name like ohci-generic or generic-ohci. That seems like a pretty good description of the hardware that the platform driver can handle.
Alan Stern
I prefer the -generic option, although generic- is equally fine - Having said that, I don't really care if it's called mmio either (although this does seem less 'descriptive').
Regards
Tony Prisk
v4 cover ohci and ehci-platform clks, phy and dt support
Hi,
[Cc'ing DT maintainers directly]
Quoted 19 lines · Tony Prisk
Quoted 18 lines · Alan Stern
Quoted 16 lines · Hans de Goede
Hi,
Quoted 8 lines · Sergei Shtylyov
Hello.
Quoted 3 lines · Hans de Goede
Here is v4 of my ohci and ehci-platform clks, phy and dt support patch-set,
this version should be 100% ready for merging upstream.I see you've decided to completely ignore my opinion. NAK, FWIW.
I'm sorry but the whole prefix thing has become a thing of
-ETOOMUCHBIKESHEDDING,
everyone except you seems to be fine with mmio and and one point in time we
need to make a decision and move forward.
Quoted 8 lines
Quoted 5 lines
If this isn't beating a dead horse... Maybe everyone can agree on a name like ohci-generic or generic-ohci. That seems like a pretty good description of the hardware that the platform driver can handle.
Alan Stern
I prefer the -generic option, although generic- is equally fine - Having said that, I don't really care if it's called mmio either (although this does seem less 'descriptive').
Grepping over existing dts files, I can find several occurrences of "usb-ehci" compatible string:
at91sam9g45.dtsi: compatible =
"atmel,at91sam9g45-ehci", "usb-ehci";at91sam9x5.dtsi: compatible =
"atmel,at91sam9g45-ehci", "usb-ehci";omap3.dtsi: compatible = "ti,ehci-omap",
"usb-ehci";omap4.dtsi: compatible = "ti,ehci-omap",
"usb-ehci";omap5.dtsi: compatible = "ti,ehci-omap",
"usb-ehci";sama5d3.dtsi: compatible = "atmel,at91sam9g45-ehci",
"usb-ehci";
spear13xx.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; spear13xx.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; spear3xx.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; spear600.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; spear600.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; tegra114.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci"; tegra114.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci"; tegra20.dtsi: compatible = "nvidia,tegra20-ehci", "usb-ehci"; tegra20.dtsi: compatible = "nvidia,tegra20-ehci", "usb-ehci"; tegra20.dtsi: compatible = "nvidia,tegra20-ehci", "usb-ehci"; tegra30.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci"; tegra30.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci"; tegra30.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci";
Same for "usb-ohci":
arch/arm/boot/dts/at91rm9200.dtsi: compatible =
"atmel,at91rm9200-ohci", "usb-ohci";arch/arm/boot/dts/at91sam9260.dtsi: compatible =
"atmel,at91rm9200-ohci", "usb-ohci";arch/arm/boot/dts/at91sam9263.dtsi: compatible =
"atmel,at91rm9200-ohci", "usb-ohci";arch/arm/boot/dts/at91sam9g45.dtsi: compatible =
"atmel,at91rm9200-ohci", "usb-ohci";arch/arm/boot/dts/at91sam9n12.dtsi: compatible =
"atmel,at91rm9200-ohci", "usb-ohci";arch/arm/boot/dts/at91sam9x5.dtsi: compatible =
"atmel,at91rm9200-ohci", "usb-ohci";arch/arm/boot/dts/lpc32xx.dtsi: compatible =
"nxp,ohci-nxp", "usb-ohci";arch/arm/boot/dts/omap3.dtsi: compatible =
"ti,ohci-omap3", "usb-ohci";arch/arm/boot/dts/omap4.dtsi: compatible =
"ti,ohci-omap3", "usb-ohci";arch/arm/boot/dts/omap5.dtsi: compatible =
"ti,ohci-omap3", "usb-ohci";arch/arm/boot/dts/sama5d3.dtsi: compatible =
"atmel,at91rm9200-ohci", "usb-ohci";arch/arm/boot/dts/spear13xx.dtsi: compatible =
"st,spear600-ohci", "usb-ohci";arch/arm/boot/dts/spear13xx.dtsi: compatible =
"st,spear600-ohci", "usb-ohci";arch/arm/boot/dts/spear3xx.dtsi: compatible =
"st,spear600-ohci", "usb-ohci";arch/arm/boot/dts/spear3xx.dtsi: compatible =
"st,spear600-ohci", "usb-ohci";arch/arm/boot/dts/spear600.dtsi: compatible =
"st,spear600-ohci", "usb-ohci";arch/arm/boot/dts/spear600.dtsi: compatible =
"st,spear600-ohci", "usb-ohci";
For "usb-ehci" there is even a documentation file [1], while "usb-ohci" seems to be undocumented.
[1] Documentation/devicetree/bindings/usb/usb-ehci.txt
Aren't they both something that should be accounted for in this series?
Best regards,
Tomasz
v4 cover ohci and ehci-platform clks, phy and dt support
Hi,
Quoted 4 lines · Tomasz Figa
Hi,
[Cc'ing DT maintainers directly]
<snip>
Quoted 4 lines
Quoted 4 lines
Quoted 1 line
Alan Stern Wrote:
I prefer the -generic option, although generic- is equally fine - Having said that, I don't really care if it's called mmio either (although this does seem less 'descriptive').
I can do a v5 changing the compatible string to generix-Xhci, if that will put an end to all this discussion, then again, there may be a better way, see below.
Quoted 43 lines
Grepping over existing dts files, I can find several occurrences of "usb-ehci" compatible string:
at91sam9g45.dtsi: compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; at91sam9x5.dtsi: compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; omap3.dtsi: compatible = "ti,ehci-omap", "usb-ehci"; omap4.dtsi: compatible = "ti,ehci-omap", "usb-ehci"; omap5.dtsi: compatible = "ti,ehci-omap", "usb-ehci"; sama5d3.dtsi: compatible = "atmel,at91sam9g45-ehci", "usb-ehci"; spear13xx.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; spear13xx.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; spear3xx.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; spear600.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; spear600.dtsi: compatible = "st,spear600-ehci", "usb-ehci"; tegra114.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci"; tegra114.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci"; tegra20.dtsi: compatible = "nvidia,tegra20-ehci", "usb-ehci"; tegra20.dtsi: compatible = "nvidia,tegra20-ehci", "usb-ehci"; tegra20.dtsi: compatible = "nvidia,tegra20-ehci", "usb-ehci"; tegra30.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci"; tegra30.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci"; tegra30.dtsi: compatible = "nvidia,tegra30-ehci", "usb-ehci";Same for "usb-ohci":
arch/arm/boot/dts/at91rm9200.dtsi: compatible = "atmel,at91rm9200-ohci", "usb-ohci"; arch/arm/boot/dts/at91sam9260.dtsi: compatible = "atmel,at91rm9200-ohci", "usb-ohci"; arch/arm/boot/dts/at91sam9263.dtsi: compatible = "atmel,at91rm9200-ohci", "usb-ohci"; arch/arm/boot/dts/at91sam9g45.dtsi: compatible = "atmel,at91rm9200-ohci", "usb-ohci"; arch/arm/boot/dts/at91sam9n12.dtsi: compatible = "atmel,at91rm9200-ohci", "usb-ohci"; arch/arm/boot/dts/at91sam9x5.dtsi: compatible = "atmel,at91rm9200-ohci", "usb-ohci"; arch/arm/boot/dts/lpc32xx.dtsi: compatible = "nxp,ohci-nxp", "usb-ohci"; arch/arm/boot/dts/omap3.dtsi: compatible = "ti,ohci-omap3", "usb-ohci"; arch/arm/boot/dts/omap4.dtsi: compatible = "ti,ohci-omap3", "usb-ohci"; arch/arm/boot/dts/omap5.dtsi: compatible = "ti,ohci-omap3", "usb-ohci"; arch/arm/boot/dts/sama5d3.dtsi: compatible = "atmel,at91rm9200-ohci", "usb-ohci"; arch/arm/boot/dts/spear13xx.dtsi: compatible = "st,spear600-ohci", "usb-ohci"; arch/arm/boot/dts/spear13xx.dtsi: compatible = "st,spear600-ohci", "usb-ohci"; arch/arm/boot/dts/spear3xx.dtsi: compatible = "st,spear600-ohci", "usb-ohci"; arch/arm/boot/dts/spear3xx.dtsi: compatible = "st,spear600-ohci", "usb-ohci"; arch/arm/boot/dts/spear600.dtsi: compatible = "st,spear600-ohci", "usb-ohci"; arch/arm/boot/dts/spear600.dtsi: compatible = "st,spear600-ohci", "usb-ohci";
Quoted 5 lines
For "usb-ehci" there is even a documentation file [1], while "usb-ohci" seems to be undocumented.
[1]
Documentation/devicetree/bindings/usb/usb-ehci.txtAren't they both something that should be accounted for in this series?
I agree that usb-Xhci would be the best compatible strings to use.
The problem with usb-ehci is that there already is a ppc specific driver binding to that compatible string, doing various ppc specific controller initialization.
Thinking more about this, there is one possible solution though, the ehci-ppc-of.c is guarded in Kconfig with:
depends on PPC_OF
If we add an inverted check to the Kconfig option for platform-ehci.c, ie:
config USB_EHCI_HCD_PLATFORM
tristate "Generic EHCI driver for a platform device"
depends on !PPC_OF
Then we can be certain that we don't end up with 2 drivers claiming the usb-ehci compatible on ppc platforms. I've done some quick research and it seems that ehci-platform.c is only used on arm and mips devices, so excluding its use on ppc should not be an issue.
Then later on someone, who has the actual hardware to test, can merge the ppc specific quirk handling into ehci-platform,c and ehci-ppc-of.c can go away entirely.
Alan, if you agree this is the best way forward, I'll do a v5 with the proposed changes.
Regards,
Hans
Alan Stern
maintainerv4 cover ohci and ehci-platform clks, phy and dt support
Quoted 21 lines · Hans de Goede
I agree that usb-Xhci would be the best compatible strings to use.
The problem with usb-ehci is that there already is a ppc specific driver binding to that compatible string, doing various ppc specific controller initialization.
Thinking more about this, there is one possible solution though, the
ehci-ppc-of.cis guarded inKconfigwith:depends on
PPC_OFIf we add an inverted check to the
Kconfigoption forplatform-ehci.c, ie:config
USB_EHCI_HCD_PLATFORM
tristate "Generic EHCI driver for a platform device"
depends on !PPC_OFThen we can be certain that we don't end up with 2 drivers claiming the usb-ehci compatible on ppc platforms. I've done some quick research and it seems that
ehci-platform.cis only used on arm and mips devices, so excluding its use on ppc should not be an issue.
Quoted 6 lines
Then later on someone, who has the actual hardware to test, can merge the ppc specific quirk handling into ehci-platform,c and
ehci-ppc-of.ccan go away entirely.Alan, if you agree this is the best way forward, I'll do a v5 with the proposed changes.
That's okay with me.
Alan Stern