From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-14.2 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F3D0C433DB for ; Wed, 13 Jan 2021 14:05:46 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 311C923382 for ; Wed, 13 Jan 2021 14:05:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 311C923382 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=fwncJJ9tsdb+0wnTvKGWC1Jv4NixS7EPSUTMLdkW0Sw=; b=248Ax/FEDl63tPojjR/SdNhvD klY6+NWAPZKUlbcE3lVF+YP87yXA7TR0t2YaFrKgJTf2LTGURDFgYxaH4/lK/EGMJlF61Z5/G/ZKr 4o8AH+o+zY9FHDE9A/cgA5G6DT73Ml+UTEq/mUTC/uDyIshGmzXLMKYmMFEskD9tasxSGKRXvmpjZ vmw2EzJCL8eeHbNsT1KL1UbeTrFTUyyMsm4gHxGk2V9heIm6cFz7Mb11/lt2zMnDqzhPgvOVmI5E2 9A5fQUJ5IIjGTUAdFEirKtJlCx49VPBBOk59xoDUPF5SzXcXnPLis2uTYX4AjnGoY3o/1Rs6gSOeg agNnZdBlA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzgl2-00039q-FI; Wed, 13 Jan 2021 14:04:20 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kzgkz-000396-N4 for linux-arm-kernel@lists.infradead.org; Wed, 13 Jan 2021 14:04:18 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id 85EEE23382; Wed, 13 Jan 2021 14:04:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1610546656; bh=+1kxR8vH18rqeWixw2gVBw9HQWeNytBO0/nYFFbzJ/c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=FfitW0nLrDbZU4DRMhAsrcPUK84kHTo99ipxUT+qTjxn8ukPBJ7l+0+rqT21iuo1G 40ukcqtzPgTVMVHaZNDqAWFEEU2bAZaHzJejOYPhwZ8EQIkQzjBYQo20DSFRjVKne9 35oaelCEtSmvuTGT9rXPC/Qg412RKbvSpOpDwLIOuuykpe9G3OKuVY7ZnTPMypDaw8 OB9JJP2UjVVQlLpUeE8jcVq+rnqwcZMnruhsFG2YA+T9INRTsBJKIe2nKCo6iXvFWd /FaAVD8RjOU0QIda46vHsN/fxHGtEePEDIiCrnoIsrmQQPU19U8cnKfc5lhXiuhGtV AP/pMNoXO+5TA== Date: Wed, 13 Jan 2021 19:34:12 +0530 From: Vinod Koul To: Kishon Vijay Abraham I Subject: Re: [PATCH 5/7] phy: ti: j721e-wiz: Configure full rate divider for AM64 Message-ID: <20210113140412.GP2771@vkoul-mobl> References: <20201224114250.1083-1-kishon@ti.com> <20201224114250.1083-6-kishon@ti.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201224114250.1083-6-kishon@ti.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210113_090417_929853_E1BC3B6A X-CRM114-Status: GOOD ( 21.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Nishanth Menon , devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Rob Herring , Swapnil Jakhade , Peter Rosin , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 24-12-20, 17:12, Kishon Vijay Abraham I wrote: > The frequency of the txmclk between PCIe and SERDES has > changed to 250MHz from 500MHz. Configure full rate divider > for AM64 accordingly. > > Signed-off-by: Kishon Vijay Abraham I > --- > drivers/phy/ti/phy-j721e-wiz.c | 43 +++++++++++++++++++++++++++++++--- > 1 file changed, 40 insertions(+), 3 deletions(-) > > diff --git a/drivers/phy/ti/phy-j721e-wiz.c b/drivers/phy/ti/phy-j721e-wiz.c > index 2a03191eac64..08acfab1ebe6 100644 > --- a/drivers/phy/ti/phy-j721e-wiz.c > +++ b/drivers/phy/ti/phy-j721e-wiz.c > @@ -101,6 +101,13 @@ static const struct reg_field p_standard_mode[WIZ_MAX_LANES] = { > REG_FIELD(WIZ_LANECTL(3), 24, 25), > }; > > +static const struct reg_field p0_fullrt_div[WIZ_MAX_LANES] = { > + REG_FIELD(WIZ_LANECTL(0), 22, 23), > + REG_FIELD(WIZ_LANECTL(1), 22, 23), > + REG_FIELD(WIZ_LANECTL(2), 22, 23), > + REG_FIELD(WIZ_LANECTL(3), 22, 23), > +}; > + > static const struct reg_field typec_ln10_swap = > REG_FIELD(WIZ_SERDES_TYPEC, 30, 30); > > @@ -193,6 +200,7 @@ static struct wiz_clk_div_sel clk_div_sel[] = { > enum wiz_type { > J721E_WIZ_16G, > J721E_WIZ_10G, > + AM64_WIZ_10G, > }; > > #define WIZ_TYPEC_DIR_DEBOUNCE_MIN 100 /* ms */ > @@ -210,6 +218,7 @@ struct wiz { > struct regmap_field *p_align[WIZ_MAX_LANES]; > struct regmap_field *p_raw_auto_start[WIZ_MAX_LANES]; > struct regmap_field *p_standard_mode[WIZ_MAX_LANES]; > + struct regmap_field *p0_fullrt_div[WIZ_MAX_LANES]; > struct regmap_field *pma_cmn_refclk_int_mode; > struct regmap_field *pma_cmn_refclk_mode; > struct regmap_field *pma_cmn_refclk_dig_div; > @@ -380,7 +389,7 @@ static int wiz_regfield_init(struct wiz *wiz) > } > > clk_mux_sel = &wiz->clk_mux_sel[REFCLK_DIG]; > - if (wiz->type == J721E_WIZ_10G) > + if (wiz->type == J721E_WIZ_10G || wiz->type == AM64_WIZ_10G) > clk_mux_sel->field = > devm_regmap_field_alloc(dev, regmap, > refclk_dig_sel_10g); > @@ -424,6 +433,14 @@ static int wiz_regfield_init(struct wiz *wiz) > i); > return PTR_ERR(wiz->p_standard_mode[i]); > } > + > + wiz->p0_fullrt_div[i] = > + devm_regmap_field_alloc(dev, regmap, p0_fullrt_div[i]); > + if (IS_ERR(wiz->p0_fullrt_div[i])) { > + dev_err(dev, "P%d_FULLRT_DIV reg field init failed\n", > + i); single line? > + return PTR_ERR(wiz->p0_fullrt_div[i]); > + } > } > > wiz->typec_ln10_swap = devm_regmap_field_alloc(dev, regmap, > @@ -719,6 +736,19 @@ static int wiz_phy_reset_assert(struct reset_controller_dev *rcdev, > return ret; > } > > +static int wiz_phy_fullrt_div(struct wiz *wiz, int lane) > +{ > + int ret = 0; drop the variable.. > + > + if (wiz->type != AM64_WIZ_10G) > + return 0; > + > + if (wiz->lane_phy_type[lane] == PHY_TYPE_PCIE) > + ret = regmap_field_write(wiz->p0_fullrt_div[lane], 0x1); return regmap_ > + > + return ret; return 0 > +} > + > static int wiz_phy_reset_deassert(struct reset_controller_dev *rcdev, > unsigned long id) > { > @@ -742,6 +772,10 @@ static int wiz_phy_reset_deassert(struct reset_controller_dev *rcdev, > return ret; > } > > + ret = wiz_phy_fullrt_div(wiz, id - 1); > + if (ret) > + return ret; > + > if (wiz->lane_phy_type[id - 1] == PHY_TYPE_DP) > ret = regmap_field_write(wiz->p_enable[id - 1], P_ENABLE); > else > @@ -769,6 +803,9 @@ static const struct of_device_id wiz_id_table[] = { > { > .compatible = "ti,j721e-wiz-10g", .data = (void *)J721E_WIZ_10G > }, > + { > + .compatible = "ti,am64-wiz-10g", .data = (void *)AM64_WIZ_10G > + }, > {} > }; > MODULE_DEVICE_TABLE(of, wiz_id_table); > @@ -904,14 +941,14 @@ static int wiz_probe(struct platform_device *pdev) > wiz->dev = dev; > wiz->regmap = regmap; > wiz->num_lanes = num_lanes; > - if (wiz->type == J721E_WIZ_10G) > + if (wiz->type == J721E_WIZ_10G || wiz->type == AM64_WIZ_10G) > wiz->clk_mux_sel = clk_mux_sel_10g; > else > wiz->clk_mux_sel = clk_mux_sel_16g; > > wiz->clk_div_sel = clk_div_sel; > > - if (wiz->type == J721E_WIZ_10G) > + if (wiz->type == J721E_WIZ_10G || wiz->type == AM64_WIZ_10G) > wiz->clk_div_sel_num = WIZ_DIV_NUM_CLOCKS_10G; > else > wiz->clk_div_sel_num = WIZ_DIV_NUM_CLOCKS_16G; > -- > 2.17.1 -- ~Vinod _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel