Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id BF65CC433EF for ; Thu, 20 Jan 2022 12:25:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:In-Reply-To:References: Message-ID:Date:Subject:CC:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=yEAKe6QHH0H7congNYpuvDhOte0rlYmvFBGiKhQrMIE=; b=avQUzRtAylCyZK 1UqUShLP+fPMiQlSvIpAJhppZ7qRyLAfb+tPfRFYkYXnkW7Vg1cNQnAfIO71M0aDSoTKyPC/Gt1ER VhQ+M2HBnRlqv0EztCJCNhOye96Bcy3ji0jZ/ts6ey88M2n9w1SSRm69CaLcUErEzI94tC63XpeXg N5cGusv0fMMTwBNCqxIxzAbTroOmOaflFYmSeN/MuMgbrz5SA2BcnrinRNT/2JiB1HlnVmyT++V/3 hVTLUCuo9rVwBKZjAP/6r/4Jo3f3l/j39L8rAgpfpim6jrrWO4ZqmmiSl1pzOA4FQV9foFBxIvthK KIb9TrLIanRH/UZJsI8A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAWTt-00BMsH-Ay; Thu, 20 Jan 2022 12:23:57 +0000 Received: from mx2.securetransport.de ([188.68.39.254]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nAWTp-00BMlQ-FE for linux-arm-kernel@lists.infradead.org; Thu, 20 Jan 2022 12:23:55 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dh-electronics.com; s=dhelectronicscom; t=1642681412; bh=cjP1hY/gV6YI+gSva1g8dPyS/nmv5JYe3LAPaeC17Hk=; h=From:To:CC:Subject:Date:References:In-Reply-To:From; b=OP3b4icjGxSyzvXTdlJniHzinTA1Gf42AT0/x/Es7MDpZ0PHzqCPPfOO3naV9YDMw T/EzdPiIu8fsHUbINNqoqowyaIWlXd9sRFulcP/EACUpChSg6sC6gtO19CN6MzFUBz Ce/jgR2JA2n6or0kWVmNNI8iucWKRWhDvefNYMLVNW4c+X3x/K6KOoOJNxld6LUyHW F2c4FLNzVQvT/gRqre81jTOcfwWVso6pHJ0S/1ekvrnEeCaY2S2UtKwJso16VlrdTx yJj4LURKjbm7vl7rUkxKlXEg7gZSzkRv8l0/hCHlW012SpSYmFQcu/XXWi8XgLMnZJ p0j32DBc5T6cA== X-secureTransport-forwarded: yes From: Johann Neuhauser Complaints-To: abuse@cubewerk.de To: "Marek MV. Vasut" , "linux-arm-kernel@lists.infradead.org" CC: "Marek MV. Vasut" , Alexandre Torgue , Christophe Roullier , Gabriel Fernandez , Patrice Chotard , Patrick Delaunay , Stephen Boyd , "linux-clk@vger.kernel.org" , "linux-stm32@st-md-mailman.stormreply.com" Subject: RE: [PATCH 5/5] ARM: dts: stm32: Switch DWMAC RMII clock to MCO2 on DHCOM Thread-Topic: [PATCH 5/5] ARM: dts: stm32: Switch DWMAC RMII clock to MCO2 on DHCOM Thread-Index: AQHYDKoxtzPgICVgbEyNJNP9H9TX9Kxr02Ow Date: Thu, 20 Jan 2022 12:08:13 +0000 Message-ID: <5dde4cf58557485790bb7c14497e8cd1@dh-electronics.com> References: <20220118202958.1840431-1-marex@denx.de> <20220118202958.1840431-5-marex@denx.de> In-Reply-To: <20220118202958.1840431-5-marex@denx.de> Accept-Language: de-DE, en-US Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220120_042353_833433_F451349A X-CRM114-Status: GOOD ( 22.78 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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 > From: Marek Vasut [mailto:marex@denx.de] > Sent: Tuesday, January 18, 2022 9:30 PM > > The DHCOM SoM has two options for supplying ETHRX clock to the DWMAC > block and PHY. Either (1) ETHCK_K generates 50 MHz clock on ETH_CLK > pad for the PHY and the same 50 MHz clock are fed back to ETHRX via > internal eth_clk_fb clock connection OR (2) ETH_CLK is not used at > all, MCO2 generates 50 MHz clock on MCO2 output pad for the PHY and > the same MCO2 clock are fed back into ETHRX via ETH_RX_CLK input pad > using external pad-to-pad connection. > > Option (1) has two downsides. ETHCK_K is supplied directly from either > PLL3_Q or PLL4_P, hence the PLL output is limited to exactly 50 MHz and > since the same PLL output is also used to supply SDMMC blocks, the > performance of SD and eMMC access is affected. The second downside is > that using this option, the EMI of the SoM is higher. > > Option (2) solves both of those problems, so implement it here. In this > case, the PLL4_P is no longer limited and can be operated faster, at > 100 MHz, which improves SDMMC performance (read performance is improved > from ~41 MiB/s to ~57 MiB/s with dd if=/dev/mmcblk1 of=/dev/null bs=64M > count=1). The EMI interference also decreases. > > Signed-off-by: Marek Vasut > Cc: Alexandre Torgue > Cc: Christophe Roullier > Cc: Gabriel Fernandez > Cc: Patrice Chotard > Cc: Patrick Delaunay > Cc: Stephen Boyd > Cc: linux-clk@vger.kernel.org > Cc: linux-stm32@st-md-mailman.stormreply.com > To: linux-arm-kernel@lists.infradead.org > --- > arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi | 22 ++++++++++++++++---- > 1 file changed, 18 insertions(+), 4 deletions(-) > > diff --git a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi > index 8c41f819f7769..b091d9901e976 100644 > --- a/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi > +++ b/arch/arm/boot/dts/stm32mp15xx-dhcom-som.dtsi > @@ -116,15 +116,29 @@ &dts { > status = "okay"; > }; > > +&rcc { > + /* Connect MCO2 output to ETH_RX_CLK input via pad-pad connection */ > + clocks = <&rcc CK_MCO2>; > + clock-names = "ETH_RX_CLK/ETH_REF_CLK"; > + > + /* > + * Set PLL4P output to 100 MHz to supply SDMMC with faster clock, > + * set MCO2 output to 50 MHz to supply ETHRX clock with PLL4P/2, > + * so that MCO2 behaves as a divider for the ETHRX clock here. > + */ > + assigned-clocks = <&rcc CK_MCO2>, <&rcc PLL4_P>; > + assigned-clock-parents = <&rcc PLL4_P>; > + assigned-clock-rates = <50000000>, <100000000>; > +}; > + > ðernet0 { > status = "okay"; > - pinctrl-0 = <ðernet0_rmii_pins_a>; > - pinctrl-1 = <ðernet0_rmii_sleep_pins_a>; > + pinctrl-0 = <ðernet0_rmii_pins_b &mco2_pins_a>; > + pinctrl-1 = <ðernet0_rmii_sleep_pins_b &mco2_sleep_pins_a>; > pinctrl-names = "default", "sleep"; > phy-mode = "rmii"; > max-speed = <100>; > phy-handle = <&phy0>; > - st,eth-ref-clk-sel; > > mdio0 { > #address-cells = <1>; > @@ -136,7 +150,7 @@ phy0: ethernet-phy@1 { > /* LAN8710Ai */ > compatible = "ethernet-phy-id0007.c0f0", > "ethernet-phy-ieee802.3-c22"; > - clocks = <&rcc ETHCK_K>; > + clocks = <&rcc CK_MCO2>; > reset-gpios = <&gpioh 3 GPIO_ACTIVE_LOW>; > reset-assert-us = <500>; > reset-deassert-us = <500>; > -- > 2.34.1 Tested-by: Johann Neuhauser _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel