summaryrefslogtreecommitdiff
path: root/board/davinci/dvevm/dvevm.c
diff options
context:
space:
mode:
authorWolfgang Denk <wd@denx.de>2009-01-28 21:09:46 +0100
committerWolfgang Denk <wd@denx.de>2009-01-28 21:09:46 +0100
commit6b7243aa89cdacefe46963dbe11cee0cbf021a49 (patch)
tree529dea142504dc68c22249a3003cca98f4eabdb8 /board/davinci/dvevm/dvevm.c
parentee64d0acc93f4f15850736eafaacdeadd7f12d25 (diff)
parent1a448db77b10153703bc5e4ad13dd55d88beb1d6 (diff)
downloadu-boot-imx-6b7243aa89cdacefe46963dbe11cee0cbf021a49.zip
u-boot-imx-6b7243aa89cdacefe46963dbe11cee0cbf021a49.tar.gz
u-boot-imx-6b7243aa89cdacefe46963dbe11cee0cbf021a49.tar.bz2
Merge branch 'master' of git://git.denx.de/u-boot-usb
Diffstat (limited to 'board/davinci/dvevm/dvevm.c')
-rw-r--r--board/davinci/dvevm/dvevm.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/board/davinci/dvevm/dvevm.c b/board/davinci/dvevm/dvevm.c
index abf60b3..bf36f73 100644
--- a/board/davinci/dvevm/dvevm.c
+++ b/board/davinci/dvevm/dvevm.c
@@ -52,6 +52,7 @@ int board_init(void)
lpsc_on(DAVINCI_LPSC_UART0);
lpsc_on(DAVINCI_LPSC_TIMER1);
lpsc_on(DAVINCI_LPSC_GPIO);
+ lpsc_on(DAVINCI_LPSC_USB);
#if !defined(CONFIG_SYS_USE_DSPLINK)
/* Powerup the DSP */
@@ -101,3 +102,26 @@ int misc_init_r(void)
return(0);
}
+
+#ifdef CONFIG_USB_DAVINCI
+
+/* IO Expander I2C address and USB VBUS enable mask */
+#define IOEXP_I2C_ADDR 0x3A
+#define IOEXP_VBUSEN_MASK 1
+
+/*
+ * This function enables USB VBUS by writting to IO expander using I2C.
+ * Note that the I2C is already initialized at this stage. This
+ * function is used by davinci specific USB wrapper code.
+ */
+void enable_vbus(void)
+{
+ uchar data; /* IO Expander data to enable VBUS */
+
+ /* Write to IO expander to enable VBUS */
+ i2c_read(IOEXP_I2C_ADDR, 0, 0, &data, 1);
+ data &= ~IOEXP_VBUSEN_MASK;
+ i2c_write(IOEXP_I2C_ADDR, 0, 0, &data, 1);
+}
+#endif
+