From patchwork Thu May 9 03:20:42 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: 242701 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 16B5E2C00E1 for ; Thu, 9 May 2013 13:19:42 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 099624A119; Thu, 9 May 2013 05:19:41 +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 TJXWRplVniOz; Thu, 9 May 2013 05:19:40 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 58F364A122; Thu, 9 May 2013 05:19:29 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5DA9E4A11C for ; Thu, 9 May 2013 05:19:22 +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 o0M2TelBBle7 for ; Thu, 9 May 2013 05:19:16 +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-da0-f46.google.com (mail-da0-f46.google.com [209.85.210.46]) by theia.denx.de (Postfix) with ESMTPS id 1A04D4A119 for ; Thu, 9 May 2013 05:19:10 +0200 (CEST) Received: by mail-da0-f46.google.com with SMTP id e20so1329895dak.5 for ; Wed, 08 May 2013 20:19:08 -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=A4A5m25ZP4Qa8j/DhQeOlNf9V8IU3MFuxN3ie9nCEGM=; b=AUZD7flr+8YKiW/cOyglCdg0iFR+IoYpu13Dlr4ClLU+jd/GIhIYCx3d6hU5FLGFSk eBJ55DzD4DUqg1wbpocF3V3hrtvenmXRR7wXm0hTL3XQyPmd6UiBanM9Swh/tf/q0CfD N/tWBR/zKLa47Ipr7BrcJPjLtdxWGLrf1CzK264lwSsprJL3H08HtOXC2Ew8v7zr2itv hAoN2faifN1nQ5e3zMO/tmUGz+4ih5wK4wDR2P6oBQ9R8iSpcg1w0gDn6YGqBm27tgI/ Ti9HtOC+0WwHzgxwlN1/K2efwCMA97G8+vyp58EAuXkR6BfE/g6KBBoknl38zK183bAh Z8Sg== X-Received: by 10.66.232.97 with SMTP id tn1mr11032399pac.20.1368069548594; Wed, 08 May 2013 20:19:08 -0700 (PDT) Received: from localhost.localdomain ([220.132.37.35]) by mx.google.com with ESMTPSA id ag4sm1131452pbc.20.2013.05.08.20.19.06 for (version=TLSv1 cipher=DES-CBC3-SHA bits=168/168); Wed, 08 May 2013 20:19:08 -0700 (PDT) From: Kuo-Jung Su To: u-boot@lists.denx.de Date: Thu, 9 May 2013 11:20:42 +0800 Message-Id: <1368069645-14582-2-git-send-email-dantesu@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1368069645-14582-1-git-send-email-dantesu@gmail.com> References: <1368069645-14582-1-git-send-email-dantesu@gmail.com> In-Reply-To: <1367907970-11903-2-git-send-email-dantesu@gmail.com> References: <1367907970-11903-2-git-send-email-dantesu@gmail.com> Cc: Marek Vasut , Kuo-Jung Su Subject: [U-Boot] [PATCH v5 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. NOTE: The minimal delay is still 100 msec, a small value defined in CONFIG_USB_HUB_MIN_POWER_ON_DELAY would be automatically justified in common/usb_hub.c. Signed-off-by: Kuo-Jung Su CC: Marek Vasut --- 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, 10 insertions(+), 1 deletion(-) -- 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 b5eeb62..0db3530 100644 --- a/common/usb_hub.c +++ b/common/usb_hub.c @@ -61,6 +61,12 @@ #define USB_HUB_DEBUG 0 #endif +#if CONFIG_USB_HUB_MIN_POWER_ON_DELAY > 100 +# define USB_HUB_MIN_POWER_ON_DELAY CONFIG_USB_HUB_MIN_POWER_ON_DELAY +#else +# define USB_HUB_MIN_POWER_ON_DELAY 100 +#endif + #define USB_PRINTF(fmt, args...) debug_cond(USB_DEBUG, fmt, ##args) #define USB_HUB_PRINTF(fmt, args...) debug_cond(USB_HUB_DEBUG, fmt, ##args) @@ -121,7 +127,7 @@ static void usb_hub_power_on(struct usb_hub_device *hub) } /* Wait at least 100 msec for power to become stable */ - mdelay(max(pgood_delay, (unsigned)100)); + mdelay(max(pgood_delay, USB_HUB_MIN_POWER_ON_DELAY)); } void usb_hub_reset(void)