From patchwork Sat Sep 14 05:17:30 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 13804237 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 9E631FC6197 for ; Sat, 14 Sep 2024 05:55:14 +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:References:In-Reply-To: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:List-Owner; bh=5AQMnRi88w3YJGkg7kJQI9DF/T3uyFlZ2NbTuH1k+hk=; b=n6nKhOk70C7lmGb7W5RfLUC/+N lrgUaQLneR7TYqxvfcuQEsNfEcyyiGjpCaIIBWQcoq8tOIabRGMUZGnrvzO4KakvDeofktkoYBOwl NoeUAHjggobyTet0M4tq8Kjqi6CnMHDx/L2v3e2isRsQjJkH8IttbXzOqlJuZjwkLXDp+K10wmndO krxCC1WsbZbgpBapmjzEigdgxO6vrQikES9mPpKlUWBTL2TBl1cHC03at9dT+unxDvaQPQA0/FqOL uBwYpNx8VP7b9Kbmx3XTyeKiO0kQNDsr7XxtUj6lIEhASev7mTcslEoPrIg6hweCdq3FhRXZaU+TL paDpvMvw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1spLkP-00000000A8g-3K6u; Sat, 14 Sep 2024 05:55:05 +0000 Received: from mail-pf1-x436.google.com ([2607:f8b0:4864:20::436]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1spLJ3-000000006GZ-1zbp for linux-arm-kernel@lists.infradead.org; Sat, 14 Sep 2024 05:26:50 +0000 Received: by mail-pf1-x436.google.com with SMTP id d2e1a72fcca58-718e11e4186so2640181b3a.2 for ; Fri, 13 Sep 2024 22:26:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1726291609; x=1726896409; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5AQMnRi88w3YJGkg7kJQI9DF/T3uyFlZ2NbTuH1k+hk=; b=Q64d+/tnt8aN005H00I4KMYSJzrFMALezInWZNW7LicyrT7y8It8ZtACeBivinEVgT VXrqZONqbOa+fY8Sj4yltZGhjEnupCYUetG4EHfxdBXiagCSawEBj3nCfsE2LwIxEzSL qTsgarS+Oh36F5TDl17QlujtvIXlg1jsvRLhn4UCeItL9veezmc0yIeqk39gZ0OzJndw +9jTnCF9ZPTDUNq8hqDov5ntJBySzd02UEeLxDzA1cWzPjCusQgYtD75QLSBvub38M3x P4sUqT+OKPjewSiChN+ej9nyiChLRHLeENs9wKQdpP8h/6pcX3S9CTk55FGdociiGI/h pYqA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1726291609; x=1726896409; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5AQMnRi88w3YJGkg7kJQI9DF/T3uyFlZ2NbTuH1k+hk=; b=EFcmnXFJzGLp5f3zLepP4W1UKbndQbiZS9aGx/G3RuM7op8+0X39rzYVhYVHNLxt9x vRrsDMEGzwB8Zsy6FgOKPv7y3J+mVbwCy9P3gbUUDReccyKT889xS4fQDrhyeDcrfYCc dIV+UtLjEN5PTIfdWLftwNiFV1tdnkqFoWu2CqDnz+fGp8RkbSyDVcpqHrMMJNF/E2Lr v9+ot7v/K9iMQrkwGV+3ToFaIDne0hgbbHqRFWFvV/k0FVuaNZNa+fvboxVTj2WAGzGE +ExiGfKciUBsjA//640idZMKItqhzdn6WuCVR8hSDxMsetLQVEKiOKHpXvLV6cnmCNHe Vzyw== X-Forwarded-Encrypted: i=1; AJvYcCXEWtr9Zt8tjjrt8xbso7h88SEyQI1TqLp8L1Nah4IaEGiwiGnLGJ6Vu9sHvDzuheZ6cXhjCkE3mDBdkVvY7Zl2@lists.infradead.org X-Gm-Message-State: AOJu0YwsibKn6U4TPpjcdnGGTvIKGaqXcox/utvQn4lLoXbtznuPuEVb DNPznQQ5ImH/s+K8ND4AeAXWgnSUeF6ETFKj0yzmP5QEkh0wndXy X-Google-Smtp-Source: AGHT+IFMRPU/3Z90LPpdnqu9q34twD0zYSR3G2hw/Ma3NwF31nSjcXiEJ15u+KKYtsfVxWPwtkotag== X-Received: by 2002:aa7:888e:0:b0:717:8aaf:43be with SMTP id d2e1a72fcca58-71925fa9081mr16090951b3a.0.1726291608743; Fri, 13 Sep 2024 22:26:48 -0700 (PDT) Received: from localhost.localdomain ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d2e1a72fcca58-71944b7b749sm391223b3a.113.2024.09.13.22.26.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Sep 2024 22:26:48 -0700 (PDT) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Rob Herring , Krzysztof Kozlowski , Conor Dooley , "Rafael J . Wysocki" , Viresh Kumar , Linus Walleij , Wim Van Sebroeck , Guenter Roeck , Catalin Marinas , Will Deacon , Lorenzo Pieralisi , Mark Kettenis , 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: Nick Chan , Ivaylo Ivanov , Konrad Dybcio Subject: [PATCH v2 21/22] arm64: dts: apple: t8010: Add cpufreq nodes Date: Sat, 14 Sep 2024 13:17:30 +0800 Message-ID: <20240914052413.68177-25-towinchenmi@gmail.com> X-Mailer: git-send-email 2.46.0 In-Reply-To: <20240914052413.68177-1-towinchenmi@gmail.com> References: <20240914052413.68177-1-towinchenmi@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240913_222649_535210_A24538CE X-CRM114-Status: GOOD ( 14.91 ) 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 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 --- arch/arm64/boot/dts/apple/t8010-fast.dtsi | 22 ++++++++ arch/arm64/boot/dts/apple/t8010.dtsi | 67 +++++++++++++++++++++++ 2 files changed, 89 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t8010-fast.dtsi b/arch/arm64/boot/dts/apple/t8010-fast.dtsi index 4bdf1c3eccfe..b5a2c78ca9e9 100644 --- a/arch/arm64/boot/dts/apple/t8010-fast.dtsi +++ b/arch/arm64/boot/dts/apple/t8010-fast.dtsi @@ -6,3 +6,25 @@ */ #include "t8010.dtsi" + +/ { + opp: opp-table { + opp08 { + opp-hz = /bits/ 64 <1944000000>; + opp-level = <8>; + opp-microvolt = <816000>; + }; + + opp09 { + opp-hz = /bits/ 64 <2244000000>; + opp-level = <9>; + opp-microvolt = <922000>; + }; + + opp10 { + opp-hz = /bits/ 64 <2340000000>; + opp-level = <10>; + opp-microvolt = <922000>; + }; + }; +}; diff --git a/arch/arm64/boot/dts/apple/t8010.dtsi b/arch/arm64/boot/dts/apple/t8010.dtsi index 926a0f501477..e27d2b5e3df1 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,70 @@ 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 { + 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>; + opp-microvolt = <525000>; + }; + + opp02 { + opp-hz = /bits/ 64 <275000000>; /* 732 MHz, E-core */ + opp-level = <2>; + opp-microvolt = <541000>; + }; + + opp03 { + opp-hz = /bits/ 64 <410000000>; /* 1092 MHz, E-core */ + opp-level = <3>; + opp-microvolt = <603000>; + }; + + /* The following operating points are handled by the P-cores */ + opp04 { + opp-hz = /bits/ 64 <756000000>; + opp-level = <4>; + opp-microvolt = <559000>; + }; + + opp05 { + opp-hz = /bits/ 64 <1056000000>; + opp-level = <5>; + opp-microvolt = <609000>; + }; + + opp06 { + opp-hz = /bits/ 64 <1356000000>; + opp-level = <6>; + opp-microvolt = <650000>; + }; + + opp07 { + opp-hz = /bits/ 64 <1644000000>; + opp-level = <7>; + opp-microvolt = <725000>; + }; + + /* + * 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 +147,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>;