public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Sricharan R <r.sricharan@ti.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] OMAP5: USB: hsusbtll_clkctrl has to be in hw_auto for USB to work
Date: Tue, 9 Apr 2013 11:57:43 +0530	[thread overview]
Message-ID: <5163B4DF.9060202@ti.com> (raw)
In-Reply-To: <51628F60.4070609@mm-sol.com>

Hi Lubomir,

On Monday 08 April 2013 03:05 PM, Lubomir Popov wrote:
> Hello Sricharan,
> 
> On 08/04/13 09:05, Sricharan R wrote:
>> On Thursday 04 April 2013 09:21 PM, Lubomir Popov wrote:
>>> V2 fixes line wrap issue of the patch itself.
>>>
>>> This fix is needed (but not sufficient) for USB EHCI operation.
>>>
>>> Signed-off-by: Lubomir Popov <lpopov@mm-sol.com>
>>>
>>> ---
>>>  arch/arm/cpu/armv7/omap5/hw_data.c |    2 +-
>>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>>
>>> diff --git a/arch/arm/cpu/armv7/omap5/hw_data.c b/arch/arm/cpu/armv7/omap5/hw_data.c
>>> index ced274e..e5e41fd 100644
>>> --- a/arch/arm/cpu/armv7/omap5/hw_data.c
>>> +++ b/arch/arm/cpu/armv7/omap5/hw_data.c
>>> @@ -403,6 +403,7 @@ void enable_basic_uboot_clocks(void)
>>>  	};
>>>  
>>>  	u32 const clk_modules_hw_auto_essential[] = {
>>> +		(*prcm)->cm_l3init_hsusbtll_clkctrl,
>>>  		0
>>>  	};
>>>  
>>> @@ -411,7 +412,6 @@ void enable_basic_uboot_clocks(void)
>>>  		(*prcm)->cm_l4per_i2c2_clkctrl,
>>>  		(*prcm)->cm_l4per_i2c3_clkctrl,
>>>  		(*prcm)->cm_l4per_i2c4_clkctrl,
>>> -		(*prcm)->cm_l3init_hsusbtll_clkctrl,
>>>  		(*prcm)->cm_l3init_hsusbhost_clkctrl,
>>>  		(*prcm)->cm_l3init_fsusb_clkctrl,
>>>  		0
>>
>> No, how is this helping you. Are you using EHCI at SPL ?
>> Those usb clocks are anyways getting enabled at u-boot.
>>
>> Regards,
>>  Sricharan
>>
> 
  Hmm, i get it. The actual problem was usb_tll clocks does not support
  'explicit en essential'. It supports only 'hw_auto' control.
 
   That's why moving it to the hw_auto array makes it to work.

   Acked-by: R Sricharan <r.sricharan@ti.com>

Regards,
 Sricharan

  
> Why SPL? This is in the enable_basic_uboot_clocks() function. The problem seems to be
> _when_ are they enabled.
> 
> This fix (moving cm_l3init_hsusbtll_clkctrl from the clk_modules_explicit_en_essential[]
> array to clk_modules_hw_auto_essential[]) is something confirmed empirically (apart from
> the fact that it is so for the OMAP4, which gave me the hint why USB was not working).
> 
> The following dump is for the SOM5 EVB (http://patchwork.ozlabs.org/patch/232739/) with all
> needed patches applied (this one, as well as http://patchwork.ozlabs.org/patch/232742/).
> Functional clocks are enabled/disabled in the board file. The boot script just sets a MAC
> address for the USB Ethernet controller to env.
> 
> U-Boot SPL 2013.04-rc1-00400-g7f594d9 (Apr 02 2013 - 14:55:24)
> OMAP5430 ES1.0
> OMAP SD/MMC: 0
> reading u-boot.img
> reading u-boot.img
> 
> 
> U-Boot 2013.04-rc1-00400-g7f594d9 (Apr 02 2013 - 14:55:24)
> 
> CPU  : OMAP5430 ES1.0
> Board: MM Solutions SOM5 EVB
> I2C:   ready
> DRAM:  2 GiB
> MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
> Using default environment
> 
> In:    serial
> Out:   serial
> Err:   serial
> Net:   No ethernet found.
> Hit any key to stop autoboot:  0 
> mmc0 is current device
> reading boot.scr
> 109 bytes read in 3 ms (35.2 KiB/s)
> Running bootscript from mmc0 ...
> ## Executing script at 82000000
> SOM5_EVB # 
> SOM5_EVB # usb start
> (Re)start USB...
> USB0:   USB EHCI 1.00
> scanning bus 0 for devices... 6 USB Device(s) found
>        scanning usb for storage devices... 3 Storage Device(s) found
>        scanning usb for ethernet devices... 1 Ethernet Device(s) found
> SOM5_EVB # usb tree
> USB device tree:
>   1  Hub (480 Mb/s, 0mA)
>   |  u-boot EHCI Host Controller 
>   |
>   +-2  Mass Storage (480 Mb/s, 200mA)
>   |    FSC                  MEMORYBIRD USB2      C157040817120315AA  
>   |  
>   +-3  Hub (480 Mb/s, 2mA)
>   | |
>   | +-4  Mass Storage (480 Mb/s, 96mA)
>   | |    Generic Ultra Fast Media Reader 000000264001
>   | |  
>   | +-5  Mass Storage (480 Mb/s, 100mA)
>   |      Generic Mass Storage C88BB2CE
>   |    
>   +-6  Vendor specific (480 Mb/s, 500mA)
>      
> SOM5_EVB # 
> 
> Now, for the experiment, I just moved cm_l3init_hsusbtll_clkctrl back to
> clk_modules_explicit_en_essential[] and built again. As you can see, the
> result is a Data Abort exception:
> 
> U-Boot SPL 2013.04-rc2-00020-g6b29a25-dirty (Apr 08 2013 - 11:14:14)
> OMAP5430 ES1.0
> OMAP SD/MMC: 0
> reading u-boot.img
> reading u-boot.img
> 
> 
> U-Boot 2013.04-rc2-00020-g6b29a25-dirty (Apr 08 2013 - 11:14:14)
> 
> CPU  : OMAP5430 ES1.0
> Board: MM Solutions SOM5 EVB
> I2C:   ready
> DRAM:  2 GiB
> MMC:   OMAP SD/MMC: 0, OMAP SD/MMC: 1
> Using default environment
> 
> In:    serial
> Out:   serial
> Err:   serial
> Net:   No ethernet found.
> Hit any key to stop autoboot:  0 
> mmc0 is current device
> reading boot.scr
> 109 bytes read in 3 ms (35.2 KiB/s)
> Running bootscript from mmc0 ...
> ## Executing script at 82000000
> SOM5_EVB # 
> SOM5_EVB # usb start
> (Re)start USB...
> USB0:   data abort
> 
>     MAYBE you should read doc/README.arm-unaligned-accesses
> 
> pc : [<fef8f32c>]          lr : [<fef738b4>]
> sp : feef2d50  ip : 00000034     fp : feef2dc4
> r10: 00000000  r9 : fefbc0c4     r8 : feef2f40
> r7 : 00000680  r6 : fefbc0c0     r5 : 000027da  r4 : 4a062000
> r3 : 00000000  r2 : 000027da     r1 : 000027da  r0 : 000027da
> Flags: nZcv  IRQs off  FIQs off  Mode SVC_32
> Resetting CPU ...
> 
> resetting ...
> 
> U-Boot SPL 2013.04-rc2-00020-g6b29a25-dirty (Apr 08 2013 - 11:14:14)
> OMAP5430 ES1.0
> OMAP SD/MMC: 0
> reading u-boot.img
> reading u-boot.img
> 
> ...
> 
> Best regards,
> Lubomir

      reply	other threads:[~2013-04-09  6:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-04 15:51 [U-Boot] [PATCH v2] OMAP5: USB: hsusbtll_clkctrl has to be in hw_auto for USB to work Lubomir Popov
2013-04-08  6:05 ` Sricharan R
2013-04-08  9:35   ` Lubomir Popov
2013-04-09  6:27     ` Sricharan R [this message]

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=5163B4DF.9060202@ti.com \
    --to=r.sricharan@ti.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