linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
@ 2013-01-31 11:20 Vivek Gautam
  2013-01-31 11:34 ` kishon
  0 siblings, 1 reply; 15+ messages in thread
From: Vivek Gautam @ 2013-01-31 11:20 UTC (permalink / raw)
  To: linux-usb
  Cc: linux-kernel, linux-omap, linux-samsung-soc, gregkh, balbi, kishon

With device tree support in place for dwc3-core layer,
it gets PHY from "synopsis-dwc3" node.
Some controllers may not have separate memory maps and interrupts
for dwc3 core and platform glue layers. In such case only glue
layer's node will exist.
Moreover, SoCs having multiple dwc3 controllers will have multiple
PHYs, which eventually be added using usb_add_phy_dev(), and not
using usb_add_phy(). So each dwc3 controller won't be able to
get PHYs by simply calling devm_usb_get_phy() also.
In such cases, dwc3 should expect PHYs from its parent's node.
So, adding provision for getting PHY from platform specific
device tree node.

Signed-off-by: Vivek Gautam <gautam.vivek@samsung.com>
---

Based on 'usb-next'.

 drivers/usb/dwc3/core.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index 9999094..75439c0 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -423,6 +423,11 @@ static int dwc3_probe(struct platform_device *pdev)
 	if (node) {
 		dwc->usb2_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 0);
 		dwc->usb3_phy = devm_usb_get_phy_by_phandle(dev, "usb-phy", 1);
+	} else if (dev->parent->of_node) {
+		dwc->usb2_phy = devm_usb_get_phy_by_phandle(dev->parent,
+								"usb-phy", 0);
+		dwc->usb3_phy = devm_usb_get_phy_by_phandle(dev->parent,
+								"usb-phy", 1);
 	} else {
 		dwc->usb2_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB2);
 		dwc->usb3_phy = devm_usb_get_phy(dev, USB_PHY_TYPE_USB3);
-- 
1.7.6.5


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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-01-31 11:20 [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node Vivek Gautam
@ 2013-01-31 11:34 ` kishon
  2013-01-31 15:23   ` Vivek Gautam
  0 siblings, 1 reply; 15+ messages in thread
From: kishon @ 2013-01-31 11:34 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: linux-usb, linux-kernel, linux-omap, linux-samsung-soc, gregkh, balbi

Hi,

On Thursday 31 January 2013 04:50 PM, Vivek Gautam wrote:
> With device tree support in place for dwc3-core layer,
> it gets PHY from "synopsis-dwc3" node.
> Some controllers may not have separate memory maps and interrupts
> for dwc3 core and platform glue layers. In such case only glue
> layer's node will exist.

Not really. As long as you have dwc3 core as a separate device, you can 
add a node for it.
Just that the glue should create a device for dwc3 core using 
of_platform_populate.(You can have a look at 
drivers/usb/dwc3/dwc3-omap.c in usb-next)
> Moreover, SoCs having multiple dwc3 controllers will have multiple
> PHYs, which eventually be added using usb_add_phy_dev(), and not
> using usb_add_phy(). So each dwc3 controller won't be able to
> get PHYs by simply calling devm_usb_get_phy() also.
No. We have added usb_get_phy_dev() for that purpose in the case of non-dt.
I think, instead you can have a patch to use devm_usb_get_phy_dev() here 
and in exynos platform specific code use usb_bind_phy() to bind the phy 
and controller till you change it to dt.
> In such cases, dwc3 should expect PHYs from its parent's node.
NAK.

Thanks
Kishon

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-01-31 11:34 ` kishon
@ 2013-01-31 15:23   ` Vivek Gautam
  2013-01-31 15:25     ` Felipe Balbi
  0 siblings, 1 reply; 15+ messages in thread
From: Vivek Gautam @ 2013-01-31 15:23 UTC (permalink / raw)
  To: kishon
  Cc: Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh, balbi

Hi Kishon,


On Thu, Jan 31, 2013 at 5:04 PM, kishon <kishon@ti.com> wrote:
> Hi,
>

Thanks for your quick help.

>
> On Thursday 31 January 2013 04:50 PM, Vivek Gautam wrote:
>>
>> With device tree support in place for dwc3-core layer,
>> it gets PHY from "synopsis-dwc3" node.
>> Some controllers may not have separate memory maps and interrupts
>> for dwc3 core and platform glue layers. In such case only glue
>> layer's node will exist.
>
>
> Not really. As long as you have dwc3 core as a separate device, you can add
> a node for it.
> Just that the glue should create a device for dwc3 core using
> of_platform_populate.(You can have a look at drivers/usb/dwc3/dwc3-omap.c in
> usb-next)
>

Right, we should be doing this way.

>> Moreover, SoCs having multiple dwc3 controllers will have multiple
>> PHYs, which eventually be added using usb_add_phy_dev(), and not
>> using usb_add_phy(). So each dwc3 controller won't be able to
>> get PHYs by simply calling devm_usb_get_phy() also.
>
> No. We have added usb_get_phy_dev() for that purpose in the case of non-dt.
> I think, instead you can have a patch to use devm_usb_get_phy_dev() here and
> in exynos platform specific code use usb_bind_phy() to bind the phy and
> controller till you change it to dt.
>

We have dt support for dwc3-exynos, in such case we should go ahead with
of_platform_populate(), right ?
But if when i use of_platform_populate() i will not be able to set
dma_mask to dwc3->dev. :-(
And setting it in dwc3_probe() won't be good idea, isn't it ?

>> In such cases, dwc3 should expect PHYs from its parent's node.
>
> NAK.
>
> Thanks
> Kishon
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc"
> in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Thanks & Regards
Vivek

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-01-31 15:23   ` Vivek Gautam
@ 2013-01-31 15:25     ` Felipe Balbi
  2013-01-31 15:30       ` Vivek Gautam
  0 siblings, 1 reply; 15+ messages in thread
From: Felipe Balbi @ 2013-01-31 15:25 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: kishon, Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh, balbi

[-- Attachment #1: Type: text/plain, Size: 932 bytes --]

Hi,

On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
> >> Moreover, SoCs having multiple dwc3 controllers will have multiple
> >> PHYs, which eventually be added using usb_add_phy_dev(), and not
> >> using usb_add_phy(). So each dwc3 controller won't be able to
> >> get PHYs by simply calling devm_usb_get_phy() also.
> >
> > No. We have added usb_get_phy_dev() for that purpose in the case of non-dt.
> > I think, instead you can have a patch to use devm_usb_get_phy_dev() here and
> > in exynos platform specific code use usb_bind_phy() to bind the phy and
> > controller till you change it to dt.
> >
> 
> We have dt support for dwc3-exynos, in such case we should go ahead with
> of_platform_populate(), right ?
> But if when i use of_platform_populate() i will not be able to set
> dma_mask to dwc3->dev. :-(

do you have a special need for dma_mask because OF already sets it.

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-01-31 15:25     ` Felipe Balbi
@ 2013-01-31 15:30       ` Vivek Gautam
  2013-01-31 15:38         ` Felipe Balbi
  0 siblings, 1 reply; 15+ messages in thread
From: Vivek Gautam @ 2013-01-31 15:30 UTC (permalink / raw)
  To: balbi
  Cc: kishon, Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh

Hi Felipe,


On Thu, Jan 31, 2013 at 8:55 PM, Felipe Balbi <balbi@ti.com> wrote:
> Hi,
>
> On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
>> >> Moreover, SoCs having multiple dwc3 controllers will have multiple
>> >> PHYs, which eventually be added using usb_add_phy_dev(), and not
>> >> using usb_add_phy(). So each dwc3 controller won't be able to
>> >> get PHYs by simply calling devm_usb_get_phy() also.
>> >
>> > No. We have added usb_get_phy_dev() for that purpose in the case of non-dt.
>> > I think, instead you can have a patch to use devm_usb_get_phy_dev() here and
>> > in exynos platform specific code use usb_bind_phy() to bind the phy and
>> > controller till you change it to dt.
>> >
>>
>> We have dt support for dwc3-exynos, in such case we should go ahead with
>> of_platform_populate(), right ?
>> But if when i use of_platform_populate() i will not be able to set
>> dma_mask to dwc3->dev. :-(
>
> do you have a special need for dma_mask because OF already sets it.
>
If i am not wrong of_platform_device_create_pdata() will set
"dev->dev.coherent_dma_mask = DMA_BIT_MASK(32)"
and not dma_mask.
I fact we had some discussion sometime back when we needed the same
for dwc3-exynos in the thread:
[PATCH v2 1/2] USB: dwc3-exynos: Add support for device tree

But couldn't get final node on it.
So suggestions here please. :-)


-- 
Thanks & Regards
Vivek

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-01-31 15:30       ` Vivek Gautam
@ 2013-01-31 15:38         ` Felipe Balbi
  2013-02-01  5:21           ` kishon
  2013-02-28 14:39           ` Vivek Gautam
  0 siblings, 2 replies; 15+ messages in thread
From: Felipe Balbi @ 2013-01-31 15:38 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: balbi, kishon, Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh, Grant Likely, Rob Herring,
	devicetree-discuss

[-- Attachment #1: Type: text/plain, Size: 1591 bytes --]

On Thu, Jan 31, 2013 at 09:00:37PM +0530, Vivek Gautam wrote:
> Hi Felipe,
> 
> 
> On Thu, Jan 31, 2013 at 8:55 PM, Felipe Balbi <balbi@ti.com> wrote:
> > Hi,
> >
> > On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
> >> >> Moreover, SoCs having multiple dwc3 controllers will have multiple
> >> >> PHYs, which eventually be added using usb_add_phy_dev(), and not
> >> >> using usb_add_phy(). So each dwc3 controller won't be able to
> >> >> get PHYs by simply calling devm_usb_get_phy() also.
> >> >
> >> > No. We have added usb_get_phy_dev() for that purpose in the case of non-dt.
> >> > I think, instead you can have a patch to use devm_usb_get_phy_dev() here and
> >> > in exynos platform specific code use usb_bind_phy() to bind the phy and
> >> > controller till you change it to dt.
> >> >
> >>
> >> We have dt support for dwc3-exynos, in such case we should go ahead with
> >> of_platform_populate(), right ?
> >> But if when i use of_platform_populate() i will not be able to set
> >> dma_mask to dwc3->dev. :-(
> >
> > do you have a special need for dma_mask because OF already sets it.
> >
> If i am not wrong of_platform_device_create_pdata() will set
> "dev->dev.coherent_dma_mask = DMA_BIT_MASK(32)"
> and not dma_mask.
> I fact we had some discussion sometime back when we needed the same
> for dwc3-exynos in the thread:
> [PATCH v2 1/2] USB: dwc3-exynos: Add support for device tree
> 
> But couldn't get final node on it.
> So suggestions here please. :-)

hmm.. you're right there. Grant, Rob ? Any hints ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-01-31 15:38         ` Felipe Balbi
@ 2013-02-01  5:21           ` kishon
  2013-02-01  6:22             ` Vivek Gautam
  2013-02-28 14:39           ` Vivek Gautam
  1 sibling, 1 reply; 15+ messages in thread
From: kishon @ 2013-02-01  5:21 UTC (permalink / raw)
  To: balbi
  Cc: Vivek Gautam, Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh, Grant Likely, Rob Herring,
	devicetree-discuss

Hi,

On Thursday 31 January 2013 09:08 PM, Felipe Balbi wrote:
> On Thu, Jan 31, 2013 at 09:00:37PM +0530, Vivek Gautam wrote:
>> Hi Felipe,
>>
>>
>> On Thu, Jan 31, 2013 at 8:55 PM, Felipe Balbi <balbi@ti.com> wrote:
>>> Hi,
>>>
>>> On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
>>>>>> Moreover, SoCs having multiple dwc3 controllers will have multiple
>>>>>> PHYs, which eventually be added using usb_add_phy_dev(), and not
>>>>>> using usb_add_phy(). So each dwc3 controller won't be able to
>>>>>> get PHYs by simply calling devm_usb_get_phy() also.
>>>>>
>>>>> No. We have added usb_get_phy_dev() for that purpose in the case of non-dt.
>>>>> I think, instead you can have a patch to use devm_usb_get_phy_dev() here and
>>>>> in exynos platform specific code use usb_bind_phy() to bind the phy and
>>>>> controller till you change it to dt.
>>>>>
>>>>
>>>> We have dt support for dwc3-exynos, in such case we should go ahead with
>>>> of_platform_populate(), right ?
>>>> But if when i use of_platform_populate() i will not be able to set
>>>> dma_mask to dwc3->dev. :-(

You can do something like this

static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);

static int dwc3_exynos_set_dmamask(struct device *dev, void *c)
{
	dev->dma_mask = &dwc3_exynos_dma_mask;

	return 0;
}

And in your probe after of_platform_populate, you can add

device_for_each_child(&pdev->dev, NULL, dwc3_exynos_set_dmamask);

Here pdev is the platform device of dwc3-exynos. By this way all the 
children of dwc3-exynos will have dma_mask set to the required value.

I'm not sure if there is any other better way to achieve the same 
(without patching of.c ;-))

Thanks
Kishon

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-02-01  5:21           ` kishon
@ 2013-02-01  6:22             ` Vivek Gautam
  2013-02-01  6:24               ` Vivek Gautam
  0 siblings, 1 reply; 15+ messages in thread
From: Vivek Gautam @ 2013-02-01  6:22 UTC (permalink / raw)
  To: kishon
  Cc: balbi, Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh, Grant Likely, Rob Herring,
	devicetree-discuss

Hi Kishon,


On Fri, Feb 1, 2013 at 10:51 AM, kishon <kishon@ti.com> wrote:
> Hi,
>
>
> On Thursday 31 January 2013 09:08 PM, Felipe Balbi wrote:
>>
>> On Thu, Jan 31, 2013 at 09:00:37PM +0530, Vivek Gautam wrote:
>>>
>>> Hi Felipe,
>>>
>>>
>>> On Thu, Jan 31, 2013 at 8:55 PM, Felipe Balbi <balbi@ti.com> wrote:
>>>>
>>>> Hi,
>>>>
>>>> On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
>>>>>>>
>>>>>>> Moreover, SoCs having multiple dwc3 controllers will have multiple
>>>>>>> PHYs, which eventually be added using usb_add_phy_dev(), and not
>>>>>>> using usb_add_phy(). So each dwc3 controller won't be able to
>>>>>>> get PHYs by simply calling devm_usb_get_phy() also.
>>>>>>
>>>>>>
>>>>>> No. We have added usb_get_phy_dev() for that purpose in the case of
>>>>>> non-dt.
>>>>>> I think, instead you can have a patch to use devm_usb_get_phy_dev()
>>>>>> here and
>>>>>> in exynos platform specific code use usb_bind_phy() to bind the phy
>>>>>> and
>>>>>> controller till you change it to dt.
>>>>>>
>>>>>
>>>>> We have dt support for dwc3-exynos, in such case we should go ahead
>>>>> with
>>>>> of_platform_populate(), right ?
>>>>> But if when i use of_platform_populate() i will not be able to set
>>>>> dma_mask to dwc3->dev. :-(
>
>
> You can do something like this
>
> static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
>
> static int dwc3_exynos_set_dmamask(struct device *dev, void *c)
> {
>         dev->dma_mask = &dwc3_exynos_dma_mask;
>
>         return 0;
> }
>
> And in your probe after of_platform_populate, you can add
>
> device_for_each_child(&pdev->dev, NULL, dwc3_exynos_set_dmamask);
>
> Here pdev is the platform device of dwc3-exynos. By this way all the
> children of dwc3-exynos will have dma_mask set to the required value.
>

Nice idea, thanks :-)
hmm.. so i can patch this now, and get things working ;-)

> I'm not sure if there is any other better way to achieve the same (without
> patching of.c ;-))
>


-- 
Thanks & Regards
Vivek

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-02-01  6:22             ` Vivek Gautam
@ 2013-02-01  6:24               ` Vivek Gautam
  2013-02-01  8:50                 ` Felipe Balbi
  0 siblings, 1 reply; 15+ messages in thread
From: Vivek Gautam @ 2013-02-01  6:24 UTC (permalink / raw)
  To: balbi
  Cc: kishon, Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh, Grant Likely, Rob Herring,
	devicetree-discuss

Hi Balbi,


On Fri, Feb 1, 2013 at 11:52 AM, Vivek Gautam <gautamvivek1987@gmail.com> wrote:
> Hi Kishon,
>
>
> On Fri, Feb 1, 2013 at 10:51 AM, kishon <kishon@ti.com> wrote:
>> Hi,
>>
>>
>> On Thursday 31 January 2013 09:08 PM, Felipe Balbi wrote:
>>>
>>> On Thu, Jan 31, 2013 at 09:00:37PM +0530, Vivek Gautam wrote:
>>>>
>>>> Hi Felipe,
>>>>
>>>>
>>>> On Thu, Jan 31, 2013 at 8:55 PM, Felipe Balbi <balbi@ti.com> wrote:
>>>>>
>>>>> Hi,
>>>>>
>>>>> On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
>>>>>>>>
>>>>>>>> Moreover, SoCs having multiple dwc3 controllers will have multiple
>>>>>>>> PHYs, which eventually be added using usb_add_phy_dev(), and not
>>>>>>>> using usb_add_phy(). So each dwc3 controller won't be able to
>>>>>>>> get PHYs by simply calling devm_usb_get_phy() also.
>>>>>>>
>>>>>>>
>>>>>>> No. We have added usb_get_phy_dev() for that purpose in the case of
>>>>>>> non-dt.
>>>>>>> I think, instead you can have a patch to use devm_usb_get_phy_dev()
>>>>>>> here and
>>>>>>> in exynos platform specific code use usb_bind_phy() to bind the phy
>>>>>>> and
>>>>>>> controller till you change it to dt.
>>>>>>>
>>>>>>
>>>>>> We have dt support for dwc3-exynos, in such case we should go ahead
>>>>>> with
>>>>>> of_platform_populate(), right ?
>>>>>> But if when i use of_platform_populate() i will not be able to set
>>>>>> dma_mask to dwc3->dev. :-(
>>
>>
>> You can do something like this
>>
>> static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
>>
>> static int dwc3_exynos_set_dmamask(struct device *dev, void *c)
>> {
>>         dev->dma_mask = &dwc3_exynos_dma_mask;
>>
>>         return 0;
>> }
>>
>> And in your probe after of_platform_populate, you can add
>>
>> device_for_each_child(&pdev->dev, NULL, dwc3_exynos_set_dmamask);
>>
>> Here pdev is the platform device of dwc3-exynos. By this way all the
>> children of dwc3-exynos will have dma_mask set to the required value.
>>
>
> Nice idea, thanks :-)
> hmm.. so i can patch this now, and get things working ;-)
>

If this is fine with you shall i go ahead and post a patch for the same ? ;-)


>> I'm not sure if there is any other better way to achieve the same (without
>> patching of.c ;-))
>>
>



-- 
Thanks & Regards
Vivek

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-02-01  6:24               ` Vivek Gautam
@ 2013-02-01  8:50                 ` Felipe Balbi
  2013-02-01  8:53                   ` Vivek Gautam
  0 siblings, 1 reply; 15+ messages in thread
From: Felipe Balbi @ 2013-02-01  8:50 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: balbi, kishon, Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh, Grant Likely, Rob Herring,
	devicetree-discuss

[-- Attachment #1: Type: text/plain, Size: 2507 bytes --]

On Fri, Feb 01, 2013 at 11:54:01AM +0530, Vivek Gautam wrote:
> Hi Balbi,
> 
> 
> On Fri, Feb 1, 2013 at 11:52 AM, Vivek Gautam <gautamvivek1987@gmail.com> wrote:
> > Hi Kishon,
> >
> >
> > On Fri, Feb 1, 2013 at 10:51 AM, kishon <kishon@ti.com> wrote:
> >> Hi,
> >>
> >>
> >> On Thursday 31 January 2013 09:08 PM, Felipe Balbi wrote:
> >>>
> >>> On Thu, Jan 31, 2013 at 09:00:37PM +0530, Vivek Gautam wrote:
> >>>>
> >>>> Hi Felipe,
> >>>>
> >>>>
> >>>> On Thu, Jan 31, 2013 at 8:55 PM, Felipe Balbi <balbi@ti.com> wrote:
> >>>>>
> >>>>> Hi,
> >>>>>
> >>>>> On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
> >>>>>>>>
> >>>>>>>> Moreover, SoCs having multiple dwc3 controllers will have multiple
> >>>>>>>> PHYs, which eventually be added using usb_add_phy_dev(), and not
> >>>>>>>> using usb_add_phy(). So each dwc3 controller won't be able to
> >>>>>>>> get PHYs by simply calling devm_usb_get_phy() also.
> >>>>>>>
> >>>>>>>
> >>>>>>> No. We have added usb_get_phy_dev() for that purpose in the case of
> >>>>>>> non-dt.
> >>>>>>> I think, instead you can have a patch to use devm_usb_get_phy_dev()
> >>>>>>> here and
> >>>>>>> in exynos platform specific code use usb_bind_phy() to bind the phy
> >>>>>>> and
> >>>>>>> controller till you change it to dt.
> >>>>>>>
> >>>>>>
> >>>>>> We have dt support for dwc3-exynos, in such case we should go ahead
> >>>>>> with
> >>>>>> of_platform_populate(), right ?
> >>>>>> But if when i use of_platform_populate() i will not be able to set
> >>>>>> dma_mask to dwc3->dev. :-(
> >>
> >>
> >> You can do something like this
> >>
> >> static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
> >>
> >> static int dwc3_exynos_set_dmamask(struct device *dev, void *c)
> >> {
> >>         dev->dma_mask = &dwc3_exynos_dma_mask;
> >>
> >>         return 0;
> >> }
> >>
> >> And in your probe after of_platform_populate, you can add
> >>
> >> device_for_each_child(&pdev->dev, NULL, dwc3_exynos_set_dmamask);
> >>
> >> Here pdev is the platform device of dwc3-exynos. By this way all the
> >> children of dwc3-exynos will have dma_mask set to the required value.
> >>
> >
> > Nice idea, thanks :-)
> > hmm.. so i can patch this now, and get things working ;-)
> >
> 
> If this is fine with you shall i go ahead and post a patch for the same ? ;-)

should be fine, but we can wait a bit to see if DeviceTree folks reply,
your patch will only go on v3.10 anyway.

cheers

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-02-01  8:50                 ` Felipe Balbi
@ 2013-02-01  8:53                   ` Vivek Gautam
  2013-02-01  9:43                     ` Felipe Balbi
  0 siblings, 1 reply; 15+ messages in thread
From: Vivek Gautam @ 2013-02-01  8:53 UTC (permalink / raw)
  To: balbi
  Cc: kishon, Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh, Grant Likely, Rob Herring,
	devicetree-discuss

On Fri, Feb 1, 2013 at 2:20 PM, Felipe Balbi <balbi@ti.com> wrote:
> On Fri, Feb 01, 2013 at 11:54:01AM +0530, Vivek Gautam wrote:
>> Hi Balbi,
>>
>>
>> On Fri, Feb 1, 2013 at 11:52 AM, Vivek Gautam <gautamvivek1987@gmail.com> wrote:
>> > Hi Kishon,
>> >
>> >
>> > On Fri, Feb 1, 2013 at 10:51 AM, kishon <kishon@ti.com> wrote:
>> >> Hi,
>> >>
>> >>
>> >> On Thursday 31 January 2013 09:08 PM, Felipe Balbi wrote:
>> >>>
>> >>> On Thu, Jan 31, 2013 at 09:00:37PM +0530, Vivek Gautam wrote:
>> >>>>
>> >>>> Hi Felipe,
>> >>>>
>> >>>>
>> >>>> On Thu, Jan 31, 2013 at 8:55 PM, Felipe Balbi <balbi@ti.com> wrote:
>> >>>>>
>> >>>>> Hi,
>> >>>>>
>> >>>>> On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
>> >>>>>>>>
>> >>>>>>>> Moreover, SoCs having multiple dwc3 controllers will have multiple
>> >>>>>>>> PHYs, which eventually be added using usb_add_phy_dev(), and not
>> >>>>>>>> using usb_add_phy(). So each dwc3 controller won't be able to
>> >>>>>>>> get PHYs by simply calling devm_usb_get_phy() also.
>> >>>>>>>
>> >>>>>>>
>> >>>>>>> No. We have added usb_get_phy_dev() for that purpose in the case of
>> >>>>>>> non-dt.
>> >>>>>>> I think, instead you can have a patch to use devm_usb_get_phy_dev()
>> >>>>>>> here and
>> >>>>>>> in exynos platform specific code use usb_bind_phy() to bind the phy
>> >>>>>>> and
>> >>>>>>> controller till you change it to dt.
>> >>>>>>>
>> >>>>>>
>> >>>>>> We have dt support for dwc3-exynos, in such case we should go ahead
>> >>>>>> with
>> >>>>>> of_platform_populate(), right ?
>> >>>>>> But if when i use of_platform_populate() i will not be able to set
>> >>>>>> dma_mask to dwc3->dev. :-(
>> >>
>> >>
>> >> You can do something like this
>> >>
>> >> static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
>> >>
>> >> static int dwc3_exynos_set_dmamask(struct device *dev, void *c)
>> >> {
>> >>         dev->dma_mask = &dwc3_exynos_dma_mask;
>> >>
>> >>         return 0;
>> >> }
>> >>
>> >> And in your probe after of_platform_populate, you can add
>> >>
>> >> device_for_each_child(&pdev->dev, NULL, dwc3_exynos_set_dmamask);
>> >>
>> >> Here pdev is the platform device of dwc3-exynos. By this way all the
>> >> children of dwc3-exynos will have dma_mask set to the required value.
>> >>
>> >
>> > Nice idea, thanks :-)
>> > hmm.. so i can patch this now, and get things working ;-)
>> >
>>
>> If this is fine with you shall i go ahead and post a patch for the same ? ;-)
>
> should be fine, but we can wait a bit to see if DeviceTree folks reply,
> your patch will only go on v3.10 anyway.
>

Yeah, sure. No problem at all.
For the time being i will continue to use this change for my other
development work too. :-)


-- 
Thanks & Regards
Vivek

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-02-01  8:53                   ` Vivek Gautam
@ 2013-02-01  9:43                     ` Felipe Balbi
  0 siblings, 0 replies; 15+ messages in thread
From: Felipe Balbi @ 2013-02-01  9:43 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: balbi, kishon, Vivek Gautam, linux-usb, linux-kernel, linux-omap,
	linux-samsung-soc, gregkh, Grant Likely, Rob Herring,
	devicetree-discuss

[-- Attachment #1: Type: text/plain, Size: 2314 bytes --]

Hi,

On Fri, Feb 01, 2013 at 02:23:28PM +0530, Vivek Gautam wrote:
> >> >>>>> On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
> >> >>>>>>>>
> >> >>>>>>>> Moreover, SoCs having multiple dwc3 controllers will have multiple
> >> >>>>>>>> PHYs, which eventually be added using usb_add_phy_dev(), and not
> >> >>>>>>>> using usb_add_phy(). So each dwc3 controller won't be able to
> >> >>>>>>>> get PHYs by simply calling devm_usb_get_phy() also.
> >> >>>>>>>
> >> >>>>>>>
> >> >>>>>>> No. We have added usb_get_phy_dev() for that purpose in the case of
> >> >>>>>>> non-dt.
> >> >>>>>>> I think, instead you can have a patch to use devm_usb_get_phy_dev()
> >> >>>>>>> here and
> >> >>>>>>> in exynos platform specific code use usb_bind_phy() to bind the phy
> >> >>>>>>> and
> >> >>>>>>> controller till you change it to dt.
> >> >>>>>>>
> >> >>>>>>
> >> >>>>>> We have dt support for dwc3-exynos, in such case we should go ahead
> >> >>>>>> with
> >> >>>>>> of_platform_populate(), right ?
> >> >>>>>> But if when i use of_platform_populate() i will not be able to set
> >> >>>>>> dma_mask to dwc3->dev. :-(
> >> >>
> >> >>
> >> >> You can do something like this
> >> >>
> >> >> static u64 dwc3_exynos_dma_mask = DMA_BIT_MASK(32);
> >> >>
> >> >> static int dwc3_exynos_set_dmamask(struct device *dev, void *c)
> >> >> {
> >> >>         dev->dma_mask = &dwc3_exynos_dma_mask;
> >> >>
> >> >>         return 0;
> >> >> }
> >> >>
> >> >> And in your probe after of_platform_populate, you can add
> >> >>
> >> >> device_for_each_child(&pdev->dev, NULL, dwc3_exynos_set_dmamask);
> >> >>
> >> >> Here pdev is the platform device of dwc3-exynos. By this way all the
> >> >> children of dwc3-exynos will have dma_mask set to the required value.
> >> >>
> >> >
> >> > Nice idea, thanks :-)
> >> > hmm.. so i can patch this now, and get things working ;-)
> >> >
> >>
> >> If this is fine with you shall i go ahead and post a patch for the same ? ;-)
> >
> > should be fine, but we can wait a bit to see if DeviceTree folks reply,
> > your patch will only go on v3.10 anyway.
> >
> 
> Yeah, sure. No problem at all.
> For the time being i will continue to use this change for my other
> development work too. :-)

Sure, makes sense ;-)

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-01-31 15:38         ` Felipe Balbi
  2013-02-01  5:21           ` kishon
@ 2013-02-28 14:39           ` Vivek Gautam
  2013-03-01  6:41             ` Felipe Balbi
  1 sibling, 1 reply; 15+ messages in thread
From: Vivek Gautam @ 2013-02-28 14:39 UTC (permalink / raw)
  To: Grant Likely, Rob Herring
  Cc: Felipe Balbi, kishon, Vivek Gautam, linux-usb, linux-kernel,
	linux-omap, linux-samsung-soc, gregkh, devicetree-discuss

Hi,

On Thu, Jan 31, 2013 at 9:08 PM, Felipe Balbi <balbi@ti.com> wrote:
> On Thu, Jan 31, 2013 at 09:00:37PM +0530, Vivek Gautam wrote:
>> Hi Felipe,
>>
>>
>> On Thu, Jan 31, 2013 at 8:55 PM, Felipe Balbi <balbi@ti.com> wrote:
>> > Hi,
>> >
>> > On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
>> >> >> Moreover, SoCs having multiple dwc3 controllers will have multiple
>> >> >> PHYs, which eventually be added using usb_add_phy_dev(), and not
>> >> >> using usb_add_phy(). So each dwc3 controller won't be able to
>> >> >> get PHYs by simply calling devm_usb_get_phy() also.
>> >> >
>> >> > No. We have added usb_get_phy_dev() for that purpose in the case of non-dt.
>> >> > I think, instead you can have a patch to use devm_usb_get_phy_dev() here and
>> >> > in exynos platform specific code use usb_bind_phy() to bind the phy and
>> >> > controller till you change it to dt.
>> >> >
>> >>
>> >> We have dt support for dwc3-exynos, in such case we should go ahead with
>> >> of_platform_populate(), right ?
>> >> But if when i use of_platform_populate() i will not be able to set
>> >> dma_mask to dwc3->dev. :-(
>> >
>> > do you have a special need for dma_mask because OF already sets it.
>> >
>> If i am not wrong of_platform_device_create_pdata() will set
>> "dev->dev.coherent_dma_mask = DMA_BIT_MASK(32)"
>> and not dma_mask.
>> I fact we had some discussion sometime back when we needed the same
>> for dwc3-exynos in the thread:
>> [PATCH v2 1/2] USB: dwc3-exynos: Add support for device tree
>>
>> But couldn't get final node on it.
>> So suggestions here please. :-)
>
> hmm.. you're right there. Grant, Rob ? Any hints ?
>

Any suggestions on this ?

> --
> balbi



-- 
Thanks & Regards
Vivek

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-02-28 14:39           ` Vivek Gautam
@ 2013-03-01  6:41             ` Felipe Balbi
  2013-03-04 15:02               ` Felipe Balbi
  0 siblings, 1 reply; 15+ messages in thread
From: Felipe Balbi @ 2013-03-01  6:41 UTC (permalink / raw)
  To: Vivek Gautam
  Cc: Grant Likely, Rob Herring, Felipe Balbi, kishon, Vivek Gautam,
	linux-usb, linux-kernel, linux-omap, linux-samsung-soc, gregkh,
	devicetree-discuss, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1892 bytes --]

Hi,

On Thu, Feb 28, 2013 at 08:09:33PM +0530, Vivek Gautam wrote:
> On Thu, Jan 31, 2013 at 9:08 PM, Felipe Balbi <balbi@ti.com> wrote:
> > On Thu, Jan 31, 2013 at 09:00:37PM +0530, Vivek Gautam wrote:
> >> Hi Felipe,
> >>
> >>
> >> On Thu, Jan 31, 2013 at 8:55 PM, Felipe Balbi <balbi@ti.com> wrote:
> >> > Hi,
> >> >
> >> > On Thu, Jan 31, 2013 at 08:53:27PM +0530, Vivek Gautam wrote:
> >> >> >> Moreover, SoCs having multiple dwc3 controllers will have multiple
> >> >> >> PHYs, which eventually be added using usb_add_phy_dev(), and not
> >> >> >> using usb_add_phy(). So each dwc3 controller won't be able to
> >> >> >> get PHYs by simply calling devm_usb_get_phy() also.
> >> >> >
> >> >> > No. We have added usb_get_phy_dev() for that purpose in the case of non-dt.
> >> >> > I think, instead you can have a patch to use devm_usb_get_phy_dev() here and
> >> >> > in exynos platform specific code use usb_bind_phy() to bind the phy and
> >> >> > controller till you change it to dt.
> >> >> >
> >> >>
> >> >> We have dt support for dwc3-exynos, in such case we should go ahead with
> >> >> of_platform_populate(), right ?
> >> >> But if when i use of_platform_populate() i will not be able to set
> >> >> dma_mask to dwc3->dev. :-(
> >> >
> >> > do you have a special need for dma_mask because OF already sets it.
> >> >
> >> If i am not wrong of_platform_device_create_pdata() will set
> >> "dev->dev.coherent_dma_mask = DMA_BIT_MASK(32)"
> >> and not dma_mask.
> >> I fact we had some discussion sometime back when we needed the same
> >> for dwc3-exynos in the thread:
> >> [PATCH v2 1/2] USB: dwc3-exynos: Add support for device tree
> >>
> >> But couldn't get final node on it.
> >> So suggestions here please. :-)
> >
> > hmm.. you're right there. Grant, Rob ? Any hints ?
> >
> 
> Any suggestions on this ?

anyone ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node.
  2013-03-01  6:41             ` Felipe Balbi
@ 2013-03-04 15:02               ` Felipe Balbi
  0 siblings, 0 replies; 15+ messages in thread
From: Felipe Balbi @ 2013-03-04 15:02 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Vivek Gautam, Grant Likely, Rob Herring, kishon, Vivek Gautam,
	linux-usb, linux-kernel, linux-omap, linux-samsung-soc, gregkh,
	devicetree-discuss, Andrew Morton

[-- Attachment #1: Type: text/plain, Size: 1639 bytes --]

Hi,

On Fri, Mar 01, 2013 at 08:41:29AM +0200, Felipe Balbi wrote:
> > >> >> >> Moreover, SoCs having multiple dwc3 controllers will have multiple
> > >> >> >> PHYs, which eventually be added using usb_add_phy_dev(), and not
> > >> >> >> using usb_add_phy(). So each dwc3 controller won't be able to
> > >> >> >> get PHYs by simply calling devm_usb_get_phy() also.
> > >> >> >
> > >> >> > No. We have added usb_get_phy_dev() for that purpose in the case of non-dt.
> > >> >> > I think, instead you can have a patch to use devm_usb_get_phy_dev() here and
> > >> >> > in exynos platform specific code use usb_bind_phy() to bind the phy and
> > >> >> > controller till you change it to dt.
> > >> >> >
> > >> >>
> > >> >> We have dt support for dwc3-exynos, in such case we should go ahead with
> > >> >> of_platform_populate(), right ?
> > >> >> But if when i use of_platform_populate() i will not be able to set
> > >> >> dma_mask to dwc3->dev. :-(
> > >> >
> > >> > do you have a special need for dma_mask because OF already sets it.
> > >> >
> > >> If i am not wrong of_platform_device_create_pdata() will set
> > >> "dev->dev.coherent_dma_mask = DMA_BIT_MASK(32)"
> > >> and not dma_mask.
> > >> I fact we had some discussion sometime back when we needed the same
> > >> for dwc3-exynos in the thread:
> > >> [PATCH v2 1/2] USB: dwc3-exynos: Add support for device tree
> > >>
> > >> But couldn't get final node on it.
> > >> So suggestions here please. :-)
> > >
> > > hmm.. you're right there. Grant, Rob ? Any hints ?
> > >
> > 
> > Any suggestions on this ?
> 
> anyone ?

ping ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

end of thread, other threads:[~2013-03-04 15:03 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-31 11:20 [PATCH RFC] usb: dwc3: Get PHY from platform specific dwc3 dt node Vivek Gautam
2013-01-31 11:34 ` kishon
2013-01-31 15:23   ` Vivek Gautam
2013-01-31 15:25     ` Felipe Balbi
2013-01-31 15:30       ` Vivek Gautam
2013-01-31 15:38         ` Felipe Balbi
2013-02-01  5:21           ` kishon
2013-02-01  6:22             ` Vivek Gautam
2013-02-01  6:24               ` Vivek Gautam
2013-02-01  8:50                 ` Felipe Balbi
2013-02-01  8:53                   ` Vivek Gautam
2013-02-01  9:43                     ` Felipe Balbi
2013-02-28 14:39           ` Vivek Gautam
2013-03-01  6:41             ` Felipe Balbi
2013-03-04 15:02               ` Felipe Balbi

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).