From: Igor Grinberg <grinberg@compulab.co.il>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 1/4] ehci-omap: Clean up added ehci-omap.c
Date: Fri, 03 Feb 2012 15:18:42 +0200 [thread overview]
Message-ID: <4F2BDEB2.70809@compulab.co.il> (raw)
In-Reply-To: <CAAL8m4yEMgj6=xkFkQtgfmtsmG78jVvapOq2-F+tXyqRSjzeOg@mail.gmail.com>
On 02/03/12 14:50, Govindraj wrote:
[...]
>>>
>>> COBJS := $(COBJS-y)
>>> SRCS := $(COBJS:.o=.c)
>>> diff --git a/drivers/usb/ulpi/omap-ulpi-viewport.c
>>> b/drivers/usb/ulpi/omap-ulpi-viewport.c
>>> new file mode 100644
>>> index 0000000..1718788
>>> --- /dev/null
>>> +++ b/drivers/usb/ulpi/omap-ulpi-viewport.c
>>> @@ -0,0 +1,110 @@
>>
>>
>> [...]
>>
>>> +/* ULPI viewport control bits */
>>> +#define OMAP_ULPI_PORT_SHIFT 24
>>> +
>>> +#define OMAP_ULPI_WR_OPSEL (3<< 21)
>>> +#define OMAP_ULPI_ACCESS (1<< 31)
>>> +
>>> +/*
>>> + * Wait for the ULPI Access to complete
>>> + */
>>> +static int ulpi_wait(struct ulpi_viewport *ulpi_vp, u32 mask)
>>> +{
>>> + int timeout = CONFIG_USB_ULPI_TIMEOUT;
>>> +
>>> + while (--timeout) {
>>> + if ((readl(ulpi_vp->viewport_addr)& mask))
>>>
>>> + return 0;
>>> +
>>> + udelay(1);
>>> + }
>>> +
>>> + return ULPI_ERROR;
>>> +}
>>> +
>>> +/*
>>> + * Wake the ULPI PHY up for communication
>>> + *
>>> + * returns 0 on success.
>>> + */
>>> +static int ulpi_wakeup(struct ulpi_viewport *ulpi_vp)
>>> +{
>>> + int err;
>>> +
>>> + if (readl(ulpi_vp->viewport_addr)& OMAP_ULPI_ACCESS)
>>>
>>> + return 0; /* already awake */
>>> +
>>> + writel(OMAP_ULPI_ACCESS, ulpi_vp->viewport_addr);
>>> +
>>> + err = ulpi_wait(ulpi_vp, OMAP_ULPI_ACCESS);
>>> + if (err)
>>> + debug("ULPI wakeup timed out\n");
>>> +
>>> + return err;
>>> +}
>>
>>
>> This function looks really weird...
>> You write the OMAP_ULPI_ACCESS bit, but you don't specify the port...
>> Now, if you will specify the port, what access type (read/write) should it
>> be?
>> So, I don't really know what whould be the consequence of that access...
>>
>> TRM does not talk about waking the ULPI PHY at all or have I missed it...
>> I think this function is unneeded on OMAP - it looks like OMAP wakes
>> the ULPI PHY automatically as soon as you access it for read/write,
>> but the TRM does not talk too much on that...
>>
>> Have you tried without this function?
>> Just calling ulpi_wait() to verify that the previous access has completed,
>> should do the job, no? Can you, please, check that?
>>
>
> Actually we have to start the ulpi access first, then we can write
> port number and mode to be used and after writing we can check for access
> done bit. (checking read/write op was successful can be polled for
> access done bit)
>
> without ulpi_wake access done was not happening and timing out.
This is really weird... because we actually don't know which port (PHY)
is being wakened (may be all of them...).
But if you say it does not work without it, then I'm fine with it.
Thanks Govindraj.
--
Regards,
Igor.
next prev parent reply other threads:[~2012-02-03 13:18 UTC|newest]
Thread overview: 40+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-06 9:03 [U-Boot] [PATCH v2 0/4] Clean up ehci-omap and extend support for omap3/4 socs Govindraj.R
2012-01-06 9:03 ` [U-Boot] [PATCH v2 1/4] ehci-omap: Clean up added ehci-omap.c Govindraj.R
2012-01-10 16:07 ` Marek Vasut
2012-01-11 6:07 ` Govindraj
2012-01-11 10:52 ` Marek Vasut
2012-01-11 11:32 ` Govindraj
2012-01-11 12:46 ` Marek Vasut
2012-01-11 13:00 ` Govindraj
2012-01-11 13:28 ` Marek Vasut
2012-01-11 14:13 ` Govindraj
2012-01-11 14:34 ` Marek Vasut
2012-01-11 15:03 ` Igor Grinberg
2012-01-11 18:50 ` Marek Vasut
2012-01-12 5:45 ` Govindraj
2012-01-12 9:23 ` Igor Grinberg
2012-01-12 10:52 ` Govindraj
2012-01-17 6:10 ` Govindraj
2012-01-18 17:51 ` Igor Grinberg
2012-01-19 8:15 ` Govindraj
2012-01-22 12:20 ` Igor Grinberg
2012-01-25 9:04 ` Govindraj
2012-01-25 13:40 ` Igor Grinberg
2012-01-27 13:29 ` Govindraj
2012-01-29 9:42 ` Igor Grinberg
2012-01-29 11:42 ` Stefano Babic
2012-02-01 11:01 ` Igor Grinberg
2012-02-01 11:26 ` Stefano Babic
2012-02-01 13:22 ` Igor Grinberg
2012-02-03 12:52 ` Govindraj
2012-02-03 12:50 ` Govindraj
2012-02-03 13:18 ` Igor Grinberg [this message]
2012-01-17 18:17 ` Igor Grinberg
2012-01-06 9:03 ` [U-Boot] [PATCH v2 2/4] OMAP3+: Clock: Adding ehci clock enabling Govindraj.R
2012-01-06 9:04 ` [U-Boot] [PATCH v2 3/4] OMAP4: clock-common: Move the usb dppl configuration to new func Govindraj.R
2012-01-06 9:04 ` [U-Boot] [PATCH v2 4/4] OMAP3+: ehci-omap: enable usb host ports for beagle/panda Govindraj.R
2012-02-26 23:13 ` [U-Boot] [PATCH v2 0/4] Clean up ehci-omap and extend support for omap3/4 socs Marek Vasut
2012-02-27 6:27 ` Govindraj
2012-02-27 13:51 ` Marek Vasut
2012-02-27 14:31 ` Tom Rini
2012-02-27 16:29 ` 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=4F2BDEB2.70809@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