Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp884093rwi; Wed, 19 Oct 2022 04:17:41 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6mauA5M8/T4ohu2nFjc4Lx5GpAzfntfYkSugax/vAtqupFkXVmCcxBIuARhj/p9vW+5r0O X-Received: by 2002:a17:906:5dae:b0:78e:3109:36d1 with SMTP id n14-20020a1709065dae00b0078e310936d1mr6323042ejv.470.1666178260880; Wed, 19 Oct 2022 04:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666178260; cv=none; d=google.com; s=arc-20160816; b=hwqCIi22RcIPNpjgTY4XUBnTS+CkAo1B9JhxF6GVFWK61JhnlgCfZRs5jfeW7XuPQj C/jaqv5eTG/i6Ip7ghThSDaA9inPpBaI1YAocIZxPCl2Nl9XGj5p6gNcNloC9h1EnLFb /q5aQL+FsI54SR6XJH683Kc8qDO31ktBWjnkb1IhLCuBacYh2SKCUO6moDqJ1899OsNB v9RYbgQsnr6sju7FJSfBLTyol+qrF9KqDWpgnlfa6OXU884Vl4+ED3Ap4CbmbzOL/W4+ 9PSbpPlkvBgtG+pVmd5++5HeCjnOzPpmwoDUKsfm3FO4vMe77k0zO7LiTHtpyPDKVtnO qDPg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=7QnVT+wK5o+ETy+yv5RPf7fLf3Q6MjjbJQaaSRTd15k=; b=q96N17qaus0Tsw8/KQbHaSoF1dZEvxqprGL/c+7ht7zc/s8BsWaW0qTbUQOZRJelmI UloYJK3AwqnKit8kSlhJMaSTqI63UeNH+7iXwa4CtEQkuTmFJGpYBmHOHqanSzlLJ1Bi ZGhql97tO6JIXyxVt9Swg/aleJqsGp8SjhW0IXB1XODmXg0h5T6PGkCvYy10SaPGra4p YS5uLf/WdP5Zha7gGdExiQzcoUaAAtnORNeeLdM0K2AbssVtDHpCI1jnPs7Uh+CYU1fq XIl/K6c5kxY+vVnuukgQUUu8wlRlCpHxoKwEvlTkn3BrgcRYYvcs6DbXNM3yXwcBODiQ Crjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bb1sUMhH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g9-20020a1709065d0900b007317274bb0dsi4645234ejt.979.2022.10.19.04.17.13; Wed, 19 Oct 2022 04:17:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=bb1sUMhH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231843AbiJSKpW (ORCPT + 99 others); Wed, 19 Oct 2022 06:45:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36080 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232558AbiJSKnp (ORCPT ); Wed, 19 Oct 2022 06:43:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FA798F958; Wed, 19 Oct 2022 03:20:45 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 21AE0B824F3; Wed, 19 Oct 2022 09:15:58 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8BC37C433C1; Wed, 19 Oct 2022 09:15:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666170956; bh=fcLNnv9u9K0j6yxnl1HXbVSr6g3bpmcU8/1pU2KX7P4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bb1sUMhH3iMKHohrttB/UdJqV0zpVPKCA/fnLG5HmuwHslRZHxxeC/cnExtrl+147 jxlWe/NtkkX/8RcqxgEL9rotou0tKAIOM9GMXUe8Mzx5/BT46qwD6sj5UwnA7E7zgX 5Dn/3GiiC+Nxi8Gjw1ph6XBEDMl4ozCJoDZAbYAw= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Li Jun , Alexander Stein , Sasha Levin Subject: [PATCH 6.0 819/862] usb: dwc3: core: add gfladj_refclk_lpm_sel quirk Date: Wed, 19 Oct 2022 10:35:06 +0200 Message-Id: <20221019083326.100779024@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Stein [ Upstream commit a6fc2f1b092787e9d7dbe472d720cede81680315 ] This selects the SOF/ITP counter be running on ref_clk. As documented U2_FREECLK_EXISTS has to be set to 0 as well. Reviewed-by: Li Jun Signed-off-by: Alexander Stein Link: https://lore.kernel.org/r/20220915062855.751881-3-alexander.stein@ew.tq-group.com Signed-off-by: Greg Kroah-Hartman Signed-off-by: Sasha Levin --- drivers/usb/dwc3/core.c | 8 +++++++- drivers/usb/dwc3/core.h | 2 ++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 919d36fd0298..f7f1952b2901 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -407,6 +407,10 @@ static void dwc3_ref_clk_period(struct dwc3 *dwc) reg |= FIELD_PREP(DWC3_GFLADJ_REFCLK_FLADJ_MASK, fladj) | FIELD_PREP(DWC3_GFLADJ_240MHZDECR, decr >> 1) | FIELD_PREP(DWC3_GFLADJ_240MHZDECR_PLS1, decr & 1); + + if (dwc->gfladj_refclk_lpm_sel) + reg |= DWC3_GFLADJ_REFCLK_LPM_SEL; + dwc3_writel(dwc->regs, DWC3_GFLADJ, reg); } @@ -788,7 +792,7 @@ static int dwc3_phy_setup(struct dwc3 *dwc) else reg |= DWC3_GUSB2PHYCFG_ENBLSLPM; - if (dwc->dis_u2_freeclk_exists_quirk) + if (dwc->dis_u2_freeclk_exists_quirk || dwc->gfladj_refclk_lpm_sel) reg &= ~DWC3_GUSB2PHYCFG_U2_FREECLK_EXISTS; dwc3_writel(dwc->regs, DWC3_GUSB2PHYCFG(0), reg); @@ -1524,6 +1528,8 @@ static void dwc3_get_properties(struct dwc3 *dwc) "snps,dis-tx-ipgap-linecheck-quirk"); dwc->parkmode_disable_ss_quirk = device_property_read_bool(dev, "snps,parkmode-disable-ss-quirk"); + dwc->gfladj_refclk_lpm_sel = device_property_read_bool(dev, + "snps,gfladj-refclk-lpm-sel-quirk"); dwc->tx_de_emphasis_quirk = device_property_read_bool(dev, "snps,tx_de_emphasis_quirk"); diff --git a/drivers/usb/dwc3/core.h b/drivers/usb/dwc3/core.h index 4fe4287dc934..11975a03316f 100644 --- a/drivers/usb/dwc3/core.h +++ b/drivers/usb/dwc3/core.h @@ -391,6 +391,7 @@ #define DWC3_GFLADJ_30MHZ_SDBND_SEL BIT(7) #define DWC3_GFLADJ_30MHZ_MASK 0x3f #define DWC3_GFLADJ_REFCLK_FLADJ_MASK GENMASK(21, 8) +#define DWC3_GFLADJ_REFCLK_LPM_SEL BIT(23) #define DWC3_GFLADJ_240MHZDECR GENMASK(30, 24) #define DWC3_GFLADJ_240MHZDECR_PLS1 BIT(31) @@ -1312,6 +1313,7 @@ struct dwc3 { unsigned dis_del_phy_power_chg_quirk:1; unsigned dis_tx_ipgap_linecheck_quirk:1; unsigned parkmode_disable_ss_quirk:1; + unsigned gfladj_refclk_lpm_sel:1; unsigned tx_de_emphasis_quirk:1; unsigned tx_de_emphasis:2; -- 2.35.1