Skip to contentSkip to conversation

musb: Add host support for DM365 EVM

PATCH New Remy Bohmer 2 participants 2 messages Jan 27, 2010 1 message not in the archive

lore
Share & tools
lore

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

#1 lore raw

PATCH v2 1/1 musb: Add host support for DM365 EVM

Hi Prathap,

Please post patch updates to an existing list in the future. That would increase response times... ;-)
But nevertheless: Applied to u-boot-usb

Thanks.

Remy

2010/1/11 Prathap Srinivas <[email protected]>:

Quoted 126 lines

Add support for musb host on DM365 EVM.

---
Changes from v1:
? ? ? ?- fixed review comments from Remy.

?drivers/usb/musb/davinci.c ? ? ? ? | ? 21 ++++++++++++++++++-
?drivers/usb/musb/davinci.h ? ? ? ? | ? ?1 +
?include/configs/davinci_dm365evm.h | ? 38 ++++++++++++++++++++++++++++++++++++

?3 files changed, 58 insertions(+), 2 deletions(-)

drivers/usb/musb/davinci.c +0 -0
index a7648fc..8fbadc9 100644
@@ -24,6 +24,7 @@

?#include <common.h>
?#include <asm/io.h>
?#include "davinci.h"
+#include <asm/arch/hardware.h>

?/* MUSB platform configuration */
?struct musb_config musb_cfg = {

drivers/usb/musb/davinci.c +3 -1
@@ -41,10 +42,25 @@ struct davinci_usb_regs *dregs;
 ?static u8 phy_on(void)
 ?{
 ? ? ? ?u32 timeout;
-
+#ifdef DAVINCI_DM365EVM
+ ? ? ? u32 val;
+#endif

? ? ? ?/* Wait until the USB phy is turned on */

drivers/usb/musb/davinci.c +4 -0
+#ifdef DAVINCI_DM365EVM
+ ? ? ? writel(USBPHY_PHY24MHZ | USBPHY_SESNDEN |
+ ? ? ? ? ? ? ? ? ? ? ? USBPHY_VBDTCTEN, USBPHY_CTL_PADDR);
+#else

? ? ? ?writel(USBPHY_SESNDEN | USBPHY_VBDTCTEN, USBPHY_CTL_PADDR); +#endif
? ? ? ?timeout = musb_cfg.timeout;

drivers/usb/musb/davinci.c +8 -0
+
+#ifdef DAVINCI_DM365EVM
+ ? ? ? /* Set the ownership of GIO33 to USB */
+ ? ? ? val = readl(PINMUX4);
+ ? ? ? val &= ~(PINMUX4_USBDRVBUS_BITCLEAR);
+ ? ? ? val |= PINMUX4_USBDRVBUS_BITSET;
+ ? ? ? writel(val, PINMUX4);
+#endif

? ? ? ?while (timeout--)
? ? ? ? ? ? ? ?if (readl(USBPHY_CTL_PADDR) & USBPHY_PHYCLKGD) ? ? ? ? ? ? ? ? ? ? ? ?return 1;

drivers/usb/musb/davinci.c +0 -0
@@ -70,8 +86,9 @@ int musb_platform_init(void)
 ? ? ? ?u32 ?revision;
 

? ? ? ?/* enable USB VBUS */
+#ifndef DAVINCI_DM365EVM
? ? ? ?enable_vbus();

drivers/usb/musb/davinci.c +1 -1
-
+#endif

? ? ? ?/* start the on-chip USB phy and its pll */ ? ? ? ?if (!phy_on())
? ? ? ? ? ? ? ?return -1;

drivers/usb/musb/davinci.h +0 -0
index f6751bf..e0829d6 100644
@@ -63,6 +63,7 @@ struct davinci_usb_regs {
 

?/* Integrated highspeed/otg PHY */
?#define USBPHY_CTL_PADDR ? ? ? (DAVINCI_SYSTEM_MODULE_BASE + 0x34) +#define USBPHY_PHY24MHZ ? ? ? ?(1 << 13)
?#define USBPHY_PHYCLKGD ? ? ? ?(1 << 8)
?#define USBPHY_SESNDEN ? ? ? ? (1 << 7) ? ? ? ?/* v(sess_end) comparator */ ?#define USBPHY_VBDTCTEN ? ? ? ?(1 << 6) ? ? ? ?/* v(bus) comparator */

include/configs/davinci_dm365evm.h +0 -0
index c01426b..0828676 100644
@@ -86,6 +86,44 @@

?#define CONFIG_SYS_MAX_NAND_DEVICE ? ? 1
?#define CONFIG_SYS_NAND_MAX_CHIPS ? ? ?2

include/configs/davinci_dm365evm.h +38 -0
+#define PINMUX4_USBDRVBUS_BITCLEAR ? ? ? 0x3000
+#define PINMUX4_USBDRVBUS_BITSET ? ? ? ? 0x2000
+
+/* USB Configuration */
+#define CONFIG_USB_DAVINCI
+#define CONFIG_MUSB_HCD
+
+#ifdef CONFIG_USB_DAVINCI
+#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
+#define CONFIG_USB_DEVICE ? ? ? ? ? ? ?1
+#define CONFIG_USB_TTY ? ? ? ? ? ? ? ? 1
+#define CONFIG_SYS_CONSOLE_IS_IN_ENV ? 1
+#define CONFIG_USBD_VENDORID ? ? ? ? ? 0x0451
+#define CONFIG_USBD_PRODUCTID ? ? ? ? ?0x5678
+#define CONFIG_USBD_MANUFACTURER ? ? ? "Texas Instruments"
+#define CONFIG_USBD_PRODUCT_NAME ? ? ? "DM365VM"
+#endif /* CONFIG_MUSB_UDC */
+

?/* U-Boot command configuration */
?#include <config_cmd_default.h>

--
1.6.2.4

#2 lore raw

PATCH v2 1/1 musb: Add host support for DM365 EVM

Dear Remy Bohmer,

Quoted 4 lines · In message <[email protected]> you…

Hi Prathap,

Please post patch updates to an existing list in the future. That would increase response times... ;-)

increase or reduce? ;-)

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
How does a project get to be a year late?      ... One day at a time.