From patchwork Wed Aug 14 05:51:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dragan Simic X-Patchwork-Id: 13762854 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 118B3C3DA4A for ; Wed, 14 Aug 2024 05:52:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: MIME-Version:Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-Type: Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender: Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=smGTUgrDMJsloxjngBCXgAlvZKKZjQGim339zUexF1w=; b=ReZY1l2k1r3ZM9Pcypdk4l0hyK wJ/B2keKjIyEej+rnjBZtDLZ/KpF0bCWo1VfvP4j7cRa0+7uuK/maHEAh1IafPMzWFafAXHOinjOR kWTvLBQjAoajgcbWy534Y3EaTDRzCnNu+0mVzDWgsGKn30CS3RMgqZiJQC+EGXiVy97hxKAepMg0a 12u2jJYkepb3lbaAmkJZEehFsrTceSxIKTzEvuv8+nd7ASOqt5k58GVsoB3h6wBhtXiovE909rdcl RUcYH1RQ4jieacn/nOBrPJDCaHwg7bwLoPJ50qKlQ3mmrzWsrIOudk6NHF32migpkCtFovBzNW50y PqD/t53Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1se6w9-00000005qfN-2hjR; Wed, 14 Aug 2024 05:52:45 +0000 Received: from mail.manjaro.org ([116.203.91.91]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1se6vV-00000005qb9-01vQ for linux-arm-kernel@lists.infradead.org; Wed, 14 Aug 2024 05:52:07 +0000 From: Dragan Simic DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=manjaro.org; s=2021; t=1723614721; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=smGTUgrDMJsloxjngBCXgAlvZKKZjQGim339zUexF1w=; b=XgXyP/p0+7MLyRshVqDrXy0f9+MDty5oQdFOYTohZtW9svCGfsIb7J+SAVxrJtWoUc8GOu J5+KiIErgtUJ4ou6eYjS3/u9Rd8WMZ/bkrB01Ev8QdIBgVfjeAXn69Hw2DiudNQmnQa9uN +j78IWV6XOlwnrzNSulgKAVkG3pAF3KQjN1LO0j/SCfxpFrGvWWPf8ULyP1gAO8DKCqIx4 wTBAYanJonrEOy1eII9amsYKTOvDpCsmuTsvMLy5j9wBUy0eXkuvz1SX/s5JoNXtMU0BD1 b2I3KUF9lVYsyA/PPSNpJdvIh7GXI60U2nVkjBqQSFruFwekwI1aD7pw36c5tg== To: linux-sunxi@lists.linux.dev Cc: wens@csie.org, jernej.skrabec@gmail.com, samuel@sholland.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: dts: allwinner: a64: Move CPU OPPs to the SoC dtsi file Date: Wed, 14 Aug 2024 07:51:54 +0200 Message-Id: <92ebc9cba6eb669df73efd478e4f5745056a4ce5.1723614345.git.dsimic@manjaro.org> MIME-Version: 1.0 Authentication-Results: ORIGINATING; auth=pass smtp.auth=dsimic@manjaro.org smtp.mailfrom=dsimic@manjaro.org X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240813_225205_651396_71FBD5CB X-CRM114-Status: GOOD ( 15.96 ) 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 Move the Allwinner A64 CPU OPPs to the A64 SoC dtsi file and, consequently, adjust the contents of the affected board dts(i) files appropriately, to "encapsulate" the CPU OPPs into the SoC dtsi file. Moving the CPU OPPs to the SoC dtsi file, instead of requiring the board dts(i) files to include both the SoC dtsi file and the CPU OPP dtsi file, reduces the possibility for incomplete SoC data inclusion and improves the overall hierarchical representation of data. Moreover, the CPU OPPs are not used anywhere but together with the SoC dtsi file, which additionally justifies the folding of the CPU OPPs into the SoC dtsi file. No functional changes are introduced, which was validated by decompiling and comparing all affected board dtb files before and after these changes. When compared with the decompiled original dtb files, the updated dtb files have some of their blocks shuffled around a bit and some of their phandles have different values, as a result of the changes to the order in which the building blocks from the parent dtsi files are included into them, but they still effectively remain the same as the originals. Signed-off-by: Dragan Simic --- Notes: These changes follow the general approach used for the Rockchip RK3588 and RK3399 SoCs, which was introduced and described further in commits def88eb4d836 ("arm64: dts: rockchip: Prepare RK3588 SoC dtsi files for per-variant OPPs") [1] and 296602b8e5f7 ("arm64: dts: rockchip: Move RK3399 OPPs to dtsi files for SoC variants"), [2] respectively. Please see those commits for a more detailed explanation. [1] https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/commit/?h=for-next&id=def88eb4d8365a4aa064d28405d03550a9d0a3be [2] https://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git/commit/?h=for-next&id=296602b8e5f715d6a0ccdcd37d57170c2c81d5e4 .../allwinner/sun50i-a64-amarula-relic.dts | 2 - .../dts/allwinner/sun50i-a64-bananapi-m64.dts | 2 - .../dts/allwinner/sun50i-a64-cpu-opp.dtsi | 75 ------------------- .../dts/allwinner/sun50i-a64-nanopi-a64.dts | 2 - .../dts/allwinner/sun50i-a64-olinuxino.dts | 2 - .../dts/allwinner/sun50i-a64-orangepi-win.dts | 2 - .../boot/dts/allwinner/sun50i-a64-pine64.dts | 2 - .../dts/allwinner/sun50i-a64-pinebook.dts | 2 - .../dts/allwinner/sun50i-a64-pinephone.dtsi | 2 - .../boot/dts/allwinner/sun50i-a64-pinetab.dts | 2 - .../boot/dts/allwinner/sun50i-a64-sopine.dtsi | 2 - .../boot/dts/allwinner/sun50i-a64-teres-i.dts | 2 - arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi | 66 +++++++++++++++- .../allwinner/sun50i-h64-remix-mini-pc.dts | 2 - 14 files changed, 63 insertions(+), 102 deletions(-) delete mode 100644 arch/arm64/boot/dts/allwinner/sun50i-a64-cpu-opp.dtsi diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts index 8233582f6288..1590a455683f 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-amarula-relic.dts @@ -5,8 +5,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include / { diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts index d1f415acd7b5..869fd4a50582 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-bananapi-m64.dts @@ -4,8 +4,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include / { diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-cpu-opp.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-cpu-opp.dtsi deleted file mode 100644 index e39db51eb448..000000000000 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-cpu-opp.dtsi +++ /dev/null @@ -1,75 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0 -/* - * Copyright (C) 2020 Vasily khoruzhick - */ - -/ { - cpu0_opp_table: opp-table-cpu { - compatible = "operating-points-v2"; - opp-shared; - - opp-648000000 { - opp-hz = /bits/ 64 <648000000>; - opp-microvolt = <1040000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - - opp-816000000 { - opp-hz = /bits/ 64 <816000000>; - opp-microvolt = <1100000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - - opp-912000000 { - opp-hz = /bits/ 64 <912000000>; - opp-microvolt = <1120000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - - opp-960000000 { - opp-hz = /bits/ 64 <960000000>; - opp-microvolt = <1160000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - - opp-1008000000 { - opp-hz = /bits/ 64 <1008000000>; - opp-microvolt = <1200000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - - opp-1056000000 { - opp-hz = /bits/ 64 <1056000000>; - opp-microvolt = <1240000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - - opp-1104000000 { - opp-hz = /bits/ 64 <1104000000>; - opp-microvolt = <1260000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - - opp-1152000000 { - opp-hz = /bits/ 64 <1152000000>; - opp-microvolt = <1300000>; - clock-latency-ns = <244144>; /* 8 32k periods */ - }; - }; -}; - -&cpu0 { - operating-points-v2 = <&cpu0_opp_table>; -}; - -&cpu1 { - operating-points-v2 = <&cpu0_opp_table>; -}; - -&cpu2 { - operating-points-v2 = <&cpu0_opp_table>; -}; - -&cpu3 { - operating-points-v2 = <&cpu0_opp_table>; -}; diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts index dec9960a7440..e3b1943f7f63 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-nanopi-a64.dts @@ -4,8 +4,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include / { diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts index fd3794678c33..f1a4a9ab295b 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-olinuxino.dts @@ -4,8 +4,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include / { diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts index c8303a66438d..f3c9a3534612 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-orangepi-win.dts @@ -5,8 +5,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include / { diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts index 09e71fd60785..4f65eec043d0 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pine64.dts @@ -4,8 +4,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include / { diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts index 379c2c8466f5..a06a0b34bd3f 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinebook.dts @@ -5,8 +5,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include #include #include diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi index 6eab61a12cd8..0e38cd02a90a 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinephone.dtsi @@ -4,8 +4,6 @@ // Copyright (C) 2020 Ondrej Jirman #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include #include #include diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts index f5fb1ee32dad..4a49f137885b 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-pinetab.dts @@ -7,8 +7,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include #include #include diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi index 6d78a1c98f10..4ba5c11e6870 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi @@ -4,8 +4,6 @@ // Copyright (c) 2016 ARM Ltd. #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include &codec_analog { diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts index b407e1dd08a7..61ccd90bae01 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64-teres-i.dts @@ -5,8 +5,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include #include #include diff --git a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi index e868ca5ae753..f842e64562b7 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi +++ b/arch/arm64/boot/dts/allwinner/sun50i-a64.dtsi @@ -1,7 +1,10 @@ // SPDX-License-Identifier: (GPL-2.0+ OR MIT) -// Copyright (C) 2016 ARM Ltd. -// based on the Allwinner H3 dtsi: -// Copyright (C) 2015 Jens Kuske +/* + * Copyright (C) 2016 ARM Ltd. + * based on the Allwinner H3 dtsi: + * Copyright (C) 2015 Jens Kuske + * Copyright (C) 2020 Vasily khoruzhick + */ #include #include @@ -54,6 +57,7 @@ cpu0: cpu@0 { clocks = <&ccu CLK_CPUX>; clock-names = "cpu"; #cooling-cells = <2>; + operating-points-v2 = <&cpu_opp_table>; i-cache-size = <0x8000>; i-cache-line-size = <64>; i-cache-sets = <256>; @@ -71,6 +75,7 @@ cpu1: cpu@1 { clocks = <&ccu CLK_CPUX>; clock-names = "cpu"; #cooling-cells = <2>; + operating-points-v2 = <&cpu_opp_table>; i-cache-size = <0x8000>; i-cache-line-size = <64>; i-cache-sets = <256>; @@ -88,6 +93,7 @@ cpu2: cpu@2 { clocks = <&ccu CLK_CPUX>; clock-names = "cpu"; #cooling-cells = <2>; + operating-points-v2 = <&cpu_opp_table>; i-cache-size = <0x8000>; i-cache-line-size = <64>; i-cache-sets = <256>; @@ -105,6 +111,7 @@ cpu3: cpu@3 { clocks = <&ccu CLK_CPUX>; clock-names = "cpu"; #cooling-cells = <2>; + operating-points-v2 = <&cpu_opp_table>; i-cache-size = <0x8000>; i-cache-line-size = <64>; i-cache-sets = <256>; @@ -124,6 +131,59 @@ l2_cache: l2-cache { }; }; + cpu_opp_table: opp-table-cpu { + compatible = "operating-points-v2"; + opp-shared; + + opp-648000000 { + opp-hz = /bits/ 64 <648000000>; + opp-microvolt = <1040000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp-816000000 { + opp-hz = /bits/ 64 <816000000>; + opp-microvolt = <1100000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp-912000000 { + opp-hz = /bits/ 64 <912000000>; + opp-microvolt = <1120000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp-960000000 { + opp-hz = /bits/ 64 <960000000>; + opp-microvolt = <1160000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp-1008000000 { + opp-hz = /bits/ 64 <1008000000>; + opp-microvolt = <1200000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp-1056000000 { + opp-hz = /bits/ 64 <1056000000>; + opp-microvolt = <1240000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp-1104000000 { + opp-hz = /bits/ 64 <1104000000>; + opp-microvolt = <1260000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + + opp-1152000000 { + opp-hz = /bits/ 64 <1152000000>; + opp-microvolt = <1300000>; + clock-latency-ns = <244144>; /* 8 32k periods */ + }; + }; + de: display-engine { compatible = "allwinner,sun50i-a64-display-engine"; allwinner,pipelines = <&mixer0>, diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts index ce90327e1b2e..19cb74cf1f57 100644 --- a/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts +++ b/arch/arm64/boot/dts/allwinner/sun50i-h64-remix-mini-pc.dts @@ -4,8 +4,6 @@ /dts-v1/; #include "sun50i-a64.dtsi" -#include "sun50i-a64-cpu-opp.dtsi" - #include / {