public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Roger Quadros <rogerq@kernel.org>
To: Tom Rini <trini@konsulko.com>, Marek Vasut <marex@denx.de>
Cc: Julien Panis <jpanis@baylibre.com>,
	u-boot@lists.denx.de, tony@atomide.com, r-gunasekaran@ti.com,
	vigneshr@ti.com, nm@ti.com
Subject: Re: [PATCH v3 09/12] usb: cdns3: Handle otg mode as peripheral
Date: Fri, 18 Aug 2023 22:26:59 +0300	[thread overview]
Message-ID: <295e1b8b-c190-c892-6586-38595e8e65eb@kernel.org> (raw)
In-Reply-To: <20230818184841.GO1515023@bill-the-cat>



On 18/08/2023 21:48, Tom Rini wrote:
> On Thu, Aug 17, 2023 at 11:15:17AM +0300, Roger Quadros wrote:
>> Hi Tom,
>>
>> On 14/08/2023 20:17, Tom Rini wrote:
>>> On Thu, Jul 13, 2023 at 03:45:42PM +0200, Julien Panis wrote:
>>>
>>>> Override 'otg' to 'peripheral' mode, since 'otg' mode
>>>> is not yet supported by u-boot.
>>>>
>>>> Signed-off-by: Julien Panis <jpanis@baylibre.com>
>>>> Suggested-by: Roger Quadros <rogerq@kernel.org>
>>>> ---
>>>>  drivers/usb/cdns3/core.c | 4 ++++
>>>>  1 file changed, 4 insertions(+)
>>>>
>>>> diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c
>>>> index 644a9791b9c9..bd763fc593e1 100644
>>>> --- a/drivers/usb/cdns3/core.c
>>>> +++ b/drivers/usb/cdns3/core.c
>>>> @@ -149,6 +149,10 @@ static int cdns3_core_init_role(struct cdns3 *cdns)
>>>>  
>>>>  	dr_mode = best_dr_mode;
>>>>  
>>>> +	/* u-boot doesn't yet support OTG so limit to PERIPHERAL */
>>>> +	if (dr_mode == USB_DR_MODE_OTG)
>>>> +		dr_mode = USB_DR_MODE_PERIPHERAL;
>>>> +
>>>>  #if defined(CONFIG_SPL_USB_HOST) || !defined(CONFIG_SPL_BUILD)
>>>>  	if (dr_mode == USB_DR_MODE_OTG || dr_mode == USB_DR_MODE_HOST) {
>>>>  		ret = cdns3_host_init(cdns);
>>>
>>> Julien, why don't we support otg mode here?
>>>
>>
>> dr_mode will never be OTG at this point as the previous if condition
>> would have forced it to PERIPHERAL.
>>
>> My understanding was that u-boot USB framework doesn't support OTG mode
>> so we force it to PERIPHERAL.
> 
> Well, the first part of this series is "make unknown state be OTG" for
> DWC3, so we do in general (and Marek told me off-list he's used it on
> DWC2 as well), so it sounds like these (CDNS3, MUSB) drivers need fixing
> / updating.
> 

CDNS3 does not have an internal OTG state machine. We mostly really care
about role switching and not the full OTG stack. There needs to be
some kind of SW framework to do that in u-boot.

Marek could you please advise what can be done here?

-- 
cheers,
-roger

  reply	other threads:[~2023-08-18 19:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-13 13:45 [PATCH v3 00/12] Remove unnecessary USBx dr_mode configuration Julien Panis
2023-07-13 13:45 ` [PATCH v3 01/12] usb: dwc3: Handle unknown mode as otg Julien Panis
2023-08-14 17:17   ` Tom Rini
2023-07-13 13:45 ` [PATCH v3 02/12] arm: dts: dra7-evm-u-boot: Remove usb1 mode configuration Julien Panis
2023-07-13 13:45 ` [PATCH v3 03/12] arm: dts: dra71-evm-u-boot: " Julien Panis
2023-07-13 13:45 ` [PATCH v3 04/12] arm: dts: dra72-evm-revc-u-boot: " Julien Panis
2023-07-13 13:45 ` [PATCH v3 05/12] arm: dts: dra72-evm-u-boot: " Julien Panis
2023-07-13 13:45 ` [PATCH v3 06/12] arm: dts: dra76-evm-u-boot: " Julien Panis
2023-07-13 13:45 ` [PATCH v3 07/12] arm: dts: keystone-k2e-evm-u-boot: " Julien Panis
2023-07-13 13:45 ` [PATCH v3 08/12] arm: dts: k3-am654-r5-base-board-u-boot: Remove usb " Julien Panis
2023-07-13 13:45 ` [PATCH v3 09/12] usb: cdns3: Handle otg mode as peripheral Julien Panis
2023-08-14 17:17   ` Tom Rini
2023-08-17  8:15     ` Roger Quadros
2023-08-18 18:48       ` Tom Rini
2023-08-18 19:26         ` Roger Quadros [this message]
2023-08-18 23:47           ` Marek Vasut
2023-08-19  7:00             ` Roger Quadros
2023-08-19 12:20               ` Marek Vasut
2023-08-19 18:14                 ` Roger Quadros
2023-07-13 13:45 ` [PATCH v3 10/12] arm: dts: k3-am642-evm-u-boot: Remove usb0 mode configuration Julien Panis
2023-07-13 13:45 ` [PATCH v3 11/12] arm: dts: k3-j7200-common-proc-board-u-boot: " Julien Panis
2023-07-13 13:45 ` [PATCH v3 12/12] arm: dts: k3-j721e-common-proc-board-u-boot: " Julien Panis
2023-07-13 17:37 ` [PATCH v3 00/12] Remove unnecessary USBx dr_mode configuration Roger Quadros

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=295e1b8b-c190-c892-6586-38595e8e65eb@kernel.org \
    --to=rogerq@kernel.org \
    --cc=jpanis@baylibre.com \
    --cc=marex@denx.de \
    --cc=nm@ti.com \
    --cc=r-gunasekaran@ti.com \
    --cc=tony@atomide.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.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