Skip to contentSkip to conversation

ARM: Tegra: FDT: Add USB EHCI function for T30/T114

PATCH Superseded Jim Lin 4 participants 21 messages Jun 14, 2013 – Jun 18, 2013

Subsystems (5)

v2 of 5 Superseded Latest is v5 →

lore
Share & tools
lore

Jim Lin

author
#0 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Add DT node for USB EHCI function.
Add support for T30-Cardhu, T30-Beaver, T114-Dalmore boards.

---
 arch/arm/dts/tegra114.dtsi            |   27 +++++++++++++++++++++++++++
 arch/arm/dts/tegra30.dtsi             |   27 +++++++++++++++++++++++++++
 board/nvidia/dts/tegra114-dalmore.dts |    7 +++++++
 board/nvidia/dts/tegra30-beaver.dts   |    6 ++++++
 board/nvidia/dts/tegra30-cardhu.dts   |    6 ++++++
 include/fdtdec.h                      |    2 ++
 lib/fdtdec.c                          |    2 ++
 7 files changed, 77 insertions(+), 0 deletions(-)
arch/arm/dts/tegra114.dtsi +27 -0
index f86d18d..f87d05a 100644
@@ -216,4 +216,31 @@
 		clocks = <&tegra_car 15>;
 		status = "disable";
 	};
+
+	usb at 7d000000 {
+		compatible = "nvidia,tegra114-ehci";
+		reg = <0x7d000000 0x4000>;
+		interrupts = <52>;
+		phy_type = "utmi";
+		clocks = <&tegra_car 22>;	/* PERIPH_ID_USBD */
+		status = "disabled";
+	};
+
+	usb at 7d004000 {
+		compatible = "nvidia,tegra114-ehci";
+		reg = <0x7d004000 0x4000>;
+		interrupts = <53>;
+		phy_type = "utmi";
+		clocks = <&tegra_car 58>;	/* PERIPH_ID_USB2 */
+		status = "disabled";
+	};
+
+	usb at 7d008000 {
+		compatible = "nvidia,tegra114-ehci";
+		reg = <0x7d008000 0x4000>;
+		interrupts = <129>;
+		phy_type = "utmi";
+		clocks = <&tegra_car 59>;	/* PERIPH_ID_USB3 */
+		status = "disabled";
+	};
 };
arch/arm/dts/tegra30.dtsi +27 -0
index ccf154f..e5275c2 100644
@@ -216,4 +216,31 @@
 		clocks = <&tegra_car 15>;
 		status = "disabled";
 	};
+
+	usb at 7d000000 {
+		compatible = "nvidia,tegra30-ehci";
+		reg = <0x7d000000 0x4000>;
+		interrupts = <52>;
+		phy_type = "utmi";
+		clocks = <&tegra_car 22>;	/* PERIPH_ID_USBD */
+		status = "disabled";
+	};
+
+	usb at 7d004000 {
+		compatible = "nvidia,tegra30-ehci";
+		reg = <0x7d004000 0x4000>;
+		interrupts = <53>;
+		phy_type = "utmi";
+		clocks = <&tegra_car 58>;	/* PERIPH_ID_USB2 */
+		status = "disabled";
+	};
+
+	usb at 7d008000 {
+		compatible = "nvidia,tegra30-ehci";
+		reg = <0x7d008000 0x4000>;
+		interrupts = <129>;
+		phy_type = "utmi";
+		clocks = <&tegra_car 59>;	/* PERIPH_ID_USB3 */
+		status = "disabled";
+	};
 };
board/nvidia/dts/tegra114-dalmore.dts +7 -0
index 86e9459..435c01e 100644
@@ -14,6 +14,7 @@
 		i2c4 = "/i2c at 7000c700";
 		sdhci0 = "/sdhci at 78000600";
 		sdhci1 = "/sdhci at 78000400";
+		usb0 = "/usb at 7d008000";
 	};
 
 	memory {
@@ -61,4 +62,10 @@
 		bus-width = <8>;
 		status = "okay";
 	};
+
+	usb at 7d008000 {
+		/* SPDIF_IN: USB_VBUS_EN1 */
+		nvidia,vbus-gpio = <&gpio 86 0>;
+		status = "okay";
+	};
 };
board/nvidia/dts/tegra30-beaver.dts +6 -0
index 836169f..b003ae1 100644
@@ -14,6 +14,7 @@
 		i2c4 = "/i2c at 7000c700";
 		sdhci0 = "/sdhci at 78000600";
 		sdhci1 = "/sdhci at 78000000";
+		usb0 = "/usb at 7d008000";
 	};
 
 	memory {
@@ -68,4 +69,9 @@
 		status = "okay";
 		bus-width = <8>;
 	};
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5, USB13_VBUS_PULLUP */
+		status = "okay";
+	};
 };
board/nvidia/dts/tegra30-cardhu.dts +6 -0
index 4d22b48..071a464 100644
@@ -14,6 +14,7 @@
 		i2c4 = "/i2c at 7000c700";
 		sdhci0 = "/sdhci at 78000600";
 		sdhci1 = "/sdhci at 78000000";
+		usb0 = "/usb at 7d008000";
 	};
 
 	memory {
@@ -63,4 +64,9 @@
 		status = "okay";
 		bus-width = <8>;
 	};
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 233 3>;	/* PDD1, EN_3V3_PU */
+		status = "okay";
+	};
 };
include/fdtdec.h +2 -0
index 4e8032b..d19b9f3 100644
@@ -64,6 +64,8 @@ struct fdt_memory {
 enum fdt_compat_id {
 	COMPAT_UNKNOWN,
 	COMPAT_NVIDIA_TEGRA20_USB,	/* Tegra20 USB port */
+	COMPAT_NVIDIA_TEGRA30_USB,	/* Tegra30 USB port */
+	COMPAT_NVIDIA_TEGRA114_USB,	/* Tegra114 USB port */
 	COMPAT_NVIDIA_TEGRA114_I2C,	/* Tegra114 I2C w/single clock source */
 	COMPAT_NVIDIA_TEGRA20_I2C,	/* Tegra20 i2c */
 	COMPAT_NVIDIA_TEGRA20_DVC,	/* Tegra20 dvc (really just i2c) */
lib/fdtdec.c +2 -0
index ac1fe0b..ffc4369 100644
@@ -37,6 +37,8 @@ DECLARE_GLOBAL_DATA_PTR;
 static const char * const compat_names[COMPAT_COUNT] = {
 	COMPAT(UNKNOWN, "<none>"),
 	COMPAT(NVIDIA_TEGRA20_USB, "nvidia,tegra20-ehci"),
+	COMPAT(NVIDIA_TEGRA30_USB, "nvidia,tegra30-ehci"),
+	COMPAT(NVIDIA_TEGRA114_USB, "nvidia,tegra114-ehci"),
 	COMPAT(NVIDIA_TEGRA114_I2C, "nvidia,tegra114-i2c"),
 	COMPAT(NVIDIA_TEGRA20_I2C, "nvidia,tegra20-i2c"),
 	COMPAT(NVIDIA_TEGRA20_DVC, "nvidia,tegra20-i2c-dvc"),
Signature · 1 line
1.7.7
author
#1 lore raw

PATCH v2 2/3 ARM: Tegra: USB: EHCI: Add support for Tegra30/Tegra114

Tegra30 and Tegra114 are compatible except PLL parameters.

Tested on Tegra30 Cardhu, and Tegra114 Dalmore
platforms. All works well.

---
 arch/arm/include/asm/arch-tegra/clk_rst.h |   10 +
 arch/arm/include/asm/arch-tegra/usb.h     |  182 ++++--------------
 arch/arm/include/asm/arch-tegra114/usb.h  |  156 +++++++++++++++
 arch/arm/include/asm/arch-tegra20/usb.h   |  155 +++++++++++++++
 arch/arm/include/asm/arch-tegra30/usb.h   |  168 ++++++++++++++++
 board/nvidia/common/board.c               |    2 +-
 drivers/usb/host/ehci-tegra.c             |  297 +++++++++++++++++++++++++----
 7 files changed, 796 insertions(+), 174 deletions(-)
 create mode 100644 arch/arm/include/asm/arch-tegra114/usb.h
 create mode 100644 arch/arm/include/asm/arch-tegra20/usb.h
 create mode 100644 arch/arm/include/asm/arch-tegra30/usb.h
arch/arm/include/asm/arch-tegra/clk_rst.h +10 -0
index c754ec7..9b8de9c 100644
@@ -225,6 +225,16 @@ enum {
 	IN_408_OUT_9_6_DIVISOR = 83,
 };
 
+/* CLK_RST_CONTROLLER_UTMIP_PLL_CFG1_0 */
+#define PLLU_POWERDOWN		(1 << 16)
+#define PLL_ENABLE_POWERDOWN	(1 << 14)
+#define PLL_ACTIVE_POWERDOWN	(1 << 12)
+
+/* CLK_RST_CONTROLLER_UTMIP_PLL_CFG2_0 */
+#define UTMIP_FORCE_PD_SAMP_C_POWERDOWN		(1 << 4)
+#define UTMIP_FORCE_PD_SAMP_B_POWERDOWN		(1 << 2)
+#define UTMIP_FORCE_PD_SAMP_A_POWERDOWN		(1 << 0)
+
 /* CLK_RST_CONTROLLER_OSC_CTRL_0 */
 #define OSC_XOBP_SHIFT		1
 #define OSC_XOBP_MASK		(1U << OSC_XOBP_SHIFT)
arch/arm/include/asm/arch-tegra/usb.h +43 -139

248 lines not on this page · raw message

arch/arm/include/asm/arch-tegra114/usb.h new file +156 -0

156 lines not on this page · raw message

arch/arm/include/asm/arch-tegra20/usb.h new file +155 -0

155 lines not on this page · raw message

arch/arm/include/asm/arch-tegra30/usb.h new file +168 -0

168 lines not on this page · raw message

board/nvidia/common/board.c +1 -1
index 8d7a227..f0f81c9 100644
@@ -46,7 +46,7 @@
 #include <asm/arch/emc.h>
 #endif
 #ifdef CONFIG_USB_EHCI_TEGRA
-#include <asm/arch-tegra/usb.h>
+#include <asm/arch/usb.h>
 #endif
 #ifdef CONFIG_TEGRA_MMC
 #include <asm/arch-tegra/tegra_mmc.h>
drivers/usb/host/ehci-tegra.c +263 -34

423 lines not on this page · raw message

Signature · 1 line
1.7.7
author
#2 lore raw

PATCH v2 3/3 Tegra: Config: Enable Tegra30/Tegra114 USB function

In reply to Jim Lin

Add USB EHCI, storage and network support.

Tested on Tegra30 Cardhu, and Tegra114 Dalmore
platforms. All works well.

---
 include/configs/beaver.h          |   14 ++++++++++++++
 include/configs/cardhu.h          |   14 ++++++++++++++
 include/configs/dalmore.h         |   14 ++++++++++++++
 include/configs/tegra114-common.h |    3 +++
 include/configs/tegra30-common.h  |    3 +++
 5 files changed, 48 insertions(+), 0 deletions(-)
include/configs/beaver.h +14 -0
index 058da4f..165de13 100644
@@ -71,6 +71,20 @@
 #define CONFIG_CMD_SF
 #define CONFIG_SPI_FLASH_SIZE          (4 << 20)
 
+/* USB Host support */
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_TEGRA
+#define CONFIG_USB_STORAGE
+#define CONFIG_CMD_USB
+
+/* USB networking support */
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+
+/* General networking support */
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP
+
 #include "tegra-common-post.h"
 
 #endif /* __CONFIG_H */
include/configs/cardhu.h +14 -0
index 6a99175..fd46083 100644
@@ -70,6 +70,20 @@
 #define CONFIG_CMD_SF
 #define CONFIG_SPI_FLASH_SIZE          (4 << 20)
 
+/* USB Host support */
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_TEGRA
+#define CONFIG_USB_STORAGE
+#define CONFIG_CMD_USB
+
+/* USB networking support */
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+
+/* General networking support */
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP
+
 #include "tegra-common-post.h"
 
 #endif /* __CONFIG_H */
include/configs/dalmore.h +14 -0
index 7b68f7c..2723843 100644
@@ -75,6 +75,20 @@
 #define CONFIG_CMD_SF
 #define CONFIG_SPI_FLASH_SIZE          (4 << 20)
 
+/* USB Host support */
+#define CONFIG_USB_EHCI
+#define CONFIG_USB_EHCI_TEGRA
+#define CONFIG_USB_STORAGE
+#define CONFIG_CMD_USB
+
+/* USB networking support */
+#define CONFIG_USB_HOST_ETHER
+#define CONFIG_USB_ETHER_ASIX
+
+/* General networking support */
+#define CONFIG_CMD_NET
+#define CONFIG_CMD_DHCP
+
 #include "tegra-common-post.h"
 
 #endif /* __CONFIG_H */
include/configs/tegra114-common.h +3 -0
index 721b29c..44e98e5 100644
@@ -77,4 +77,7 @@
 /* Total I2C ports on Tegra114 */
 #define TEGRA_I2C_NUM_CONTROLLERS	5
 
+/* For USB EHCI controller */
+#define CONFIG_EHCI_IS_TDI
+
 #endif /* _TEGRA114_COMMON_H_ */
include/configs/tegra30-common.h +3 -0
index ed36e11..7ea36be 100644
@@ -90,4 +90,7 @@
 /* Total I2C ports on Tegra30 */
 #define TEGRA_I2C_NUM_CONTROLLERS	5
 
+/* For USB EHCI controller */
+#define CONFIG_EHCI_IS_TDI
+
 #endif /* _TEGRA30_COMMON_H_ */
Signature · 1 line
1.7.7
#3 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

In reply to Jim Lin
Quoted 4 lines · Jim Lin

Add DT node for USB EHCI function.
Add support for T30-Cardhu, T30-Beaver, T114-Dalmore boards.

Hi Jim,

none of the patches in this series have a changelog that list the changes between v1 to v2. It's customary to include one between the separator and the diffstat (as pointed out below). That makes it easier for people reviewing or testing your patches because they know what to look for or test.

Quoted 1 line

---

Changelog goes here.

Quoted 8 lines
 arch/arm/dts/tegra114.dtsi            |   27 +++++++++++++++++++++++++++
 arch/arm/dts/tegra30.dtsi             |   27 +++++++++++++++++++++++++++
 board/nvidia/dts/tegra114-dalmore.dts |    7 +++++++
 board/nvidia/dts/tegra30-beaver.dts   |    6 ++++++
 board/nvidia/dts/tegra30-cardhu.dts   |    6 ++++++
 include/fdtdec.h                      |    2 ++
 lib/fdtdec.c                          |    2 ++
 7 files changed, 77 insertions(+), 0 deletions(-)

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130614/a0b97c8f/attachment.pgp>

#4 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Dear Thierry Reding,

Quoted 6 lines · Jim Lin
Quoted 4 lines

Add DT node for USB EHCI function.
Add support for T30-Cardhu, T30-Beaver, T114-Dalmore boards.

Quoted 7 lines

Hi Jim,

none of the patches in this series have a changelog that list the changes between v1 to v2. It's customary to include one between the separator and the diffstat (as pointed out below). That makes it easier for people reviewing or testing your patches because they know what to look for or test.

Good point. Unless anyone is against this patchset, I'll pick it after I know what changed in this version.

Best regards,
Marek Vasut

#5 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

In reply to Jim Lin

Dear Jim Lin,

Quoted 2 lines

Add DT node for USB EHCI function.
Add support for T30-Cardhu, T30-Beaver, T114-Dalmore boards.

I'd like to get ACK from someone with the actual hardware.

btw. How usable is the cardhu with current U-Boot ? That's the ASUS TF700, right? How can I install U-Boot on it, is there any howto?

Best regards,
Marek Vasut

author
#6 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Quoted 9 lines · Marek Vasut

Dear Jim Lin,

Quoted 2 lines

Add DT node for USB EHCI function.
Add support for T30-Cardhu, T30-Beaver, T114-Dalmore boards.

I'd like to get ACK from someone with the actual hardware.

btw. How usable is the cardhu with current U-Boot ? That's the ASUS TF700, right? How can I install U-Boot on it, is there any howto?

I know nothing about ASUS TF700.
The T30-Cardhu board I have is a demo board.

-----------------------------------------------------------------------------------
This email message is for the sole use of the intended recipient(s) and may contain confidential information. Any unauthorized review, use, disclosure or distribution is prohibited. If you are not the intended recipient, please contact the sender by reply email and destroy all copies of the original message.
-----------------------------------------------------------------------------------

#7 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

In reply to Marek Vasut
Quoted 9 lines · Marek Vasut

Dear Jim Lin,

Quoted 2 lines

Add DT node for USB EHCI function.
Add support for T30-Cardhu, T30-Beaver, T114-Dalmore boards.

I'd like to get ACK from someone with the actual hardware.

btw. How usable is the cardhu with current U-Boot ? That's the ASUS TF700, right? How can I install U-Boot on it, is there any howto?

I don't think Cardhu and TF700 are the same hardware. I'm not familiar with the TF700, but if you have access to the recovery mode you should be able to put mainline U-Boot on it using documentation found here:

ftp://download.nvidia.com/tegra-public-appnotes/index.html

There's also a pretty new tool to perform almost all of the required steps automatically:

https://github.com/NVIDIA/tegra-uboot-flasher-scripts

You should follow the instructions in the README-developer.txt to get started.

But given that the hardware might not be the same as Cardhu, I'm not sure you can actually run mainline U-Boot on it. I don't suppose the schematics for the TF700 are available anywhere? =)

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130617/f84b07e2/attachment.pgp>

#8 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

In reply to Jim Lin

On Fri, Jun 14, 2013 at 06:41:40PM +0800, Jim Lin wrote:
[...]

Quoted 1 line
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

board/nvidia/dts/tegra30-beaver.dts line 74

Quoted 7 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
@@ -68,4 +69,9 @@
 		status = "okay";
 		bus-width = <8>;
 	};
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5, USB13_VBUS_PULLUP */

This doesn't work for me on Beaver. I need to turn the above line into this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed something strange. When I try to use USB, I get this:

Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however, the storage device is detected:

Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Any idea what might be going on here?

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130615/fcb41947/attachment.pgp>

#9 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Dear Thierry Reding,

Quoted 52 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

board/nvidia/dts/tegra30-beaver.dts line 74

Quoted 10 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
@@ -68,4 +69,9 @@
 
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5, USB13_VBUS_PULLUP */

This doesn't work for me on Beaver. I need to turn the above line into this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed something strange. When I try to use USB, I get this:

Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however, the storage device is detected:

Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Quoted 1 line

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

Best regards,
Marek Vasut

#10 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Quoted 54 lines · Marek Vasut

Dear Thierry Reding,

Quoted 52 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

board/nvidia/dts/tegra30-beaver.dts line 74

Quoted 10 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
@@ -68,4 +69,9 @@
 
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5, USB13_VBUS_PULLUP */

This doesn't work for me on Beaver. I need to turn the above line into this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed something strange. When I try to use USB, I get this:

Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found
scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however, the storage device is detected:

Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found
scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Quoted 4 lines
Quoted 1 line

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130616/dc3322b5/attachment.pgp>

#11 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Dear Thierry Reding,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

Dear Thierry Reding,

Quoted 10 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0
@@ -68,4 +69,9 @@
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/nvidia/dts/tegra30-beaver.dts

Quoted 8 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5, 

USB13_VBUS_PULLUP */

Quoted 46 lines
Quoted 33 lines
Quoted 33 lines

This doesn't work for me on Beaver. I need to turn the above line into

this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed

something strange. When I try to use USB, I get this:
Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however,

the storage device is detected:
Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found

Quoted 7 lines
Quoted 4 lines

scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

Quoted 4 lines

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Try reverting 020bbcb "usb: hub: Power-cycle on root-hub ports" ... there's a thread in the ML that it caused issues.

Best regards,
Marek Vasut

#12 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Quoted 70 lines · Marek Vasut

Dear Thierry Reding,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

Dear Thierry Reding,

Quoted 10 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0
@@ -68,4 +69,9 @@
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/nvidia/dts/tegra30-beaver.dts

Quoted 8 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5, 

USB13_VBUS_PULLUP */

Quoted 46 lines
Quoted 33 lines
Quoted 33 lines

This doesn't work for me on Beaver. I need to turn the above line into

this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed

something strange. When I try to use USB, I get this:
Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however,

the storage device is detected:
Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found

Quoted 7 lines
Quoted 4 lines

scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

Quoted 7 lines
Quoted 4 lines

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Try reverting 020bbcb "usb: hub: Power-cycle on root-hub ports" ... there's a thread in the ML that it caused issues.

I reverted the following two patches:

0bf796f usb: hub: Parallelize power-cycling of root-hub ports 020bbcb usb: hub: Power-cycle on root-hub ports

because it wasn't trivial to revert only 020bbcb alone. However it didn't change anything regarding the problem I was seeing.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130617/95dbfd65/attachment.pgp>

#13 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Dear Thierry Reding,

Quoted 88 lines · Marek Vasut
Quoted 77 lines

Dear Thierry Reding,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

Dear Thierry Reding,

Quoted 10 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0
@@ -68,4 +69,9 @@
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/nvidia/dts/tegra30-beaver.dts

Quoted 8 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5,

USB13_VBUS_PULLUP */

Quoted 51 lines
Quoted 37 lines
Quoted 37 lines

This doesn't work for me on Beaver. I need to turn the above line into

this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed

something strange. When I try to use USB, I get this:
Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however,

the storage device is detected:
Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found

Quoted 8 lines
Quoted 5 lines

scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

Quoted 7 lines
Quoted 4 lines

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Try reverting 020bbcb "usb: hub: Power-cycle on root-hub ports" ... there's a thread in the ML that it caused issues.

I reverted the following two patches:

Quoted 7 lines

0bf796f usb: hub: Parallelize power-cycling of root-hub ports 020bbcb usb: hub: Power-cycle on root-hub ports

because it wasn't trivial to revert only 020bbcb alone. However it didn't change anything regarding the problem I was seeing.

Thierry

Ok, this looks ugly and calls for a bisect. Can you check it ? I'll try to test if USB works for me on some EHCI-enabled device.

Best regards,
Marek Vasut

#14 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Quoted 93 lines · Marek Vasut

Dear Thierry Reding,

Quoted 91 lines · Marek Vasut
Quoted 77 lines

Dear Thierry Reding,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

Dear Thierry Reding,

Quoted 10 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0
@@ -68,4 +69,9 @@
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/nvidia/dts/tegra30-beaver.dts

Quoted 8 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5,

USB13_VBUS_PULLUP */

Quoted 51 lines
Quoted 37 lines
Quoted 37 lines

This doesn't work for me on Beaver. I need to turn the above line into

this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed

something strange. When I try to use USB, I get this:
Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however,

the storage device is detected:
Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found

Quoted 8 lines
Quoted 5 lines

scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

Quoted 7 lines
Quoted 4 lines

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Try reverting 020bbcb "usb: hub: Power-cycle on root-hub ports" ... there's a thread in the ML that it caused issues.

I reverted the following two patches:

0bf796f usb: hub: Parallelize power-cycling of root-hub ports 020bbcb usb: hub: Power-cycle on root-hub ports

Quoted 7 lines
Quoted 4 lines

because it wasn't trivial to revert only 020bbcb alone. However it didn't change anything regarding the problem I was seeing.

Thierry

Ok, this looks ugly and calls for a bisect. Can you check it ? I'll try to test if USB works for me on some EHCI-enabled device.

The problem is definitely caused by 020bbcb "usb: hub: Power-cycle on root-hub ports"; I reverted just that locally and it fixed my problems.

#15 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Dear Stephen Warren,

Quoted 96 lines · Marek Vasut
Quoted 95 lines

Dear Thierry Reding,

Quoted 93 lines · Marek Vasut
Quoted 77 lines

Dear Thierry Reding,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

Dear Thierry Reding,

Quoted 10 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0
@@ -68,4 +69,9 @@
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/nvidia/dts/tegra30-beaver.dts

Quoted 8 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5,

USB13_VBUS_PULLUP */

Quoted 51 lines
Quoted 37 lines
Quoted 37 lines

This doesn't work for me on Beaver. I need to turn the above line into

this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed

something strange. When I try to use USB, I get this:
Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however,

the storage device is detected:
Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found

Quoted 8 lines
Quoted 5 lines

scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

Quoted 7 lines
Quoted 4 lines

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Try reverting 020bbcb "usb: hub: Power-cycle on root-hub ports" ... there's a thread in the ML that it caused issues.

I reverted the following two patches:
0bf796f usb: hub: Parallelize power-cycling of root-hub ports 020bbcb usb: hub: Power-cycle on root-hub ports

because it wasn't trivial to revert only 020bbcb alone. However it didn't change anything regarding the problem I was seeing.

Quoted 7 lines
Quoted 4 lines
Quoted 1 line

Thierry

Ok, this looks ugly and calls for a bisect. Can you check it ? I'll try to test if USB works for me on some EHCI-enabled device.

The problem is definitely caused by 020bbcb "usb: hub: Power-cycle on root-hub ports"; I reverted just that locally and it fixed my problems.

Even this one ? Did we already get any reply from the patch author?

Best regards,
Marek Vasut

#16 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Quoted 100 lines · Marek Vasut

Dear Stephen Warren,

Quoted 98 lines · Marek Vasut
Quoted 97 lines

Dear Thierry Reding,

Quoted 94 lines · Marek Vasut
Quoted 77 lines

Dear Thierry Reding,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

Dear Thierry Reding,

Quoted 10 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0
@@ -68,4 +69,9 @@
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/nvidia/dts/tegra30-beaver.dts

Quoted 8 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5,

USB13_VBUS_PULLUP */

Quoted 51 lines
Quoted 37 lines
Quoted 37 lines

This doesn't work for me on Beaver. I need to turn the above line into

this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed

something strange. When I try to use USB, I get this:
Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however,

the storage device is detected:
Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found

Quoted 8 lines
Quoted 5 lines

scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

Quoted 7 lines
Quoted 4 lines

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Try reverting 020bbcb "usb: hub: Power-cycle on root-hub ports" ... there's a thread in the ML that it caused issues.

I reverted the following two patches:
0bf796f usb: hub: Parallelize power-cycling of root-hub ports 020bbcb usb: hub: Power-cycle on root-hub ports

because it wasn't trivial to revert only 020bbcb alone. However it didn't change anything regarding the problem I was seeing.

Thierry

Quoted 7 lines
Quoted 5 lines
Quoted 2 lines

Ok, this looks ugly and calls for a bisect. Can you check it ? I'll try to test if USB works for me on some EHCI-enabled device.

The problem is definitely caused by 020bbcb "usb: hub: Power-cycle on root-hub ports"; I reverted just that locally and it fixed my problems.

Even this one ? Did we already get any reply from the patch author?

Oh, it's possible this is a different symptom, although I'd wager since it's narrowed down to a patch that's known to cause another problem already, it's the same patch that caused it, but yes that should be verified explicitly.

No, I haven't heard anything at all from the patch author.

#17 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

In reply to Marek Vasut
Quoted 93 lines · Marek Vasut

Dear Thierry Reding,

Quoted 91 lines · Marek Vasut
Quoted 77 lines

Dear Thierry Reding,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

Dear Thierry Reding,

Quoted 10 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0
@@ -68,4 +69,9 @@
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/nvidia/dts/tegra30-beaver.dts

Quoted 8 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5,

USB13_VBUS_PULLUP */

Quoted 51 lines
Quoted 37 lines
Quoted 37 lines

This doesn't work for me on Beaver. I need to turn the above line into

this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed

something strange. When I try to use USB, I get this:
Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however,

the storage device is detected:
Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found

Quoted 8 lines
Quoted 5 lines

scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

Quoted 7 lines
Quoted 4 lines

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Try reverting 020bbcb "usb: hub: Power-cycle on root-hub ports" ... there's a thread in the ML that it caused issues.

I reverted the following two patches:

0bf796f usb: hub: Parallelize power-cycling of root-hub ports 020bbcb usb: hub: Power-cycle on root-hub ports

Quoted 7 lines
Quoted 4 lines

because it wasn't trivial to revert only 020bbcb alone. However it didn't change anything regarding the problem I was seeing.

Thierry

Ok, this looks ugly and calls for a bisect. Can you check it ? I'll try to test if USB works for me on some EHCI-enabled device.

I should repeat that things work fine for a more recent flash drive, so it doesn't look all that bad. Bisecting will be difficult because the patches for Tegra30 haven't been merged upstream yet. Also I can't tell for sure if this particular flash driver ever worked as expected since I've never tried it before.

Given that I have limited time over the next few weeks, I'll see if I can come up with a successful bisection. If I do I'll let you know.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20130618/0a3d3d15/attachment.pgp>

#18 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

Dear Thierry Reding,

Quoted 101 lines · Marek Vasut
Quoted 92 lines

Dear Thierry Reding,

Quoted 90 lines · Marek Vasut
Quoted 77 lines

Dear Thierry Reding,

Quoted 13 lines · Marek Vasut
Quoted 12 lines

Dear Thierry Reding,

Quoted 10 lines · Jim Lin

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0
@@ -68,4 +69,9 @@
 
Quoted 8 lines
Quoted 8 lines
Quoted 8 lines

board/nvidia/dts/tegra30-beaver.dts

Quoted 8 lines
board/nvidia/dts/tegra30-beaver.dts +3 -0
 		status = "okay";
 		bus-width = <8>;
 
 	};
 
+
+	usb at 7d008000 {
+		nvidia,vbus-gpio = <&gpio 61 3>; /* PH5,

USB13_VBUS_PULLUP */

Quoted 51 lines
Quoted 37 lines
Quoted 37 lines

This doesn't work for me on Beaver. I need to turn the above line into

this:

	nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed

something strange. When I try to use USB, I get this:
Tegra30 (Beaver) # usb start
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 1 USB Device(s) found

scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however,

the storage device is detected:
Tegra30 (Beaver) # usb reset
(Re)start USB...
USB0: set_host_mode: GPIO 236 high
USB EHCI 1.00
scanning bus 0 for devices... 2 USB Device(s) found

Quoted 8 lines
Quoted 5 lines

scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

Quoted 7 lines
Quoted 4 lines

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Try reverting 020bbcb "usb: hub: Power-cycle on root-hub ports" ... there's a thread in the ML that it caused issues.

I reverted the following two patches:
0bf796f usb: hub: Parallelize power-cycling of root-hub ports 020bbcb usb: hub: Power-cycle on root-hub ports

Quoted 7 lines
Quoted 4 lines

because it wasn't trivial to revert only 020bbcb alone. However it didn't change anything regarding the problem I was seeing.

Thierry

Ok, this looks ugly and calls for a bisect. Can you check it ? I'll try to test if USB works for me on some EHCI-enabled device.

Quoted 8 lines

I should repeat that things work fine for a more recent flash drive, so it doesn't look all that bad. Bisecting will be difficult because the patches for Tegra30 haven't been merged upstream yet. Also I can't tell for sure if this particular flash driver ever worked as expected since I've never tried it before.

Given that I have limited time over the next few weeks, I'll see if I can come up with a successful bisection. If I do I'll let you know.

You can try checking 2013.01, I recall merging some usb-storage related changes after that release.

Best regards,
Marek Vasut

#19 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

In reply to Thierry Reding
Quoted 1 line · Thierry Reding

On Mon, Jun 17, 2013 at 10:39:12PM +0200, Marek Vasut wrote:

...

Quoted 9 lines
Quoted 3 lines

Ok, this looks ugly and calls for a bisect. Can you check it ? I'll try to test if USB works for me on some EHCI-enabled device.

I should repeat that things work fine for a more recent flash drive, so it doesn't look all that bad. Bisecting will be difficult because the patches for Tegra30 haven't been merged upstream yet. Also I can't tell for sure if this particular flash driver ever worked as expected since I've never tried it before.

You can easily cherry-pick changes on top of each commit while you're doing a bisect to add the board support in if you need; just be careful to say "git bisect good|bad the_commit_which_git_bisect_told_me_to_test" where "the_commit_which_git_bisect_told_me_to_test" is before the cherry-picks you did.

Doesn't the problem happen on a Tegra20 board though; it might be easier to test there since no cherry-picks would be needed.

#20 lore raw

PATCH v2 1/3 ARM: Tegra: FDT: Add USB EHCI function for T30/T114

In reply to Thierry Reding
Quoted 58 lines · Thierry Reding
Quoted 47 lines · Marek Vasut

Dear Thierry Reding,

Quoted 45 lines

On Fri, Jun 14, 2013 at 06:41:40PM +0800, Jim Lin wrote: [...]

Quoted 2 lines
board/nvidia/dts/tegra30-beaver.dts +0 -0

[...]

Quoted 6 lines
board/nvidia/dts/tegra30-beaver.dts +1 -0
@@ -68,4 +69,9 @@
 
 status = "okay"; bus-width = <8>;  };
 
+ +	usb at 7d008000 { +		nvidia,vbus-gpio = <&gpio 61 3>; /*

PH5, USB13_VBUS_PULLUP */

This doesn't work for me on Beaver. I need to turn the above line into this:

nvidia,vbus-gpio = <&gpio 236 0>; /* PDD4 */

PDD4 is the correct GPIO according to the schematics and the pin is high-active. Also as far as I can tell, 3 is not a meaningful value for the U-Boot GPIO bindings. Only the value 1 (low-active) is used.

With that change applied on top of your patches I can see that a USB flash drive connected to USB3 is indeed powered. However I noticed something strange. When I try to use USB, I get this:

Tegra30 (Beaver) # usb start (Re)start USB... USB0:
set_host_mode: GPIO 236 high USB EHCI 1.00 scanning bus 0 for devices... 1 USB Device(s) found scanning usb for storage devices... 0 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

So no storage device is detected, even though a USB flash drive is connected and powered properly. If I repeat the same command, however, the storage device is detected:

Tegra30 (Beaver) # usb reset (Re)start USB... USB0:
set_host_mode: GPIO 236 high USB EHCI 1.00 scanning bus 0 for devices... 2 USB Device(s) found scanning usb for storage devices... 1 Storage Device(s) found scanning usb for ethernet devices... 0 Ethernet Device(s) found

Quoted 4 lines
Quoted 1 line

Any idea what might be going on here?

Try waiting a little after setting the GPIO maybe? The drive might need some time to settle.

I can make it work on the first invocation of "usb start" by adding a rather long mdelay() at the very end of ehci_hcd_init() in the Tegra EHCI driver. The magic value seems to be 853 ms. 852 ms wasn't enough in any of the test runs. 853 ms always worked.

Quoted 4 lines

However 850+ ms seems like a very long time for the device to settle, and keeping it in the driver probably isn't a good idea. Furthermore I cannot reproduce the same issue with a newer flash drive, which works fine with no additional delays.

Interesting. I see this exact same issue on Dalmore (Tegra114) with my SD card reader too. I tried inserting a 1000ms delay at the end of ehci_hcd_init() and that solves the problem for me too.

I already have 020bbcb "usb: hub: Power-cycle on root-hub ports" reverted locally, although when I reverted it, IIRC there was a conflict, so it's possible I just hacked around that and ended up reverting all/part of 0bf796f "usb: hub: Parallelize power-cycling of root-hub ports" too; see my branch at:

git://github.com:swarren/u-boot.git mainline_dev

... if you want to see the revert (about 8 commits down).

Another interesting aspect to this: An NVIDIA intern is trying to get the Linux Tegra USB driver working on Tegra114. All the devices we've tried except this SD card reader work fine with that driver, so there's obviously something quirky with it. However, once I've run "usb start" twice in U-Boot, or added the mdelay() to U-Boot and run "usb start" once in U-Boot, then the kernel driver works with the problematic SD card reader...