Skip to contentSkip to conversation

DA8xx: USB support

PATCH Superseded Ajay Kumar Gupta 1 participant 5 messages Nov 15, 2009

Subsystems (2)

v5 of 7 Superseded Latest is v7 →

lore
Share & tools
lore
#0 lore raw

v5 cover DA8xx: USB support

Hi,

These patch set have been created against uboot-ti/master branch.

Fixed missing '&' in [PATCH 3/4] from previous version.

I didn't modify the alignment in include/usb.h as Nick suggested, would wait for Remy Bohmer's comment on this.

Regards,
Ajay

Ajay Kumar Gupta (4):
DA830: Add pinmux for USB0_DRVVBUS
DA8xx: Add GPIO register definitions
DA8xx: Add MUSB host support
DA830: Add usb config

 board/davinci/da830evm/da830evm.c        |    8 ++
 drivers/usb/musb/Makefile                |    1 +
 drivers/usb/musb/da8xx.c                 |  139 ++++++++++++++++++++++++++++++
 drivers/usb/musb/da8xx.h                 |  103 ++++++++++++++++++++++
 include/asm-arm/arch-davinci/gpio_defs.h |   14 +++
 include/configs/da830evm.h               |   38 +++++++-
 include/usb.h                            |    3 +-
 7 files changed, 300 insertions(+), 6 deletions(-)
 create mode 100644 drivers/usb/musb/da8xx.c
 create mode 100644 drivers/usb/musb/da8xx.h
#1 lore raw

PATCH v5 1/4 DA830: Add pinmux for USB0_DRVVBUS

USB0_DRVVBUS pinmux configuration is required for USB functinality in uboot.

---
 board/davinci/da830evm/da830evm.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
board/davinci/da830evm/da830evm.c +8 -0
index bb8cc3c..7cf6013 100644
@@ -65,6 +65,11 @@ const struct pinmux_config i2c_pins[] = {
 	{ pinmux[9], 2, 4 }
 };
 
+/* USB0_DRVVBUS pin muxer settings */
+const struct pinmux_config usb_pins[] = {
+	{ pinmux[9], 1, 1 }
+};
+
 int board_init(void)
 {
 #ifndef CONFIG_USE_IRQ
@@ -118,6 +123,9 @@ int board_init(void)
 	if (davinci_configure_pin_mux(i2c_pins, ARRAY_SIZE(i2c_pins)) != 0)
 		return 1;
 
+	if (davinci_configure_pin_mux(usb_pins, ARRAY_SIZE(usb_pins)) != 0)
+		return 1;
+
 	/* enable the console UART */
 	writel((DAVINCI_UART_PWREMU_MGMT_FREE | DAVINCI_UART_PWREMU_MGMT_URRST |
 		DAVINCI_UART_PWREMU_MGMT_UTRST),
Signature · 1 line
1.6.2.4
#2 lore raw

PATCH v5 2/4 DA8xx: Add GPIO register definitions

Added DA8xx GPIO base addresses in gpio_defs.h and pointers to different BANKs which can be used to program GPIOs.

---
 include/asm-arm/arch-davinci/gpio_defs.h |   14 ++++++++++++++
 1 files changed, 14 insertions(+), 0 deletions(-)
include/asm-arm/arch-davinci/gpio_defs.h +14 -0
index ff62976..1be2ac2 100644
@@ -22,12 +22,21 @@
 #ifndef _GPIO_DEFS_H_
 #define _GPIO_DEFS_H_
 
+#ifndef CONFIG_SOC_DA8XX
 #define DAVINCI_GPIO_BINTEN	0x01C67008
 #define DAVINCI_GPIO_BANK01	0x01C67010
 #define DAVINCI_GPIO_BANK23	0x01C67038
 #define DAVINCI_GPIO_BANK45	0x01C67060
 #define DAVINCI_GPIO_BANK67	0x01C67088
 
+#else /* CONFIG_SOC_DA8XX */
+#define DAVINCI_GPIO_BINTEN	0x01E26008
+#define DAVINCI_GPIO_BANK01	0x01E26010
+#define DAVINCI_GPIO_BANK23	0x01E26038
+#define DAVINCI_GPIO_BANK45	0x01E26060
+#define DAVINCI_GPIO_BANK67	0x01E26088
+#endif /* CONFIG_SOC_DA8XX */
+
 struct davinci_gpio {
 	unsigned int dir;
 	unsigned int out_data;
@@ -49,4 +58,9 @@ struct davinci_gpio_bank {
 	unsigned long base;
 };
 
+#define davinci_gpio_bank01 ((struct davinci_gpio *)DAVINCI_GPIO_BANK01)
+#define davinci_gpio_bank23 ((struct davinci_gpio *)DAVINCI_GPIO_BANK23)
+#define davinci_gpio_bank45 ((struct davinci_gpio *)DAVINCI_GPIO_BANK45)
+#define davinci_gpio_bank67 ((struct davinci_gpio *)DAVINCI_GPIO_BANK67)
+
 #endif
Signature · 1 line
1.6.2.4
#3 lore raw

PATCH v5 3/4 DA8xx: Add MUSB host support

Tested USB host functionality on DA830 EVM.

---
 drivers/usb/musb/Makefile |    1 +
 drivers/usb/musb/da8xx.c  |  139 +++++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/musb/da8xx.h  |  103 +++++++++++++++++++++++++++++++++
 include/usb.h             |    3 +-
 4 files changed, 245 insertions(+), 1 deletions(-)
 create mode 100644 drivers/usb/musb/da8xx.c
 create mode 100644 drivers/usb/musb/da8xx.h
drivers/usb/musb/Makefile +1 -0
index 09e0a5f..eb4d8fd 100644
@@ -27,6 +27,7 @@ LIB	:= $(obj)libusb_musb.a
 
 COBJS-$(CONFIG_MUSB_HCD) += musb_hcd.o musb_core.o
 COBJS-$(CONFIG_USB_DAVINCI) += davinci.o
+COBJS-$(CONFIG_USB_DA8XX) += da8xx.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
drivers/usb/musb/da8xx.c new file +139 -0

139 lines not on this page · raw message

drivers/usb/musb/da8xx.h new file +103 -0

103 lines not on this page · raw message

include/usb.h +2 -1
index 7c47098..7c56ace 100644
@@ -183,7 +183,8 @@ 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_DAVINCI)
+	defined(CONFIG_USB_R8A66597_HCD) || defined(CONFIG_USB_DAVINCI) || \
+	defined(CONFIG_USB_DA8XX)
 
 int usb_lowlevel_init(void);
 int usb_lowlevel_stop(void);
Signature · 1 line
1.6.2.4
#4 lore raw

PATCH v5 4/4 DA830: Add usb config

Adding USB configuration. Default is set for USB MSC host.

---
 include/configs/da830evm.h |   38 +++++++++++++++++++++++++++++++++-----
 1 files changed, 33 insertions(+), 5 deletions(-)
include/configs/da830evm.h +33 -5
index 38e2ce1..432cd57 100644
@@ -149,6 +149,11 @@
 #define CONFIG_SYS_ENV_SPI_MAX_HZ	CONFIG_SF_DEFAULT_SPEED
 #endif
 
+/*
+ * USB configuration
+ */
+#define CONFIG_USB_DA8XX	/* Platform hookup to MUSB controller */
+#define CONFIG_MUSB_HCD
 
 /*
  * U-Boot general configuration
@@ -234,10 +239,33 @@
 #endif
 
 #ifdef CONFIG_USB_DA8XX
-#define CONFIG_CMD_USB		/* include support for usb	*/
-#define CONFIG_CMD_STORAGE	/* include support for usb	*/
-#define CONFIG_CMD_FAT		/* include support for FAT/storage*/
-#define CONFIG_DOS_PARTITION	/* include support for FAT/storage*/
-#endif
 
+#ifdef CONFIG_MUSB_HCD		/* include support for usb host */
+#define CONFIG_CMD_USB		/* include support for usb cmd */
+
+#define CONFIG_USB_STORAGE	/* MSC class support */
+#define CONFIG_CMD_STORAGE	/* inclue support for usb-storage cmd */
+#define CONFIG_CMD_FAT		/* inclue support for FAT/storage */
+#define CONFIG_DOS_PARTITION	/* inclue support for FAT/storage */
+
+#ifdef CONFIG_USB_KEYBOARD	/* HID class support */
+#define CONFIG_SYS_USB_EVENT_POLL
+#define CONFIG_PREBOOT "usb start"
+#endif /* CONFIG_USB_KEYBOARD */
+
+#endif /* CONFIG_MUSB_HCD */
+
+#ifdef CONFIG_MUSB_UDC
+/* USB device configuration */
+#define CONFIG_USB_DEVICE		1
+#define CONFIG_USB_TTY			1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV	1
+/* Change these to suit your needs */
+#define CONFIG_USBD_VENDORID		0x0451
+#define CONFIG_USBD_PRODUCTID		0x5678
+#define CONFIG_USBD_MANUFACTURER	"Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME	"DA830EVM"
+#endif /* CONFIG_MUSB_UDC */
+
+#endif /* CONFIG_USB_DA8XX */
 #endif /* __CONFIG_H */
Signature · 1 line
1.6.2.4