[U-Boot] [PATCH] TWL4030/BeagleBoard: Added hub power enable

Jason Kridner jkridner at beagleboard.org
Thu Apr 21 01:52:52 CEST 2011


This is an attempt to get the EHCI port working on the BeagleBoard-xM,
but it is not working for me.  It hangs when I do 'usb start'.

Signed-off-by: Jason Kridner <jkridner at beagleboard.org>
---
 board/ti/beagle/beagle.c   |   15 +++++++++++++++
 drivers/misc/twl4030_led.c |    6 +++++-
 include/twl4030.h          |    1 +
 3 files changed, 21 insertions(+), 1 deletions(-)

diff --git a/board/ti/beagle/beagle.c b/board/ti/beagle/beagle.c
index 69fe162..4a778b8 100644
--- a/board/ti/beagle/beagle.c
+++ b/board/ti/beagle/beagle.c
@@ -400,6 +400,21 @@ int ehci_hcd_init(void)
 {
 	pr_debug("Initializing OMAP3 ECHI\n");
 
+	/* Enable power to the USB hub */
+	switch (get_board_revision()) {
+	case REVISION_XM_A:
+	case REVISION_XM_B:
+		twl4030_led_set(TWL4030_LED_LEDEN_LEDAON | TWL4030_LED_LEDEN_LEDBON);
+		break;
+	case REVISION_AXBX:
+	case REVISION_CX:
+	case REVISION_C4:
+	case REVISION_XM_C:
+	default:
+		twl4030_led_set(TWL4030_LED_LEDEN_LEDBON);
+		break;
+	}
+
 	/* Put the PHY in RESET */
 	omap_request_gpio(GPIO_PHY_RESET);
 	omap_set_gpio_direction(GPIO_PHY_RESET, 0);
diff --git a/drivers/misc/twl4030_led.c b/drivers/misc/twl4030_led.c
index 33cea11..8a02e8b 100644
--- a/drivers/misc/twl4030_led.c
+++ b/drivers/misc/twl4030_led.c
@@ -42,7 +42,11 @@ void twl4030_led_init(unsigned char ledon_mask)
 	if (ledon_mask & TWL4030_LED_LEDEN_LEDBON)
 		ledon_mask |= TWL4030_LED_LEDEN_LEDBPWM;
 
+	twl4030_led_set(ledon_mask);
+}
+
+void twl4030_led_set(unsigned char ledon_mask)
+{
 	twl4030_i2c_write_u8(TWL4030_CHIP_LED, ledon_mask,
 			     TWL4030_LED_LEDEN);
-
 }
diff --git a/include/twl4030.h b/include/twl4030.h
index 930c285..60d6d2b 100644
--- a/include/twl4030.h
+++ b/include/twl4030.h
@@ -523,6 +523,7 @@ void twl4030_power_mmc_init(void);
  * LED
  */
 void twl4030_led_init(unsigned char ledon_mask);
+void twl4030_led_set(unsigned char ledon_mask);
 
 /*
  * USB
-- 
1.5.6.4



More information about the U-Boot mailing list