All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marek Vasut <marex@denx.de>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 1/3] usb:ehci-mx6 add board_usb_phy_mode function
Date: Fri, 7 Nov 2014 12:09:06 +0100	[thread overview]
Message-ID: <201411071209.06824.marex@denx.de> (raw)
In-Reply-To: <545CA702.6090301@freescale.com>

On Friday, November 07, 2014 at 12:03:30 PM, Peng Fan wrote:

[...]

> >> @@ -160,7 +174,7 @@ static int usb_phy_enable(int index, struct usb_ehci
> >> *ehci) val |= (USBPHY_CTRL_ENUTMILEVEL2 | USBPHY_CTRL_ENUTMILEVEL3);
> >> 
> >>   	__raw_writel(val, phy_ctrl);
> >> 
> >> -	return val & USBPHY_CTRL_OTG_ID;
> >> +	return board_usb_phy_mode(index);
> > 
> > This should be called from ehci_hcd_init() right after usb_phy_enable().
> > Afterall, the mode detection has nothing to do with the PHY enabling.
> 
> This back to what I did in patch v2. right after usb_phy_enable(), just
> paste that piece of code here:
> 
> The weak function:
> +int __weak board_ehci_usb_mode(int index, enum usb_init_type *type)
> +{
> +       return 0;
> +}
> +
> 
>          type = usb_phy_enable(index, ehci) ? USB_INIT_DEVICE :
> USB_INIT_HOST;
> 
> +       board_usb_phy_mode(index, &type);
> +

The usb_phy_enable() should not return the PHY mode at all though.
It should be the board_usb_phy_mode() which adjusts the PHY type.
The usb_phy_enable() should return just a success/failure return
value.

> What need to do is to let board can modify the `type` like following:
> +int board_usb_phy_mode(int port, enum usb_init_type *type)
> +{
> +	if (port == 1)
> +       /* port1 works in HOST Mode */
> +       	*type = USB_INIT_HOST;
> +
> +       return 0;
> +}
> +
> This is the way that I did in patch v2. If this is fine, I'll resent
> this patch set.

It should really explicitly set it, not modify it, see above.

[...]

  reply	other threads:[~2014-11-07 11:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-07  1:08 [U-Boot] [PATCH v3 0/3] Add board level usb supporrt for mxsxsabresd and mx6slevk Peng Fan
2014-11-07  1:08 ` [U-Boot] [PATCH v3 1/3] usb:ehci-mx6 add board_usb_phy_mode function Peng Fan
2014-11-07  8:25   ` Marek Vasut
2014-11-07 11:03     ` Peng Fan
2014-11-07 11:09       ` Marek Vasut [this message]
2014-11-07 11:45         ` Peng Fan
2014-11-07 12:17           ` Marek Vasut
2014-11-08  4:07             ` Peng Fan
2014-11-08  4:35               ` Peng Fan
2014-11-08 11:33               ` Marek Vasut
2014-11-10  1:01                 ` Peng Fan
2014-11-10 17:55                   ` Marek Vasut
2014-11-07  1:08 ` [U-Boot] [PATCH v3 2/3] imx:mx6sxsabresd add board level support for usb Peng Fan
2014-11-07  1:08 ` [U-Boot] [PATCH v3 3/3] imx:mx6slevk " Peng Fan
2014-11-07  8:26   ` Marek Vasut
2014-11-07 11:08     ` Peng Fan
2014-11-07 11:10       ` Marek Vasut
2014-11-07 11:48         ` Peng Fan

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=201411071209.06824.marex@denx.de \
    --to=marex@denx.de \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.