From patchwork Wed Sep 11 14:45:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 1161048 X-Patchwork-Delegate: monstr@monstr.eu 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=none (p=none dis=none) header.from=xilinx.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=monstr-eu.20150623.gappssmtp.com header.i=@monstr-eu.20150623.gappssmtp.com header.b="GgOAPV0i"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46T4T965jhz9sDB for ; Thu, 12 Sep 2019 00:45:49 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 744C5C21DD7; Wed, 11 Sep 2019 14:45:46 +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=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 C759FC21C8B; Wed, 11 Sep 2019 14:45:44 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 6E3D9C21C8B; Wed, 11 Sep 2019 14:45:43 +0000 (UTC) Received: from mail-wm1-f65.google.com (mail-wm1-f65.google.com [209.85.128.65]) by lists.denx.de (Postfix) with ESMTPS id 204A1C21C29 for ; Wed, 11 Sep 2019 14:45:43 +0000 (UTC) Received: by mail-wm1-f65.google.com with SMTP id q12so3910171wmj.4 for ; Wed, 11 Sep 2019 07:45:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=pPVqycN7CjZx4ZDHZKM1CHKAemmQxA4WjTNYcU2hWxU=; b=GgOAPV0iu98AeRl83tiCPj7OzDzHy6C/Bj12Ia/1tEz2oEbnb63JPmSmEvr2RRyKoY 2kt6XjAhKGUCBy4H3z14wqmpAFNB1qNYvAcq11Z5JkN3bKvTTMRZln/nWZNl/ogxnAhi OZTCFBoTuIMONe0k66cC8rM7HEDqA8HEiqp/Z9lane5D+hl9wS3gWvNSiR3ARRYvjeEf dZzqqAlPli84tHMhfp+VUs4mKtp1Db4Sd6n7Bn7TR92Oq7XwGuXQBuoJCxwFRNuvP6bf dR1n0peM3ht37e15c1UoRI2FE0LMWDsruAEvfwTR1DZInVV2YwXY/lwKvCcQJQ0tZx9d uBmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=pPVqycN7CjZx4ZDHZKM1CHKAemmQxA4WjTNYcU2hWxU=; b=ZFtJazE1Mqqu4PyvhN6H+3QXlZwTwV+kw7k6oD+K1n1P6/AyR2Ajlg6LFzkwDKQHC/ c4I4bH8p2OI3tOXMNjDG23h/TwanyXT1KGK2k1Nqra8rKbF4R+/OoYZlN1AMSv/HEGg4 Q1pWYRu5gDaI4RgWThizq9yLbH9IEweJ6a4j2FTmUYKWPfli0JacxBoTYLcJKPCCrsDc Zopcba7vSPM9Z7sOOfNE2fFQfE4tFJ27SLsvdygEjOH5FWdx1kWOIbrqNLyIqfBzCs9l m/qDOE0Fi+KXgDwVJU5VpYjhY4GA9XfttksNqZOsKkg3kaYFjzq5gB+jGLxtZJa08dch r/aA== X-Gm-Message-State: APjAAAWNSKO6h/xR/wUnJz+eEoHXXZhcJ9adFxk8c/c+cwLxuRbghCBf gaIingdWDUCLWsRT2gDBQ7k3gfVtNCqWbBFj X-Google-Smtp-Source: APXvYqzOXxRworGBR1LaBbwmo37lzL9OAjmR0tygmfRi5fXKvdK+pt4HBkucWYoN2GRsHzxlloyG6w== X-Received: by 2002:a1c:7a05:: with SMTP id v5mr4033079wmc.173.1568213142538; Wed, 11 Sep 2019 07:45:42 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id z142sm7061779wmc.24.2019.09.11.07.45.41 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Sep 2019 07:45:42 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de, git@xilinx.com Date: Wed, 11 Sep 2019 16:45:40 +0200 Message-Id: <9b714bb2e06e947416d11a4d01e6bcee2a89360b.1568213138.git.michal.simek@xilinx.com> X-Mailer: git-send-email 2.17.1 Cc: Marek Vasut , Sven Schwermer , T Karthik Reddy Subject: [U-Boot] [PATCH] drivers: usb: dwc3: setup phy before dwc3 core soft reset 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" From: T Karthik Reddy Phy setup should be done before dwc3 soft core reset as it is done in linux & this fixes unreliable detection of usb cable on host side. Signed-off-by: T Karthik Reddy Signed-off-by: Siva Durga Prasad Paladugu Signed-off-by: Michal Simek --- drivers/usb/dwc3/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 56e2a046bf06..2498f0efb1a4 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -440,6 +440,8 @@ static int dwc3_core_init(struct dwc3 *dwc) goto err0; } + dwc3_phy_setup(dwc); + ret = dwc3_core_soft_reset(dwc); if (ret) goto err0; @@ -514,8 +516,6 @@ static int dwc3_core_init(struct dwc3 *dwc) dwc3_writel(dwc->regs, DWC3_GCTL, reg); - dwc3_phy_setup(dwc); - ret = dwc3_alloc_scratch_buffers(dwc); if (ret) goto err0;