diff mbox series

usb: dwc3: Add support for usb3-phy PHY configuration

Message ID 7911a4b784c1a534631a1409569622f494b316bb.1645628193.git.michal.simek@xilinx.com
State Superseded
Delegated to: Bin Meng
Headers show
Series usb: dwc3: Add support for usb3-phy PHY configuration | expand

Commit Message

Michal Simek Feb. 23, 2022, 2:56 p.m. UTC
When usb3-phy label is found, PHY driver is called and serdes line is
initialized. This is preparation for serdes/psgtr driver to configure GT
lines based on description in DT.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
---

 drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
 1 file changed, 17 insertions(+)

Comments

Marek Vasut Feb. 23, 2022, 5:31 p.m. UTC | #1
On 2/23/22 15:56, Michal Simek wrote:
> When usb3-phy label is found, PHY driver is called and serdes line is
> initialized. This is preparation for serdes/psgtr driver to configure GT
> lines based on description in DT.
> 
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
> 
>   drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>   1 file changed, 17 insertions(+)
> 
> diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
> index 01bd0ca190e3..b1e019b5b91a 100644
> --- a/drivers/usb/dwc3/dwc3-generic.c
> +++ b/drivers/usb/dwc3/dwc3-generic.c
> @@ -409,6 +409,17 @@ static int dwc3_glue_probe(struct udevice *dev)
>   	struct udevice *child = NULL;
>   	int index = 0;
>   	int ret;
> +	struct phy phy;
> +
> +	ret = generic_phy_get_by_name(dev, "usb3-phy", &phy);
> +	if (!ret) {
> +		ret = generic_phy_init(&phy);
> +		if (ret)
> +			return ret;
> +	} else if (ret != -ENOENT) {
> +		debug("could not get phy (err %d)\n", ret);
> +		return ret;
> +	}
>   
>   	glue->regs = dev_read_addr(dev);
>   
> @@ -420,6 +431,12 @@ static int dwc3_glue_probe(struct udevice *dev)
>   	if (ret)
>   		return ret;
>   
> +	if (phy.dev) {
> +		ret = generic_phy_power_on(&phy);
> +		if (ret)
> +			return ret;
> +	}
> +
>   	ret = device_find_first_child(dev, &child);
>   	if (ret)
>   		return ret;


CC Bin please.
Bin Meng March 3, 2022, 8:40 a.m. UTC | #2
On Wed, Feb 23, 2022 at 10:56 PM Michal Simek <michal.simek@xilinx.com> wrote:
>
> When usb3-phy label is found, PHY driver is called and serdes line is
> initialized. This is preparation for serdes/psgtr driver to configure GT
> lines based on description in DT.
>
> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> ---
>
>  drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>  1 file changed, 17 insertions(+)
>

Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
Marek Vasut March 4, 2022, 4:42 a.m. UTC | #3
On 3/3/22 09:40, Bin Meng wrote:
> On Wed, Feb 23, 2022 at 10:56 PM Michal Simek <michal.simek@xilinx.com> wrote:
>>
>> When usb3-phy label is found, PHY driver is called and serdes line is
>> initialized. This is preparation for serdes/psgtr driver to configure GT
>> lines based on description in DT.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>>   drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>>   1 file changed, 17 insertions(+)
>>
> 
> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>

Applied, thanks.
Marek Vasut March 4, 2022, 5:33 p.m. UTC | #4
On 3/4/22 05:42, Marek Vasut wrote:
> On 3/3/22 09:40, Bin Meng wrote:
>> On Wed, Feb 23, 2022 at 10:56 PM Michal Simek 
>> <michal.simek@xilinx.com> wrote:
>>>
>>> When usb3-phy label is found, PHY driver is called and serdes line is
>>> initialized. This is preparation for serdes/psgtr driver to configure GT
>>> lines based on description in DT.
>>>
>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>> ---
>>>
>>>   drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>>>   1 file changed, 17 insertions(+)
>>>
>>
>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
> 
> Applied, thanks.

Fails to build, please fix. Patch dropped:

https://source.denx.de/u-boot/custodians/u-boot-usb/-/jobs/399461
Michal Simek March 8, 2022, 1:21 p.m. UTC | #5
On 3/4/22 18:33, Marek Vasut wrote:
> On 3/4/22 05:42, Marek Vasut wrote:
>> On 3/3/22 09:40, Bin Meng wrote:
>>> On Wed, Feb 23, 2022 at 10:56 PM Michal Simek <michal.simek@xilinx.com> wrote:
>>>>
>>>> When usb3-phy label is found, PHY driver is called and serdes line is
>>>> initialized. This is preparation for serdes/psgtr driver to configure GT
>>>> lines based on description in DT.
>>>>
>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>> ---
>>>>
>>>>   drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>>>>   1 file changed, 17 insertions(+)
>>>>
>>>
>>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>>
>> Applied, thanks.
> 
> Fails to build, please fix. Patch dropped:
> 
> https://source.denx.de/u-boot/custodians/u-boot-usb/-/jobs/399461


This patch is fixing the problem

https://lore.kernel.org/r/eabd31079152659556432fed561cd3a98300c8f5.1646745547.git.michal.simek@xilinx.com

Thanks,
Michal
Marek Vasut March 8, 2022, 1:39 p.m. UTC | #6
On 3/8/22 14:21, Michal Simek wrote:
> 
> 
> On 3/4/22 18:33, Marek Vasut wrote:
>> On 3/4/22 05:42, Marek Vasut wrote:
>>> On 3/3/22 09:40, Bin Meng wrote:
>>>> On Wed, Feb 23, 2022 at 10:56 PM Michal Simek 
>>>> <michal.simek@xilinx.com> wrote:
>>>>>
>>>>> When usb3-phy label is found, PHY driver is called and serdes line is
>>>>> initialized. This is preparation for serdes/psgtr driver to 
>>>>> configure GT
>>>>> lines based on description in DT.
>>>>>
>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>> ---
>>>>>
>>>>>   drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>>>>>   1 file changed, 17 insertions(+)
>>>>>
>>>>
>>>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>>>
>>> Applied, thanks.
>>
>> Fails to build, please fix. Patch dropped:
>>
>> https://source.denx.de/u-boot/custodians/u-boot-usb/-/jobs/399461
> 
> 
> This patch is fixing the problem
> 
> https://lore.kernel.org/r/eabd31079152659556432fed561cd3a98300c8f5.1646745547.git.michal.simek@xilinx.com 

I'm confused, is this a patch I should try to apply somehow ?
Michal Simek March 8, 2022, 1:46 p.m. UTC | #7
On 3/8/22 14:39, Marek Vasut wrote:
> On 3/8/22 14:21, Michal Simek wrote:
>>
>>
>> On 3/4/22 18:33, Marek Vasut wrote:
>>> On 3/4/22 05:42, Marek Vasut wrote:
>>>> On 3/3/22 09:40, Bin Meng wrote:
>>>>> On Wed, Feb 23, 2022 at 10:56 PM Michal Simek <michal.simek@xilinx.com> wrote:
>>>>>>
>>>>>> When usb3-phy label is found, PHY driver is called and serdes line is
>>>>>> initialized. This is preparation for serdes/psgtr driver to configure GT
>>>>>> lines based on description in DT.
>>>>>>
>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>>> ---
>>>>>>
>>>>>>   drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>>>>>>   1 file changed, 17 insertions(+)
>>>>>>
>>>>>
>>>>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>>>>
>>>> Applied, thanks.
>>>
>>> Fails to build, please fix. Patch dropped:
>>>
>>> https://source.denx.de/u-boot/custodians/u-boot-usb/-/jobs/399461
>>
>>
>> This patch is fixing the problem
>>
>> https://lore.kernel.org/r/eabd31079152659556432fed561cd3a98300c8f5.1646745547.git.michal.simek@xilinx.com 
> 
> 
> I'm confused, is this a patch I should try to apply somehow ?

It should be applied before that dwc3 patch. If you don't want to apply it via 
your usb tree I can take it via my tree or ask Tom to take it.

Thanks,
Michal
Marek Vasut March 8, 2022, 3:32 p.m. UTC | #8
On 3/8/22 14:46, Michal Simek wrote:
> 
> 
> On 3/8/22 14:39, Marek Vasut wrote:
>> On 3/8/22 14:21, Michal Simek wrote:
>>>
>>>
>>> On 3/4/22 18:33, Marek Vasut wrote:
>>>> On 3/4/22 05:42, Marek Vasut wrote:
>>>>> On 3/3/22 09:40, Bin Meng wrote:
>>>>>> On Wed, Feb 23, 2022 at 10:56 PM Michal Simek 
>>>>>> <michal.simek@xilinx.com> wrote:
>>>>>>>
>>>>>>> When usb3-phy label is found, PHY driver is called and serdes 
>>>>>>> line is
>>>>>>> initialized. This is preparation for serdes/psgtr driver to 
>>>>>>> configure GT
>>>>>>> lines based on description in DT.
>>>>>>>
>>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>>>> ---
>>>>>>>
>>>>>>>   drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>>>>>>>   1 file changed, 17 insertions(+)
>>>>>>>
>>>>>>
>>>>>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>>>>>
>>>>> Applied, thanks.
>>>>
>>>> Fails to build, please fix. Patch dropped:
>>>>
>>>> https://source.denx.de/u-boot/custodians/u-boot-usb/-/jobs/399461
>>>
>>>
>>> This patch is fixing the problem
>>>
>>> https://lore.kernel.org/r/eabd31079152659556432fed561cd3a98300c8f5.1646745547.git.michal.simek@xilinx.com 
>>
>>
>>
>> I'm confused, is this a patch I should try to apply somehow ?
> 
> It should be applied before that dwc3 patch. If you don't want to apply 
> it via your usb tree I can take it via my tree or ask Tom to take it.

Please just collect the patches in the right order and resubmit them.
Michal Simek March 8, 2022, 3:34 p.m. UTC | #9
On 3/8/22 16:32, Marek Vasut wrote:
> On 3/8/22 14:46, Michal Simek wrote:
>>
>>
>> On 3/8/22 14:39, Marek Vasut wrote:
>>> On 3/8/22 14:21, Michal Simek wrote:
>>>>
>>>>
>>>> On 3/4/22 18:33, Marek Vasut wrote:
>>>>> On 3/4/22 05:42, Marek Vasut wrote:
>>>>>> On 3/3/22 09:40, Bin Meng wrote:
>>>>>>> On Wed, Feb 23, 2022 at 10:56 PM Michal Simek <michal.simek@xilinx.com> 
>>>>>>> wrote:
>>>>>>>>
>>>>>>>> When usb3-phy label is found, PHY driver is called and serdes line is
>>>>>>>> initialized. This is preparation for serdes/psgtr driver to configure GT
>>>>>>>> lines based on description in DT.
>>>>>>>>
>>>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>>>>> ---
>>>>>>>>
>>>>>>>>   drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>>>>>>>>   1 file changed, 17 insertions(+)
>>>>>>>>
>>>>>>>
>>>>>>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>>>>>>
>>>>>> Applied, thanks.
>>>>>
>>>>> Fails to build, please fix. Patch dropped:
>>>>>
>>>>> https://source.denx.de/u-boot/custodians/u-boot-usb/-/jobs/399461
>>>>
>>>>
>>>> This patch is fixing the problem
>>>>
>>>> https://lore.kernel.org/r/eabd31079152659556432fed561cd3a98300c8f5.1646745547.git.michal.simek@xilinx.com 
>>>
>>>
>>>
>>>
>>> I'm confused, is this a patch I should try to apply somehow ?
>>
>> It should be applied before that dwc3 patch. If you don't want to apply it via 
>> your usb tree I can take it via my tree or ask Tom to take it.
> 
> Please just collect the patches in the right order and resubmit them.

They were sent in the right order. 1/2 header fix, 2/2 dwc3 fix.
Both of them are in patchwork.

M
Marek Vasut March 8, 2022, 9:58 p.m. UTC | #10
On 3/8/22 16:34, Michal Simek wrote:
> 
> 
> On 3/8/22 16:32, Marek Vasut wrote:
>> On 3/8/22 14:46, Michal Simek wrote:
>>>
>>>
>>> On 3/8/22 14:39, Marek Vasut wrote:
>>>> On 3/8/22 14:21, Michal Simek wrote:
>>>>>
>>>>>
>>>>> On 3/4/22 18:33, Marek Vasut wrote:
>>>>>> On 3/4/22 05:42, Marek Vasut wrote:
>>>>>>> On 3/3/22 09:40, Bin Meng wrote:
>>>>>>>> On Wed, Feb 23, 2022 at 10:56 PM Michal Simek 
>>>>>>>> <michal.simek@xilinx.com> wrote:
>>>>>>>>>
>>>>>>>>> When usb3-phy label is found, PHY driver is called and serdes 
>>>>>>>>> line is
>>>>>>>>> initialized. This is preparation for serdes/psgtr driver to 
>>>>>>>>> configure GT
>>>>>>>>> lines based on description in DT.
>>>>>>>>>
>>>>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>>>>>>>>> ---
>>>>>>>>>
>>>>>>>>>   drivers/usb/dwc3/dwc3-generic.c | 17 +++++++++++++++++
>>>>>>>>>   1 file changed, 17 insertions(+)
>>>>>>>>>
>>>>>>>>
>>>>>>>> Reviewed-by: Bin Meng <bmeng.cn@gmail.com>
>>>>>>>
>>>>>>> Applied, thanks.
>>>>>>
>>>>>> Fails to build, please fix. Patch dropped:
>>>>>>
>>>>>> https://source.denx.de/u-boot/custodians/u-boot-usb/-/jobs/399461
>>>>>
>>>>>
>>>>> This patch is fixing the problem
>>>>>
>>>>> https://lore.kernel.org/r/eabd31079152659556432fed561cd3a98300c8f5.1646745547.git.michal.simek@xilinx.com 
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> I'm confused, is this a patch I should try to apply somehow ?
>>>
>>> It should be applied before that dwc3 patch. If you don't want to 
>>> apply it via your usb tree I can take it via my tree or ask Tom to 
>>> take it.
>>
>> Please just collect the patches in the right order and resubmit them.
> 
> They were sent in the right order. 1/2 header fix, 2/2 dwc3 fix.
> Both of them are in patchwork.

I received random lore patch link here, another half of series in 
another thread and now I should look up yet more patches in patchwork. I 
am really confused, I do not know what you expect me to do about this, 
randomly try to chase down patches in multiple patch trackers, try to 
apply them somehow, and likely get it all wrong?

Please, collect and resubmit the patches which you want applied, that 
way we can be certain I apply the right patches in the right order.
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-generic.c b/drivers/usb/dwc3/dwc3-generic.c
index 01bd0ca190e3..b1e019b5b91a 100644
--- a/drivers/usb/dwc3/dwc3-generic.c
+++ b/drivers/usb/dwc3/dwc3-generic.c
@@ -409,6 +409,17 @@  static int dwc3_glue_probe(struct udevice *dev)
 	struct udevice *child = NULL;
 	int index = 0;
 	int ret;
+	struct phy phy;
+
+	ret = generic_phy_get_by_name(dev, "usb3-phy", &phy);
+	if (!ret) {
+		ret = generic_phy_init(&phy);
+		if (ret)
+			return ret;
+	} else if (ret != -ENOENT) {
+		debug("could not get phy (err %d)\n", ret);
+		return ret;
+	}
 
 	glue->regs = dev_read_addr(dev);
 
@@ -420,6 +431,12 @@  static int dwc3_glue_probe(struct udevice *dev)
 	if (ret)
 		return ret;
 
+	if (phy.dev) {
+		ret = generic_phy_power_on(&phy);
+		if (ret)
+			return ret;
+	}
+
 	ret = device_find_first_child(dev, &child);
 	if (ret)
 		return ret;