All of lore.kernel.org
 help / color / mirror / Atom feed
From: maitysanchayan at gmail.com <maitysanchayan@gmail.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH 2/3] usb: host: ehci-vf: Implement board_usb_phy_mode weak function
Date: Fri, 8 Jan 2016 17:52:07 +0530	[thread overview]
Message-ID: <20160108122207.GC22303@Sanchayan-Arch.toradex.int> (raw)
In-Reply-To: <81eb8b3165c233924a7239c72660736112883447.1445862541.git.maitysanchayan@gmail.com>

Hello Stefano / Marek,

Can you pick this up?

- Sanchayan.

On 15-10-26 18:28:50, Sanchayan Maity wrote:
> Add board_usb_phy_mode weak function on similar lines to ehci-mx6.
> However since Vybrid USB does not have a true OTG, make this weak
> functon just return 0. The function is supposed to be implemented
> by the individual boards using a GPIO for providing the OTG pin
> functionality.
> 
> Signed-off-by: Sanchayan Maity <maitysanchayan@gmail.com>
> ---
> There seems to be a problem here. As per DFU's help note,
> the first argument to dfu is the USB controller.
> 
> So if dfu 1 nand 2 is run, I would expect the ehci_hcd_init
> function's first index argument to recieve 1. However this
> does not seem to be the case. Not sure if I am understanding
> something wrongly here. Is this expected?
> 
> Currently because of this even though I did like dfu 1 nand 2
> to bail out, it does not. I tried tracing the code from do_dfu
> but I have yet to get from where ehci_hcd_init is getting called
> in the call chain.
> 
> All seems to be well when using usb start.
> 
> ---
>  drivers/usb/host/ehci-vf.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/usb/host/ehci-vf.c b/drivers/usb/host/ehci-vf.c
> index 351e0fb..335e303 100644
> --- a/drivers/usb/host/ehci-vf.c
> +++ b/drivers/usb/host/ehci-vf.c
> @@ -121,6 +121,11 @@ static void usb_oc_config(int index)
>  	setbits_le32(ctrl, UCTRL_OVER_CUR_DIS);
>  }
>  
> +int __weak board_usb_phy_mode(int port)
> +{
> +	return 0;
> +}
> +
>  int __weak board_ehci_hcd_init(int port)
>  {
>  	return 0;
> @@ -130,6 +135,7 @@ int ehci_hcd_init(int index, enum usb_init_type init,
>  		struct ehci_hccr **hccr, struct ehci_hcor **hcor)
>  {
>  	struct usb_ehci *ehci;
> +	enum usb_init_type type;
>  
>  	if (index >= ARRAY_SIZE(nc_reg_bases))
>  		return -EINVAL;
> @@ -148,6 +154,10 @@ int ehci_hcd_init(int index, enum usb_init_type init,
>  	*hcor = (struct ehci_hcor *)((uint32_t)*hccr +
>  			HC_LENGTH(ehci_readl(&(*hccr)->cr_capbase)));
>  
> +	type = board_usb_phy_mode(index);
> +	if (type != init)
> +		return -ENODEV;
> +
>  	if (init == USB_INIT_DEVICE) {
>  		setbits_le32(&ehci->usbmode, CM_DEVICE);
>  		writel((PORT_PTS_UTMI | PORT_PTS_PTW), &ehci->portsc);
> -- 
> 2.6.2
> 

  reply	other threads:[~2016-01-08 12:22 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-26 12:58 [U-Boot] [PATCH 1/3] usb: host: ehci-vf: Remove hardcoded USB host client configuration Sanchayan Maity
2015-10-26 12:58 ` [U-Boot] [PATCH 2/3] usb: host: ehci-vf: Implement board_usb_phy_mode weak function Sanchayan Maity
2016-01-08 12:22   ` maitysanchayan at gmail.com [this message]
2016-01-08 14:02     ` Marek Vasut
2015-10-26 12:58 ` [U-Boot] [PATCH 3/3] colibri_vf: Add board_usb_phy_mode function Sanchayan Maity
2015-10-27  9:18   ` Marek Vasut
2015-10-27 11:34     ` maitysanchayan at gmail.com
2015-10-29 10:15   ` [U-Boot] [PATCH v2] " Sanchayan Maity
2015-10-29 17:25     ` Marek Vasut
2015-10-30 12:26     ` [U-Boot] [PATCH v3] " Sanchayan Maity
2015-10-30 13:20       ` Marek Vasut
2015-11-06  7:00         ` maitysanchayan at gmail.com
2015-11-06 15:00           ` Marek Vasut
2015-10-30 16:12       ` Stefan Agner
2015-10-30 16:24         ` Marek Vasut
2015-10-30 16:26           ` Stefan Agner
2015-10-30 17:07             ` Marek Vasut
2015-11-09 14:59       ` [U-Boot] [PATCH v4] " Sanchayan Maity
2015-11-09 15:22         ` Marek Vasut
2015-11-12  6:17         ` [U-Boot] [PATCH v5] " Sanchayan Maity
2015-11-24 10:23           ` maitysanchayan at gmail.com
2015-11-24 10:30             ` Marek Vasut
2015-11-24 10:37             ` Stefano Babic
2015-11-24 10:38               ` maitysanchayan at gmail.com
2016-01-07 20:02               ` maitysanchayan at gmail.com
2016-01-07 21:12                 ` Stefano Babic
2016-01-08  5:50                   ` maitysanchayan at gmail.com
2016-01-08 12:11                     ` Marek Vasut
2016-01-08 12:18                       ` maitysanchayan at gmail.com
2016-01-08 12:25                         ` Marek Vasut
2015-10-26 19:19 ` [U-Boot] [PATCH 1/3] usb: host: ehci-vf: Remove hardcoded USB host client configuration Marek Vasut
2015-10-27  3:28   ` maitysanchayan at gmail.com
2016-01-08 12:20 ` maitysanchayan at gmail.com
2016-01-08 12:26   ` Marek Vasut
2016-01-08 12:26     ` maitysanchayan at gmail.com
2016-01-08 14:02   ` Marek Vasut

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=20160108122207.GC22303@Sanchayan-Arch.toradex.int \
    --to=maitysanchayan@gmail.com \
    --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.