Re: [U-Boot] [PATCH 4/8] OMAP3 Add usb device support

Tom,
From: Tom Rix <Tom.Rix <at> windriver.com> Subject: [PATCH 4/8] OMAP3 Add usb device support Newsgroups: gmane.comp.boot-loaders.u-boot Date: 2009-09-28 16:37:25 GMT (4 weeks, 12 hours and 29 minutes ago) This change adds the usb device support for musb.
Omap3 platform support added at the same level as davinci.
The interface for usbtty to use the musb device support was added.
Verified on omap3 beagle, zoom1 and zoom2.
Signed-off-by: Tom Rix <Tom.Rix <at> windriver.com>
drivers/serial/usbtty.h | 2 + drivers/usb/musb/Makefile | 2 + drivers/usb/musb/musb_core.c | 8 +- drivers/usb/musb/musb_core.h | 40 ++ drivers/usb/musb/musb_debug.h | 205 +++++++++ drivers/usb/musb/musb_udc.c | 963 +++++++++++++++++++++++++++++++++++++++++ drivers/usb/musb/omap3.c | 129 ++++++ drivers/usb/musb/omap3.h | 48 ++ include/usb.h | 3 +- include/usb/musb_udc.h | 54 +++ 10 files changed, 1451 insertions(+), 3 deletions(-) create mode 100644 drivers/usb/musb/musb_debug.h create mode 100644 drivers/usb/musb/musb_udc.c create mode 100644 drivers/usb/musb/omap3.c create mode 100644 drivers/usb/musb/omap3.h create mode 100644 include/usb/musb_udc.h
<snip> .. ..
+int musb_platform_init(void) +{ + int ret = -1;
+ if (platform_needs_initialization) { + u32 stdby;
+ if (twl4030_usb_ulpi_init()) { + serial_printf("ERROR: %s Could not initialize PHY\n", + __PRETTY_FUNCTION__); + goto end; + }
OMAP3EVM uses ISP1504 phy and so twl4030 related init is not required. Can we move this within #ifdef like,
#ifndef CONFIG_OMAP3_EVM + if (twl4030_usb_ulpi_init()) { ... ... #endif
-Ajay
+ otg = (struct omap3_otg_regs *)OMAP3_OTG_BASE;
+ /* Set OTG to always be on */ + writel(OMAP3_OTG_SYSCONFIG_NO_STANDBY_MODE | + OMAP3_OTG_SYSCONFIG_NO_IDLE_MODE, &otg->sysconfig);
+ /* Set the interface */ + writel(OMAP3_OTG_INTERFSEL_OMAP, &otg->interfsel);
+ /* Clear force standby */ + stdby = readl(&otg->forcestdby); + stdby &= ~OMAP3_OTG_FORCESTDBY_STANDBY; + writel(stdby, &otg->forcestdby);
+ platform_needs_initialization = 0; + }
+ ret = platform_needs_initialization; +end: + return ret;
+}
+/* UDC level routines */ +void udc_irq(void); +void udc_set_nak(int ep_num); +void udc_unset_nak(int ep_num); +int udc_endpoint_write(struct usb_endpoint_instance *endpoint); +void udc_setup_ep(struct usb_device_instance *device, unsigned int id, + struct usb_endpoint_instance *endpoint); +void udc_connect(void); +void udc_disconnect(void); +void udc_enable(struct usb_device_instance *device); +void udc_disable(void); +void udc_startup_events(struct usb_device_instance *device); +int udc_init(void);
+/* usbtty */ +#ifdef CONFIG_USB_TTY
+#define EP0_MAX_PACKET_SIZE 64 /* MUSB_EP0_FIFOSIZE */ +#define UDC_INT_ENDPOINT 1 +#define UDC_INT_PACKET_SIZE 64 +#define UDC_OUT_ENDPOINT 2 +#define UDC_OUT_PACKET_SIZE 64 +#define UDC_IN_ENDPOINT 3 +#define UDC_IN_PACKET_SIZE 64 +#define UDC_BULK_PACKET_SIZE 64
+#endif /* CONFIG_USB_TTY */
+#endif /* __MUSB_UDC_H__ */
-- 1.6.0.6

Gupta, Ajay Kumar wrote:
Tom,
From: Tom Rix <Tom.Rix <at> windriver.com> Subject: [PATCH 4/8] OMAP3 Add usb device support Newsgroups: gmane.comp.boot-loaders.u-boot Date: 2009-09-28 16:37:25 GMT (4 weeks, 12 hours and 29 minutes ago) This change adds the usb device support for musb.
Omap3 platform support added at the same level as davinci.
The interface for usbtty to use the musb device support was added.
Verified on omap3 beagle, zoom1 and zoom2.
Signed-off-by: Tom Rix <Tom.Rix <at> windriver.com>
drivers/serial/usbtty.h | 2 + drivers/usb/musb/Makefile | 2 + drivers/usb/musb/musb_core.c | 8 +- drivers/usb/musb/musb_core.h | 40 ++ drivers/usb/musb/musb_debug.h | 205 +++++++++ drivers/usb/musb/musb_udc.c | 963 +++++++++++++++++++++++++++++++++++++++++ drivers/usb/musb/omap3.c | 129 ++++++ drivers/usb/musb/omap3.h | 48 ++ include/usb.h | 3 +- include/usb/musb_udc.h | 54 +++ 10 files changed, 1451 insertions(+), 3 deletions(-) create mode 100644 drivers/usb/musb/musb_debug.h create mode 100644 drivers/usb/musb/musb_udc.c create mode 100644 drivers/usb/musb/omap3.c create mode 100644 drivers/usb/musb/omap3.h create mode 100644 include/usb/musb_udc.h
<snip> .. ..
+int musb_platform_init(void) +{
int ret = -1;
if (platform_needs_initialization) {
u32 stdby;
if (twl4030_usb_ulpi_init()) {
serial_printf("ERROR: %s Could not initialize
PHY\n",
__PRETTY_FUNCTION__);
goto end;
}
OMAP3EVM uses ISP1504 phy and so twl4030 related init is not required. Can we move this within #ifdef like,
#ifndef CONFIG_OMAP3_EVM
if (twl4030_usb_ulpi_init()) {
... ... #endif
-Ajay
I will include this in the next revision. Will the omap3_evm need to add its own PHY initialization code ?

Tom,
OMAP3EVM uses ISP1504 phy and so twl4030 related init is not required. Can we move this within #ifdef like,
#ifndef CONFIG_OMAP3_EVM
if (twl4030_usb_ulpi_init()) {
... ... #endif
-Ajay
I will include this in the next revision.
Thanks.
Will the omap3_evm need to add its own PHY initialization code ?
omap3_evm doesn't need any phy initialization code. In kernel driver also it uses nop (no-operation) transceiver.
-Ajay
participants (2)
-
Gupta, Ajay Kumar
-
Tom