From patchwork Sun Dec 22 17:52:04 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Chan X-Patchwork-Id: 13918246 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 03441E77188 for ; Sun, 22 Dec 2024 18:00:12 +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=wPevbon6m/T00pf3vYuYkO653KRfOrsNDd02bFq47S4=; b=IKHxHHA5LbbrcU1ZBevxyqOLzg znDruuNDGI5VfZds3pgfqqwmIzc4ovZYZwRZu+59fo/pTjTUI5OfmSWpKFadOCzJkdFBDZrd1MBDh PzLYbezou59RR4HV5RWNH4kkhNWPlv6RJwiODCy5NZ/eBEtEz0T2jT9YtVi8J8hkjFF0iDLKq9c1k h6AhLhmSrOlJo1m0Xfb0ItNVrDPSDEjc8JmqYDAWpa1XJTJjstwBB43sVBb/Y6e8MjHoG/yMy4/Am SOmX4XUj1zMwuQH3e1BTnO9mBwUick0yCKkMDUaESFF6CT6PGerw8SGNVKjFwxJyI6gmXT93Kuptc CYt61Rfw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tPQFD-00000008eeu-1o7y; Sun, 22 Dec 2024 17:59:59 +0000 Received: from mail-pl1-x630.google.com ([2607:f8b0:4864:20::630]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tPQ95-00000008dmQ-1En5 for linux-arm-kernel@lists.infradead.org; Sun, 22 Dec 2024 17:53:40 +0000 Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-2163dc5155fso30485335ad.0 for ; Sun, 22 Dec 2024 09:53:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1734890018; x=1735494818; 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=wPevbon6m/T00pf3vYuYkO653KRfOrsNDd02bFq47S4=; b=h+8cm2InBLw0WONg8bcpXqiXEgHItRGN0ubpdNN4y2mQQAMU2x3uWJEFCy8IvBxN5A G/8ujiUDhKcrwWhf4UMzg1HiAgPPUbMaSyzRPYVckLBMAc1SklGypVqHvFe9Yf0+C+rI p86IDaDft7CbQRH3Tdo2wpY5etonifxtKERBGSdu7jNxUwZqZhr0fKiIW15Ei0Bbg545 WNZvYE/W9MzgTfS7xE9OZlXoJkGaszuKUUMZA3EHftjlTjTrKJ/bEvgtl8bzUMVpgpQN DG4XkgV+mnOQjfEr3kXAYbv6P6NHN6kZkT07bYRchOIlVfbm4dHJ6k5owCgEZWCFyX+o x0mQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734890018; x=1735494818; 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=wPevbon6m/T00pf3vYuYkO653KRfOrsNDd02bFq47S4=; b=jbr0ic8JvoU27ib/sjq6momDjcTaIlMJbr7N4Mz4p/QuINSQsHShJF0cLNMqSKqKNk D/W67aMYMB0VsUCRFR79AI0oQYJmuaQeJKu+tTAv7V7+lE2UBqRH/65Rdjj62t/lLI7t DiXlKtDAob6EEvwck2vybR4n1hGNKGklPOeHvex96g6WN8gwJV2yP3iGU//1Vg7OTcN5 RnZI1lKPEdaoj6hNwmWH4MWWsVqFXO+C2kgDGYh5quFaNZot3qzc81D31l1DT95eaO8R z7xVn5HtIn2f6UmoAWmXvix9mLA7oqaRVjVXJkqBb8qXddoLFhfLuE6hb7u8KCtf8dfD DMAw== X-Forwarded-Encrypted: i=1; AJvYcCVuw0Joo6SEqBcLZbwHtC0s83lm6Ep6S+XzfwAowsWpSK4ZAwDNTzInuFj7Xi9cGa5cXpuERQ8kXDcmECwLNeJE@lists.infradead.org X-Gm-Message-State: AOJu0YyqkaKgspEojqgWheU3HpfcdGaKHgWnatsfm2lMyj1Bld0Y016G ETNG8OS0PXTmOF6b+9zV1UvNeqDa7KXYee+YrL85j4IAg0th0/9B X-Gm-Gg: ASbGncsMwaAnZT3b8KAf12Z2YzcdlIA9b4PyolzNGpEXU0GgxflEciZLZbI0WuhHaBk QLdCB4/FJVpkFBpfLn7QSmHA1TpCL/tjVN2za4giJkAG+6YcGzOcdOwFnFRTQVpyVqG6C4ObYe3 UTlsS/N2xvTRYcBvZq2XqQWbX9gI8wHj1BTOzV5+/O9gAWGotoUEZMGKPyWZ3q4Aqpe5xip+cvQ T51Ds4/WjODpHwI490K2Co0Qe68zR7kOr/tFyA6OkzI/m26eetmPqaM5Q== X-Google-Smtp-Source: AGHT+IE7f2w+pW5eXG5g7QIlLGxjJq2YFC2yMAhiVeASPpXTfKK7ET7lE8ZEKwanTLgnFmV/NW71uQ== X-Received: by 2002:a17:903:94d:b0:216:46f4:7e30 with SMTP id d9443c01a7336-219e6f11764mr154607305ad.43.1734890018302; Sun, 22 Dec 2024 09:53:38 -0800 (PST) Received: from nick-mbp.. ([59.188.211.160]) by smtp.googlemail.com with ESMTPSA id d9443c01a7336-219dca04c33sm59503685ad.247.2024.12.22.09.53.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 22 Dec 2024 09:53:37 -0800 (PST) From: Nick Chan To: Hector Martin , Sven Peter , Alyssa Rosenzweig , Rob Herring , Krzysztof Kozlowski , Conor Dooley , asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Nick Chan Subject: [PATCH 4/9] arm64: dts: apple: Add cpufreq nodes for S8000/S8003 Date: Mon, 23 Dec 2024 01:52:04 +0800 Message-ID: <20241222175314.151437-5-towinchenmi@gmail.com> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20241222175314.151437-1-towinchenmi@gmail.com> References: <20241222175314.151437-1-towinchenmi@gmail.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241222_095339_340018_4097C724 X-CRM114-Status: GOOD ( 13.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: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Add cpufreq nodes for the two variants of Apple A9 SoC. The difference is that S8000 is slower than S8003 in state transitions. Change the copyright information in s8000.dtsi and s8003.dtsi as well since these are now essentially new files with the original content now being in s800-0-3.dtsi. Signed-off-by: Nick Chan --- arch/arm64/boot/dts/apple/s800-0-3.dtsi | 10 +++++ arch/arm64/boot/dts/apple/s8000.dtsi | 53 ++++++++++++++++++++++++- arch/arm64/boot/dts/apple/s8003.dtsi | 53 ++++++++++++++++++++++++- 3 files changed, 114 insertions(+), 2 deletions(-) diff --git a/arch/arm64/boot/dts/apple/s800-0-3.dtsi b/arch/arm64/boot/dts/apple/s800-0-3.dtsi index 082e5b1733d0..382d7be3f8ce 100644 --- a/arch/arm64/boot/dts/apple/s800-0-3.dtsi +++ b/arch/arm64/boot/dts/apple/s800-0-3.dtsi @@ -32,6 +32,8 @@ cpu0: cpu@0 { compatible = "apple,twister"; reg = <0x0 0x0>; cpu-release-addr = <0 0>; /* To be filled in by loader */ + operating-points-v2 = <&twister_opp>; + performance-domains = <&cpufreq>; enable-method = "spin-table"; device_type = "cpu"; }; @@ -40,6 +42,8 @@ cpu1: cpu@1 { compatible = "apple,twister"; reg = <0x0 0x1>; cpu-release-addr = <0 0>; /* To be filled in by loader */ + operating-points-v2 = <&twister_opp>; + performance-domains = <&cpufreq>; enable-method = "spin-table"; device_type = "cpu"; }; @@ -52,6 +56,12 @@ soc { nonposted-mmio; ranges; + cpufreq: performance-controller@202220000 { + compatible = "apple,s8000-cluster-cpufreq", "apple,t8103-cluster-cpufreq", "apple,cluster-cpufreq"; + reg = <0x2 0x02220000 0 0x1000>; + #performance-domain-cells = <0>; + }; + serial0: serial@20a0c0000 { compatible = "apple,s5l-uart"; reg = <0x2 0x0a0c0000 0x0 0x4000>; diff --git a/arch/arm64/boot/dts/apple/s8000.dtsi b/arch/arm64/boot/dts/apple/s8000.dtsi index c7e39abda7e1..72322f5677ab 100644 --- a/arch/arm64/boot/dts/apple/s8000.dtsi +++ b/arch/arm64/boot/dts/apple/s8000.dtsi @@ -4,11 +4,62 @@ * * Other names: H8P, "Maui" * - * Copyright (c) 2022, Konrad Dybcio + * Copyright (c) 2024, Nick Chan */ #include "s800-0-3.dtsi" +/ { + twister_opp: opp-table { + compatible = "operating-points-v2"; + + opp01 { + opp-hz = /bits/ 64 <300000000>; + opp-level = <1>; + clock-latency-ns = <650>; + }; + opp02 { + opp-hz = /bits/ 64 <396000000>; + opp-level = <2>; + clock-latency-ns = <75000>; + }; + opp03 { + opp-hz = /bits/ 64 <600000000>; + opp-level = <3>; + clock-latency-ns = <27000>; + }; + opp04 { + opp-hz = /bits/ 64 <912000000>; + opp-level = <4>; + clock-latency-ns = <32000>; + }; + opp05 { + opp-hz = /bits/ 64 <1200000000>; + opp-level = <5>; + clock-latency-ns = <35000>; + }; + opp06 { + opp-hz = /bits/ 64 <1512000000>; + opp-level = <6>; + clock-latency-ns = <45000>; + }; + opp07 { + opp-hz = /bits/ 64 <1800000000>; + opp-level = <7>; + clock-latency-ns = <58000>; + }; +#if 0 + /* Not available until CPU deep sleep is implemented */ + opp08 { + opp-hz = /bits/ 64 <1844000000>; + opp-level = <8>; + clock-latency-ns = <58000>; + turbo-mode; + }; +#endif + }; +}; + /* * The A9 was made by two separate fabs on two different process * nodes: Samsung made the S8000 (APL0898) on 14nm and TSMC made diff --git a/arch/arm64/boot/dts/apple/s8003.dtsi b/arch/arm64/boot/dts/apple/s8003.dtsi index 807e3452f8a7..79df5c783260 100644 --- a/arch/arm64/boot/dts/apple/s8003.dtsi +++ b/arch/arm64/boot/dts/apple/s8003.dtsi @@ -4,11 +4,62 @@ * * Other names: H8P, "Malta" * - * Copyright (c) 2022, Konrad Dybcio + * Copyright (c) 2024, Nick Chan */ #include "s800-0-3.dtsi" +/ { + twister_opp: opp-table { + compatible = "operating-points-v2"; + + opp01 { + opp-hz = /bits/ 64 <300000000>; + opp-level = <1>; + clock-latency-ns = <500>; + }; + opp02 { + opp-hz = /bits/ 64 <396000000>; + opp-level = <2>; + clock-latency-ns = <45000>; + }; + opp03 { + opp-hz = /bits/ 64 <600000000>; + opp-level = <3>; + clock-latency-ns = <22000>; + }; + opp04 { + opp-hz = /bits/ 64 <912000000>; + opp-level = <4>; + clock-latency-ns = <25000>; + }; + opp05 { + opp-hz = /bits/ 64 <1200000000>; + opp-level = <5>; + clock-latency-ns = <28000>; + }; + opp06 { + opp-hz = /bits/ 64 <1512000000>; + opp-level = <6>; + clock-latency-ns = <35000>; + }; + opp07 { + opp-hz = /bits/ 64 <1800000000>; + opp-level = <7>; + clock-latency-ns = <38000>; + }; +#if 0 + /* Not available until CPU deep sleep is implemented */ + opp08 { + opp-hz = /bits/ 64 <1844000000>; + opp-level = <8>; + clock-latency-ns = <38000>; + turbo-mode; + }; +#endif + }; +}; + /* * The A9 was made by two separate fabs on two different process * nodes: Samsung made the S8000 (APL0898) on 14nm and TSMC made