From patchwork Tue May 26 03:33:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 1238 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f69.google.com (mail-pj1-f69.google.com [209.85.216.69]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 4902B3F06D for ; Tue, 26 May 2020 05:35:07 +0200 (CEST) Received: by mail-pj1-f69.google.com with SMTP id mt16sf1468902pjb.5 for ; Mon, 25 May 2020 20:35:07 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1590464106; cv=pass; d=google.com; s=arc-20160816; b=W0gBFPb+URC7I1tCnnMSdBmEnowEm8Z/de78vSU91oedW3Od3TsDd+LMy6cvygRXxo gsqPup5VD5AXCnejuHQU50M2ko8uX3vfVjWPM9ffmQBHbkLNvBkNt9nwt71rorMbmIqs 7i6wczVtynYWmZWaHCE20hYsimxZ5e0Fdb1GrbLw/HZfelpE0PK57b7xefN6zgtAuafL QSmOQwg5LBFC1LO/07H7HIZKYxZFqhJT/mQQqFDAAGlZzGC+zwH+GTgqh5suIgu9WtdH r3ggEKT8bh+76JUVNowjajq39BoCKGenC5MJKiEJ+2eGNHk89nW7PayunXcYZBTXDyEc xg9Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-unsubscribe:list-archive:list-help:list-post:list-id :mailing-list:precedence:references:in-reply-to:message-id:date :subject:cc:to:from:mime-version:sender:dkim-signature; bh=zQ7jV0vB5KgTwwOQY7c1thExU7kqIESeQ3qHlzGqRVg=; b=huCuFDWzsmlnqVUiY6v58GCj0uQD/X8fyguVE4mdIlEYHqg4Z1a+UdoY8khS38e6AZ Hn9qdqx5wmpKieGEHJW15ggL/WvOG2n7wLxPNvawZbaYz+CETukmKef/PsF82sBA97OX 3yCvhuilybtlCRZXOWyS/JjgWvz0zPeLwrXYO/CFRJwyFsKCoxU1AtGSGGAScwWUIFVt SNe90NotHdEocHHnfGC4tXJM5kVjTq98e6AQELhM4jf4+Qz1SiTzSxj50OJWl943JmVJ NzOEIYfMHYsOWuutgMnaESqUOfDWUe7HgWxVfiopUPAkC73p+CwXHlrDy9nSAxrelw70 8EJw== ARC-Authentication-Results: i=2; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.134 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; h=sender:mime-version:from:to:cc:subject:date:message-id:in-reply-to :references:x-original-sender:x-original-authentication-results :precedence:mailing-list:list-id:list-post:list-help:list-archive :list-unsubscribe; bh=zQ7jV0vB5KgTwwOQY7c1thExU7kqIESeQ3qHlzGqRVg=; b=CPEkM6F/WvkaJifgjDTOeKJ1Mx04GlqO3TOHRY8lk6iIjLyTRLRYq7lziDrVRtg6Oo iDIMGeAIzF0rsbkNNQSx3l1OqUYTFnnkbR48alWMe08L6ztC+rO2KJVcHWw03Fh9ZHxg dpV+GNBCkOz5mh7CN/FWaYECJhn9Pf9tp5CWE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=sender:x-gm-message-state:mime-version:from:to:cc:subject:date :message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :x-spam-checked-in-group:list-post:list-help:list-archive :list-unsubscribe; bh=zQ7jV0vB5KgTwwOQY7c1thExU7kqIESeQ3qHlzGqRVg=; b=j7BQmHGEwZi2akrm1oyrIg9LXAm8jAXeihfZreRqbJJkjjtecmut6FrHqgHloJBFrL MTbGh+7GBIAh/0VM7G/uK+l+bdjexxwfhzI+Hpxk8PLrkkKIg9Bb/WNC1XMsirUYm9Rz y0z1Ckp84oLNpRtaoC7vuVmP+EPhiT0opaDtNIQOfheepLN1WRJU4FVM0Xp/RDPwu6f4 OQU1lVolPdZdRLYONdtzOoZ7l7MM1DHOK4LUsmbM7kMniIVT4U5+iGND/qtnnlwjqeXj qc0RsGFMqAM8XgBJUCWYTmn3l6vPrTw/p0wmqMUqOMNARzk1V//AIuZcCkUNquMJjP42 HUKw== Sender: linux-amarula@amarulasolutions.com X-Gm-Message-State: AOAM531MMc851BIWNGwSJVFBaLQHM8NVzEE7O9kKFfflaE5Bd8OLlXkg mL37hB9giS0f8e43bf5uDi36rUlk X-Google-Smtp-Source: ABdhPJx6xxszi3QV2X8b6bnbceXBVtZ/qSnmIplIsuCj0OzvBTTOZvQHbtjexbApsqzloKru9ox5Ow== X-Received: by 2002:a17:902:dc86:: with SMTP id n6mr31050083pld.17.1590464106056; Mon, 25 May 2020 20:35:06 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a65:63d0:: with SMTP id n16ls179596pgv.6.gmail; Mon, 25 May 2020 20:35:05 -0700 (PDT) X-Received: by 2002:a63:4d5a:: with SMTP id n26mr6323101pgl.85.1590464105377; Mon, 25 May 2020 20:35:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590464105; cv=none; d=google.com; s=arc-20160816; b=vgefGMh9jrunsbSghPnHG/b76Efb0q85zrMXNQRYwhLMZa8pjXA3LQWWfHd3SP8l2a 2c/Mg1RSLwhGYYU/Qv2Bq1TIjtiA3/C9rnTjwlORyjVbh1FoB9MqkyYA/4setggRndlJ QXOWLCcnP0aSDMu8/MPnGDf799eefOSuV72TsRNAOfRkdZF8c5QwI3Z6pH/abbrKygAr 1DqC5mcYwN3zjjkat3J95KLj8JeQ9IdFbwHORrU5DlUNj+8hnkTenI4faGc2eV6A0u86 Fg9W29FUwd7/9VGYO07+isQn7qgKQFHye06o2DeiOor9Ek0iEP70J4+ExZKC9I7x90fD MK3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from; bh=2Fzx52TZfLBERSuL4keI2pH1V2y3+3NjowmcHy9G9BE=; b=Lj9ES9YSSZcGMGHJt78jTbwAfJygzS2AV1xYE5WbEzqkwOCSG24AbJQpE2BX4dYoSo l5Gwd2eKPP79tKX9VTLcmn7fxcJ06uHq0WrcqyA9nU0BwoQD2jzFlx81dyC1/sQ7jHvm BOmX9XWAUt25iG4NnaMJiE6efkAykHu/xxz8cY+Nzk5wu/d/nYoQBHbpN2TDB6ZF6xF1 4HkZQ6525AoJ63SMM1nXaUv/0kSMPJL3xg4r9Wgy4ID3T/GRzS19poH8gsrhLYWrCFxA 0kXT6OC9aS7jXmNbVN8aBZ0FN3MTbwIrgih2glHfuNKIF3XRvn8fb3pmkxfcyl0xHFSP 8X4g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.134 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.com Received: from lucky1.263xmail.com (lucky1.263xmail.com. [211.157.147.134]) by mx.google.com with ESMTPS id bj11si15203860pjb.23.2020.05.25.20.35.04 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2020 20:35:05 -0700 (PDT) Received-SPF: pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.134 as permitted sender) client-ip=211.157.147.134; Received: from localhost (unknown [192.168.167.8]) by lucky1.263xmail.com (Postfix) with ESMTP id 81A0EB0F18; Tue, 26 May 2020 11:34:02 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P21206T140696195421952S1590464037437993_; Tue, 26 May 2020 11:34:00 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <6485659e323b6519f276a53a7fa13101> X-RL-SENDER: frank.wang@rock-chips.com X-SENDER: wmc@rock-chips.com X-LOGIN-NAME: frank.wang@rock-chips.com X-FST-TO: heiko@sntech.de X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 X-System-Flag: 0 From: Frank Wang To: heiko@sntech.de, marex@denx.de, bmeng.cn@gmail.com, philipp.tomsich@theobroma-systems.com, klaus.goger@theobroma-systems.com, jagan@amarulasolutions.com, sjg@chromium.org, kever.yang@rock-chips.com Cc: u-boot@lists.denx.de, linux-rockchip@lists.infradead.org, linux-amarula@amarulasolutions.com, marek.belisko@gmail.com, william.wu@rock-chips.com, jianing.ren@rock-chips.com, chenjh@rock-chips.com, wmc@rock-chips.com, Frank Wang Subject: [PATCH v6 07/16] usb: dwc3: add dis_enblslpm_quirk Date: Tue, 26 May 2020 11:33:46 +0800 Message-Id: <20200526033355.20147-3-frank.wang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200526033355.20147-1-frank.wang@rock-chips.com> References: <20200526033220.20047-1-frank.wang@rock-chips.com> <20200526033355.20147-1-frank.wang@rock-chips.com> X-Original-Sender: frank.wang@rock-chips.com X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.134 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.com Content-Type: text/plain; charset="UTF-8" Precedence: list Mailing-list: list linux-amarula@amarulasolutions.com; contact linux-amarula+owners@amarulasolutions.com List-ID: X-Spam-Checked-In-Group: linux-amarula@amarulasolutions.com X-Google-Group-Id: 476853432473 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Add a quirk to clear the GUSB2PHYCFG.ENBLSLPM bit, which controls whether the PHY receives the suspend signal from the controller. Refer to commit ec791d149bca("usb: dwc3: Add dis_enblslpm_quirk") in Linux Kernel. Signed-off-by: Frank Wang Reviewed-by: Kever Yang Reviewed-by: Jagan Teki Tested-by: Jagan Teki --- drivers/usb/dwc3/core.c | 6 ++++++ drivers/usb/dwc3/core.h | 2 ++ include/dwc3-uboot.h | 1 + 3 files changed, 9 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 0972e458eb..20be617fd4 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -398,6 +398,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc) if (dwc->dis_u2_susphy_quirk) reg &= ~DWC3_GUSB2PHYCFG_SUSPHY; + if (dwc->dis_enblslpm_quirk) + reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; + dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); mdelay(100); @@ -719,6 +722,7 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev) dwc->dis_u3_susphy_quirk = dwc3_dev->dis_u3_susphy_quirk; dwc->dis_u2_susphy_quirk = dwc3_dev->dis_u2_susphy_quirk; dwc->dis_del_phy_power_chg_quirk = dwc3_dev->dis_del_phy_power_chg_quirk; + dwc->dis_enblslpm_quirk = dwc3_dev->dis_enblslpm_quirk; dwc->tx_de_emphasis_quirk = dwc3_dev->tx_de_emphasis_quirk; if (dwc3_dev->tx_de_emphasis) @@ -926,6 +930,8 @@ void dwc3_of_parse(struct dwc3 *dwc) "snps,dis_u2_susphy_quirk"); dwc->dis_del_phy_power_chg_quirk = dev_read_bool(dev, "snps,dis-del-phy-power-chg-quirk"); + dwc->dis_enblslpm_quirk = dev_read_bool(dev, + "snps,dis_enblslpm_quirk"); dwc->tx_de_emphasis_quirk = dev_read_bool(dev, "snps,tx_de_emphasis_quirk"); tmp = dev_read_u8_array_ptr(dev, "snps,tx_de_emphasis", 1); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 7f45a9c459..e76e357f1e 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -162,6 +162,7 @@ /* Global USB2 PHY Configuration Register */ #define DWC3_GUSB2PHYCFG_PHYSOFTRST (1 << 31) #define DWC3_GUSB2PHYCFG_SUSPHY (1 << 6) +#define DWC3_GUSB2PHYCFG_ENBLSLPM (1 << 8) #define DWC3_GUSB2PHYCFG_PHYIF(n) ((n) << 3) #define DWC3_GUSB2PHYCFG_PHYIF_MASK DWC3_GUSB2PHYCFG_PHYIF(1) #define DWC3_GUSB2PHYCFG_USBTRDTIM(n) ((n) << 10) @@ -822,6 +823,7 @@ struct dwc3 { unsigned dis_u3_susphy_quirk:1; unsigned dis_u2_susphy_quirk:1; unsigned dis_del_phy_power_chg_quirk:1; + unsigned dis_enblslpm_quirk:1; unsigned tx_de_emphasis_quirk:1; unsigned tx_de_emphasis:2; diff --git a/include/dwc3-uboot.h b/include/dwc3-uboot.h index ecae34bf06..98d51e05e1 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -34,6 +34,7 @@ struct dwc3_device { unsigned dis_u3_susphy_quirk; unsigned dis_u2_susphy_quirk; unsigned dis_del_phy_power_chg_quirk; + unsigned dis_enblslpm_quirk; unsigned tx_de_emphasis_quirk; unsigned tx_de_emphasis; int index;