public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jeroen Hofstee <jeroen@myspectrum.nl>
To: u-boot@lists.denx.de
Subject: [U-Boot] twister: usb host support
Date: Tue, 09 Jul 2013 21:46:52 +0200	[thread overview]
Message-ID: <51DC68AC.5090904@myspectrum.nl> (raw)

Hello Stefano,

The twister always had a fragile usb support in u-boot
in the past. Since some floating patches mentioned
alternating success after usb hub resets, I had a look
if these patches fixed the twister as well, they don't.

Some fiddling around [1] makes the usb work however,
by not attempting to reset the USB hub with gpio_25.
I cannot find any document mentioning gpio_25 though.
Any reason for this usage? It seems better to get rid
of it completely.. Anything against that?

---
Regards,
Jeroen

p.s.
I found by sheer accidence that the usb is behaving
completely normal (after the patch) on rev B1. It is
broken on rev B without the patch and working buggy
with it. On rev B1 + patch the USB to SATA converter
is discovered as well, which I have never seen before.


=== [1] patch to disable the usb reset

The change to port_mode[1] is not needed, but since it is unused,
MODE_UNUSED seems appropriate.


diff --git a/board/technexion/twister/twister.c 
b/board/technexion/twister/twister.c
index a28c704..31cf6c0 100644
--- a/board/technexion/twister/twister.c
+++ b/board/technexion/twister/twister.c
@@ -63,7 +63,7 @@ static const u32 gpmc_XR16L2751[] = {
  #ifdef CONFIG_USB_EHCI
  static struct omap_usbhs_board_data usbhs_bdata = {
      .port_mode[0] = OMAP_EHCI_PORT_MODE_PHY,
-    .port_mode[1] = OMAP_EHCI_PORT_MODE_PHY,
+    .port_mode[1] = OMAP_USBHS_PORT_MODE_UNUSED,
      .port_mode[2] = OMAP_USBHS_PORT_MODE_UNUSED,
  };

@@ -92,9 +92,6 @@ int board_init(void)
      enable_gpmc_cs_config(gpmc_XR16L2751, &gpmc_cfg->cs[3],
          XR16L2751_UART2_BASE, GPMC_SIZE_16M);

-    gpio_request(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, "USB_PHY1_RESET");
-    gpio_direction_output(CONFIG_OMAP_EHCI_PHY1_RESET_GPIO, 1);
-

=== [2] current usb master (rev B1) ===

twister => usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
        scanning usb for storage devices... 1 Storage Device(s) found
twister => usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... cannot reset port 1!?
1 USB Device(s) found
        scanning usb for storage devices... 0 Storage Device(s) found
twister => usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
        scanning usb for storage devices... 1 Storage Device(s) found
twister => usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... cannot reset port 1!?
1 USB Device(s) found
        scanning usb for storage devices... 0 Storage Device(s) found

=== [3] after the patch (rev B1) ===

twister => usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 4 USB Device(s) found
        scanning usb for storage devices... Device NOT ready
    Request Sense returned 02 3A 00
1 Storage Device(s) found

twister => usb tree
USB device tree:
   1  Hub (480 Mb/s, 0mA)
   |  u-boot EHCI Host Controller
   |
   +-2  Hub (480 Mb/s, 100mA)
     |   USB2.0 Hub
     |
     +-3  Mass Storage (480 Mb/s, 96mA)
     |     USB Storage 000000000033
     |
     +-4  Mass Storage (480 Mb/s, 498mA)
          Philips USB Flash Drive 070825AEA237D121


=== [4] after the patch (rev B) ===
Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
        scanning usb for storage devices... 0 Storage Device(s) found
bpp3=> usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... 3 USB Device(s) found
        scanning usb for storage devices... 1 Storage Device(s) found
bpp3=> usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... cannot reset port 1!?
1 USB Device(s) found
        scanning usb for storage devices... 0 Storage Device(s) found

=== [5]
twister => usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... port(0) reset error
cannot reset port 1!?
1 USB Device(s) found
        scanning usb for storage devices... 0 Storage Device(s) found
twister => usb start
(Re)start USB...
USB0:   USB EHCI 1.00
scanning bus 0 for devices... cannot reset port 1!?
1 USB Device(s) found
        scanning usb for storage devices... 0 Storage Device(s) found




      return 0;
  }

diff --git a/include/configs/tam3517-common.h 
b/include/configs/tam3517-common.h
index 2af504b..852bdd7 100644
--- a/include/configs/tam3517-common.h
+++ b/include/configs/tam3517-common.h
@@ -102,7 +102,6 @@
  #define CONFIG_USB_EHCI_OMAP
  #define CONFIG_USB_ULPI
  #define CONFIG_USB_ULPI_VIEWPORT_OMAP
-#define CONFIG_OMAP_EHCI_PHY1_RESET_GPIO    25
  #define CONFIG_SYS_USB_EHCI_MAX_ROOT_PORTS 3
  #define CONFIG_USB_STORAGE

             reply	other threads:[~2013-07-09 19:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-09 19:46 Jeroen Hofstee [this message]
2013-07-10 14:27 ` [U-Boot] twister: usb host support Stefano Babic
2013-07-10 16:04   ` Jeroen Hofstee
2013-07-11  5:47     ` Tapani
2013-07-11  8:21     ` Stefano Babic

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=51DC68AC.5090904@myspectrum.nl \
    --to=jeroen@myspectrum.nl \
    --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