Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp4614571rdb; Tue, 12 Dec 2023 04:54:32 -0800 (PST) X-Google-Smtp-Source: AGHT+IGphun1JS1SB2sTDyXblOVxuGvom0bVPn3847v/WHMQ1ADCDyhlyocq8p5wx66oGU1lfNWN X-Received: by 2002:a17:902:db04:b0:1d0:81a3:4432 with SMTP id m4-20020a170902db0400b001d081a34432mr3639982plx.81.1702385671918; Tue, 12 Dec 2023 04:54:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702385671; cv=none; d=google.com; s=arc-20160816; b=agMWDLSQugwc6wsirwuZ7fwZY41yr7rg099Tpz6z/B9GsS+NJcjLDx+rYspPqlOqEH Ytelx9+eeIcL8DWb4QKAlIS/SW6AmLB49TORSs9tVRMy/iKfT4lgYo2PtDS6D+qxKBbA QZp1SAsFXy/F1YCMhy4y+FwzjEvwzTS7BqWXBR2WFk5MM7kRmBEgm87QBuwjjfOb6GeP IdvveNAigUfGOLWWqkSWtiZ6uWTyG+9YKgC6C6uWnh1opCtzJ7hZSeJMsh+ZDoK7t0Vu nw1RekKcdGbMD4nhdrMwIVtoW9S5k5cRimm7w+MMLypedY+qJT5aSHsQktyB7l6aXBi8 dbeQ== 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=SUAQ6qv2aDc1m39TxOBaleeDpMHPGrbRMQ0hbDXfaoc=; fh=NacFT00Flex3V9srurNu5Mg1ktNOLUllvwsK2y7VrOE=; b=tZLst3Jrlez+B3wzR/fiE78qoS//UvQgzoq2N3AdNxQT4UtYBts71Cc4hL4KKRobIo wU9+/HGDUkc8GJ3X2QCqKu/oVRklZTMvWhgW1FzbVtLsoEFPQEdzmsMzhttzDInmugoG Ua2PHOlq8bOqZkbynvbvPtR/SbRIUOEo2j9tZ2E54N25uJrzTyat4whT7IRl+siylrj4 VcQ2jOb5j/bDVJmIYwcOPWatzt7Z0qZEzW0zZsDTbwknbGVEFLDppb2WGg9yf1GZBhGR zLOxTl8Pr19zWIVGSENfyp8MQ1C9Yad/c8Cul1DogS+FJk6Ftwty9pVgf9RCmiHk6eWA ssOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MQuO2Peu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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. [2620:137:e000::3:7]) by mx.google.com with ESMTPS id j12-20020a170903024c00b001cfc46abb07si7949041plh.128.2023.12.12.04.54.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Dec 2023 04:54:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 as permitted sender) client-ip=2620:137:e000::3:7; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=MQuO2Peu; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:7 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 7A7C180AD8E8; Tue, 12 Dec 2023 04:54:29 -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 S1376364AbjLLMyR (ORCPT + 99 others); Tue, 12 Dec 2023 07:54:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1376342AbjLLMyQ (ORCPT ); Tue, 12 Dec 2023 07:54:16 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 931FDEE; Tue, 12 Dec 2023 04:54:21 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id BDDDBE0005; Tue, 12 Dec 2023 12:54:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1702385660; 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=SUAQ6qv2aDc1m39TxOBaleeDpMHPGrbRMQ0hbDXfaoc=; b=MQuO2Peu2llqSqRR1/YYvEdJdNUf+iPUYijiG0G0ljrK6Kxmy5nmYPEfdiPlRgp5Nl+aGn DkK6lPCLNdX4jgZZZQH50s1pYP0QCtcZXZCdaT5siIkf+oEH8r/YkowVTv+RUjUITj6llU xFKF0rdyfMxCs4Af+4k8/onZDL3nntonTknSTqNyVw45zj09tGmXemDqw1P5mF+f/joSte i7wXbG9l8DMdGVMqvstAh0uHspm9hJ7LiNmEEHGMceFCiQHRomZobD25BIJsFxVwhibl7w NWtyT4VPqO/OLs7Yp7GNfTPGYT08lOiNCAMtiPrJ30UMjr3CyzR2lepTxaeEzQ== Date: Tue, 12 Dec 2023 13:54:17 +0100 From: Maxime Chevallier To: Luo Jie Cc: , , , , , , , , , , , , , , , , , , Subject: Re: [PATCH v2 3/5] net: mdio: ipq4019: configure CMN PLL clock for ipq5332 Message-ID: <20231212135417.67ece4d0@device.home> In-Reply-To: <20231212115151.20016-4-quic_luoj@quicinc.com> References: <20231212115151.20016-1-quic_luoj@quicinc.com> <20231212115151.20016-4-quic_luoj@quicinc.com> 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_H3,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]); Tue, 12 Dec 2023 04:54:29 -0800 (PST) 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 [...] > @@ -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