public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH v3 2/5] usb : musb : Adding USB VBUS enable functionality for DM644x DVEVM
@ 2009-01-04  4:11 Thomas Abraham
  2009-01-04  4:11 ` [U-Boot] [PATCH v3 3/5] usb : musb : Adding DM6446 (TI DaVinci) platform specific USB support Thomas Abraham
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Abraham @ 2009-01-04  4:11 UTC (permalink / raw)
  To: u-boot

Adding USB VBUS enable functionality for DM644x DVEVM (TI DaVinci)
platform.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Swaminathan S <swami.iyer@ti.com>
Signed-off-by: Thomas Abraham <t-abraham@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 board/davinci/dvevm/dvevm.c |   23 +++++++++++++++++++++++
 1 files changed, 23 insertions(+), 0 deletions(-)

diff --git a/board/davinci/dvevm/dvevm.c b/board/davinci/dvevm/dvevm.c
index abf60b3..5dd081c 100644
--- a/board/davinci/dvevm/dvevm.c
+++ b/board/davinci/dvevm/dvevm.c
@@ -101,3 +101,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
+
-- 
1.5.6

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

* [U-Boot] [PATCH v3 3/5] usb : musb : Adding DM6446 (TI DaVinci) platform specific USB support
@ 2009-01-04  4:11 ` Thomas Abraham
  2009-01-04  4:11   ` [U-Boot] [PATCH v3 4/5] usb : musb : Enabling DM6446 (TI DaVinci) USB module power Thomas Abraham
  2009-01-11  5:41   ` [U-Boot] [PATCH v3 3/5] usb : musb : Adding DM6446 (TI DaVinci) platform specific USB support Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 2 replies; 5+ messages in thread
From: Thomas Abraham @ 2009-01-04  4:11 UTC (permalink / raw)
  To: u-boot

Adding DM6446 (TI DaVinci) platform specific USB functionality for
USB Phy and VBUS initialization.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Swaminathan S <swami.iyer@ti.com>
Signed-off-by: Thomas Abraham <t-abraham@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 drivers/usb/Makefile      |    1 +
 drivers/usb/davinci_usb.c |  106 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/davinci_usb.h |   87 +++++++++++++++++++++++++++++++++++++
 3 files changed, 194 insertions(+), 0 deletions(-)
 create mode 100644 drivers/usb/davinci_usb.c
 create mode 100644 drivers/usb/davinci_usb.h

diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
index 94eea70..3a2706d 100644
--- a/drivers/usb/Makefile
+++ b/drivers/usb/Makefile
@@ -36,6 +36,7 @@ COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
 COBJS-$(CONFIG_USB_SL811HS) += sl811_usb.o
 COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o
 COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
+COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
 
 # device
 ifdef CONFIG_USB_DEVICE
diff --git a/drivers/usb/davinci_usb.c b/drivers/usb/davinci_usb.c
new file mode 100644
index 0000000..e66f660
--- /dev/null
+++ b/drivers/usb/davinci_usb.c
@@ -0,0 +1,106 @@
+/*
+ * TI's Davinci platform specific USB wrapper functions.
+ *
+ * Copyright (c) 2008 Texas Instruments
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * Author: Thomas Abraham t-abraham at ti.com, Texas Instruments
+ */
+
+#include <common.h>
+#include <asm/io.h>
+#include "davinci_usb.h"
+
+/* MUSB platform configuration */
+struct musb_config musb_cfg = {
+	(struct	musb_regs *)MENTOR_USB0_BASE,
+	DAVINCI_USB_TIMEOUT,
+	0
+};
+
+/* MUSB module register overlay */
+struct davinci_usb_regs *dregs;
+
+/*
+ * Enable the USB phy
+ */
+static u8 phy_on(void)
+{
+	u32 timeout;
+
+	/* Wait until the USB phy is turned on */
+	writel(USBPHY_SESNDEN | USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
+	timeout = musb_cfg.timeout;
+	while (timeout--)
+		if (readl(USBPHY_CTL_PADDR) & USBPHY_PHYCLKGD)
+			return 1;
+
+	/* USB phy was not turned on */
+	return 0;
+}
+
+/*
+ * Disable the USB phy
+ */
+static void phy_off(void)
+{
+	/* powerdown the on-chip PHY and its oscillator */
+	writel(USBPHY_OSCPDWN | USBPHY_PHYPDWN, USBPHY_CTL_PADDR);
+}
+
+/*
+ * This function performs Davinci platform specific initialization for usb0.
+ */
+int musb_platform_init(void)
+{
+	u32  revision;
+
+	/* enable USB VBUS */
+	enable_vbus();
+
+	/* start the on-chip USB phy and its pll */
+	if (!phy_on())
+		return -1;
+
+	/* reset the controller */
+	dregs = (struct davinci_usb_regs *)DAVINCI_USB0_BASE;
+	writel(1, &dregs->ctrlr);
+	udelay(5000);
+
+	/* Returns zero if e.g. not clocked */
+	revision = readl(&dregs->version);
+	if (!revision)
+		return -1;
+
+	/* Disable all interrupts */
+	writel(DAVINCI_USB_USBINT_MASK | DAVINCI_USB_RXINT_MASK |
+			DAVINCI_USB_TXINT_MASK , &dregs->intmsksetr);
+	return 0;
+}
+
+/*
+ * This function performs Davinci platform specific deinitialization for usb0.
+ */
+void musb_platform_deinit(void)
+{
+	/* Turn of the phy */
+	phy_off();
+
+	/* flush any interrupts */
+	writel(DAVINCI_USB_USBINT_MASK | DAVINCI_USB_TXINT_MASK |
+			DAVINCI_USB_RXINT_MASK , &dregs->intclrr);
+}
diff --git a/drivers/usb/davinci_usb.h b/drivers/usb/davinci_usb.h
new file mode 100644
index 0000000..d270861
--- /dev/null
+++ b/drivers/usb/davinci_usb.h
@@ -0,0 +1,87 @@
+/*
+ * TI's Davinci platform specific USB wrapper functions.
+ *
+ * Copyright (c) 2008 Texas Instruments
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ *
+ * Author: Thomas Abraham t-abraham at ti.com, Texas Instruments
+ */
+
+#ifndef __DAVINCI_USB_H__
+#define __DAVINCI_USB_H__
+
+#include <asm/arch/hardware.h>
+#include "musb_core.h"
+
+/* Base address of DAVINCI usb0 wrapper */
+#define DAVINCI_USB0_BASE 0x01C64000
+
+/* Base address of DAVINCI musb core */
+#define MENTOR_USB0_BASE (DAVINCI_USB0_BASE+0x400)
+
+/*
+ * Davinci platform USB wrapper register overlay. Note: Only the required
+ * registers are included in this structure. It can be expanded as required.
+ */
+struct davinci_usb_regs {
+	u32	version;
+	u32	ctrlr;
+	u32	reserved[0x20];
+	u32	intclrr;
+	u32 	intmskr;
+	u32 	intmsksetr;
+};
+
+#define DAVINCI_USB_TX_ENDPTS_MASK	0x1f /* ep0 + 4 tx */
+#define DAVINCI_USB_RX_ENDPTS_MASK	0x1e /* 4 rx */
+#define DAVINCI_USB_USBINT_SHIFT	16
+#define DAVINCI_USB_TXINT_SHIFT 	0
+#define DAVINCI_USB_RXINT_SHIFT 	8
+#define DAVINCI_INTR_DRVVBUS		0x0100
+
+#define DAVINCI_USB_USBINT_MASK 	0x01ff0000	/* 8 Mentor, DRVVBUS */
+#define DAVINCI_USB_TXINT_MASK \
+		(DAVINCI_USB_TX_ENDPTS_MASK << DAVINCI_USB_TXINT_SHIFT)
+#define DAVINCI_USB_RXINT_MASK \
+		(DAVINCI_USB_RX_ENDPTS_MASK << DAVINCI_USB_RXINT_SHIFT)
+#define MGC_BUSCTL_OFFSET(_bEnd, _bOffset) \
+		(0x80 + (8*(_bEnd)) + (_bOffset))
+
+/* Integrated highspeed/otg PHY */
+#define USBPHY_CTL_PADDR	(DAVINCI_SYSTEM_MODULE_BASE + 0x34)
+#define USBPHY_PHYCLKGD 	(1 << 8)
+#define USBPHY_SESNDEN		(1 << 7)	/* v(sess_end) comparator */
+#define USBPHY_VBDTCTEN 	(1 << 6)	/* v(bus) comparator */
+#define USBPHY_PHYPLLON 	(1 << 4)	/* override pll suspend */
+#define USBPHY_CLKO1SEL 	(1 << 3)
+#define USBPHY_OSCPDWN		(1 << 2)
+#define USBPHY_PHYPDWN		(1 << 0)
+
+/* Timeout for Davinci USB module */
+#define DAVINCI_USB_TIMEOUT 0x3FFFFFF
+
+/* IO Expander I2C address and VBUS enable mask */
+#define IOEXP_I2C_ADDR 0x3A
+#define IOEXP_VBUSEN_MASK 1
+
+/* extern functions */
+extern void lpsc_on(unsigned int id);
+extern int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len);
+extern int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len);
+extern void enable_vbus(void);
+#endif	/* __DAVINCI_USB_H__ */
+
-- 
1.5.6

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

* [U-Boot] [PATCH v3 4/5] usb : musb : Enabling DM6446 (TI DaVinci) USB module power
@ 2009-01-04  4:11   ` Thomas Abraham
  2009-01-11  5:43     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 1 reply; 5+ messages in thread
From: Thomas Abraham @ 2009-01-04  4:11 UTC (permalink / raw)
  To: u-boot

Enabling DM6446 (TI DaVinci) USB module power and MUSB low-level
controller hook up to USB core layer.

Signed-off-by: Ravi Babu <ravibabu@ti.com>
Signed-off-by: Swaminathan S <swami.iyer@ti.com>
Signed-off-by: Thomas Abraham <t-abraham@ti.com>
Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
---
 board/davinci/dvevm/dvevm.c |    1 +
 include/usb.h               |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/board/davinci/dvevm/dvevm.c b/board/davinci/dvevm/dvevm.c
index 5dd081c..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 */
diff --git a/include/usb.h b/include/usb.h
index b8f2fa2..45bf04b 100644
--- a/include/usb.h
+++ b/include/usb.h
@@ -183,7 +183,7 @@ struct usb_device {
 #if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
 	defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
 	defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
-	defined(CONFIG_USB_R8A66597_HCD)
+	defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI)
 
 int usb_lowlevel_init(void);
 int usb_lowlevel_stop(void);
-- 
1.5.6

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

* [U-Boot] [PATCH v3 3/5] usb : musb : Adding DM6446 (TI DaVinci) platform specific USB support
  2009-01-04  4:11 ` [U-Boot] [PATCH v3 3/5] usb : musb : Adding DM6446 (TI DaVinci) platform specific USB support Thomas Abraham
  2009-01-04  4:11   ` [U-Boot] [PATCH v3 4/5] usb : musb : Enabling DM6446 (TI DaVinci) USB module power Thomas Abraham
@ 2009-01-11  5:41   ` Jean-Christophe PLAGNIOL-VILLARD
  1 sibling, 0 replies; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-01-11  5:41 UTC (permalink / raw)
  To: u-boot

On 09:41 Sun 04 Jan     , Thomas Abraham wrote:
> Adding DM6446 (TI DaVinci) platform specific USB functionality for
> USB Phy and VBUS initialization.
> 
> Signed-off-by: Ravi Babu <ravibabu@ti.com>
> Signed-off-by: Swaminathan S <swami.iyer@ti.com>
> Signed-off-by: Thomas Abraham <t-abraham@ti.com>
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> ---
>  drivers/usb/Makefile      |    1 +
>  drivers/usb/davinci_usb.c |  106 +++++++++++++++++++++++++++++++++++++++++++++
>  drivers/usb/davinci_usb.h |   87 +++++++++++++++++++++++++++++++++++++
>  3 files changed, 194 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/usb/davinci_usb.c
>  create mode 100644 drivers/usb/davinci_usb.h
> 
> diff --git a/drivers/usb/Makefile b/drivers/usb/Makefile
> index 94eea70..3a2706d 100644
> --- a/drivers/usb/Makefile
> +++ b/drivers/usb/Makefile
> @@ -36,6 +36,7 @@ COBJS-$(CONFIG_USB_R8A66597_HCD) += r8a66597-hcd.o
>  COBJS-$(CONFIG_USB_SL811HS) += sl811_usb.o
>  COBJS-$(CONFIG_USB_EHCI_FSL) += usb_ehci_fsl.o
>  COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
> +COBJS-$(CONFIG_USB_DAVINCI) += davinci_usb.o
>  
>  # device
>  ifdef CONFIG_USB_DEVICE
> diff --git a/drivers/usb/davinci_usb.c b/drivers/usb/davinci_usb.c
> new file mode 100644
> index 0000000..e66f660
> --- /dev/null
> +++ b/drivers/usb/davinci_usb.c
> @@ -0,0 +1,106 @@
> +/*
> + * TI's Davinci platform specific USB wrapper functions.
> + *
> + * Copyright (c) 2008 Texas Instruments
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + *
> + * Author: Thomas Abraham t-abraham at ti.com, Texas Instruments
> + */
> +
> +#include <common.h>
> +#include <asm/io.h>
> +#include "davinci_usb.h"
> +
> +/* MUSB platform configuration */
> +struct musb_config musb_cfg = {
> +	(struct	musb_regs *)MENTOR_USB0_BASE,
> +	DAVINCI_USB_TIMEOUT,
> +	0
> +};
> +
> +/* MUSB module register overlay */
> +struct davinci_usb_regs *dregs;
> +
> +/*
> + * Enable the USB phy
> + */
> +static u8 phy_on(void)
> +{
> +	u32 timeout;
> +
> +	/* Wait until the USB phy is turned on */
> +	writel(USBPHY_SESNDEN | USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
> +	timeout = musb_cfg.timeout;
> +	while (timeout--)
> +		if (readl(USBPHY_CTL_PADDR) & USBPHY_PHYCLKGD)
> +			return 1;
> +
> +	/* USB phy was not turned on */
> +	return 0;
> +}
> +
> +/*
> + * Disable the USB phy
> + */
> +static void phy_off(void)
> +{
> +	/* powerdown the on-chip PHY and its oscillator */
> +	writel(USBPHY_OSCPDWN | USBPHY_PHYPDWN, USBPHY_CTL_PADDR);
> +}
> +
> +/*
> + * This function performs Davinci platform specific initialization for usb0.
> + */
> +int musb_platform_init(void)
> +{
> +	u32  revision;
> +
> +	/* enable USB VBUS */
> +	enable_vbus();
> +
> +	/* start the on-chip USB phy and its pll */
> +	if (!phy_on())
> +		return -1;
> +
> +	/* reset the controller */
> +	dregs = (struct davinci_usb_regs *)DAVINCI_USB0_BASE;
> +	writel(1, &dregs->ctrlr);
> +	udelay(5000);
> +
> +	/* Returns zero if e.g. not clocked */
> +	revision = readl(&dregs->version);
> +	if (!revision)
> +		return -1;
> +
> +	/* Disable all interrupts */
> +	writel(DAVINCI_USB_USBINT_MASK | DAVINCI_USB_RXINT_MASK |
> +			DAVINCI_USB_TXINT_MASK , &dregs->intmsksetr);
> +	return 0;
> +}
> +
> +/*
> + * This function performs Davinci platform specific deinitialization for usb0.
> + */
> +void musb_platform_deinit(void)
> +{
> +	/* Turn of the phy */
> +	phy_off();
> +
> +	/* flush any interrupts */
> +	writel(DAVINCI_USB_USBINT_MASK | DAVINCI_USB_TXINT_MASK |
> +			DAVINCI_USB_RXINT_MASK , &dregs->intclrr);
> +}
> diff --git a/drivers/usb/davinci_usb.h b/drivers/usb/davinci_usb.h
> new file mode 100644
> index 0000000..d270861
> --- /dev/null
> +++ b/drivers/usb/davinci_usb.h
> @@ -0,0 +1,87 @@
> +/*
> + * TI's Davinci platform specific USB wrapper functions.
> + *
> + * Copyright (c) 2008 Texas Instruments
> + *
> + * This program is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU General Public License as
> + * published by the Free Software Foundation; either version 2 of
> + * the License, or (at your option) any later version.
> + *
> + * This program is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
> + * GNU General Public License for more details.
> + *
> + * You should have received a copy of the GNU General Public License
> + * along with this program; if not, write to the Free Software
> + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
> + * MA 02111-1307 USA
> + *
> + * Author: Thomas Abraham t-abraham at ti.com, Texas Instruments
> + */
> +
> +#ifndef __DAVINCI_USB_H__
> +#define __DAVINCI_USB_H__
> +
> +#include <asm/arch/hardware.h>
> +#include "musb_core.h"
> +
> +/* Base address of DAVINCI usb0 wrapper */
> +#define DAVINCI_USB0_BASE 0x01C64000
> +
> +/* Base address of DAVINCI musb core */
> +#define MENTOR_USB0_BASE (DAVINCI_USB0_BASE+0x400)
					      ^
please add a space before and after '+'
> +
> +/*
> + * Davinci platform USB wrapper register overlay. Note: Only the required
> + * registers are included in this structure. It can be expanded as required.
> + */
> +struct davinci_usb_regs {
> +	u32	version;
> +	u32	ctrlr;
> +	u32	reserved[0x20];
> +	u32	intclrr;
> +	u32 	intmskr;
	   ^
whitespace please remove
> +	u32 	intmsksetr;
	   ^
whitespace please remove
there is other whitespaces please check
> +};
> +
> +#define DAVINCI_USB_TX_ENDPTS_MASK	0x1f /* ep0 + 4 tx */
> +#define DAVINCI_USB_RX_ENDPTS_MASK	0x1e /* 4 rx */
> +#define DAVINCI_USB_USBINT_SHIFT	16
> +#define DAVINCI_USB_TXINT_SHIFT 	0
> +#define DAVINCI_USB_RXINT_SHIFT 	8
> +#define DAVINCI_INTR_DRVVBUS		0x0100
> +
> +#define DAVINCI_USB_USBINT_MASK 	0x01ff0000	/* 8 Mentor, DRVVBUS */
> +#define DAVINCI_USB_TXINT_MASK \
> +		(DAVINCI_USB_TX_ENDPTS_MASK << DAVINCI_USB_TXINT_SHIFT)
> +#define DAVINCI_USB_RXINT_MASK \
> +		(DAVINCI_USB_RX_ENDPTS_MASK << DAVINCI_USB_RXINT_SHIFT)
> +#define MGC_BUSCTL_OFFSET(_bEnd, _bOffset) \
> +		(0x80 + (8*(_bEnd)) + (_bOffset))
> +
> +/* Integrated highspeed/otg PHY */
> +#define USBPHY_CTL_PADDR	(DAVINCI_SYSTEM_MODULE_BASE + 0x34)
> +#define USBPHY_PHYCLKGD 	(1 << 8)
> +#define USBPHY_SESNDEN		(1 << 7)	/* v(sess_end) comparator */
> +#define USBPHY_VBDTCTEN 	(1 << 6)	/* v(bus) comparator */
> +#define USBPHY_PHYPLLON 	(1 << 4)	/* override pll suspend */
> +#define USBPHY_CLKO1SEL 	(1 << 3)
> +#define USBPHY_OSCPDWN		(1 << 2)
> +#define USBPHY_PHYPDWN		(1 << 0)
> +
> +/* Timeout for Davinci USB module */
> +#define DAVINCI_USB_TIMEOUT 0x3FFFFFF
> +
> +/* IO Expander I2C address and VBUS enable mask */
> +#define IOEXP_I2C_ADDR 0x3A
> +#define IOEXP_VBUSEN_MASK 1
> +
> +/* extern functions */
> +extern void lpsc_on(unsigned int id);
> +extern int i2c_write(uchar chip, uint addr, int alen, uchar *buffer, int len);
> +extern int i2c_read(uchar chip, uint addr, int alen, uchar *buffer, int len);
all ready define in i2c.h

Best Regards,
J.

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

* [U-Boot] [PATCH v3 4/5] usb : musb : Enabling DM6446 (TI DaVinci) USB module power
  2009-01-04  4:11   ` [U-Boot] [PATCH v3 4/5] usb : musb : Enabling DM6446 (TI DaVinci) USB module power Thomas Abraham
@ 2009-01-11  5:43     ` Jean-Christophe PLAGNIOL-VILLARD
  0 siblings, 0 replies; 5+ messages in thread
From: Jean-Christophe PLAGNIOL-VILLARD @ 2009-01-11  5:43 UTC (permalink / raw)
  To: u-boot

On 09:41 Sun 04 Jan     , Thomas Abraham wrote:
> Enabling DM6446 (TI DaVinci) USB module power and MUSB low-level
> controller hook up to USB core layer.
> 
> Signed-off-by: Ravi Babu <ravibabu@ti.com>
> Signed-off-by: Swaminathan S <swami.iyer@ti.com>
> Signed-off-by: Thomas Abraham <t-abraham@ti.com>
> Signed-off-by: Ajay Kumar Gupta <ajay.gupta@ti.com>
> ---
>  board/davinci/dvevm/dvevm.c |    1 +
>  include/usb.h               |    2 +-
>  2 files changed, 2 insertions(+), 1 deletions(-)
> 
> diff --git a/board/davinci/dvevm/dvevm.c b/board/davinci/dvevm/dvevm.c
> index 5dd081c..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 */
> diff --git a/include/usb.h b/include/usb.h
> index b8f2fa2..45bf04b 100644
> --- a/include/usb.h
> +++ b/include/usb.h
> @@ -183,7 +183,7 @@ struct usb_device {
>  #if defined(CONFIG_USB_UHCI) || defined(CONFIG_USB_OHCI) || \
>  	defined(CONFIG_USB_EHCI) || defined(CONFIG_USB_OHCI_NEW) || \
>  	defined(CONFIG_USB_SL811HS) || defined(CONFIG_USB_ISP116X_HCD) || \
> -	defined(CONFIG_USB_R8A66597_HCD)
> +	defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI)
it will be nice to stop to add more and more ifdef and add generic CONFIG

Best Regards,
J.

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

end of thread, other threads:[~2009-01-11  5:43 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-04  4:11 [U-Boot] [PATCH v3 2/5] usb : musb : Adding USB VBUS enable functionality for DM644x DVEVM Thomas Abraham
2009-01-04  4:11 ` [U-Boot] [PATCH v3 3/5] usb : musb : Adding DM6446 (TI DaVinci) platform specific USB support Thomas Abraham
2009-01-04  4:11   ` [U-Boot] [PATCH v3 4/5] usb : musb : Enabling DM6446 (TI DaVinci) USB module power Thomas Abraham
2009-01-11  5:43     ` Jean-Christophe PLAGNIOL-VILLARD
2009-01-11  5:41   ` [U-Boot] [PATCH v3 3/5] usb : musb : Adding DM6446 (TI DaVinci) platform specific USB support Jean-Christophe PLAGNIOL-VILLARD

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