From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kuo-Jung Su Date: Mon, 13 May 2013 09:11:25 +0800 Subject: [U-Boot] [PATCH v5 1/4] usb: hub: make minimum power-on delay configurable In-Reply-To: <201305101341.59595.marex@denx.de> References: <1368069645-14582-1-git-send-email-dantesu@gmail.com> <1368069645-14582-2-git-send-email-dantesu@gmail.com> <201305101341.59595.marex@denx.de> Message-ID: List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 2013/5/10 Marek Vasut : > Dear Kuo-Jung Su, > >> 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(-) >> >> 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 > > Even better (and easier) solution here would be: > > ifndef CONFIG_USB_HUB_MIN_POWER_ON_DELAY > #define CONFIG_USB_HUB_MIN_POWER_ON_DELAY 100 > #endif > > no ? ;-) > Yep, it looks better, I'll have it fixed. >> #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) >> -- >> 1.7.9.5 > > Best regards, > Marek Vasut -- Best wishes, Kuo-Jung Su