From patchwork Mon Jan 15 11:03:03 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13519530 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 29345C4707C for ; Mon, 15 Jan 2024 11:03:55 +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:References:In-Reply-To: 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=HPKr/jRP+0ah9A+CRRFyXpqU72QRehTFVgKNETrM7kQ=; b=bW6b6weTdWahcG 9b0FrK0eBeCn3sy0RfCF0bzCHFxPoKoEifNS5sF/yDIt+w+UJngYiITNF76gUIKiEHk0UTmi2+IHy zNcBNYiVqf01Skcobrtogxl9SnvRVd2mRWeWt0JgjnSZ2prfOxff7oaCqPSIEjc93Q4x5cy5S4ucZ nYz4Tbt4Kzg15Vi5fD9JHt30pk5mkgDiWRSf84tvB0N2bIXAVJ3tr0cgyRz+SHjDjA3oe8KF+O8MO AsuKAd2RAWnLvqN3Z+HFKJy0ZJz2tCmuJn9ucCncIqDQ86Dw41lpuFiZe5z7Bz+6Ie3BgGA5DTjVM Wp6KkBUu1Kh6KfWWZtMg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rPKka-008dQZ-1N; Mon, 15 Jan 2024 11:03:28 +0000 Received: from albert.telenet-ops.be ([2a02:1800:110:4::f00:1a]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rPKkR-008dNI-1i for linux-arm-kernel@lists.infradead.org; Mon, 15 Jan 2024 11:03:21 +0000 Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:1376:70aa:e074:32d3]) by albert.telenet-ops.be with bizsmtp id az3A2B00W34Hgv906z3A18; Mon, 15 Jan 2024 12:03:12 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1rPKjZ-00Fdgw-Tq; Mon, 15 Jan 2024 12:03:10 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1rPKkI-00Bz8m-MT; Mon, 15 Jan 2024 12:03:10 +0100 From: Geert Uytterhoeven To: Magnus Damm Cc: Ulrich Hecht , linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven Subject: [PATCH 1/3] ARM: dts: renesas: r8a73a4: Fix external clocks and clock rate Date: Mon, 15 Jan 2024 12:03:03 +0100 Message-Id: <1692bc8cd465d62168cbf110522ad62a7af3f606.1705315614.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240115_030319_729261_98BC9CB5 X-CRM114-Status: GOOD ( 11.51 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org External clocks should be defined as zero-Hz clocks in the SoC .dtsi, and overridden in the board .dts when present. Correct the clock rate of extal1 from 25 to 26 MHz, to match the crystal oscillator present on the APE6-EVM board. Fixes: a76809a329d6ebae ("ARM: shmobile: r8a73a4: Common clock framework DT description") Signed-off-by: Geert Uytterhoeven --- Before, DMIPS/MHZ for the Cortex-A15 CPU cores was slightly higher than on R-Car M2-W, due to most clocks running 4% faster than assumed. Also verified by measuring I2C clock rates using a logic analyzer. --- arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts | 12 ++++++++++++ arch/arm/boot/dts/renesas/r8a73a4.dtsi | 9 ++++++--- 2 files changed, 18 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts b/arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts index de87f2682e323866..ae656ee27124c745 100644 --- a/arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts +++ b/arch/arm/boot/dts/renesas/r8a73a4-ape6evm.dts @@ -223,6 +223,18 @@ &cmt1 { status = "okay"; }; +&extal1_clk { + clock-frequency = <26000000>; +}; + +&extal2_clk { + clock-frequency = <48000000>; +}; + +&extalr_clk { + clock-frequency = <32768>; +}; + &pfc { scifa0_pins: scifa0 { groups = "scifa0_data"; diff --git a/arch/arm/boot/dts/renesas/r8a73a4.dtsi b/arch/arm/boot/dts/renesas/r8a73a4.dtsi index 704b0e4acb4dedf6..b9c20e8ac14f2156 100644 --- a/arch/arm/boot/dts/renesas/r8a73a4.dtsi +++ b/arch/arm/boot/dts/renesas/r8a73a4.dtsi @@ -553,17 +553,20 @@ clocks { extalr_clk: extalr { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <32768>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; }; extal1_clk: extal1 { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <25000000>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; }; extal2_clk: extal2 { compatible = "fixed-clock"; #clock-cells = <0>; - clock-frequency = <48000000>; + /* This value must be overridden by the board. */ + clock-frequency = <0>; }; fsiack_clk: fsiack { compatible = "fixed-clock"; From patchwork Mon Jan 15 11:03:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13519531 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 A7979C3DA79 for ; Mon, 15 Jan 2024 11:03:59 +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:References:In-Reply-To: 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=iWJirAWISo4CEvMWYFiNe5Xb3QA2HKd8XUqn/8zmAH0=; b=tyU7zwKcsx/oDo rcj4I4KAh4SbappxfQPHXWc7xBgKnipod60K/zzr4yb/3DdgudoZCVEj7vtq8MopI8sVMBiFyJyre NHRz8VnD296N9orSK36NQLHfBB3YMx8cXHPwTc6mHr2pVbMz+u5aevOgSAfDGHA5zsueANbfQpbNY R24O6KAv5ob+FT3hQEgkemQU+7JtXu7F1sLDqUaWNvyGPFUVdgAxV2cbp+QRm5WM7RdMg7FbVaFop VFP3MRN3MrtAbhvu6IHSABFkcgmKDoJzfck9LuqPed4sZw6FW8f2fpvZiGjTZLjHp8J5CNM+VFAGz HPu1F8+Y50MkQwnqxHwA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rPKkZ-008dQA-2n; Mon, 15 Jan 2024 11:03:27 +0000 Received: from laurent.telenet-ops.be ([2a02:1800:110:4::f00:19]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rPKkQ-008dN0-1e for linux-arm-kernel@lists.infradead.org; Mon, 15 Jan 2024 11:03:21 +0000 Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:1376:70aa:e074:32d3]) by laurent.telenet-ops.be with bizsmtp id az3A2B00P34Hgv901z3AbV; Mon, 15 Jan 2024 12:03:11 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1rPKjZ-00Fdgy-UW; Mon, 15 Jan 2024 12:03:10 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1rPKkI-00Bz8p-N9; Mon, 15 Jan 2024 12:03:10 +0100 From: Geert Uytterhoeven To: Magnus Damm Cc: Ulrich Hecht , linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven Subject: [PATCH 2/3] ARM: dts: renesas: r8a73a4: Add cp clock Date: Mon, 15 Jan 2024 12:03:04 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240115_030318_707828_F8862611 X-CRM114-Status: GOOD ( 10.71 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add the Common Peripheral (CP) clock, which is driven by the main clock / 2 during normal system operation, but may be driven by EXTALR during early system boot, when SYSCLK_EN is still low. As the latter is irrelevant to Linux, just model it as a fixed clock driven from main_div2_clk. Switch all users of main_div2_clk that are documented to be clocked by the CP clock to cp_clk, to better reflect the actual clock topology. Signed-off-by: Geert Uytterhoeven --- arch/arm/boot/dts/renesas/r8a73a4.dtsi | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/arm/boot/dts/renesas/r8a73a4.dtsi b/arch/arm/boot/dts/renesas/r8a73a4.dtsi index b9c20e8ac14f2156..6847acaecc809eaa 100644 --- a/arch/arm/boot/dts/renesas/r8a73a4.dtsi +++ b/arch/arm/boot/dts/renesas/r8a73a4.dtsi @@ -727,6 +727,13 @@ main_div2_clk: main_div2 { clock-div = <2>; clock-mult = <1>; }; + cp_clk: cp { + compatible = "fixed-factor-clock"; + clocks = <&main_div2_clk>; + #clock-cells = <0>; + clock-div = <1>; + clock-mult = <1>; + }; pll0_div2_clk: pll0_div2 { compatible = "fixed-factor-clock"; clocks = <&cpg_clocks R8A73A4_CLK_PLL0>; @@ -792,9 +799,8 @@ R8A73A4_CLK_CMT1 mstp4_clks: mstp4_clks@e6150140 { compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks"; reg = <0 0xe6150140 0 4>, <0 0xe615004c 0 4>; - clocks = <&main_div2_clk>, <&cpg_clocks R8A73A4_CLK_ZS>, - <&main_div2_clk>, - <&cpg_clocks R8A73A4_CLK_HP>, + clocks = <&cp_clk>, <&cpg_clocks R8A73A4_CLK_ZS>, + <&cp_clk>, <&cpg_clocks R8A73A4_CLK_HP>, <&cpg_clocks R8A73A4_CLK_HP>; #clock-cells = <1>; clock-indices = < From patchwork Mon Jan 15 11:03:05 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 13519529 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 2B7A7C3DA79 for ; Mon, 15 Jan 2024 11:03:52 +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:References:In-Reply-To: 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=ZS1QPGDoYGM2B2r5yj6bE9WERr2UWM5blQkXX5Ww6KM=; b=JBmYspsTQAVwhe oH98/7Wp49ynDXCJcYp0nSPaijA9V1h9z8MhY9TdzffkKrZ79fEYVe2BxObWG5CYq+emmCRvc6ohQ 0H4GmyqZUd7lsG6dmhomFhfueXXJo+M8ECSz8BQovpW4O7K6vBE6SyAr4qX2Y6Qi+0DXWRaodeIts sZgFXXLIXoFn1Fuym89xpbA4aux12gGHUVBnDgMyitrA9uC0m2oKZ7uc02IgaErbb9OiMhCVIDNOP 4/QksNPsU0Ppa4tKFi/EaMn85+RSy/tbwyCg8tieVDmnHzM92AXKUH4kXaPIPhngpqSGcYCTS5CIk NQ4hUN6dpwuEN7Zzxy2g==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1rPKkT-008dOm-1v; Mon, 15 Jan 2024 11:03:21 +0000 Received: from andre.telenet-ops.be ([2a02:1800:120:4::f00:15]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1rPKkQ-008dNA-1L for linux-arm-kernel@lists.infradead.org; Mon, 15 Jan 2024 11:03:19 +0000 Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed40:1376:70aa:e074:32d3]) by andre.telenet-ops.be with bizsmtp id az3A2B00F34Hgv901z3AuH; Mon, 15 Jan 2024 12:03:12 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1rPKjZ-00Fdh2-VE; Mon, 15 Jan 2024 12:03:10 +0100 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1rPKkI-00Bz8u-O2; Mon, 15 Jan 2024 12:03:10 +0100 From: Geert Uytterhoeven To: Magnus Damm Cc: Ulrich Hecht , linux-renesas-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Geert Uytterhoeven Subject: [PATCH 3/3] ARM: dts: renesas: r8a73a4: Fix thermal parent clock Date: Mon, 15 Jan 2024 12:03:05 +0100 Message-Id: X-Mailer: git-send-email 2.34.1 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240115_030318_596775_F767A81E X-CRM114-Status: GOOD ( 11.70 ) 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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org According to Table 8.1, "Summary of Module Power, Reset condition and Clock assignment" of the R-Mobile APE6 Hardware Manual Rev. 0.7, the parent clock of the thermal sensor clock is the Common Peripheral (CP) clock, which runs at 13 MHz (main clock / 2). As the R-Car Thermal driver does not use the clock rate, this change has no functional impact. Signed-off-by: Geert Uytterhoeven --- arch/arm/boot/dts/renesas/r8a73a4.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/boot/dts/renesas/r8a73a4.dtsi b/arch/arm/boot/dts/renesas/r8a73a4.dtsi index 6847acaecc809eaa..b3d5c154cfc1b8c1 100644 --- a/arch/arm/boot/dts/renesas/r8a73a4.dtsi +++ b/arch/arm/boot/dts/renesas/r8a73a4.dtsi @@ -814,7 +814,7 @@ R8A73A4_CLK_IIC3 mstp5_clks: mstp5_clks@e6150144 { compatible = "renesas,r8a73a4-mstp-clocks", "renesas,cpg-mstp-clocks"; reg = <0 0xe6150144 0 4>, <0 0xe615003c 0 4>; - clocks = <&extal2_clk>, <&cpg_clocks R8A73A4_CLK_HP>; + clocks = <&cp_clk>, <&cpg_clocks R8A73A4_CLK_HP>; #clock-cells = <1>; clock-indices = < R8A73A4_CLK_THERMAL R8A73A4_CLK_IIC8