public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v3 7/7] usb: ulpi: Add omap-ulpi-view port support
Date: Mon, 06 Feb 2012 11:10:20 +0200	[thread overview]
Message-ID: <4F2F98FC.6020006@compulab.co.il> (raw)
In-Reply-To: <1328276312-30153-8-git-send-email-govindraj.raja@ti.com>

On 02/03/12 15:38, Govindraj.R wrote:
> From: "Govindraj.R" <govindraj.raja@ti.com>
> 
> Based on discussion from this thread [1].
> Adding omap-view port that helps us in using the generic ulpi
> framework for any ulpi phy ops using the INSNREG05_ULPI viewport
> reg available on omap platform.
> 
> Currently ehci ports are available on omap3/4 platforms so enable the same
> for beagle and panda, patch is tested on the same boards.
> 
> Thanks to Igor Grinberg <grinberg@compulab.co.il> for reviewing the
> omap-ehci patches and suggesting this approach.
> 
> [1]: http://www.mail-archive.com/u-boot at lists.denx.de/msg76076.html
> 
> Tested-by: Stefano Babic <sbabic@denx.de>
> Signed-off-by: Govindraj.R <govindraj.raja@ti.com>

After fixing several neats below,

Acked-by: Igor Grinberg <grinberg@compulab.co.il>

> ---
>  doc/README.omap-ulpi-viewport         |   27 +++++++++
>  drivers/usb/ulpi/Makefile             |    1 +
>  drivers/usb/ulpi/omap-ulpi-viewport.c |  105 +++++++++++++++++++++++++++++++++
>  include/configs/omap3_beagle.h        |    3 +
>  include/configs/omap4_panda.h         |    2 +
>  5 files changed, 138 insertions(+), 0 deletions(-)
>  create mode 100644 doc/README.omap-ulpi-viewport
>  create mode 100644 drivers/usb/ulpi/omap-ulpi-viewport.c
> 
> diff --git a/doc/README.omap-ulpi-viewport b/doc/README.omap-ulpi-viewport
> new file mode 100644
> index 0000000..19feecd
> --- /dev/null
> +++ b/doc/README.omap-ulpi-viewport
> @@ -0,0 +1,27 @@
> +Reference code ""drivers/usb/ulpi/omap-ulpi-viewport.c"
> +
> +Contains the ulpi read write api's to perform
> +any ulpi phy port access on omap platform.
> +
> +On omap ehci reg map contains INSNREG05_ULPI
> +register which offers the ulpi phy access so
> +any ulpi phy commands can be passsed using this

should be passed                  ^^^

> +register.
> +
> +omap-ulpi-viewport.c is a low level function
> +implementation of "drivers/usb/ulpi/ulpi.c"
> +
> +To enable and use omap-ulpi-viewport.c
> +we requires CONFIG_USB_ULPI_VIEWPORT_OMAP and

s/requires/require/

> +CONFIG_USB_ULPI be enabled from config file.

s/from/in/

> +
> +Any ulpi ops request can be done with ulpi.c
> +and soc specific binding and usage is done with
> +omap-ulpi-viewport implementation.
> +
> +Ex: scenario:
> +omap-ehci driver code requests for ulpi phy reset if
> +ehci is used in phy mode, which will call ulpi phy reset
> +the ulpi phy reset does ulpi_read/write from viewport
> +implementation which will do ulpi reset using the
> +INSNREG05_ULPI register.

[...]

> diff --git a/drivers/usb/ulpi/omap-ulpi-viewport.c b/drivers/usb/ulpi/omap-ulpi-viewport.c
> new file mode 100644
> index 0000000..66b1795
> --- /dev/null
> +++ b/drivers/usb/ulpi/omap-ulpi-viewport.c

[...]

> +int ulpi_write(struct ulpi_viewport *ulpi_vp, u8 *reg, u32 value)
> +{
> +	u32 val = ((ulpi_vp->port_num & 0x7) << 24) |
> +			OMAP_ULPI_WR_OPSEL | ((u32)reg << 16) | (value & 0xff);

On OMAP, port_num is 4 bits wide, therefore:
ulpi_vp->port_num & 0xf

> +
> +	return ulpi_request(ulpi_vp, val);
> +}
> +
> +u32 ulpi_read(struct ulpi_viewport *ulpi_vp, u8 *reg)
> +{
> +	int err;
> +	u32 val = ((ulpi_vp->port_num & 0x7) << 24) |
> +			 OMAP_ULPI_WR_OPSEL | ((u32)reg << 16);

same here:
ulpi_vp->port_num & 0xf

> +
> +	err = ulpi_request(ulpi_vp, val);
> +	if (err)
> +		return err;
> +
> +	return readl(ulpi_vp->viewport_addr) & 0xff;
> +}

[...]


-- 
Regards,
Igor.

  reply	other threads:[~2012-02-06  9:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-02-03 13:38 [U-Boot] [PATCH v3 0/7] Clean up ehci-omap and extend support for omap3/4 socs Govindraj.R
2012-02-03 13:38 ` [U-Boot] [PATCH v3 1/7] ehci-omap: driver for EHCI host on OMAP3 Govindraj.R
2012-02-03 13:38 ` [U-Boot] [PATCH v3 2/7] ehci-omap: Clean up added ehci-omap.c Govindraj.R
2012-02-06 11:26   ` Igor Grinberg
2012-02-03 13:38 ` [U-Boot] [PATCH v3 3/7] OMAP3+: Clock: Adding ehci clock enabling Govindraj.R
2012-02-06 11:42   ` Igor Grinberg
2012-02-06 11:57     ` Govindraj
2012-02-06 12:17       ` Igor Grinberg
2012-02-03 13:38 ` [U-Boot] [PATCH v3 4/7] OMAP4: clock-common: Move the usb dppl configuration to new func Govindraj.R
2012-02-03 13:38 ` [U-Boot] [PATCH v3 5/7] OMAP3+: ehci-omap: enable usb host ports for beagle/panda Govindraj.R
2012-02-06 12:03   ` Igor Grinberg
2012-02-03 13:38 ` [U-Boot] [PATCH v3 6/7] usb: ulpi: Extend the existing ulpi framework Govindraj.R
2012-02-06  8:55   ` Igor Grinberg
2012-02-06  9:38     ` Govindraj
2012-02-06 10:03       ` Igor Grinberg
2012-02-08 17:42   ` SUBHASHINI MANNE
2012-02-09  6:32     ` Govindraj
2012-02-03 13:38 ` [U-Boot] [PATCH v3 7/7] usb: ulpi: Add omap-ulpi-view port support Govindraj.R
2012-02-06  9:10   ` Igor Grinberg [this message]
2012-02-03 15:25 ` [U-Boot] [PATCH v3 0/7] Clean up ehci-omap and extend support for omap3/4 socs 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=4F2F98FC.6020006@compulab.co.il \
    --to=grinberg@compulab.co.il \
    --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