From patchwork Tue May 14 02:29:38 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kuo-Jung Su X-Patchwork-Id: 243564 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 7CB2B2C00A3 for ; Tue, 14 May 2013 12:28:47 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 0E37A4A054; Tue, 14 May 2013 04:28:40 +0200 (CEST) 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 WTK01ntR0jin; Tue, 14 May 2013 04:28:39 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 749B14A094; Tue, 14 May 2013 04:28:24 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id B94BF4A052 for ; Tue, 14 May 2013 04:28:15 +0200 (CEST) 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 HvFBNgl373N4 for ; Tue, 14 May 2013 04:28:07 +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-pb0-f51.google.com (mail-pb0-f51.google.com [209.85.160.51]) by theia.denx.de (Postfix) with ESMTPS id 150214A030 for ; Tue, 14 May 2013 04:27:56 +0200 (CEST) Received: by mail-pb0-f51.google.com with SMTP id wy7so8734pbc.10 for ; Mon, 13 May 2013 19:27:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references:in-reply-to:references; bh=yOa22PRT4HyuuJZ7G1GcF24+HW9jFDw31sIAUNf7Y3A=; b=jmV4/cngkbC+grSNTyYPKOqTsW9eryrgkl+4mAZ+N6R4DmLdDuKsCl77Erd6fZFxuP innpqiBD9TDlgEtDPs1cFF0cELYFZPHlMHV4Ntt7wMp1DkHNb+rzs0rDKysg3wtUzzOX hQ+dYGu5GE//uzJyHLrR2Nyjs/B2szokBkb/Cn9OIJ+cpfAy69bdbUGIGZXfAo90oBIb FAB9VaSQrvjZ2jIxbUyCBJJmv/4Q7jDNU2rnyYPRoVVn4jlHGxvUnYNfr0zwV39ibALD 4NVsK9zxRl9ihRJIusqm1fawSxLPQPHaweWKb/f3s9onSyKSc48swT1o4eIJtPCLgYol Ryqw== X-Received: by 10.66.146.74 with SMTP id ta10mr32072960pab.60.1368498474723; Mon, 13 May 2013 19:27:54 -0700 (PDT) Received: from localhost.localdomain ([220.132.37.35]) by mx.google.com with ESMTPSA id tq8sm16089212pbc.30.2013.05.13.19.27.52 for (version=TLSv1 cipher=DES-CBC3-SHA bits=168/168); Mon, 13 May 2013 19:27:54 -0700 (PDT) From: Kuo-Jung Su To: u-boot@lists.denx.de Date: Tue, 14 May 2013 10:29:38 +0800 Message-Id: <1368498581-19525-2-git-send-email-dantesu@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1368498581-19525-1-git-send-email-dantesu@gmail.com> References: <1368498581-19525-1-git-send-email-dantesu@gmail.com> In-Reply-To: <1368433693-18599-2-git-send-email-dantesu@gmail.com> References: <1368433693-18599-2-git-send-email-dantesu@gmail.com> Cc: Marek Vasut , Kuo-Jung Su Subject: [U-Boot] [PATCH v8 1/4] usb: hub: make minimum power-on delay configurable 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: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de From: Kuo-Jung Su This patch makes the minimum power-on delay for USB HUB become configurable. The original design waits at least 100 msec here, but some EHCI controlers(e.g. Faraday EHCI) are known to require much longer delay interval. Signed-off-by: Kuo-Jung Su CC: Marek Vasut --- Changes for v8: - Nothing updates Changes for v7: - Rebase to u-boot-bbd0f7e3ba66d288a2f146f1c7797801e04598ae Changes for v6: - Simplify CONFIG_USB_HUB_MIN_POWER_ON_DELAY default value setup. Changes for v5: - Split up from Faraday EHCI patch - Replace the Faraday EHCI ifdef for the long delay in usb_hub_configure() with the new configuration option: USB_HUB_MIN_POWER_ON_DELAY, which is used in usb_hub_power_on() to control the minimum usb hub power-on delay. Changes for v2 - v4: - See 'usb: ehci: add Faraday USB 2.0 EHCI support' README | 3 +++ common/usb_hub.c | 8 ++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) -- 1.7.9.5 diff --git a/README b/README index 0d37d56..c70a59b 100644 --- a/README +++ b/README @@ -1244,6 +1244,9 @@ The following options need to be configured: CONFIG_USB_EHCI_TXFIFO_THRESH enables setting of the txfilltuning field in the EHCI controller on reset. + CONFIG_USB_HUB_MIN_POWER_ON_DELAY defines the minimum + interval for usb hub power-on delay.(minimum 100msec) + - USB Device: Define the below if you wish to use the USB console. Once firmware is rebuilt from a serial console issue the diff --git a/common/usb_hub.c b/common/usb_hub.c index 0d79ec3..fc3a8c1 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -53,6 +53,10 @@ #include #endif +#ifndef CONFIG_USB_HUB_MIN_POWER_ON_DELAY +#define CONFIG_USB_HUB_MIN_POWER_ON_DELAY 100 +#endif + #define USB_BUFSIZ 512 static struct usb_hub_device hub_dev[USB_MAX_HUB]; @@ -148,8 +152,8 @@ static void usb_hub_power_on(struct usb_hub_device *hub) debug("port %d returns %lX\n", i + 1, dev->status); } - /* Wait at least 100 msec for power to become stable */ - mdelay(max(pgood_delay, (unsigned)100)); + /* Wait for power to become stable */ + mdelay(max(pgood_delay, CONFIG_USB_HUB_MIN_POWER_ON_DELAY)); } void usb_hub_reset(void)