From patchwork Mon May 11 07:55:11 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 1171 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f199.google.com (mail-pl1-f199.google.com [209.85.214.199]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 168943F08B for ; Mon, 11 May 2020 09:55:29 +0200 (CEST) Received: by mail-pl1-f199.google.com with SMTP id x3sf6792029plm.9 for ; Mon, 11 May 2020 00:55:29 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589183728; cv=pass; d=google.com; s=arc-20160816; b=yXxaVEYkJjQvB+Lat1wUbFqFQpjXPfNILnp0tdV7mNOCZ6OsNlPV4rbrmkDdfCMdRp pCX59fYr4N89i+GzLQI4lhJ6whLbM2IP77yy9/ICJkrb+LmFphgi6PolrrfISLG7UVxC g4fZB/iQnRg7noEnk0NbtcPI0oHgInwOLS4cIC4OCMCNPHl4P+AsYYnpDN5DyFNv+bTG ZZyA/kebTdQaQKMY9GEW5aAmk7u0Zjpx3349dwinUkDLmiKl2nY2I0HpnxdbigA/7co9 ujP0WYUE5KZcm31bNq9WOYICl8O1hNChHSoLdOiZ0qJ9riK1C4nq0ZnZs+J7GSNY5rZn 04ug== 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=4I6prDlW7uGnedtxnH4Z/uI3sdmk8lhQX+QHZtMi1zw=; b=Vb4KALy+uqdnMqjQKIAsSwlHtwHdIryVgZW/CnRR+Ak8XSvAFBgMWBqsv5tQkrTz/s N9oE6H0UEjA403/jZfYAWfHvfVYaUiTsptRhBnqO4GKB2M1z5Qz6b9gdjYUYPxIZifxE 7OJog6dTgyBLwhxIvcTDZxfbKYJqMILXl+vFQtctAyMMr5vpHNgPsv3oz2YJpkT+NdeF f92wiXpw9gKfurT64VF8brrOF9Ob0Y+0dKZUARQWrlDVVo00jHMlbDo6VElTnv+Rrqfl ZG8H7mLp5KnEZu+SrzAJAmU2AnWK103dVgjkgdV4eK2mkzcNRW+C2OHbyp8SQMATIWHh 19Ig== ARC-Authentication-Results: i=2; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.132 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=4I6prDlW7uGnedtxnH4Z/uI3sdmk8lhQX+QHZtMi1zw=; b=Bd0fKmcDds0siZCOVKGoAw5KhswXQ0RQEWItMGjHJHtSpV4g24VGciNlnl6epwb2CY ytsTzy8yrvUrFvL2bAVT9lPII2/6fd9oQLrUh6Xg+mORygUErQ4M8W6fqPbXK6hnCXwq Chb59wmvjAl0gfNG6ujRHMq/HvN8XaQJeu+/I= 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=4I6prDlW7uGnedtxnH4Z/uI3sdmk8lhQX+QHZtMi1zw=; b=hqpqmC2RGmFSIyC/WrWN6ZMsS/EtA8mmEaTJh6hbDtl3bAUEhm0eLHm2pOGUAckgBd C5GSUqWZDYCO0UuQq81AWx9hrrUz57BqX+vFRmfD+tURMQvdnPGs3kg1tGhwyGQJ2sCz qlkp4vYCtNFhKHPzcJm/+lj9fUXBxPgkH0lhs9GCkMCb6m/Lu1fRHeHQ1R56ZLyC0/NE E4zlY4E4V4s2DJYcWWqCo2gDdwXoRk6ufuh2TibGihDQjq99YxMG0xgSTfsCs6aIhbVG A9CmTh/Y4r22WEc2PaIoCWYZURPHIwMaxJesezrCEUeTpSeE/BqDJoiSqsk+OvbDDBim Bppg== Sender: linux-amarula@amarulasolutions.com X-Gm-Message-State: AGi0Pubd3ZROuspZjvkuuvL7guVByh8BjlAs6DwLEHqUL93bnNMMcWgl Vu3QDY1LFxKOroW8GRe2B6W+lNFt X-Google-Smtp-Source: APiQypIUfv7i/64sqZo2T2AlGs7ZRNcdKiDSE9UZI8qdK4bElysqNcf1CH/4ZkFuWKQl7qt1HR15tQ== X-Received: by 2002:a17:902:6b01:: with SMTP id o1mr14277742plk.64.1589183727884; Mon, 11 May 2020 00:55:27 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90a:7143:: with SMTP id g3ls16188134pjs.0.canary-gmail; Mon, 11 May 2020 00:55:27 -0700 (PDT) X-Received: by 2002:a17:90a:bd91:: with SMTP id z17mr21492652pjr.189.1589183727517; Mon, 11 May 2020 00:55:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589183727; cv=none; d=google.com; s=arc-20160816; b=Qa+yW1RCsyZ2S/LqwqM3DRVDHgn/3pbKLw+jc4Oy0lotW0Jw8NqIHiFvW3+jVMi1Wv XomEeZ6E3cfQ5oj8lLSTvMSUCYJrIopcdqun0Gny/0wP8uWA49/r4OG0dxTRZRqFjm4Q ceAwVn7G42Fz+9trCwsmyJXdf1JnVOfUSHaZLzgYTNOlxVMthGuIK+Ss/qMRjYy6ofxm Av83NcevAFFtv2VNkCjVGEYzAIlsWaRaw3t6nIGP8QxB00b7fbCeNS0fJyxFD8/IzahZ ILDxsnnoEKQqaXfHK0ktRXxrhLB6K++278Jem6y/iXCg8FQGwY9HhbR1VZMjRNNgmA4g AYsg== 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=ewoDqNjGkB95CLMm4CQMxAypYj9Od+ya8eEQpsL5M+g=; b=gPA0HFu8MRuQiDOzNfwaJu7J5cK2T9br6kzrMNCse9xxJv8OBQ2eAPY3OPhqWvc7le cblJPGTOJ47XK4Q6pVwU3deqjxKze3V+BHLRrfkTij+vJwhCaSTOepn2RYCev2Y29wZK Bp03nAtWvP+eQdTqLF7UCAqmOQg31Q1b2CAmJ5J34SF3BVCCWd6I4X1q5EtybFlkmwpY 5Rp7TeK6DH6bLE9afouKrTblgK0VdU4Ejuiqei5rHmzV9bsReNZ/az4yS5QK98fC+Csy trK7CUldiE3fPUb212eksO4VOkMPIsuThbe+03XabIucN6glJzfABhnIFeM69N+7kHDG sw5Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.132 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.com Received: from lucky1.263xmail.com (lucky1.263xmail.com. [211.157.147.132]) by mx.google.com with ESMTPS id m1si7021923pls.61.2020.05.11.00.55.27 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 00:55:27 -0700 (PDT) Received-SPF: pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.132 as permitted sender) client-ip=211.157.147.132; Received: from localhost (unknown [192.168.167.8]) by lucky1.263xmail.com (Postfix) with ESMTP id 001AFCD61D; Mon, 11 May 2020 15:55:25 +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 P2949T140479804974848S1589183722650576_; Mon, 11 May 2020 15:55:26 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <19a343bbd400d2876a0394a475736801> 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 v4 07/16] usb: dwc3: add dis_enblslpm_quirk Date: Mon, 11 May 2020 15:55:11 +0800 Message-Id: <20200511075520.26557-3-frank.wang@rock-chips.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200511075520.26557-1-frank.wang@rock-chips.com> References: <20200511075330.26462-1-frank.wang@rock-chips.com> <20200511075520.26557-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.132 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 # roc-rk3399-pc --- 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;