Message ID | 20240209212816.11187-3-ddrokosov@salutedevices.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-60030-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:7300:50ea:b0:106:860b:bbdd with SMTP id r10csp1140960dyd; Fri, 9 Feb 2024 13:29:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IEsMSN7UotrJRUJzMSvLI1wNUBTkGI92cO/S2eKbwJAsMX9dJbN43krKI8/5ucUj4muMFsj X-Received: by 2002:a17:906:f190:b0:a38:4ff3:773 with SMTP id gs16-20020a170906f19000b00a384ff30773mr179760ejb.47.1707514170171; Fri, 09 Feb 2024 13:29:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707514170; cv=pass; d=google.com; s=arc-20160816; b=iC2+d1Xjyxzm5FErh6nURlZ/gn4ONpoC5LOaU68MgMco9vvudL6DTpYw4H6mp09Sfv gwdvPP7hFh7IixgkZ+5faJ4/ZuxoKCTogLLdMt7laSy7Jvddicn0/TBA9T8KYMmNAUMU ceyfCLeagdX2mB4E/vjf92QNvFpfkPuIDuJgl8jeHGxei/mhz3V454MZi5ruCjcirSpz zBeDAbpaOYo9M/hLY79uudTD2XzUmMDJ+n5rUTNlKC+KHxBufF9VqCL4Je21y0tTdqUT QVj+UAe/VQ/mTGvH0wKMVyxrJh4rrc3KIfJXQsMoReVw7gwsFvXJ4Yh8UCKGZZA1G47x Gs1w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature:dkim-filter; bh=UksBPVFmefUFUHqRznndwrxhRo3WIvAX17OojuW++vk=; fh=xte5btlLZOcy1D9P1DsACiez6KCKaTq0F/Qz2XU+d70=; b=IA7DyCcmIsXL9za0oOTyHY7vL3OPaasz4GmRsvrpLj3Pprqs2m0a5tOSePPEbWEEJS yeqYpCm+AzyBgcYW4PTKnriL1HZeXWnbMn+zZuiIMR9bmTveCiaBeLQhahvrkNy1yT6b 0E7oS7VqEjRuG9hxJy8xUD3rCYwl7GgI+skFP6dUlwIe+W38CrJgJcYOKB+3VNDOGlZo cnnTdmijFZEGtEaQ/E7vG6iSpift6ZHwLzHXFymxmJO/jvy3gyaakEkrJcmMwMEgyd06 Wo4ZfjxAyGa7asJOAJvG+cuwgB5zxIwK77x1UXfkHIz99ttzYJDl96B/15d/EhpqSehO PbYw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b="NAKyYun/"; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-60030-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60030-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com X-Forwarded-Encrypted: i=2; AJvYcCV45dkUe6neHcwyiYjDi1uPGh73PiqZ0nraVrtZueST7xkNx5Dr3OurApwABdRtrw7VnveiPYwN09BvjYtoGs1TJL6yog== Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id k22-20020a170906681600b00a3c1520813esi280296ejr.339.2024.02.09.13.29.29 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 13:29:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-60030-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@salutedevices.com header.s=mail header.b="NAKyYun/"; arc=pass (i=1 spf=pass spfdomain=salutedevices.com dkim=pass dkdomain=salutedevices.com dmarc=pass fromdomain=salutedevices.com); spf=pass (google.com: domain of linux-kernel+bounces-60030-ouuuleilei=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-60030-ouuuleilei=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=salutedevices.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id B09B71F23E8D for <ouuuleilei@gmail.com>; Fri, 9 Feb 2024 21:29:29 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D65E3364A0; Fri, 9 Feb 2024 21:28:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b="NAKyYun/" Received: from mx1.sberdevices.ru (mx2.sberdevices.ru [45.89.224.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 18848DDC3; Fri, 9 Feb 2024 21:28:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=45.89.224.132 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707514117; cv=none; b=t6jYDDbxP7v8tBAYq4Spsm2J1n0ln7RZWds7xuVN4XzIxIHBt3zxDqbN0LUDW2T3LlFfl7fwDloltWBd5CqxopZ6kkK5dD+z1anlR2sMjoN9Rn/Zch8NU72Kvf/2JaYdR5Jrn88Y+UAYgHXTkIKQVk0I/mFBC7tZ9y/BTdGszjE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707514117; c=relaxed/simple; bh=+wSk16rWtWzHXM9Q9SlcXKZL7HXEw7oUA3RQJn4rL5g=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=kX18l8tYnusKLrbTIHf0YcOSB/N6Mqhfcpe2cUibUUlzPFHk8uZu0vJt3A1oYvii9O7uzqi/JuYo+r11V24Vx0qwViOisTM4n1U0GkNODyCci9v+zRojsvZVEysyhcJnm/SY5+mzompnx9yqxrPVdokHcRFdgz8ZlLGMFh949Kc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=salutedevices.com; spf=pass smtp.mailfrom=salutedevices.com; dkim=pass (2048-bit key) header.d=salutedevices.com header.i=@salutedevices.com header.b=NAKyYun/; arc=none smtp.client-ip=45.89.224.132 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=salutedevices.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=salutedevices.com Received: from p-infra-ksmg-sc-msk02 (localhost [127.0.0.1]) by mx1.sberdevices.ru (Postfix) with ESMTP id 15EB2120012; Sat, 10 Feb 2024 00:28:27 +0300 (MSK) DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.sberdevices.ru 15EB2120012 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=salutedevices.com; s=mail; t=1707514107; bh=UksBPVFmefUFUHqRznndwrxhRo3WIvAX17OojuW++vk=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From; b=NAKyYun/KMWjbEBPsY60+209iu7D1M+61o46g0yJz71Lt1goi9WhHBRYTcaMcT1nj b+pQHQn8O5PAqV+m6ER1to5UnWEQD9/jy9PJhusqlOudl+ncHYs9vT+2pJzEXM9x1J 9NX/2WELBUTkQ6RigZCfWk1Qst7xwtxJvomJkBefaFvlwLT7l9+wsAl6++oZ9B00PI XIZCvmrPRDN6oMY41hvkZuv6rCrVmb6n0Q8exETslA2OojC/1k6JnM/wOvy50hw/oU RdpC33l9HVDnqD3oAcLbQtvJpwLoT2KOuNevWoB7pFZfU+Y1WasYqj59KFvGbNRNqk 4PDJ6KWZq++Ew== Received: from smtp.sberdevices.ru (p-i-exch-sc-m01.sberdevices.ru [172.16.192.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.sberdevices.ru (Postfix) with ESMTPS; Sat, 10 Feb 2024 00:28:26 +0300 (MSK) Received: from CAB-WSD-L081021.sberdevices.ru (100.64.160.123) by p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Sat, 10 Feb 2024 00:28:26 +0300 From: Dmitry Rokosov <ddrokosov@salutedevices.com> To: <neil.armstrong@linaro.org>, <jbrunet@baylibre.com>, <mturquette@baylibre.com>, <adeep@lexina.in>, <robh+dt@kernel.org>, <krzysztof.kozlowski+dt@linaro.org>, <khilman@baylibre.com>, <martin.blumenstingl@googlemail.com>, <conor+dt@kernel.org> CC: <kernel@sberdevices.ru>, <sdfw_system_team@sberdevices.ru>, <rockosov@gmail.com>, <linux-amlogic@lists.infradead.org>, <devicetree@vger.kernel.org>, <linux-kernel@vger.kernel.org>, <linux-arm-kernel@lists.infradead.org>, Dmitry Rokosov <ddrokosov@salutedevices.com> Subject: [PATCH v1 2/2] arm64: dts: amlogic: axg: initialize default SoC capacitance Date: Sat, 10 Feb 2024 00:28:06 +0300 Message-ID: <20240209212816.11187-3-ddrokosov@salutedevices.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240209212816.11187-1-ddrokosov@salutedevices.com> References: <20240209212816.11187-1-ddrokosov@salutedevices.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: p-i-exch-sc-m02.sberdevices.ru (172.16.192.103) To p-i-exch-sc-m01.sberdevices.ru (172.16.192.107) X-KSMG-Rule-ID: 10 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Lua-Profiles: 183341 [Feb 09 2024] X-KSMG-AntiSpam-Version: 6.1.0.3 X-KSMG-AntiSpam-Envelope-From: ddrokosov@salutedevices.com X-KSMG-AntiSpam-Rate: 0 X-KSMG-AntiSpam-Status: not_detected X-KSMG-AntiSpam-Method: none X-KSMG-AntiSpam-Auth: dkim=none X-KSMG-AntiSpam-Info: LuaCore: 7 0.3.7 6d6bf5bd8eea7373134f756a2fd73e9456bb7d1a, {Tracking_from_domain_doesnt_match_to}, 100.64.160.123:7.1.2;d41d8cd98f00b204e9800998ecf8427e.com:7.1.1;127.0.0.199:7.1.2;salutedevices.com:7.1.1;smtp.sberdevices.ru:7.1.1,5.0.1, FromAlignment: s, ApMailHostAddress: 100.64.160.123 X-MS-Exchange-Organization-SCL: -1 X-KSMG-AntiSpam-Interceptor-Info: scan successful X-KSMG-AntiPhishing: Clean X-KSMG-LinksScanning: Clean X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 2.0.1.6960, bases: 2024/02/09 20:35:00 #23447606 X-KSMG-AntiVirus-Status: Clean, skipped X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1790458378186937503 X-GMAIL-MSGID: 1790458378186937503 |
Series |
meson-axg: properly setup CPU power management
|
|
Commit Message
Dmitry Rokosov
Feb. 9, 2024, 9:28 p.m. UTC
The capacitance value is required for the usage of the cpufreq cooling
device and power_allocator thermal governor in the appropriate energy
model.
It helps to compute the power estimated by the SoC at the appropriate
frequency. If it is the frequency of an existing OPP, or at the
frequency of the first OPP above the requested value otherwise.
The power is estimated as P = C * V^2 * f, with C being the SoC's
capacitance and V and f respectively representing the voltage and
frequency of the OPP.
Since AXG SoC doesn't have SCMI protocol support, we need to initialize
capacitance using the 'dynamic-power-coefficient' DT entry. Its value is
retrieved from the vendor kernel, and it gives us the following
freq2power mapping:
+-----------+--------+
| frequency,| power, |
| MHz | uW |
+-----------+--------+
| 100 | 10354 |
+-----------+--------+
| 250 | 27104 |
+-----------+--------+
| 500 | 55447 |
+-----------+--------+
| 667 | 77327 |
+-----------+--------+
| 1000 | 129024 |
+-----------+--------+
| 1200 | 164656 |
+-----------+--------+
| 1296 | 192489 |
+-----------+--------+
| 1416 | 239870 |
+-----------+--------+
Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com>
---
arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++++
1 file changed, 4 insertions(+)
Comments
On 09/02/2024 22:28, Dmitry Rokosov wrote: > The capacitance value is required for the usage of the cpufreq cooling > device and power_allocator thermal governor in the appropriate energy > model. > > It helps to compute the power estimated by the SoC at the appropriate > frequency. If it is the frequency of an existing OPP, or at the > frequency of the first OPP above the requested value otherwise. > > The power is estimated as P = C * V^2 * f, with C being the SoC's > capacitance and V and f respectively representing the voltage and > frequency of the OPP. > > Since AXG SoC doesn't have SCMI protocol support, we need to initialize > capacitance using the 'dynamic-power-coefficient' DT entry. Its value is > retrieved from the vendor kernel, and it gives us the following > freq2power mapping: > +-----------+--------+ > | frequency,| power, | > | MHz | uW | > +-----------+--------+ > | 100 | 10354 | > +-----------+--------+ > | 250 | 27104 | > +-----------+--------+ > | 500 | 55447 | > +-----------+--------+ > | 667 | 77327 | > +-----------+--------+ > | 1000 | 129024 | > +-----------+--------+ > | 1200 | 164656 | > +-----------+--------+ > | 1296 | 192489 | > +-----------+--------+ > | 1416 | 239870 | > +-----------+--------+ > > Signed-off-by: Dmitry Rokosov <ddrokosov@salutedevices.com> > --- > arch/arm64/boot/dts/amlogic/meson-axg.dtsi | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi > index ea96fef328e8..6d12b760b90f 100644 > --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi > +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi > @@ -74,6 +74,7 @@ cpu0: cpu@0 { > enable-method = "psci"; > next-level-cache = <&l2>; > clocks = <&scpi_dvfs 0>; > + dynamic-power-coefficient = <140>; > #cooling-cells = <2>; > }; > > @@ -84,6 +85,7 @@ cpu1: cpu@1 { > enable-method = "psci"; > next-level-cache = <&l2>; > clocks = <&scpi_dvfs 0>; > + dynamic-power-coefficient = <140>; > #cooling-cells = <2>; > }; > > @@ -94,6 +96,7 @@ cpu2: cpu@2 { > enable-method = "psci"; > next-level-cache = <&l2>; > clocks = <&scpi_dvfs 0>; > + dynamic-power-coefficient = <140>; > #cooling-cells = <2>; > }; > > @@ -104,6 +107,7 @@ cpu3: cpu@3 { > enable-method = "psci"; > next-level-cache = <&l2>; > clocks = <&scpi_dvfs 0>; > + dynamic-power-coefficient = <140>; > #cooling-cells = <2>; > }; > Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
diff --git a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi index ea96fef328e8..6d12b760b90f 100644 --- a/arch/arm64/boot/dts/amlogic/meson-axg.dtsi +++ b/arch/arm64/boot/dts/amlogic/meson-axg.dtsi @@ -74,6 +74,7 @@ cpu0: cpu@0 { enable-method = "psci"; next-level-cache = <&l2>; clocks = <&scpi_dvfs 0>; + dynamic-power-coefficient = <140>; #cooling-cells = <2>; }; @@ -84,6 +85,7 @@ cpu1: cpu@1 { enable-method = "psci"; next-level-cache = <&l2>; clocks = <&scpi_dvfs 0>; + dynamic-power-coefficient = <140>; #cooling-cells = <2>; }; @@ -94,6 +96,7 @@ cpu2: cpu@2 { enable-method = "psci"; next-level-cache = <&l2>; clocks = <&scpi_dvfs 0>; + dynamic-power-coefficient = <140>; #cooling-cells = <2>; }; @@ -104,6 +107,7 @@ cpu3: cpu@3 { enable-method = "psci"; next-level-cache = <&l2>; clocks = <&scpi_dvfs 0>; + dynamic-power-coefficient = <140>; #cooling-cells = <2>; };