* [PATCH] mfd: omap: Restore TLL initialization
@ 2011-06-23 21:01 Jassi Brar
2011-06-24 6:22 ` Munegowda, Keshava
0 siblings, 1 reply; 5+ messages in thread
From: Jassi Brar @ 2011-06-23 21:01 UTC (permalink / raw)
To: linux-kernel
Cc: ti, Keshava_mgowda, parthab, sameo, gadiyar, balbi, linux-omap,
linux-usb, Jassi Brar
The commit
7e6502d577106fb5b202bbaac64c5f1b065 'mfd: Add omap-usbhs runtime PM support'
besides moving to RPM, removes necessary TLL initialization as well.
Restore the TLL initialization, without which device detection fails.
Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
---
drivers/mfd/omap-usb-host.c | 42 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 42 insertions(+), 0 deletions(-)
diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
index 8552195..12ca77b 100644
--- a/drivers/mfd/omap-usb-host.c
+++ b/drivers/mfd/omap-usb-host.c
@@ -640,6 +640,7 @@ static int usbhs_enable(struct device *dev)
struct usbhs_omap_platform_data *pdata = &omap->platdata;
unsigned long flags = 0;
int ret = 0;
+ unsigned long timeout;
unsigned reg;
dev_dbg(dev, "starting TI HSUSB Controller\n");
@@ -676,6 +677,47 @@ static int usbhs_enable(struct device *dev)
omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION);
dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev);
+ /* perform TLL soft reset, and wait until reset is complete */
+ usbhs_write(omap->tll_base, OMAP_USBTLL_SYSCONFIG,
+ OMAP_USBTLL_SYSCONFIG_SOFTRESET);
+
+ /* Wait for TLL reset to complete */
+ timeout = jiffies + msecs_to_jiffies(1000);
+ while (!(usbhs_read(omap->tll_base, OMAP_USBTLL_SYSSTATUS)
+ & OMAP_USBTLL_SYSSTATUS_RESETDONE)) {
+ cpu_relax();
+
+ if (time_after(jiffies, timeout)) {
+ dev_dbg(dev, "operation timed out\n");
+ ret = -EINVAL;
+ goto err_tll;
+ }
+ }
+ dev_dbg(dev, "TLL RESET DONE\n");
+
+ /* (1<<3) = no idle mode only for initial debugging */
+ usbhs_write(omap->tll_base, OMAP_USBTLL_SYSCONFIG,
+ OMAP_USBTLL_SYSCONFIG_ENAWAKEUP |
+ OMAP_USBTLL_SYSCONFIG_SIDLEMODE |
+ OMAP_USBTLL_SYSCONFIG_AUTOIDLE);
+
+ /* Put UHH in NoIdle/NoStandby mode */
+ reg = usbhs_read(omap->uhh_base, OMAP_UHH_SYSCONFIG);
+ if (is_omap_usbhs_rev1(omap)) {
+ reg |= (OMAP_UHH_SYSCONFIG_ENAWAKEUP
+ | OMAP_UHH_SYSCONFIG_SIDLEMODE
+ | OMAP_UHH_SYSCONFIG_CACTIVITY
+ | OMAP_UHH_SYSCONFIG_MIDLEMODE);
+ reg &= ~OMAP_UHH_SYSCONFIG_AUTOIDLE;
+ } else if (is_omap_usbhs_rev2(omap)) {
+ reg &= ~OMAP4_UHH_SYSCONFIG_IDLEMODE_CLEAR;
+ reg |= OMAP4_UHH_SYSCONFIG_NOIDLE;
+ reg &= ~OMAP4_UHH_SYSCONFIG_STDBYMODE_CLEAR;
+ reg |= OMAP4_UHH_SYSCONFIG_NOSTDBY;
+ }
+
+ usbhs_write(omap->uhh_base, OMAP_UHH_SYSCONFIG, reg);
+
reg = usbhs_read(omap->uhh_base, OMAP_UHH_HOSTCONFIG);
/* setup ULPI bypass and burst configurations */
reg |= (OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN
--
1.7.4.1
^ permalink raw reply related [flat|nested] 5+ messages in thread* Re: [PATCH] mfd: omap: Restore TLL initialization
2011-06-23 21:01 [PATCH] mfd: omap: Restore TLL initialization Jassi Brar
@ 2011-06-24 6:22 ` Munegowda, Keshava
2011-06-24 7:03 ` Jaswinder Singh
2011-06-27 22:04 ` Kevin Hilman
0 siblings, 2 replies; 5+ messages in thread
From: Munegowda, Keshava @ 2011-06-24 6:22 UTC (permalink / raw)
To: Jassi Brar
Cc: linux-kernel, ti, parthab, sameo, gadiyar, balbi, linux-omap,
linux-usb, Jassi Brar
On Fri, Jun 24, 2011 at 2:31 AM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
> The commit
> 7e6502d577106fb5b202bbaac64c5f1b065 'mfd: Add omap-usbhs runtime PM support'
> besides moving to RPM, removes necessary TLL initialization as well.
>
> Restore the TLL initialization, without which device detection fails.
>
> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
> ---
> drivers/mfd/omap-usb-host.c | 42 ++++++++++++++++++++++++++++++++++++++++++
> 1 files changed, 42 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/mfd/omap-usb-host.c b/drivers/mfd/omap-usb-host.c
> index 8552195..12ca77b 100644
> --- a/drivers/mfd/omap-usb-host.c
> +++ b/drivers/mfd/omap-usb-host.c
> @@ -640,6 +640,7 @@ static int usbhs_enable(struct device *dev)
> struct usbhs_omap_platform_data *pdata = &omap->platdata;
> unsigned long flags = 0;
> int ret = 0;
> + unsigned long timeout;
> unsigned reg;
>
> dev_dbg(dev, "starting TI HSUSB Controller\n");
> @@ -676,6 +677,47 @@ static int usbhs_enable(struct device *dev)
> omap->usbhs_rev = usbhs_read(omap->uhh_base, OMAP_UHH_REVISION);
> dev_dbg(dev, "OMAP UHH_REVISION 0x%x\n", omap->usbhs_rev);
>
> + /* perform TLL soft reset, and wait until reset is complete */
> + usbhs_write(omap->tll_base, OMAP_USBTLL_SYSCONFIG,
> + OMAP_USBTLL_SYSCONFIG_SOFTRESET);
> +
> + /* Wait for TLL reset to complete */
> + timeout = jiffies + msecs_to_jiffies(1000);
> + while (!(usbhs_read(omap->tll_base, OMAP_USBTLL_SYSSTATUS)
> + & OMAP_USBTLL_SYSSTATUS_RESETDONE)) {
> + cpu_relax();
> +
> + if (time_after(jiffies, timeout)) {
> + dev_dbg(dev, "operation timed out\n");
> + ret = -EINVAL;
> + goto err_tll;
> + }
> + }
> + dev_dbg(dev, "TLL RESET DONE\n");
> +
> + /* (1<<3) = no idle mode only for initial debugging */
> + usbhs_write(omap->tll_base, OMAP_USBTLL_SYSCONFIG,
> + OMAP_USBTLL_SYSCONFIG_ENAWAKEUP |
> + OMAP_USBTLL_SYSCONFIG_SIDLEMODE |
> + OMAP_USBTLL_SYSCONFIG_AUTOIDLE);
> +
> + /* Put UHH in NoIdle/NoStandby mode */
> + reg = usbhs_read(omap->uhh_base, OMAP_UHH_SYSCONFIG);
> + if (is_omap_usbhs_rev1(omap)) {
> + reg |= (OMAP_UHH_SYSCONFIG_ENAWAKEUP
> + | OMAP_UHH_SYSCONFIG_SIDLEMODE
> + | OMAP_UHH_SYSCONFIG_CACTIVITY
> + | OMAP_UHH_SYSCONFIG_MIDLEMODE);
> + reg &= ~OMAP_UHH_SYSCONFIG_AUTOIDLE;
> + } else if (is_omap_usbhs_rev2(omap)) {
> + reg &= ~OMAP4_UHH_SYSCONFIG_IDLEMODE_CLEAR;
> + reg |= OMAP4_UHH_SYSCONFIG_NOIDLE;
> + reg &= ~OMAP4_UHH_SYSCONFIG_STDBYMODE_CLEAR;
> + reg |= OMAP4_UHH_SYSCONFIG_NOSTDBY;
> + }
> +
> + usbhs_write(omap->uhh_base, OMAP_UHH_SYSCONFIG, reg);
> +
> reg = usbhs_read(omap->uhh_base, OMAP_UHH_HOSTCONFIG);
> /* setup ULPI bypass and burst configurations */
> reg |= (OMAP_UHH_HOSTCONFIG_INCR4_BURST_EN
> --
> 1.7.4.1
if you move to RPM, you should'tn access these configuration/reset
registers in your driver.
moreover, the patch 'mfd: Add omap-usbhs runtime PM support' is
already reverted.
keshava
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] mfd: omap: Restore TLL initialization
2011-06-24 6:22 ` Munegowda, Keshava
@ 2011-06-24 7:03 ` Jaswinder Singh
2011-06-27 22:04 ` Kevin Hilman
1 sibling, 0 replies; 5+ messages in thread
From: Jaswinder Singh @ 2011-06-24 7:03 UTC (permalink / raw)
To: Munegowda, Keshava
Cc: Jassi Brar, linux-kernel, ti, parthab, sameo, gadiyar, balbi,
linux-omap, linux-usb
On 24 June 2011 11:52, Munegowda, Keshava <keshava_mgowda@ti.com> wrote:
> On Fri, Jun 24, 2011 at 2:31 AM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
>> The commit
>> 7e6502d577106fb5b202bbaac64c5f1b065 'mfd: Add omap-usbhs runtime PM support'
>> besides moving to RPM, removes necessary TLL initialization as well.
>>
>> Restore the TLL initialization, without which device detection fails.
>>
>> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
>
> if you move to RPM, you should'tn access these configuration/reset
> registers in your driver.
Sorry I don't get it. Obviously the RPM backend here doesn't initialize
the TLL and if it only manages the clocks, can't we safely assume that
the pm_runtime_get_sync will get clocks to speed and the driver does
the TLL init ?
> moreover, the patch 'mfd: Add omap-usbhs runtime PM support' is
> already reverted.
Ok, though if the ultimate goal is to move on to RPM, this would be a
step back.
Btw, which tree could I find the revert in ?
Thanks,
Jassi
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mfd: omap: Restore TLL initialization
2011-06-24 6:22 ` Munegowda, Keshava
2011-06-24 7:03 ` Jaswinder Singh
@ 2011-06-27 22:04 ` Kevin Hilman
2011-06-28 5:29 ` Munegowda, Keshava
1 sibling, 1 reply; 5+ messages in thread
From: Kevin Hilman @ 2011-06-27 22:04 UTC (permalink / raw)
To: Munegowda, Keshava
Cc: Jassi Brar, linux-kernel, ti, parthab, sameo, gadiyar, balbi,
linux-omap, linux-usb, Jassi Brar
"Munegowda, Keshava" <keshava_mgowda@ti.com> writes:
> On Fri, Jun 24, 2011 at 2:31 AM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
>> The commit
>> 7e6502d577106fb5b202bbaac64c5f1b065 'mfd: Add omap-usbhs runtime PM support'
>> besides moving to RPM, removes necessary TLL initialization as well.
>>
>> Restore the TLL initialization, without which device detection fails.
>>
>> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
[...]
> if you move to RPM, you should'tn access these configuration/reset
> registers in your driver.
Yes, but Jaswinder's changelog clearly shows that the runtime PM (and
thus hwmod) init is not doing the equivalent of what was removed from
the driver.
A hunch after a quick glance is that the driver changes are only doing
runtime PM calls on the UHH device and not the TTL device. In fact,
the patch that builds the USB host omap_device[1] doesn't even build one.
> moreover, the patch 'mfd: Add omap-usbhs runtime PM support' is
> already reverted.
It is reverted for this merge window, but will be added back for the
next window, so Jaswinder's problem still needs to be fixed the right way.
Please rework the USB host runtime PM conversion so that *all* the IP
blocks are managed by runtime PM and the driver is doing runtime PM
calls for all the devices used.
Kevin
[1] http://marc.info/?l=linux-omap&m=130693494126396&w=2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] mfd: omap: Restore TLL initialization
2011-06-27 22:04 ` Kevin Hilman
@ 2011-06-28 5:29 ` Munegowda, Keshava
0 siblings, 0 replies; 5+ messages in thread
From: Munegowda, Keshava @ 2011-06-28 5:29 UTC (permalink / raw)
To: Kevin Hilman
Cc: Jassi Brar, linux-kernel, ti, parthab, sameo, gadiyar, balbi,
linux-omap, linux-usb, Jassi Brar
On Tue, Jun 28, 2011 at 3:34 AM, Kevin Hilman <khilman@ti.com> wrote:
> "Munegowda, Keshava" <keshava_mgowda@ti.com> writes:
>
>> On Fri, Jun 24, 2011 at 2:31 AM, Jassi Brar <jassisinghbrar@gmail.com> wrote:
>>> The commit
>>> 7e6502d577106fb5b202bbaac64c5f1b065 'mfd: Add omap-usbhs runtime PM support'
>>> besides moving to RPM, removes necessary TLL initialization as well.
>>>
>>> Restore the TLL initialization, without which device detection fails.
>>>
>>> Signed-off-by: Jassi Brar <jaswinder.singh@linaro.org>
>
> [...]
>
>> if you move to RPM, you should'tn access these configuration/reset
>> registers in your driver.
>
> Yes, but Jaswinder's changelog clearly shows that the runtime PM (and
> thus hwmod) init is not doing the equivalent of what was removed from
> the driver.
>
> A hunch after a quick glance is that the driver changes are only doing
> runtime PM calls on the UHH device and not the TTL device. In fact,
> the patch that builds the USB host omap_device[1] doesn't even build one.
>
>> moreover, the patch 'mfd: Add omap-usbhs runtime PM support' is
>> already reverted.
>
> It is reverted for this merge window, but will be added back for the
> next window, so Jaswinder's problem still needs to be fixed the right way.
>
> Please rework the USB host runtime PM conversion so that *all* the IP
> blocks are managed by runtime PM and the driver is doing runtime PM
> calls for all the devices used.
>
> Kevin
> [1] http://marc.info/?l=linux-omap&m=130693494126396&w=2
>
Ya, the changes are going on ; I will post the patches soon.
keshava
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2011-06-28 5:31 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-23 21:01 [PATCH] mfd: omap: Restore TLL initialization Jassi Brar
2011-06-24 6:22 ` Munegowda, Keshava
2011-06-24 7:03 ` Jaswinder Singh
2011-06-27 22:04 ` Kevin Hilman
2011-06-28 5:29 ` Munegowda, Keshava
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox