Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp5212850rdb; Wed, 13 Dec 2023 02:09:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IHGNUI32Gl2NWkNy8sGNFdJ6NpF4rsz8YvF/3Kv91cMqW06MBUQa5OywxII50qxQIl0Fie+ X-Received: by 2002:a05:6a21:19c:b0:18d:1fbb:f8ab with SMTP id le28-20020a056a21019c00b0018d1fbbf8abmr10233700pzb.58.1702462153560; Wed, 13 Dec 2023 02:09:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702462153; cv=none; d=google.com; s=arc-20160816; b=aMjWPdMdjrHbWU/UHuntsqwXpIm+rFGSTZbClnY6V2UXeeFGKywPCNjdShzAVH3sL2 o9aLi73qRhF+Qd8wc9GWBPTFkAV0yOSLpjEMt0IbYPbW514zprta47XK34w6PnIfac4n 0zFBf+0QHiGXtTaLCcfMTAFmLyt29hfy+Ogo9QrdGtSFXmuCm4LhOF7XPU95NV4Bgtj7 8CIhajGJ7vQl2SNqLHbExCKIrcOTLLkOsCbySCrUJ7CAtM28cP9oiQFEneNHjTfVSuaP kR/O15gHPPTBRAuCR8377LOc9n2BdqV3zFQIzUVsCXz4LlESaCYvPkjssN+aZVt6t30H pT7Q== 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 :organization:references:in-reply-to:message-id:subject:cc:to:from :date:dkim-signature; bh=BkEPmwBo76rZMnhAQd2TljBiXO6wxAjKUlmXUkfuePY=; fh=bLLDYZRA0E+3NkPLaFdErY/OwRw5WsuKuC+lG5rXz0o=; b=kkIjY0tJY1BR0LkWE68gOAn9Y/7R845nHj+IlSpRvFjXMp06/A95WLPbp3Ygpke5J6 WX5O9Dhy0Mw7V36MjuvsZbAcEvdSmkiAmqsiAD71vH0FJkse0DBBjfe5l3D5QEVAkBWh Zyopa9Sam7jHc0yP58iT3xpXQuCMDeSjlEzqIfDLeXJZ2um9UsUDDdfl001XQYCLVnHA grIOP3lIZbMQqQla72sLDRJHXpFbs4xL5m3+QyPr/GbenD5CFb5/LTlMSbhHBSmnoyG2 3YntWJWTFWPFpxd8YjgmvzWERtLtAtSYEGMoTsqidFvs/TpB/qFi5izoYossHx8d8RDE 5RJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=o1TvX1J7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id u6-20020a6540c6000000b005c60319035dsi9055256pgp.835.2023.12.13.02.09.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Dec 2023 02:09:13 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=o1TvX1J7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 926F780BC53D; Wed, 13 Dec 2023 02:09:12 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235267AbjLMKIx (ORCPT + 99 others); Wed, 13 Dec 2023 05:08:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34894 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235247AbjLMKIw (ORCPT ); Wed, 13 Dec 2023 05:08:52 -0500 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [217.70.183.198]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C581783; Wed, 13 Dec 2023 02:08:57 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id EC77EC0007; Wed, 13 Dec 2023 10:08:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702462136; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=BkEPmwBo76rZMnhAQd2TljBiXO6wxAjKUlmXUkfuePY=; b=o1TvX1J7P4zG7d64wUmm6horPq6/QP0Cau8umau4GIgzX90kjj/oBPz/oTiCVDKMgmkSMB SSNUEJM7Odk6FBTt3Atpq/m6U9/t2dhz3l3jax8NSgEGulOn/LQE9axsGEsQXEdvTCEGSq 4x+cpLUEOCJp1t76t8kIZYaEBrTzxf2QUL9yBF6iKWWlcobzecfU6pzGwsgBonAWdL6S7R XOAJMLZpcRdRXoEEQj5vwcvT63cCHmIgVZBls5I5Y3daiSD7uQ0jJSNY+3sHCrDLzatAzn Wy2GsboVFaPc5dyMuuvbp8ywgg32TwvsxbVrNEIFh6vmqsa2fgKPrxoVwOKMlg== Date: Wed, 13 Dec 2023 11:08:53 +0100 From: Maxime Chevallier To: Jie Luo Cc: , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v2 3/5] net: mdio: ipq4019: configure CMN PLL clock for ipq5332 Message-ID: <20231213110853.07f2be7d@device.home> In-Reply-To: References: <20231212115151.20016-1-quic_luoj@quicinc.com> <20231212115151.20016-4-quic_luoj@quicinc.com> <20231212135417.67ece4d0@device.home> Organization: Bootlin X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-GND-Sasl: maxime.chevallier@bootlin.com X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,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 X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 13 Dec 2023 02:09:12 -0800 (PST) On Wed, 13 Dec 2023 16:09:53 +0800 Jie Luo wrote: > On 12/12/2023 8:54 PM, Maxime Chevallier wrote: > > Hello, > > > > I have some more minor comments for yoi :) > > > > On Tue, 12 Dec 2023 19:51:48 +0800 > > Luo Jie wrote: > > > >> The reference clock of CMN PLL block is selectable, the internal > >> 48MHZ is used by default. > >> > >> The output clock of CMN PLL block is for providing the clock > >> source of ethernet device(such as qca8084), there are 1 * 25MHZ > >> and 3 * 50MHZ output clocks available for the ethernet devices. > >> > >> Signed-off-by: Luo Jie > >> --- > > > > [...] > > > >> +/* For the CMN PLL block, the reference clock can be configured according to > >> + * the device tree property "cmn-reference-clock", the internal 48MHZ is used > >> + * by default on the ipq533 platform. > >> + * > >> + * The output clock of CMN PLL block is provided to the ethernet devices, > >> + * threre are 4 CMN PLL output clocks (1*25MHZ + 3*50MHZ) enabled by default. > >> + * > >> + * Such as the output 50M clock for the qca8084 ethernet PHY. > >> + */ > >> +static int ipq_cmn_clock_config(struct mii_bus *bus) > >> +{ > >> + int ret; > >> + u32 reg_val, src_sel, ref_clk; > >> + struct ipq4019_mdio_data *priv; > > > > Here you should also use reverse christmas-tree notation > > Ok, will correct this, thanks. > > > > > [...] > > > >> @@ -317,6 +441,17 @@ static int ipq4019_mdio_probe(struct platform_device *pdev) > >> } > >> } > >> > >> + /* The CMN block resource is for providing clock source to ethernet, > >> + * which can be optionally configured on the platform ipq9574 and > >> + * ipq5332. > >> + */ > >> + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "cmn_blk"); > >> + if (res) { > >> + priv->cmn_membase = devm_ioremap_resource(&pdev->dev, res); > >> + if (IS_ERR(priv->cmn_membase)) > >> + return PTR_ERR(priv->cmn_membase); > >> + } > >> + > > > > And here you can simplify a bit by using > > devm_platform_ioremap_resource_byname() > > > > Thanks, > > > > Maxime > > > As Russell mentioned, since this resource is optional, > so devm_platform_ioremap_resource_byname can't be used here. > Indeed, my bad I missed that point. Sorry for the noise :/ Thanks, Maxime