From patchwork Mon Sep 29 00:36:56 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eric Nelson X-Patchwork-Id: 394228 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 920AD1400F1 for ; Mon, 29 Sep 2014 10:37:17 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6E181A742F; Mon, 29 Sep 2014 02:37:13 +0200 (CEST) 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 XGFO7T1ffW+J; Mon, 29 Sep 2014 02:37:13 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B8AC5A741A; Mon, 29 Sep 2014 02:37:12 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EEF1DA741A for ; Mon, 29 Sep 2014 02:37:08 +0200 (CEST) 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 PZhsEZ5Bpnbn for ; Mon, 29 Sep 2014 02:37:08 +0200 (CEST) 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 mail-pa0-f44.google.com (mail-pa0-f44.google.com [209.85.220.44]) by theia.denx.de (Postfix) with ESMTPS id 88DBAA7408 for ; Mon, 29 Sep 2014 02:37:04 +0200 (CEST) Received: by mail-pa0-f44.google.com with SMTP id et14so1596526pad.17 for ; Sun, 28 Sep 2014 17:37:02 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wqN2gSWcBlV8h8U9LWJCdheXqYyPCUi/wcXpgCw3qYo=; b=fiO87+YmMz3BElkKAPgR1GsFIYF2suMtZmy2RiH0DJ5/VoIXodfxrdrtZARspPX0oF jxSA3d8Os5iKijBVe/+Ws9zVjY3juCE/CGvgjAeRnt2f9EQK4JtGgiiLemyA3L+fQGGS zI/eqkWngPMvpc2dVNIoNaw2++9ByzHZUgTZ7PzcKoEkVH8gXF/8IuHdR5zpzk8MtcAv Q5J05iAfytMV4m7ouVBX9v1YSp3uwZeR5ejohUY7sxoeQL/UBRnilgpzAs2qzaWNIXab PYsdlRjsoaqsUCBc0O3ztuQFxgOFXxTRva36pKEyniOxA6qGzm/935nnaAIe8rbHGa82 vJRQ== X-Gm-Message-State: ALoCoQnPZTVFFmOqC6Kwh0Qn7zKU83XSiGPyX9w2vkm4GXXAh6XbtNZRTZPTzEuPjrxI6/2KSEBD X-Received: by 10.70.96.143 with SMTP id ds15mr5374708pdb.123.1411951022528; Sun, 28 Sep 2014 17:37:02 -0700 (PDT) Received: from localhost.localdomain (ip98-165-98-97.ph.ph.cox.net. [98.165.98.97]) by mx.google.com with ESMTPSA id c9sm10651861pdn.81.2014.09.28.17.37.00 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 28 Sep 2014 17:37:01 -0700 (PDT) From: Eric Nelson To: u-boot@lists.denx.de Date: Sun, 28 Sep 2014 17:36:56 -0700 Message-Id: <1411951016-16330-1-git-send-email-eric.nelson@boundarydevices.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1411931555-15826-1-git-send-email-eric.nelson@boundarydevices.com> References: <1411931555-15826-1-git-send-email-eric.nelson@boundarydevices.com> Cc: marex@denx.de, swarren@nvidia.com Subject: [U-Boot] [PATCH V2] usb: ci_udc: respect CONFIG_USB_GADGET_DUALSPEED X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.13 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de Force full-speed (12 Mbit/s) operation if CONFIG_USB_GADGET_DUALSPEED is not defined. The controller is capable of high-speed (480 Mbit/s) operation, but some designs may require the use of lower-speed operation. Signed-off-by: Eric Nelson --- drivers/usb/gadget/ci_udc.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/usb/gadget/ci_udc.c b/drivers/usb/gadget/ci_udc.c index 2572b34..dbbeff7 100644 --- a/drivers/usb/gadget/ci_udc.c +++ b/drivers/usb/gadget/ci_udc.c @@ -766,6 +766,7 @@ void udc_disconnect(void) static int ci_pullup(struct usb_gadget *gadget, int is_on) { + u32 regval; struct ci_udc *udc = (struct ci_udc *)controller.ctrl->hcor; if (is_on) { /* RESET */ @@ -777,6 +778,11 @@ static int ci_pullup(struct usb_gadget *gadget, int is_on) /* select DEVICE mode */ writel(USBMODE_DEVICE, &udc->usbmode); +#if !defined(CONFIG_USB_GADGET_DUALSPEED) && defined(CONFIG_MX6) + /* Port force Full-Speed Connect */ + setbits_le32(&udc->portsc, PFSC); +#endif + writel(0xffffffff, &udc->epflush); /* Turn on the USB connection by enabling the pullup resistor */