diff mbox

[U-Boot,2/3] ARM: tegra: fix USB controller aliases

Message ID 20160915181939.12167-2-swarren@wwwdotorg.org
State Accepted
Commit 002ddbffb6e51ea3291d7bf22eca6f847b40fa90
Delegated to: Tom Warren
Headers show

Commit Message

Stephen Warren Sept. 15, 2016, 6:19 p.m. UTC
From: Stephen Warren <swarren@nvidia.com>

Some boards have a different set of USB controllers enabled in DT than
the set referenced by /alias entries. This patch fixes that. For
example, this avoids the following message while booting on Ventana,
which is caused by the fact that the USB0 controller had no alias, and
defaulted to wanting a sequence number of 0, which was later explicitly
requested by the alias for USB controller 2.

USB2:   Device 'usb@c5008000': seq 0 is in use by 'usb@c5000000'

This didn't affect USB operation in any way though.

Related, there's no need for the USB controller aliases to have an order
that's different from the HW order, so re-order any aliases to match the
HW ordering. This has the benefit that since USB controller 0 is the only
one that supports device-mode in HW, and U-Boot only supports enabling
device move on controller 0, there's now good synergy in the ordering! For
Tegra20, that's not relevant at present since USB device mode doesn't work
correctly on that SoC, but it will save some head-scratching later.

This patch doesn't fix the colibri_t20 board, even though it has the same
issue, since Marcel already sent a patch for that.

Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
Signed-off-by: Stephen Warren <swarren@nvidia.com>
---
 arch/arm/dts/tegra20-harmony.dts   | 3 ++-
 arch/arm/dts/tegra20-seaboard.dts  | 5 +++--
 arch/arm/dts/tegra20-trimslice.dts | 3 +--
 arch/arm/dts/tegra20-ventana.dts   | 4 +++-
 4 files changed, 9 insertions(+), 6 deletions(-)

Comments

Simon Glass Sept. 19, 2016, 12:58 a.m. UTC | #1
On 15 September 2016 at 12:19, Stephen Warren <swarren@wwwdotorg.org> wrote:
> From: Stephen Warren <swarren@nvidia.com>
>
> Some boards have a different set of USB controllers enabled in DT than
> the set referenced by /alias entries. This patch fixes that. For
> example, this avoids the following message while booting on Ventana,
> which is caused by the fact that the USB0 controller had no alias, and
> defaulted to wanting a sequence number of 0, which was later explicitly
> requested by the alias for USB controller 2.
>
> USB2:   Device 'usb@c5008000': seq 0 is in use by 'usb@c5000000'
>
> This didn't affect USB operation in any way though.
>
> Related, there's no need for the USB controller aliases to have an order
> that's different from the HW order, so re-order any aliases to match the
> HW ordering. This has the benefit that since USB controller 0 is the only
> one that supports device-mode in HW, and U-Boot only supports enabling
> device move on controller 0, there's now good synergy in the ordering! For
> Tegra20, that's not relevant at present since USB device mode doesn't work
> correctly on that SoC, but it will save some head-scratching later.
>
> This patch doesn't fix the colibri_t20 board, even though it has the same
> issue, since Marcel already sent a patch for that.
>
> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>
> Signed-off-by: Stephen Warren <swarren@nvidia.com>
> ---
>  arch/arm/dts/tegra20-harmony.dts   | 3 ++-
>  arch/arm/dts/tegra20-seaboard.dts  | 5 +++--
>  arch/arm/dts/tegra20-trimslice.dts | 3 +--
>  arch/arm/dts/tegra20-ventana.dts   | 4 +++-
>  4 files changed, 9 insertions(+), 6 deletions(-)

Reviewed-by: Simon Glass <sjg@chromium.org>
Marcel Ziswiler Sept. 20, 2016, 1:52 p.m. UTC | #2
Hi Stephen

Cool, it's all working again. You saved my day!

Tegra20 (Harmony) # usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller 
   
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller 
  |
  +-2  Hub (12 Mb/s, 94mA)
    |  Broadcom BCM2046B1 
    |
    +-3  Human Interface (12 Mb/s, 2mA)
    |  
    +-4  Human Interface (12 Mb/s, 2mA)
       
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller 
  |
  +-2  Hub (480 Mb/s, 2mA)
    |
    +-3  Mass Storage (480 Mb/s, 500mA)
    |      T1204020000702
    |  
    +-4  Vendor specific (480 Mb/s, 0mA)
    |    SMSC LAN9514 12345678
    |  
    +-5  Mass Storage (480 Mb/s, 200mA)
    |    Generic Mass Storage CAF6AFF4
    |  
    +-6  Mass Storage (480 Mb/s, 300mA)
         Kingston DataTraveler 3.0 001D0F1FEBFDBE51C741753F

Tegra20 (Ventana) # usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller 
   
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller 
  |
  +-2  Hub (12 Mb/s, 94mA)
    |  Broadcom BCM2046B1 
    |
    +-3  Human Interface (12 Mb/s, 2mA)
       
  1  Hub (480 Mb/s, 0mA)
  |  u-boot EHCI Host Controller 
  |
  +-2  Mass Storage (480 Mb/s, 500mA)
         T1204020000702

More feedback below.

On Thu, 2016-09-15 at 18:19 +0000, Stephen Warren wrote:
> From: Stephen Warren <swarren@nvidia.com>

> 

> Some boards have a different set of USB controllers enabled in DT

> than

> the set referenced by /alias entries. This patch fixes that. For

> example, this avoids the following message while booting on Ventana,

> which is caused by the fact that the USB0 controller had no alias,

> and

> defaulted to wanting a sequence number of 0, which was later

> explicitly

> requested by the alias for USB controller 2.

> 

> USB2:   Device 'usb@c5008000': seq 0 is in use by 'usb@c5000000'

> 

> This didn't affect USB operation in any way though.

> 

> Related, there's no need for the USB controller aliases to have an

> order

> that's different from the HW order, so re-order any aliases to match

> the

> HW ordering. This has the benefit that since USB controller 0 is the

> only

> one that supports device-mode in HW, and U-Boot only supports

> enabling

> device move on controller 0, there's now good synergy in the

> ordering! For

> Tegra20, that's not relevant at present since USB device mode doesn't

> work

> correctly on that SoC, but it will save some head-scratching later.

> 

> This patch doesn't fix the colibri_t20 board, even though it has the

> same

> issue, since Marcel already sent a patch for that.

> 

> Cc: Marcel Ziswiler <marcel.ziswiler@toradex.com>

> Signed-off-by: Stephen Warren <swarren@nvidia.com>

> ---

>  arch/arm/dts/tegra20-harmony.dts   | 3 ++-

>  arch/arm/dts/tegra20-seaboard.dts  | 5 +++--

>  arch/arm/dts/tegra20-trimslice.dts | 3 +--

>  arch/arm/dts/tegra20-ventana.dts   | 4 +++-

>  4 files changed, 9 insertions(+), 6 deletions(-)

> 

> diff --git a/arch/arm/dts/tegra20-harmony.dts b/arch/arm/dts/tegra20-

> harmony.dts

> index 5aec150b5e61..dcbde7c2ed7e 100644

> --- a/arch/arm/dts/tegra20-harmony.dts

> +++ b/arch/arm/dts/tegra20-harmony.dts

> @@ -15,8 +15,9 @@

>  		rtc0 = "/i2c@7000d000/tps6586x@34";

>  		rtc1 = "/rtc@7000e000";

>  		serial0 = &uartd;

> -		usb0 = "/usb@c5008000";

> +		usb0 = "/usb@c5000000";

>  		usb1 = "/usb@c5004000";

> +		usb2 = "/usb@c5008000";

>  		mmc0 = "/sdhci@c8000600";

>  		mmc1 = "/sdhci@c8000200";


Aren't those called sdhci in mainline? Ah, I guess I missed that one:

http://git.denx.de/?p=u-boot/u-boot-tegra.git;a=commitdiff;h=dacb893017
c20ebaaca2138b281c87c0d8977065

>  	};

> diff --git a/arch/arm/dts/tegra20-seaboard.dts

> b/arch/arm/dts/tegra20-seaboard.dts

> index 14210519a6c2..77f5bb51b027 100644

> --- a/arch/arm/dts/tegra20-seaboard.dts

> +++ b/arch/arm/dts/tegra20-seaboard.dts

> @@ -9,8 +9,9 @@

>  

>  	aliases {

>  		/* This defines the order of our ports */

> -		usb0 = "/usb@c5008000";

> -		usb1 = "/usb@c5000000";

> +		usb0 = "/usb@c5000000";

> +		usb1 = "/usb@c5004000";

> +		usb2 = "/usb@c5008000";

>  		i2c0 = "/i2c@7000d000";

>  		i2c1 = "/i2c@7000c000";

>  		i2c2 = "/i2c@7000c400";

> diff --git a/arch/arm/dts/tegra20-trimslice.dts

> b/arch/arm/dts/tegra20-trimslice.dts

> index be64e667cd5b..7fb7dd0b5815 100644

> --- a/arch/arm/dts/tegra20-trimslice.dts

> +++ b/arch/arm/dts/tegra20-trimslice.dts

> @@ -11,8 +11,7 @@

>  	};

>  

>  	aliases {

> -		usb0 = "/usb@c5008000";

> -		usb1 = "/usb@c5000000";

> +		usb0 = "/usb@c5000000";

>  		mmc0 = "/sdhci@c8000600";

>  		mmc1 = "/sdhci@c8000000";

>  		spi0 = "/spi@7000c380";

> diff --git a/arch/arm/dts/tegra20-ventana.dts b/arch/arm/dts/tegra20-

> ventana.dts

> index 371445622c1e..85cd1e39bda7 100644

> --- a/arch/arm/dts/tegra20-ventana.dts

> +++ b/arch/arm/dts/tegra20-ventana.dts

> @@ -15,7 +15,9 @@

>  		rtc0 = "/i2c@7000d000/tps6586x@34";

>  		rtc1 = "/rtc@7000e000";

>  		serial0 = &uartd;

> -		usb0 = "/usb@c5008000";

> +		usb0 = "/usb@c5000000";

> +		usb1 = "/usb@c5004000";

> +		usb2 = "/usb@c5008000";

>  		mmc0 = "/sdhci@c8000600";

>  		mmc1 = "/sdhci@c8000400";

>  	};


For the whole series you may add:

Tested-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>

Tested-on: Harmony and Ventana

Cheers

Marcel
diff mbox

Patch

diff --git a/arch/arm/dts/tegra20-harmony.dts b/arch/arm/dts/tegra20-harmony.dts
index 5aec150b5e61..dcbde7c2ed7e 100644
--- a/arch/arm/dts/tegra20-harmony.dts
+++ b/arch/arm/dts/tegra20-harmony.dts
@@ -15,8 +15,9 @@ 
 		rtc0 = "/i2c@7000d000/tps6586x@34";
 		rtc1 = "/rtc@7000e000";
 		serial0 = &uartd;
-		usb0 = "/usb@c5008000";
+		usb0 = "/usb@c5000000";
 		usb1 = "/usb@c5004000";
+		usb2 = "/usb@c5008000";
 		mmc0 = "/sdhci@c8000600";
 		mmc1 = "/sdhci@c8000200";
 	};
diff --git a/arch/arm/dts/tegra20-seaboard.dts b/arch/arm/dts/tegra20-seaboard.dts
index 14210519a6c2..77f5bb51b027 100644
--- a/arch/arm/dts/tegra20-seaboard.dts
+++ b/arch/arm/dts/tegra20-seaboard.dts
@@ -9,8 +9,9 @@ 
 
 	aliases {
 		/* This defines the order of our ports */
-		usb0 = "/usb@c5008000";
-		usb1 = "/usb@c5000000";
+		usb0 = "/usb@c5000000";
+		usb1 = "/usb@c5004000";
+		usb2 = "/usb@c5008000";
 		i2c0 = "/i2c@7000d000";
 		i2c1 = "/i2c@7000c000";
 		i2c2 = "/i2c@7000c400";
diff --git a/arch/arm/dts/tegra20-trimslice.dts b/arch/arm/dts/tegra20-trimslice.dts
index be64e667cd5b..7fb7dd0b5815 100644
--- a/arch/arm/dts/tegra20-trimslice.dts
+++ b/arch/arm/dts/tegra20-trimslice.dts
@@ -11,8 +11,7 @@ 
 	};
 
 	aliases {
-		usb0 = "/usb@c5008000";
-		usb1 = "/usb@c5000000";
+		usb0 = "/usb@c5000000";
 		mmc0 = "/sdhci@c8000600";
 		mmc1 = "/sdhci@c8000000";
 		spi0 = "/spi@7000c380";
diff --git a/arch/arm/dts/tegra20-ventana.dts b/arch/arm/dts/tegra20-ventana.dts
index 371445622c1e..85cd1e39bda7 100644
--- a/arch/arm/dts/tegra20-ventana.dts
+++ b/arch/arm/dts/tegra20-ventana.dts
@@ -15,7 +15,9 @@ 
 		rtc0 = "/i2c@7000d000/tps6586x@34";
 		rtc1 = "/rtc@7000e000";
 		serial0 = &uartd;
-		usb0 = "/usb@c5008000";
+		usb0 = "/usb@c5000000";
+		usb1 = "/usb@c5004000";
+		usb2 = "/usb@c5008000";
 		mmc0 = "/sdhci@c8000600";
 		mmc1 = "/sdhci@c8000400";
 	};