public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Lubomir Popov <lpopov@mm-sol.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] usb: omap: ulpi: fix ulpi reading/writing functions
Date: Mon, 10 Jun 2013 17:52:52 +0300	[thread overview]
Message-ID: <51B5E844.6030704@mm-sol.com> (raw)
In-Reply-To: <20130610142332.GA15098@panicking>

Hi Michael,

A minor suggestion to clarify the explanation (its HW that requires +1):

On 10/06/13 17:23, Michael Trimarchi wrote:
> Fix ulpi reading and writing function.
>  * Both functions need to have the bit31 setted.
>  * Right now uboot use 0 to enumerate port 1 and 1 to
>    enumerate port 2 and so on. Omap code use 1 for port 1 and 2 for port 2.
---------------------------------^
The OMAP INSNREG05_ULPI register expects a value of 1 for Port 1 and of 2 for
Port 2 in the PORTSEL field.
>    Add a +1 fix the problem
> 
> Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com>
> ---
>  drivers/usb/ulpi/omap-ulpi-viewport.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/ulpi/omap-ulpi-viewport.c b/drivers/usb/ulpi/omap-ulpi-viewport.c
> index 2a42033..4db7fa4 100644
> --- a/drivers/usb/ulpi/omap-ulpi-viewport.c
> +++ b/drivers/usb/ulpi/omap-ulpi-viewport.c
> @@ -61,7 +61,7 @@ static int ulpi_request(struct ulpi_viewport *ulpi_vp, u32 value)
>  
>  int ulpi_write(struct ulpi_viewport *ulpi_vp, u8 *reg, u32 value)
>  {
> -	u32 val = (OMAP_ULPI_START | (ulpi_vp->port_num & 0xf) << 24) |
> +	u32 val = OMAP_ULPI_START | (((ulpi_vp->port_num + 1) & 0xf) << 24) |
>  			OMAP_ULPI_WR_OPSEL | ((u32)reg << 16) | (value & 0xff);
>  
>  	return ulpi_request(ulpi_vp, val);
> @@ -70,7 +70,7 @@ int ulpi_write(struct ulpi_viewport *ulpi_vp, u8 *reg, u32 value)
>  u32 ulpi_read(struct ulpi_viewport *ulpi_vp, u8 *reg)
>  {
>  	int err;
> -	u32 val = ((ulpi_vp->port_num & 0xf) << 24) |
> +	u32 val = OMAP_ULPI_START | (((ulpi_vp->port_num + 1) & 0xf) << 24) |
>  			 OMAP_ULPI_RD_OPSEL | ((u32)reg << 16);
>  
>  	err = ulpi_request(ulpi_vp, val);
> 
As for the patch itself, tested on a custom OMAP5430 board with a TUSB1210
ULPI PHY on USBB1:

Tested-by: Lubomir Popov <lpopov@mm-sol.com>

  reply	other threads:[~2013-06-10 14:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-10 14:23 [U-Boot] [PATCH] usb: omap: ulpi: fix ulpi reading/writing functions Michael Trimarchi
2013-06-10 14:52 ` Lubomir Popov [this message]
2013-06-10 15:05 ` Lubomir Popov
2013-06-10 15:13 ` Igor Grinberg
2013-07-02 20:06 ` [U-Boot] " Tom Rini

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=51B5E844.6030704@mm-sol.com \
    --to=lpopov@mm-sol.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox