Skip to contentSkip to conversation

tegra: add ULPI on USB2 funcmux entry

PATCH New Lucas Stach 3 participants 5 messages May 31, 2012 1 message not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 tegra: add ULPI on USB2 funcmux entry

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

---
 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(-)

arch/arm/cpu/armv7/tegra2/funcmux.c +12 -1
index 820ba4e9..455d010 100644
@@ -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);
arch/arm/include/asm/arch-tegra2/funcmux.h +3 -0
index b16c496..3cbc7d2 100644
@@ -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,
 };
 
 /**
Signature · 1 line
1.7.10.2
#1 lore raw

PATCH 2/2 tegra: usb: fix wrong error check

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

---
 arch/arm/cpu/armv7/tegra2/usb.c |    2 +-

1 Datei ge?ndert, 1 Zeile hinzugef?gt(+), 1 Zeile entfernt(-)

arch/arm/cpu/armv7/tegra2/usb.c +1 -1
index c80de7f..5f2b243 100644
@@ -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;
Signature · 1 line
1.7.10.2
#2 lore raw

PATCH 2/2 tegra: usb: fix wrong error check

Dear Lucas Stach,

arch/arm/cpu/armv7/tegra2/usb.c

Quoted 15 lines

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

---
 arch/arm/cpu/armv7/tegra2/usb.c |    2 +-

1 Datei ge?ndert, 1 Zeile hinzugef?gt(+), 1 Zeile entfernt(-)

(quoted diff) +0 -0

b/arch/arm/cpu/armv7/tegra2/usb.c index c80de7f..5f2b243 100644

arch/arm/cpu/armv7/tegra2/usb.c +0 -0

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

arch/arm/cpu/armv7/tegra2/usb.c static int init_usb_controller(struct fdt_usb *config, · line 296

Quoted 9 lines
arch/arm/cpu/armv7/tegra2/usb.c +1 -1
@@ -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

#3 lore raw

PATCH 2/2 tegra: usb: fix wrong error check

In reply to Lucas Stach
Quoted 7 lines · Lucas Stach

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

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.

A message that is not in the archive (sent off-list or not yet received): [email protected]

#5 lore raw

PATCH 1/2 tegra: add ULPI on USB2 funcmux entry

Hi Tom,
Am Donnerstag, den 31.05.2012, 08:47 -0700 schrieb Tom Warren:

Quoted 11 lines

Lucas,

Quoted 6 lines

-----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