From mboxrd@z Thu Jan 1 00:00:00 1970 From: Amit Virdi Date: Tue, 6 Mar 2012 11:14:37 +0530 Subject: [U-Boot] [PATCH 3/4] USB:gadget:designware Support high speed In-Reply-To: <201203051915.36384.marex@denx.de> References: <1329393818-24552-1-git-send-email-amit.virdi@st.com> <1329393818-24552-4-git-send-email-amit.virdi@st.com> <201203051915.36384.marex@denx.de> Message-ID: <4F55A445.9070903@st.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Marek, On 3/5/2012 11:45 PM, Marek Vasut wrote: > Dear Amit Virdi, > >> From: Vipin KUMAR >> >> This patch adds the support for usb device high speed for designware >> peripheral. >> >> Signed-off-by: Vipin Kumar >> Signed-off-by: Amit Virdi >> --- >> drivers/usb/gadget/designware_udc.c | 13 +++++++++---- >> include/usb/designware_udc.h | 3 +++ >> 2 files changed, 12 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/usb/gadget/designware_udc.c >> b/drivers/usb/gadget/designware_udc.c index 3c20f3d..d4b53a2 100644 >> --- a/drivers/usb/gadget/designware_udc.c >> +++ b/drivers/usb/gadget/designware_udc.c >> @@ -566,7 +566,7 @@ int udc_init(void) >> writel(~0x0,&udc_regs_p->dev_int_mask); >> writel(~0x0,&udc_regs_p->endp_int_mask); >> >> - writel(DEV_CONF_FS_SPEED | DEV_CONF_REMWAKEUP | DEV_CONF_SELFPOW | >> + writel(DEV_CONF_HS_SPEED | DEV_CONF_REMWAKEUP | DEV_CONF_SELFPOW | >> DEV_CONF_PHYINT_16,&udc_regs_p->dev_conf); > > Won't this break anything? You're right. Perhaps, it's better to configure FS only if the FS is configured. I'll amend this part. >> >> writel(DEV_CNTL_SOFTDISCONNECT,&udc_regs_p->dev_cntl); >> @@ -577,6 +577,11 @@ int udc_init(void) >> return 0; >> } >> >> +int is_usbd_high_speed(void) >> +{ >> + return (readl(&udc_regs_p->dev_stat)& DEV_STAT_ENUM) ? 0 : 1; >> +} >> + >> /* >> * udc_setup_ep - setup endpoint >> * Associate a physical endpoint with endpoint_instance >> @@ -792,7 +797,7 @@ void udc_startup_events(struct usb_device_instance >> *device) /* >> * Plug detection interrupt handling >> */ >> -void dw_udc_plug_irq(void) >> +static void dw_udc_plug_irq(void) > > This staticisation stuff should go in a separate patch please. > Ok. >> { >> if (readl(&plug_regs_p->plug_state)& PLUG_STATUS_ATTACHED) { >> /* >> @@ -816,7 +821,7 @@ void dw_udc_plug_irq(void) >> /* >> * Device interrupt handling >> */ >> -void dw_udc_dev_irq(void) >> +static void dw_udc_dev_irq(void) >> { >> if (readl(&udc_regs_p->dev_int)& DEV_INT_USBRESET) { >> writel(~0x0,&udc_regs_p->endp_int_mask); >> @@ -886,7 +891,7 @@ void dw_udc_dev_irq(void) >> /* >> * Endpoint interrupt handling >> */ >> -void dw_udc_endpoint_irq(void) >> +static void dw_udc_endpoint_irq(void) >> { >> while (readl(&udc_regs_p->endp_int)& ENDP0_INT_CTRLOUT) { >> >> diff --git a/include/usb/designware_udc.h b/include/usb/designware_udc.h >> index ae98e8c..8d48ae9 100644 >> --- a/include/usb/designware_udc.h >> +++ b/include/usb/designware_udc.h >> @@ -197,6 +197,9 @@ struct udcfifo_regs { >> #define UDC_INT_PACKET_SIZE 64 >> #define UDC_OUT_ENDPOINT 2 >> #define UDC_BULK_PACKET_SIZE 64 >> +#if defined(CONFIG_USBD_HS) >> +#define UDC_BULK_HS_PACKET_SIZE 512 >> +#endif > > You can define this without the ifdef > Ok. >> #define UDC_IN_ENDPOINT 3 >> #define UDC_OUT_PACKET_SIZE 64 >> #define UDC_IN_PACKET_SIZE 64 > Thanks for reviewing. Best Regards Amit Virdi