From patchwork Tue May 26 03:33:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 1232 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pl1-f200.google.com (mail-pl1-f200.google.com [209.85.214.200]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 605793F1EE for ; Tue, 26 May 2020 05:34:05 +0200 (CEST) Received: by mail-pl1-f200.google.com with SMTP id s7sf1604051plp.13 for ; Mon, 25 May 2020 20:34:05 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1590464044; cv=pass; d=google.com; s=arc-20160816; b=zEpZch68pb7yvmKnF0I9JXtDR0YmuCRNfkAhcMQiYXj7fBptVenXLHn04/sjkOLTR6 8VAEy2xtGJ/srvTKGTLaF+xh06fY2HpWS7MI991oBjdz4LOLyp7lSyOBlDmVNeEnp69g g0G9BAmOISzP8MB+o0UOkd5mzgofxREe5ZjaGU/JtU1wAaLAzxxz/k8GT0gAQ0PNdjpF HlBRYkr7uFfwTxaOSwz5iFZ5B4SjH+lblbiuIWQbx0eYTvBdam+RlGu5KgKPwQ79rjeZ lX4DO7nZyLfn8lKWq7vNgPqerH9JxYOnISwxAbQ6iJa316xxiU8A47MR45p2C7fa7MZg vIIA== 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=4AOiEItqNQBMBaG5MJlym4sDbASnhFe3lZDElJulYKI=; b=0FMlPqAv8O5PYCzT4C1rFOjw4Kwyp6HwsHUdd68zTFTqoMc8cKhSFkAdT+hF4lHF/e m4Ows+RpNsQt6FZhdU9/6BDW01yxA3U3T+rRrXfpsn28Qea+iKbAiPiMWz4hsyO/TUD4 c0RdiQeVstE9A5vkzzYeAfwP4MLkSMZfUeDoPDPVslLn0kSHZZ/u01cCG9hpxIkkaGGi guH8/FzsFu5eonnPEecl0V7b8HYgMl/WMV6UXgttg/bmpPiDY84GZBwewPMs7uZ6IvTV kyJfqKPZQRrY3nNQWWLydRSJQDB5TQfqRaUwkwP1XnwNB0qM8MYLFQv0/8pOMIlNYrfR Mx4g== ARC-Authentication-Results: i=2; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.133 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=4AOiEItqNQBMBaG5MJlym4sDbASnhFe3lZDElJulYKI=; b=E5+OnQ3X4EhmrGLiytqwzPQbQEmADL2P1R7rbqI0KzJ6IBetblxrurYPni6yToGNPN wUt0dt0N0gIWVHB9gGp8yn3Z6nzzxcgwJ29po4aFMXpP3vrNRDBiMtUZ/JLK1X4FDGwR JXwqGow/SOdBALmBY690BEnSv+R2Nj1jeRuiw= 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=4AOiEItqNQBMBaG5MJlym4sDbASnhFe3lZDElJulYKI=; b=JKmc5Dc1/Ps2mNOalrOEaytjJrl/g91lhONApCWQPzN54G73RwCwmvCvgvsk9jJRJW aAwxWJK04mzPoZ82A8OOEXZnekmJr2WFPTW353v3fZJoG8JMROVU+fGlVVRnN3kiqsg0 Rn4kkF+4h2F1ylCspJTLNl/GBZBksNSL9scURhRmnVlvy6h7MZxe0SDIMKp8ejJFGyj8 JJA53/1xgNzcYco+xc93fBbD8tkHpRWYdn5Viu0EZvdTnypVWNRcFE7RJhOWdbcQB69u Xlzw6H9JSaSXRLDNdrWTgIwiJa8alkqr8BGtxrievHEd3IaSYGvt82EsD2y94r8kftbK cJDg== Sender: linux-amarula@amarulasolutions.com X-Gm-Message-State: AOAM532VAiYzX9xmzMI6wil7Z6E6xzUV1iY1459Rw4/aHzC7otCRaqpT aWmoyBPIBGGXvB61HsnD1npri5hI X-Google-Smtp-Source: ABdhPJxqQvaPC28ljFbMZIHR2c9jatepwD7F7S6kfM0GKHwifktds3g0IBHqyMDdRAMAKOCjUBrGHA== X-Received: by 2002:a17:90a:6a4a:: with SMTP id d10mr24478447pjm.199.1590464044156; Mon, 25 May 2020 20:34:04 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:902:8d95:: with SMTP id v21ls4419847plo.3.gmail; Mon, 25 May 2020 20:34:03 -0700 (PDT) X-Received: by 2002:a17:902:6903:: with SMTP id j3mr9315932plk.110.1590464043452; Mon, 25 May 2020 20:34:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590464043; cv=none; d=google.com; s=arc-20160816; b=xtCC5m4mGMz9lgyWqI56ku8BSAHlMO2kjUAJW1rUS+MSdlNxJGMkdxX5aA16kTqDb8 nWRv4oBa437FkWCsIVtjdZSzBCz/t1divoX9IRr2//H7zgunAWf339XnfsiXY67+spdT d3CgZgCFoqIFt12Sj6QowOKu1NqL/1Xo3NkXC391D+vgnK+bFNTkx6SfxTAXV2SFbrOq wU48zaZsg1Sb9/ACVUXqkDNgy42M2FYuHU8tZCMMWXW/+MDS9qCAHsQVr5hxzZEk7K6b GoPEFHYoBoTPzQD5Zzo3BKgosoYWZu61CvSUOVHWpi2bNT0DqL1KQxIdVVuFzEN5etYi i7yA== 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=voR2mC0dTFw76/rCrO/CMjej4Bfdg0/gQJz9bWnsGIU=; b=atMc7WfMOgxz9IUwD0uWeZFd5dZv+y0VFjZu8vFbQ4pSCaNBxCIE0B6L1l+htN5IKh XkX3jWUq9gWJjzyngE2bjLyckc8an45kDLPLxaEHUpNL1XuwmyhfHJLooLajiYokbDUo jKxAo/S5hNakYus3zOVQxPi6Jvjmb8jGp/N3iePsIndk4YL+v2X87IMxH8KnUmsupXlc j4lGnzBamj2WfLHnwropMggHHY+6cWgYT0sc5R4ltk1Lu7GhcHsvkXH5FLZSozAcBUyL 5NbLuUws19N4R/AuheK25cPAFvxf9XI/Emau+FSfSHkhRXp9RTRRxvRM53/Pmjl8IUax HSug== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.133 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.com Received: from lucky1.263xmail.com (lucky1.263xmail.com. [211.157.147.133]) by mx.google.com with ESMTPS id 19si15239541pli.160.2020.05.25.20.34.03 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 May 2020 20:34:03 -0700 (PDT) Received-SPF: pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.133 as permitted sender) client-ip=211.157.147.133; Received: from localhost (unknown [192.168.167.8]) by lucky1.263xmail.com (Postfix) with ESMTP id 06621B72B6; 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:01 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <5fd96fdf29328713779c9bbcfffb4aaf> 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 08/16] usb: dwc3: add dis_u2_freeclk_exists_quirk Date: Tue, 26 May 2020 11:33:47 +0800 Message-Id: <20200526033355.20147-4-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.133 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.U2_FREECLK_EXISTS bit, which specifies whether the USB2.0 PHY provides a free-running PHY clock, which is active when the clock control input is active. Refer to commit 27f83eeb6b42("usb: dwc3: add dis_u2_freeclk_exists_quirk") in Linux Rockchip 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 20be617fd4..3cb66515a2 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -401,6 +401,9 @@ static void dwc3_phy_setup(struct dwc3 *dwc) if (dwc->dis_enblslpm_quirk) reg &= ~DWC3_GUSB2PHYCFG_ENBLSLPM; + if (dwc->dis_u2_freeclk_exists_quirk) + reg &= ~DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS; + dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); mdelay(100); @@ -723,6 +726,7 @@ int dwc3_uboot_init(struct dwc3_device *dwc3_dev) 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->dis_u2_freeclk_exists_quirk = dwc3_dev->dis_u2_freeclk_exists_quirk; dwc->tx_de_emphasis_quirk = dwc3_dev->tx_de_emphasis_quirk; if (dwc3_dev->tx_de_emphasis) @@ -932,6 +936,8 @@ void dwc3_of_parse(struct dwc3 *dwc) "snps,dis-del-phy-power-chg-quirk"); dwc->dis_enblslpm_quirk = dev_read_bool(dev, "snps,dis_enblslpm_quirk"); + dwc->dis_u2_freeclk_exists_quirk = dev_read_bool(dev, + "snps,dis-u2-freeclk-exists-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 e76e357f1e..c5e656885a 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -161,6 +161,7 @@ /* Global USB2 PHY Configuration Register */ #define DWC3_GUSB2PHYCFG_PHYSOFTRST (1 << 31) +#define DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS (1 << 30) #define DWC3_GUSB2PHYCFG_SUSPHY (1 << 6) #define DWC3_GUSB2PHYCFG_ENBLSLPM (1 << 8) #define DWC3_GUSB2PHYCFG_PHYIF(n) ((n) << 3) @@ -824,6 +825,7 @@ struct dwc3 { unsigned dis_u2_susphy_quirk:1; unsigned dis_del_phy_power_chg_quirk:1; unsigned dis_enblslpm_quirk:1; + unsigned dis_u2_freeclk_exists_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 98d51e05e1..193d225d31 100644 --- a/include/dwc3-uboot.h +++ b/include/dwc3-uboot.h @@ -35,6 +35,7 @@ struct dwc3_device { unsigned dis_u2_susphy_quirk; unsigned dis_del_phy_power_chg_quirk; unsigned dis_enblslpm_quirk; + unsigned dis_u2_freeclk_exists_quirk; unsigned tx_de_emphasis_quirk; unsigned tx_de_emphasis; int index;