From patchwork Thu Feb 16 12:03:37 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Amit Virdi X-Patchwork-Id: 141580 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id EFD28B6F62 for ; Thu, 16 Feb 2012 23:04:34 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 064AA28107; Thu, 16 Feb 2012 13:04:30 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id LWs5FTBFHo1F; Thu, 16 Feb 2012 13:04:29 +0100 (CET) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id E4D5F280C2; Thu, 16 Feb 2012 13:04:18 +0100 (CET) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 66EF928094 for ; Thu, 16 Feb 2012 13:04:15 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id usHoeS7ilqtK for ; Thu, 16 Feb 2012 13:04:14 +0100 (CET) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from eu1sys200aog113.obsmtp.com (eu1sys200aog113.obsmtp.com [207.126.144.135]) by theia.denx.de (Postfix) with ESMTPS id 282F7280A6 for ; Thu, 16 Feb 2012 13:04:03 +0100 (CET) Received: from beta.dmz-ap.st.com ([138.198.100.35]) (using TLSv1) by eu1sys200aob113.postini.com ([207.126.147.11]) with SMTP ID DSNKTzzwpqxdsEbQEqCkLRvUkEIxuufk48/J@postini.com; Thu, 16 Feb 2012 12:04:05 UTC Received: from zeta.dmz-ap.st.com (ns6.st.com [138.198.234.13]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 52DA7D5; Thu, 16 Feb 2012 11:55:22 +0000 (GMT) Received: from Webmail-ap.st.com (eapex1hubcas4.st.com [10.80.176.69]) by zeta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 3D2E250E; Thu, 16 Feb 2012 12:03:48 +0000 (GMT) Received: from localhost (10.199.7.86) by Webmail-ap.st.com (10.80.176.7) with Microsoft SMTP Server (TLS) id 8.3.192.1; Thu, 16 Feb 2012 20:03:47 +0800 From: Amit Virdi To: Date: Thu, 16 Feb 2012 17:33:37 +0530 Message-ID: <1329393818-24552-4-git-send-email-amit.virdi@st.com> X-Mailer: git-send-email 1.7.2.2 In-Reply-To: <1329393818-24552-1-git-send-email-amit.virdi@st.com> References: <1329393818-24552-1-git-send-email-amit.virdi@st.com> MIME-Version: 1.0 Cc: armando.visconti@st.com, shiraz.hashim@st.com, Amit Virdi Subject: [U-Boot] [PATCH 3/4] USB:gadget:designware Support high speed X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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); 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) { 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 #define UDC_IN_ENDPOINT 3 #define UDC_OUT_PACKET_SIZE 64 #define UDC_IN_PACKET_SIZE 64