Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp52588pxm; Tue, 22 Feb 2022 06:14:34 -0800 (PST) X-Google-Smtp-Source: ABdhPJxXIOPoG9RnUbLODu9mzdnlwsMGl/7qjFJOJehWLYS3nQif35TNYOkLafzHKB5c/z9fD4vI X-Received: by 2002:a17:907:124b:b0:6cf:9c76:13f9 with SMTP id wc11-20020a170907124b00b006cf9c7613f9mr18879171ejb.603.1645539273980; Tue, 22 Feb 2022 06:14:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645539273; cv=none; d=google.com; s=arc-20160816; b=S8nrRtvNofagleTtzlqCIeoqP9Nsm7qPtZlxBgUY6pRuP+aanH9X13CbSS4qSA0xZZ /uRtIX15+F1DBC+3ObRUyIxgtsuKEJCknmhPTKNnXD37v39+o2PCcT4zOwMeiDVHPeIw GhOCe4R8OJWMsVohyArjl4jLpv6LhfW3Jo0E3T4pxkQbntTgcmy1Yld2ppsh5plr/cHb 6vJHf8GZ0Zd4k9gAS1wv+rbRyCcINBdzJlCaotVGIIUWUS57pmDN4hlQ/v2E6yK29gWP 4dvSzqZsAUi3PmFqb7JZQYM9FJvB8aCwDZkNTW7C6YEmGQwofv0TXMZJV4P0CN4V1lOO oxyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=aphfNeIWIAiX1qV4ack53dP1QspdbtUHcDW+apLlJss=; b=op664cbQJzG8sXJjoytwrdnBFgFHqLaazTRfAZZjvWnlW5vCJv3jsnQPU8pm9try5m 2p22sW0KlVPb7809juST949DPy9wE27PuWqbScIyxgvCyqfrFcT8j33aMfyCwZJJAzoC RhedEmJdT1wf7t3gusggYuYSpbezcLY3AZ0B3qA7yKc05TWTtFw/4jfgYi6q7MLk7isw Jd7QwmoW0WRnsVQ7EftR0zuG7E5293VmnVYwjalMtv+NxBkepQ6oQYokOg/skBlF/WN+ K0mDX+Er3D+83ZVpZxwHqeTNCHxmObO3P1AtoGZ6YfblWw+eCn4Y7VRpQXNsgPMXx+Wm smcQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Mxayw4Pq; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dm11si5015400ejc.352.2022.02.22.06.14.11; Tue, 22 Feb 2022 06:14:33 -0800 (PST) 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=@kernel.org header.s=k20201202 header.b=Mxayw4Pq; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232051AbiBVM4g (ORCPT + 99 others); Tue, 22 Feb 2022 07:56:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231889AbiBVM4f (ORCPT ); Tue, 22 Feb 2022 07:56:35 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A01F128DF7 for ; Tue, 22 Feb 2022 04:56:10 -0800 (PST) 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 16BF2B81998 for ; Tue, 22 Feb 2022 12:56:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2026AC340E8; Tue, 22 Feb 2022 12:56:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1645534567; bh=oJ/w9DrjJ8UVUe7wYc1OQHhSMTw8H6h+UWV8CFaeNPM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Mxayw4Pqw5XPRdaAsVWmuRsbbbCslKZoiBb8FJ2oApvIJFv2jL35xShhlroFOEs2X JlyvhbEnkYlsVX1DVTiGtFmjmCtmTJQ0FN1S2fKvb09j99a+mieAjG3KL/gQvyhotn UbUbnPE3id7GMKPRIZ2pkuQ08QRucvGUXiSjl1GkmigHeQWN3WewzT+QirTa7Sejdg QT+NdZnzL650m9fIShnU8GmzP2rh0op5qBZEePzwT2BM1Bc5/+cBsVxLPT+4r5Oxu4 HJtrX21OVDYaNvGZxHj9rwx9A+7MWi0FQENZ0eS+xELs9GA+8BVMtHPaqHYRMzoKVY uRe3dZbIto9uQ== Date: Tue, 22 Feb 2022 18:26:03 +0530 From: Vinod Koul To: Swapnil Jakhade Cc: kishon@ti.com, linux-phy@lists.infradead.org, linux-kernel@vger.kernel.org, mparab@cadence.com, a-govindraju@ti.com, r-ravikumar@ti.com Subject: Re: [PATCH 1/4] phy: cadence-torrent: Add function to get PLL to be configured for DP Message-ID: References: <20220127142958.23465-1-sjakhade@cadence.com> <20220127142958.23465-2-sjakhade@cadence.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220127142958.23465-2-sjakhade@cadence.com> X-Spam-Status: No, score=-7.1 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,T_SCC_BODY_TEXT_LINE 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 On 27-01-22, 15:29, Swapnil Jakhade wrote: > Torrent PHY PLL0 or PLL1 is used for DP depending on the single link or > multilink protocol configuration for which PHY is configured. In multilink > configurations with other protocols, either PLL0 or PLL1 will be used > for DP. For single link DP, both PLLs need to be configured at POR. > > Signed-off-by: Swapnil Jakhade > --- > drivers/phy/cadence/phy-cadence-torrent.c | 30 +++++++++++++++++++++++ > 1 file changed, 30 insertions(+) > > diff --git a/drivers/phy/cadence/phy-cadence-torrent.c b/drivers/phy/cadence/phy-cadence-torrent.c > index 7c4b8050485f..0e2839a6c65d 100644 > --- a/drivers/phy/cadence/phy-cadence-torrent.c > +++ b/drivers/phy/cadence/phy-cadence-torrent.c > @@ -38,6 +38,9 @@ > #define POLL_TIMEOUT_US 5000 > #define PLL_LOCK_TIMEOUT 100000 > > +#define DP_PLL0 BIT(0) > +#define DP_PLL1 BIT(1) > + > #define TORRENT_COMMON_CDB_OFFSET 0x0 > > #define TORRENT_TX_LANE_CDB_OFFSET(ln, block_offset, reg_offset) \ > @@ -323,6 +326,7 @@ struct cdns_torrent_phy { > void __iomem *base; /* DPTX registers base */ > void __iomem *sd_base; /* SD0801 registers base */ > u32 max_bit_rate; /* Maximum link bit rate to use (in Mbps) */ > + u32 dp_pll; > struct reset_control *phy_rst; > struct reset_control *apb_rst; > struct device *dev; > @@ -978,6 +982,30 @@ void cdns_torrent_dp_pma_cmn_vco_cfg_100mhz(struct cdns_torrent_phy *cdns_phy, > } > } > > +/* Set PLL used for DP configuration */ > +static int cdns_torrent_dp_get_pll(struct cdns_torrent_phy *cdns_phy, > + enum cdns_torrent_phy_type phy_t2) why return an error if you are going to ignore it! > +{ > + switch (phy_t2) { > + case TYPE_PCIE: > + case TYPE_USB: > + cdns_phy->dp_pll = DP_PLL1; > + break; > + case TYPE_SGMII: > + case TYPE_QSGMII: > + cdns_phy->dp_pll = DP_PLL0; > + break; > + case TYPE_NONE: > + cdns_phy->dp_pll = DP_PLL0 | DP_PLL1; > + break; > + default: > + dev_err(cdns_phy->dev, "Unsupported PHY configuration\n"); > + return -EINVAL; > + } > + > + return 0; > +} > + > /* > * Enable or disable PLL for selected lanes. > */ > @@ -1640,6 +1668,8 @@ static int cdns_torrent_dp_init(struct phy *phy) > return -EINVAL; > } > > + cdns_torrent_dp_get_pll(cdns_phy, TYPE_NONE); > + > cdns_torrent_dp_common_init(cdns_phy, inst); > > return cdns_torrent_dp_start(cdns_phy, inst, phy); > -- > 2.34.1 -- ~Vinod