linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nick Chan <towinchenmi@gmail.com>
To: Hector Martin <marcan@marcan.st>, Sven Peter <sven@svenpeter.dev>,
	Alyssa Rosenzweig <alyssa@rosenzweig.io>,
	Rob Herring <robh@kernel.org>,
	Krzysztof Kozlowski <krzk+dt@kernel.org>,
	Conor Dooley <conor+dt@kernel.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Viresh Kumar <viresh.kumar@linaro.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Wim Van Sebroeck <wim@linux-watchdog.org>,
	Guenter Roeck <linux@roeck-us.net>,
	Catalin Marinas <catalin.marinas@arm.com>,
	Will Deacon <will@kernel.org>,
	Lorenzo Pieralisi <lpieralisi@kernel.org>,
	Mark Kettenis <kettenis@openbsd.org>,
	asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org,
	devicetree@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-pm@vger.kernel.org, linux-gpio@vger.kernel.org,
	linux-watchdog@vger.kernel.org
Cc: Konrad Dybcio <konradybcio@kernel.org>,
	Ivaylo Ivanov <ivo.ivanov.ivanov1@gmail.com>,
	Nick Chan <towinchenmi@gmail.com>
Subject: [PATCH 21/22] arm64: dts: apple: t8010: Add cpufreq nodes
Date: Wed, 11 Sep 2024 16:41:11 +0800	[thread overview]
Message-ID: <20240911084353.28888-23-towinchenmi@gmail.com> (raw)
In-Reply-To: <20240911084353.28888-2-towinchenmi@gmail.com>

Add cpufreq nodes for the A10 SoC.

The Apple iPod touch 7 can only go up to 1.64 GHz, so the higher operating
points are in t8010-fast.dtsi.

A10 consists of logical cores that switches between E-mode and P-mode
depending on the current p-state. Each mode have different capacities so
the E-mode frequencies are adjusted to make performance scale linearly
with clock speed.

Signed-off-by: Nick Chan <towinchenmi@gmail.com>
---
 arch/arm64/boot/dts/apple/t8010-fast.dtsi | 19 +++++++
 arch/arm64/boot/dts/apple/t8010.dtsi      | 60 +++++++++++++++++++++++
 2 files changed, 79 insertions(+)

diff --git a/arch/arm64/boot/dts/apple/t8010-fast.dtsi b/arch/arm64/boot/dts/apple/t8010-fast.dtsi
index 4bdf1c3eccfe..9a263eadc776 100644
--- a/arch/arm64/boot/dts/apple/t8010-fast.dtsi
+++ b/arch/arm64/boot/dts/apple/t8010-fast.dtsi
@@ -6,3 +6,22 @@
  */
 
 #include "t8010.dtsi"
+
+/ {
+	opp: opp-table-0 {
+		opp08 {
+			opp-hz = /bits/ 64 <1944000000>;
+			opp-level = <8>;
+		};
+
+		opp09 {
+			opp-hz = /bits/ 64 <2244000000>;
+			opp-level = <9>;
+		};
+
+		opp10 {
+			opp-hz = /bits/ 64 <2340000000>;
+			opp-level = <10>;
+		};
+	};
+};
diff --git a/arch/arm64/boot/dts/apple/t8010.dtsi b/arch/arm64/boot/dts/apple/t8010.dtsi
index 926a0f501477..e7d7194b412c 100644
--- a/arch/arm64/boot/dts/apple/t8010.dtsi
+++ b/arch/arm64/boot/dts/apple/t8010.dtsi
@@ -50,6 +50,8 @@ cpu0: cpu@0 {
 			compatible = "apple,hurricane-zephyr";
 			reg = <0x0 0x0>;
 			cpu-release-addr = <0 0>; /* To be filled by loader */
+			operating-points-v2 = <&opp>;
+			performance-domains = <&cpufreq>;
 			enable-method = "spin-table";
 			device_type = "cpu";
 		};
@@ -58,11 +60,63 @@ cpu1: cpu@1 {
 			compatible = "apple,hurricane-zephyr";
 			reg = <0x0 0x1>;
 			cpu-release-addr = <0 0>; /* To be filled by loader */
+			operating-points-v2 = <&opp>;
+			performance-domains = <&cpufreq>;
 			enable-method = "spin-table";
 			device_type = "cpu";
 		};
 	};
 
+	opp: opp-table-0 {
+		compatible = "operating-points-v2";
+
+		/*
+		 * The E-core frequencies are adjusted so performance scales
+		 * linearly with reported clock speed.
+		 */
+
+		opp01 {
+			opp-hz = /bits/ 64 <149000000>; /* 396 MHz, E-core */
+			opp-level = <1>;
+		};
+
+		opp02 {
+			opp-hz = /bits/ 64 <275000000>; /* 732 MHz, E-core */
+			opp-level = <2>;
+		};
+
+		opp03 {
+			opp-hz = /bits/ 64 <410000000>; /* 1092 MHz, E-core */
+			opp-level = <3>;
+		};
+
+		/* The following operating points are handled by the P-cores */
+		opp04 {
+			opp-hz = /bits/ 64 <756000000>;
+			opp-level = <4>;
+		};
+
+		opp05 {
+			opp-hz = /bits/ 64 <1056000000>;
+			opp-level = <5>;
+		};
+
+		opp06 {
+			opp-hz = /bits/ 64 <1356000000>;
+			opp-level = <6>;
+		};
+
+		opp07 {
+			opp-hz = /bits/ 64 <1644000000>;
+			opp-level = <7>;
+		};
+
+		/*
+		 * The iPod Touch 7 supports up to 1.6 GHz, faster operating
+		 * points for other devices are in t8010-fast.dtsi
+		 */
+	};
+
 	memory@800000000 {
 		device_type = "memory";
 		reg = <0x8 0 0 0>; /* To be filled by loader */
@@ -86,6 +140,12 @@ soc {
 		nonposted-mmio;
 		ranges;
 
+		cpufreq: performance-controller@202f20000 {
+			compatible = "apple,t8010-cluster-cpufreq", "apple,t8103-cluster-cpufreq", "apple,cluster-cpufreq";
+			reg = <0x2 0x2f20000 0 0x1000>;
+			#performance-domain-cells = <0>;
+		};
+
 		serial0: serial@20a0c0000 {
 			compatible = "apple,s5l-uart";
 			reg = <0x2 0x0a0c0000 0x0 0x4000>;
-- 
2.46.0


  parent reply	other threads:[~2024-09-11  8:48 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-11  8:40 [PATCH 00/22] Initial device trees for A7-A11 based Apple devices Nick Chan
2024-09-11  8:40 ` [PATCH 01/22] dt-bindings: arm: cpus: Add Apple A7-A11 CPU cores Nick Chan
2024-09-11 18:16   ` Conor Dooley
2024-09-11 18:40     ` Nick Chan
2024-09-11  8:40 ` [PATCH 02/22] dt-bindings: watchdog: apple,wdt: Add A7-A11 compatibles Nick Chan
2024-09-11 17:52   ` Conor Dooley
2024-09-11  8:40 ` [PATCH 03/22] dt-bindings: cpufreq: apple,cluster-cpufreq: Add A10 compatible Nick Chan
2024-09-11 18:10   ` Conor Dooley
2024-09-11  8:40 ` [PATCH 04/22] dt-bindings: pinctrl: apple,pinctrl: Add A7-A11 compatibles Nick Chan
2024-09-11 18:10   ` Conor Dooley
2024-09-11  8:40 ` [PATCH 05/22] dt-bindings: arm: apple: Add A7 devices Nick Chan
2024-09-11 18:13   ` Conor Dooley
2024-09-11 18:24     ` Nick Chan
2024-09-11 18:27       ` Conor Dooley
2024-09-11  8:40 ` [PATCH 06/22] dt-bindings: arm: apple: Add A8 devices Nick Chan
2024-09-11  8:40 ` [PATCH 07/22] dt-bindings: arm: apple: Add A8X devices Nick Chan
2024-09-11  8:40 ` [PATCH 08/22] dt-bindings: arm: apple: Add A9 devices Nick Chan
2024-09-11  8:40 ` [PATCH 09/22] dt-bindings: arm: apple: Add A9X devices Nick Chan
2024-09-11  8:41 ` [PATCH 10/22] dt-bindings: arm: apple: Add A10 devices Nick Chan
2024-09-11  8:41 ` [PATCH 11/22] dt-bindings: arm: apple: Add A10X devices Nick Chan
2024-09-11  8:41 ` [PATCH 12/22] dt-bindings: arm: apple: Add A11 devices Nick Chan
2024-09-11  8:41 ` [PATCH 13/22] arm64: dts: apple: Add A7 devices Nick Chan
2024-09-11  8:41 ` [PATCH 14/22] arm64: dts: apple: Add A8 devices Nick Chan
2024-09-11  8:41 ` [PATCH 15/22] arm64: dts: apple: Add A8X devices Nick Chan
2024-09-11  8:41 ` [PATCH 16/22] arm64: dts: apple: Add A9 devices Nick Chan
2024-09-11  8:41 ` [PATCH 17/22] arm64: dts: apple: Add A9X devices Nick Chan
2024-09-11  8:41 ` [PATCH 18/22] arm64: dts: apple: Add A10 devices Nick Chan
2024-09-11  8:41 ` [PATCH 19/22] arm64: dts: apple: Add A10X devices Nick Chan
2024-09-11  8:41 ` [PATCH 20/22] arm64: dts: apple: Add A11 devices Nick Chan
2024-09-11  8:41 ` Nick Chan [this message]
2024-09-11  8:41 ` [PATCH 22/22] arm64: Kconfig: Update help text for CONFIG_ARCH_APPLE Nick Chan
2024-09-11 12:13 ` [PATCH 00/22] Initial device trees for A7-A11 based Apple devices Nick Chan
2024-09-11 14:10   ` Nick Chan
2024-09-11 13:50 ` Rob Herring (Arm)
2024-09-11 13:57   ` Nick Chan
2024-09-11 14:05     ` Nick Chan
2024-09-11 14:21 ` Nick Chan

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240911084353.28888-23-towinchenmi@gmail.com \
    --to=towinchenmi@gmail.com \
    --cc=alyssa@rosenzweig.io \
    --cc=asahi@lists.linux.dev \
    --cc=catalin.marinas@arm.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=ivo.ivanov.ivanov1@gmail.com \
    --cc=kettenis@openbsd.org \
    --cc=konradybcio@kernel.org \
    --cc=krzk+dt@kernel.org \
    --cc=linus.walleij@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pm@vger.kernel.org \
    --cc=linux-watchdog@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lpieralisi@kernel.org \
    --cc=marcan@marcan.st \
    --cc=rafael@kernel.org \
    --cc=robh@kernel.org \
    --cc=sven@svenpeter.dev \
    --cc=viresh.kumar@linaro.org \
    --cc=will@kernel.org \
    --cc=wim@linux-watchdog.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).