From patchwork Mon May 11 07:55:12 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Wang X-Patchwork-Id: 1174 Return-Path: X-Original-To: linux-amarula@patchwork.amarulasolutions.com Delivered-To: linux-amarula@patchwork.amarulasolutions.com Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by ganimede.amarulasolutions.com (Postfix) with ESMTPS id 5B1843F08B for ; Mon, 11 May 2020 09:55:33 +0200 (CEST) Received: by mail-pj1-f70.google.com with SMTP id bg6sf16581492pjb.2 for ; Mon, 11 May 2020 00:55:33 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1589183732; cv=pass; d=google.com; s=arc-20160816; b=bu2M0Iblr0loE7VuFopPVu9HDUkRuhUUiOc7mglaPhyiCwZrmYfR90VUtMtpjmRy/d Cdd+C/z/ilIsp1QkIl2ML9EMeKmLjh9cHs+AGYKA/eF4VxeBqT3XQpSpfRl3ndh1EHJL N3J+KfgYTas9RTcNLsCMyCPAo8vFE8GHxQDnwE5aq8hze8lx1kuq09v43s2w01JPqZFQ f2b67HDyXKp4PaZ/wqFeyVZR7np1zGRosIGXJ/eTBZkFY3MPC9/wsNYTo6L2SwZ/huii XRdFWaNgeY1ixht0HkJaQaRIustPqMwMSlorbsYlK5GLoRY3Ez32W6fXiioTPzjeA4gk c+Xw== 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=rbpM808S9neo8EHv8wAd6xEKDZ2uRSqVtC+ialo35fU=; b=ldg3C0/3A5CBzdcmOre0VFZvpC/quFJVLYM9haC+YnsPlqt60LF97BSSP4tK/Ec1b5 NZbHXrc104oUWQHWa4NiKAlVtpy4f9/d0L9in+pXbrrV+41FmdSRGR0Q/nsmTEYiyHUp tmv/Av2gZvxR9gSCPrf0xdWl9ykpZ2AiYaBGRAKcE8Z0msL+ZyTHBx2tl2yE3EE+y5+M w+VMSOKnQPXjIhogOflWKd93EdOr2AuGH5ILCOM2F7kgkulKpLwFA8Kf2OXK0W4AVE/Z 4Xn2+kDrRP5RWzUzXaLOeLExnD1UsBhxdb19Z9SQYXdpMrikB41S+2hf3ptYQ7ZjbwHW IqbQ== ARC-Authentication-Results: i=2; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.130 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=rbpM808S9neo8EHv8wAd6xEKDZ2uRSqVtC+ialo35fU=; b=cpFAyfAQyjxjOorCETwnlIHBef0zTXhQ6TleINgxXRx/I6skv2sPjpLb1XfKkUJg+p /rsYqoSTSDvjrdDwxCdSMm/ngCGDWOfi97PTdhWfB/p2D4Wcx271x+W2yLf0Lz1ZySrW pxa950gTonhXxcMjeWj+t8R9dX0Rbe5gbmPQs= 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=rbpM808S9neo8EHv8wAd6xEKDZ2uRSqVtC+ialo35fU=; b=OmBWwnd/mOgYKaZNn503ANe5DYqjOmf9SfuhU5xq76Q+lM9/BzfF1Z9+UJXy3Q9asW 44sR8gAuCP1IylVXUil0VeFZ5tMeqQav4uLMwbIx2XMGnSzx6AmNpQHTcaffHUfV5aK1 Cz3PfsBEXuLqdTPYDRvxX89ZKSsAraDZtWZO38VDm3HrXN1g70TzggjWB4twcScMEP1z mlg/7fRNTtP+wKihFlKxhm3B0K0L63j+LNCzCUJWKj/g9GhSCX33h9uQ074kPBiL0PZf XLmv53lbHueom/UaC7jeWBhn0qdJrWEwIgARsOqSbGmMijmIoHaGfpntuOkmsHSRlCvi FI5g== Sender: linux-amarula@amarulasolutions.com X-Gm-Message-State: AGi0PuZpkrnLENF9/p1utHzne4ypUeNbMVZiGY2i7gpCv+PaVgXUMkkg k1ABCwQ+4MkUOoAWWM1a06mEKf0J X-Google-Smtp-Source: APiQypKoK63akcc86LeVxMUAlOmA7BQwuXimDcQivMxV9AqM/Kvyda04AOL38yHVVZhOPQTh7mcDqw== X-Received: by 2002:a63:24a:: with SMTP id 71mr14198977pgc.184.1589183732167; Mon, 11 May 2020 00:55:32 -0700 (PDT) MIME-Version: 1.0 X-BeenThere: linux-amarula@amarulasolutions.com Received: by 2002:a17:90b:4d05:: with SMTP id mw5ls15741422pjb.1.canary-gmail; Mon, 11 May 2020 00:55:28 -0700 (PDT) X-Received: by 2002:a17:90a:930c:: with SMTP id p12mr22884585pjo.64.1589183728725; Mon, 11 May 2020 00:55:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589183728; cv=none; d=google.com; s=arc-20160816; b=qVrRRGRV8XMrbf6Vo1ZWPTC2caYDPT11vfiMUxA47Jp3yllW/47xvE2WDak37VzPpu GV/0++A5rgffssbi8I6wguzCnFk83XBJ+9o8T29pwcQFkzbfgSK/DaCOcn19viWMkmLp oXgD0ma8TUjGXUW2dAA0BWumnGsCJ+ouSGn1AcvsuDMmEpee8SzsCGX6Fv6JfL0/ejBV WNkIYlJp2plp98f6WAj+tanzdQZ5tw+HxfffFCWsiSgSomCVJVmJ/TM44IOHgXNasuE8 IXywKVyAZfGhfCP4IVIDxOblDJa/rs6Fslt1r6jkcnEQ0n/EXKaoPsVXwkK6rM26CH7E Fsxg== 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=eTRR2rbTad3mEDe0it7aipRqKrJS/X4WiSHZAsD4hPY=; b=uEac4EoJ2qAXfLmCLT7DDzJpOoSbwsU/UoRlwH87ggtdY81SsObgMsoLqb2EsPAuac YKUqmt+biOFpdQXWX8ii3NwX1zJ058rQQ8o2fjA3EJbYEyQeYkuwPe37e7m1/nRCy7Hn 8vhzDHQur9bug1T2JsaJYAbGl6R4pwnnqyUh6vbPN+4PfAEbTvyeK8UaYFXckI7DxNzd yp8MPHKCnQZ1SNR9MEJxFfmaSjkED2dYVhErWzTmhQZzsreziLsKuLeEkXdduKAmD3XO W95JJ8i2ya3ObA34DfEwRfsOMlD9FG5pws/p+exIG8+cWJhRo777ZJ5IisOujb+xXmPk eeJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.130 as permitted sender) smtp.mailfrom=frank.wang@rock-chips.com Received: from lucky1.263xmail.com (lucky1.263xmail.com. [211.157.147.130]) by mx.google.com with ESMTPS id i132si7098938pgd.129.2020.05.11.00.55.28 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 00:55:28 -0700 (PDT) Received-SPF: pass (google.com: domain of frank.wang@rock-chips.com designates 211.157.147.130 as permitted sender) client-ip=211.157.147.130; Received: from localhost (unknown [192.168.167.8]) by lucky1.263xmail.com (Postfix) with ESMTP id 3D543B4E54; Mon, 11 May 2020 15:55:27 +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:27 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <4d14b74171187f3bbf4b5ef019f15a3c> 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 08/16] usb: dwc3: add dis_u2_freeclk_exists_quirk Date: Mon, 11 May 2020 15:55:12 +0800 Message-Id: <20200511075520.26557-4-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.130 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 # 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 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;