public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] tegra: add ULPI on USB2 funcmux entry
@ 2012-05-31 11:51 Lucas Stach
  2012-05-31 11:51 ` [U-Boot] [PATCH 2/2] tegra: usb: fix wrong error check Lucas Stach
       [not found] ` <5FBF8E85CA34454794F0F7ECBA79798F379C416005@HQMAIL04.nvidia.com>
  0 siblings, 2 replies; 5+ messages in thread
From: Lucas Stach @ 2012-05-31 11:51 UTC (permalink / raw)
  To: u-boot

This is needed as a prerequisite for Tegra USB ULPI support
within U-Boot.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
CC: Stephen Warren <swarren@wwwdotorg.org>
CC: Tom Warren <twarren@nvidia.com>
---
 arch/arm/cpu/armv7/tegra2/funcmux.c        |   13 ++++++++++++-
 arch/arm/include/asm/arch-tegra2/funcmux.h |    3 +++
 2 Dateien ge?ndert, 15 Zeilen hinzugef?gt(+), 1 Zeile entfernt(-)

diff --git a/arch/arm/cpu/armv7/tegra2/funcmux.c b/arch/arm/cpu/armv7/tegra2/funcmux.c
index 820ba4e9..455d010 100644
--- a/arch/arm/cpu/armv7/tegra2/funcmux.c
+++ b/arch/arm/cpu/armv7/tegra2/funcmux.c
@@ -209,9 +209,20 @@ int funcmux_select(enum periph_id id, int config)
 				pinmux_set_func(grp[i], PMUX_FUNC_KBC);
 				pinmux_set_pullupdown(grp[i], PMUX_PULL_UP);
 			}
+		}
+		break;
 
-			break;
+	case PERIPH_ID_USB2:
+		if (config == FUNCMUX_USB2_ULPI) {
+			pinmux_set_func(PINGRP_UAA, PMUX_FUNC_ULPI);
+			pinmux_set_func(PINGRP_UAB, PMUX_FUNC_ULPI);
+			pinmux_set_func(PINGRP_UDA, PMUX_FUNC_ULPI);
+
+			pinmux_tristate_disable(PINGRP_UAA);
+			pinmux_tristate_disable(PINGRP_UAB);
+			pinmux_tristate_disable(PINGRP_UDA);
 		}
+		break;
 
 	default:
 		debug("%s: invalid periph_id %d", __func__, id);
diff --git a/arch/arm/include/asm/arch-tegra2/funcmux.h b/arch/arm/include/asm/arch-tegra2/funcmux.h
index b16c496..3cbc7d2 100644
--- a/arch/arm/include/asm/arch-tegra2/funcmux.h
+++ b/arch/arm/include/asm/arch-tegra2/funcmux.h
@@ -51,6 +51,9 @@ enum {
 	FUNCMUX_SDMMC4_ATC_ATD_8BIT = 0,
 	FUNCMUX_SDMMC4_ATB_GMA_4_BIT,
 	FUNCMUX_SDMMC4_ATB_GMA_GME_8_BIT,
+
+	/* USB configs */
+	FUNCMUX_USB2_ULPI = 0,
 };
 
 /**
-- 
1.7.10.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH 2/2] tegra: usb: fix wrong error check
  2012-05-31 11:51 [U-Boot] [PATCH 1/2] tegra: add ULPI on USB2 funcmux entry Lucas Stach
@ 2012-05-31 11:51 ` Lucas Stach
  2012-05-31 13:14   ` Marek Vasut
  2012-05-31 17:44   ` Stephen Warren
       [not found] ` <5FBF8E85CA34454794F0F7ECBA79798F379C416005@HQMAIL04.nvidia.com>
  1 sibling, 2 replies; 5+ messages in thread
From: Lucas Stach @ 2012-05-31 11:51 UTC (permalink / raw)
  To: u-boot

loop_count runs down from 10000, so the correct condition to error out
is ==0.

Signed-off-by: Lucas Stach <dev@lynxeye.de>
Acked-by: Stephen Warren <swarren@wwwdotorg.org>
CC: Stephen Warren <swarren@wwwdotorg.org>
CC: Tom Warren <twarren.nvidia@gmail.com>
---
 arch/arm/cpu/armv7/tegra2/usb.c |    2 +-
 1 Datei ge?ndert, 1 Zeile hinzugef?gt(+), 1 Zeile entfernt(-)

diff --git a/arch/arm/cpu/armv7/tegra2/usb.c b/arch/arm/cpu/armv7/tegra2/usb.c
index c80de7f..5f2b243 100644
--- a/arch/arm/cpu/armv7/tegra2/usb.c
+++ b/arch/arm/cpu/armv7/tegra2/usb.c
@@ -290,7 +290,7 @@ static int init_usb_controller(struct fdt_usb *config,
 			break;
 		udelay(1);
 	}
-	if (loop_count == 100000)
+	if (!loop_count)
 		return -1;
 
 	return 0;
-- 
1.7.10.2

^ permalink raw reply related	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH 2/2] tegra: usb: fix wrong error check
  2012-05-31 11:51 ` [U-Boot] [PATCH 2/2] tegra: usb: fix wrong error check Lucas Stach
@ 2012-05-31 13:14   ` Marek Vasut
  2012-05-31 17:44   ` Stephen Warren
  1 sibling, 0 replies; 5+ messages in thread
From: Marek Vasut @ 2012-05-31 13:14 UTC (permalink / raw)
  To: u-boot

Dear Lucas Stach,

> loop_count runs down from 10000, so the correct condition to error out
> is ==0.
> 
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
> CC: Stephen Warren <swarren@wwwdotorg.org>
> CC: Tom Warren <twarren.nvidia@gmail.com>
> ---
>  arch/arm/cpu/armv7/tegra2/usb.c |    2 +-
>  1 Datei ge?ndert, 1 Zeile hinzugef?gt(+), 1 Zeile entfernt(-)
> 
> diff --git a/arch/arm/cpu/armv7/tegra2/usb.c
> b/arch/arm/cpu/armv7/tegra2/usb.c index c80de7f..5f2b243 100644
> --- a/arch/arm/cpu/armv7/tegra2/usb.c
> +++ b/arch/arm/cpu/armv7/tegra2/usb.c

Why isn't this file in drivers/usb/ ?

> @@ -290,7 +290,7 @@ static int init_usb_controller(struct fdt_usb *config,
>  			break;
>  		udelay(1);
>  	}
> -	if (loop_count == 100000)
> +	if (!loop_count)
>  		return -1;
> 
>  	return 0;

Best regards,
Marek Vasut

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH 2/2] tegra: usb: fix wrong error check
  2012-05-31 11:51 ` [U-Boot] [PATCH 2/2] tegra: usb: fix wrong error check Lucas Stach
  2012-05-31 13:14   ` Marek Vasut
@ 2012-05-31 17:44   ` Stephen Warren
  1 sibling, 0 replies; 5+ messages in thread
From: Stephen Warren @ 2012-05-31 17:44 UTC (permalink / raw)
  To: u-boot

On 05/31/2012 05:51 AM, Lucas Stach wrote:
> loop_count runs down from 10000, so the correct condition to error out
> is ==0.
> 
> Signed-off-by: Lucas Stach <dev@lynxeye.de>
> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
> CC: Stephen Warren <swarren@wwwdotorg.org>
> CC: Tom Warren <twarren.nvidia@gmail.com>

Tested-by: Stephen Warren <swarren@wwwdotorg.org>

On Harmony, repeated invocations of "usb start 0 ; dhcp ${loadaddr}
zImage.uimg" appeared to work OK, with this patch applied to
u-boot-tegra.git master branch.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* [U-Boot] [PATCH 1/2] tegra: add ULPI on USB2 funcmux entry
       [not found] ` <5FBF8E85CA34454794F0F7ECBA79798F379C416005@HQMAIL04.nvidia.com>
@ 2012-05-31 19:43   ` Lucas Stach
  0 siblings, 0 replies; 5+ messages in thread
From: Lucas Stach @ 2012-05-31 19:43 UTC (permalink / raw)
  To: u-boot

Hi Tom,
Am Donnerstag, den 31.05.2012, 08:47 -0700 schrieb Tom Warren:
> Lucas,
> 
> > -----Original Message-----
> > From: Lucas Stach [mailto:dev at lynxeye.de]
> > Sent: Thursday, May 31, 2012 4:51 AM
> > To: u-boot at lists.denx.de
> > Cc: Stephen Warren; Tom Warren
> > Subject: [PATCH 1/2] tegra: add ULPI on USB2 funcmux entry
> 
> This should be a [PATCH V2 1/2], if you are dropping the RAM size patch from the series (so I can keep track of which patches are the latest and should be applied to u-boot-tegra).  Please see the 'Patches' entry on the U-Boot wiki, specifically 'Sending updated patch versions'.
> 
Yes, I intend to drop the first patch, as my need to support multiple
RAM configurations with a single u-boot image is addressed by your patch
to load the ODMDATA from the BCT.
Though I still dislike this duplication of information between MC config
and ODMDATA, but I think it's a waste of time to argue about this, as it
is way above my head.

Sorry for not properly versioning those two patches, I'll do so in the
future.

Thanks,
Lucas

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-05-31 19:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-05-31 11:51 [U-Boot] [PATCH 1/2] tegra: add ULPI on USB2 funcmux entry Lucas Stach
2012-05-31 11:51 ` [U-Boot] [PATCH 2/2] tegra: usb: fix wrong error check Lucas Stach
2012-05-31 13:14   ` Marek Vasut
2012-05-31 17:44   ` Stephen Warren
     [not found] ` <5FBF8E85CA34454794F0F7ECBA79798F379C416005@HQMAIL04.nvidia.com>
2012-05-31 19:43   ` [U-Boot] [PATCH 1/2] tegra: add ULPI on USB2 funcmux entry Lucas Stach

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox