From patchwork Fri Dec 7 08:56:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Kiernan X-Patchwork-Id: 1009230 X-Patchwork-Delegate: marek.vasut@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="gv6fXl5C"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 43B5vG32rVz9s55 for ; Fri, 7 Dec 2018 19:57:14 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id 23BA9C2235C; Fri, 7 Dec 2018 08:57:10 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 77709C21E88; Fri, 7 Dec 2018 08:57:08 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6A69CC21E88; Fri, 7 Dec 2018 08:57:07 +0000 (UTC) Received: from mail-wm1-f66.google.com (mail-wm1-f66.google.com [209.85.128.66]) by lists.denx.de (Postfix) with ESMTPS id 19E29C21C2C for ; Fri, 7 Dec 2018 08:57:07 +0000 (UTC) Received: by mail-wm1-f66.google.com with SMTP id a18so3722566wmj.1 for ; Fri, 07 Dec 2018 00:57:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=thMMRXkjzzDUNwu6kde4bZsyyiIlX8K4kxeL8fjddmw=; b=gv6fXl5Cu5n25iBbZMLApNSFgEc/U0Rpq7gkRjXhgnNMTg/5LJdwRd6SdOAlGHADOD +mwIQldZMUzubJ9L7Hlc74TyM8mQdgBATfNxHsTSmEvaCihgrCpahI4hFqXVflgY8uNm nj6oKF/JVMhndVC9sk40LDLX8SUrkc+BysiceaEg0IUmn9i+CtMT9Y94FXmY16mprv9U h8w/4fR8DwnP1qD2FsGIvnktfnpwMAgNtkMUaA1gO2JVwN/Q8sRZDdEuzoUYan4lrBTv MZ8/smDR/exvCluk8YjsHo3zTxzU9gEknbM/XB+Z6zvFeDLKbnWPRx+OR00OCdVwBtFG F1Ow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=thMMRXkjzzDUNwu6kde4bZsyyiIlX8K4kxeL8fjddmw=; b=FUV1WybF24/72FPrgf0OcvWBGL9pH3dWYmQl1sU9VDgWRMlJ2VQz64EAfvN7RE1O2L ScgNVzTr2EezEuQq4a1K782erGkTYTLAHpI/RoQUY/iaSmfuIhcLpIp8ylstG7WTiIjY MR39g3AXoR5tpplXeOd9NpV5L5iMIUNFj9TbyYXod4y8Jv++OvBvisUxXO8xf5xISolS x18EBjuM800kghmh7iw/x/VUyH/q9hDA5x0ilE+2/Th5CQR109fcCr7arQ7VfVGIz784 o7Q6Pp9wnKg/jEAsvIqhROdHFC2G91gxcjesOKrttEA/x+8fDBGbErs31wmRzvz6GqHx VzhQ== X-Gm-Message-State: AA+aEWZ7ix7rn3WuXK+zXXBVhTfYrCzOL/IjzpeIthqZMGcDMjQXw330 iOKh+exXNqklq7fDQjepmgTZjQJyhOI= X-Google-Smtp-Source: AFSGD/XLV8i/HWlycrM83s77UvTma84096a6woT0j4nPHnX45dAJ55JR3oKM732iekByuXRKPBPvPw== X-Received: by 2002:a7b:cb18:: with SMTP id u24mr1375793wmj.138.1544173026373; Fri, 07 Dec 2018 00:57:06 -0800 (PST) Received: from localhost.localdomain (193.164.125.18.ip.redstone-isp.net. [193.164.125.18]) by smtp.gmail.com with ESMTPSA id l202sm6861509wma.33.2018.12.07.00.57.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 07 Dec 2018 00:57:05 -0800 (PST) From: Alex Kiernan To: u-boot@lists.denx.de Date: Fri, 7 Dec 2018 08:56:51 +0000 Message-Id: <20181207085651.12674-1-alex.kiernan@gmail.com> X-Mailer: git-send-email 2.17.1 Cc: Marek Vasut , Sven Schwermer Subject: [U-Boot] [PATCH] usb: musb-new: Add CONFIG_USB_MUSB_INIT_TIMEOUT X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Make the timeout in musb_lowlevel_init() configurable from the 1s default. Some USB memory sticks take longer than 1s to connect and so whilst usable in Linux aren't usable in U-Boot. The default in Kconfig is still 1000ms, so this should be a non-change for any existing users. Signed-off-by: Alex Kiernan --- drivers/usb/musb-new/Kconfig | 8 ++++++++ drivers/usb/musb-new/musb_uboot.c | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/musb-new/Kconfig b/drivers/usb/musb-new/Kconfig index f8f2205a62d3..5b9df5227961 100644 --- a/drivers/usb/musb-new/Kconfig +++ b/drivers/usb/musb-new/Kconfig @@ -54,6 +54,14 @@ config USB_MUSB_SUNXI Say y here to enable support for the sunxi OTG / DRC USB controller used on almost all sunxi boards. +config USB_MUSB_INIT_TIMEOUT + int "Low level initialization timeout" + default 1000 + help + The USB spec says it may take up to 1 second for a device to + connect. Some devices take longer than this to connect, so + you can increase the timeout here. The value here is in ms. + endif config USB_MUSB_PIO_ONLY diff --git a/drivers/usb/musb-new/musb_uboot.c b/drivers/usb/musb-new/musb_uboot.c index d40772b1aa5c..82591ad8f6b5 100644 --- a/drivers/usb/musb-new/musb_uboot.c +++ b/drivers/usb/musb-new/musb_uboot.c @@ -214,7 +214,7 @@ int musb_lowlevel_init(struct musb_host_data *host) { void *mbase; /* USB spec says it may take up to 1 second for a device to connect */ - unsigned long timeout = get_timer(0) + 1000; + unsigned long timeout = get_timer(0) + CONFIG_USB_MUSB_INIT_TIMEOUT; int ret; if (!host->host) {