From patchwork Fri Apr 12 00:01:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Matthias Kaehlcke X-Patchwork-Id: 10897099 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1B5E9139A for ; Fri, 12 Apr 2019 00:02:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0371428E38 for ; Fri, 12 Apr 2019 00:02:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBB8228E3B; Fri, 12 Apr 2019 00:02:13 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 8759F28C82 for ; Fri, 12 Apr 2019 00:02:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=kQFyGP2gW2gWPl/Ki1sZPaIV+u+xQoKPjyYsQ1DhOLQ=; b=EfJDlS2/rFyjH7 6W3TKtbSZqXTQatyVxKs3BmJnZQhD8zEeSRl76lK++CQjABuWqzw7QRO1ze7qfM7nmjkaWCO5QoNE ld4HrlVd2RE3rIN7doYZn8bZIOAUMicgUr7PzAg9YPIv3ttOCa6fGoj0/URNnk1hLN7veBjyEeqXJ dPKEVNx0sndqYLYflSfA7ByQoidp9fzL6Hz8uIIR+htISh9SRSUzsZ8cnZuZXNw8GkuPCbuVqQgOm QszhJQeZkmpQGH1PztDWOLmHIOfSa7+LKsqIH0iktkNTipYUOXVVyaWWLk0qEHHCCx3MFUd0I0o0N cFNLajPpYpzvKddKgl+Q==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEjdw-0008H1-Ny; Fri, 12 Apr 2019 00:02:08 +0000 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEjds-0008Fy-JA for linux-arm-kernel@lists.infradead.org; Fri, 12 Apr 2019 00:02:06 +0000 Received: by mail-pl1-x643.google.com with SMTP id f36so4179483plb.5 for ; Thu, 11 Apr 2019 17:02:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CBrXfahcrBFEuBwWPHCafCU3+H7O4tvEDowgXbhEK6U=; b=D5Fi8mbOCSkrQfJXjSCpDWQqcV7dm8ryqhwcqsasuSdKzRyh9K3aR7qnvpyvxtoff3 oczbvp1H+Wg/qACYaPZqbLBIepUNRmlKzBabcqg6qE6rvPAJqNNjWfzWJ0Zw455u6Y7T 1lYmVne3UKodqGbXUr8kqunA6yoN1h+Rm90Kk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CBrXfahcrBFEuBwWPHCafCU3+H7O4tvEDowgXbhEK6U=; b=HilHoiiMRnLeYSm3Mhj0iWSQYb78N5wsesbucOEPHn8jH7D48g1i7HJ8ayYxaq9F74 2LNkDSO7pl8IgY7DHI+96W1K0trLlJQrzeMg2Hog/nMVAzH82slWh3Yz3qXo5a3L9poa Yphnf4XzKRexrsvlvVgZDAwmmx1WYeRVo+ZfrnIh/zQtBrdVSun2R0p4bVxQso7LCudS GQZDBp408xrU5IeWvAwI3mBMFJYm3pNuT1CYNiMRDZEQbN/h/Lsew7XesAacBgVbEYhB aR4D+Uo2kWVvmS+8l+ualGGCJIr4VdkaPBfRZ2pR53x2WwJQJJdXcq5Rt6mo6J16hTQO o4+A== X-Gm-Message-State: APjAAAWQ5QwzIhps6FFb/YlIUjTSr2vLw0OtqSJZ41tuEL804W3EddNs B7SK9xIi3TPRrTM1L4ALi42eDXYlLPmTJQ== X-Google-Smtp-Source: APXvYqziWqnQWMDp7tTMmr/NmtdDsC1Uxc8Wsojj9LnVi+iw4SkqKwTXyY1TIqkwxJJFCAdRh4U/Mw== X-Received: by 2002:a17:902:aa85:: with SMTP id d5mr54113352plr.251.1555027323186; Thu, 11 Apr 2019 17:02:03 -0700 (PDT) Received: from localhost ([2620:15c:202:1:75a:3f6e:21d:9374]) by smtp.gmail.com with ESMTPSA id g5sm21081011pfo.53.2019.04.11.17.02.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Apr 2019 17:02:02 -0700 (PDT) From: Matthias Kaehlcke To: Heiko Stuebner , Rob Herring , Mark Rutland Subject: [PATCH] ARM: dts: rockchip: Add dynamic-power-coefficient for rk3288 Date: Thu, 11 Apr 2019 17:01:58 -0700 Message-Id: <20190412000158.248080-1-mka@chromium.org> X-Mailer: git-send-email 2.21.0.392.gf8f6787159e-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190411_170204_658330_C421E579 X-CRM114-Status: GOOD ( 13.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, Matthias Kaehlcke , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP The value was determined with the following method: - take CPUs 1-3 offline - for each OPP - set cpufreq min and max freq to OPP freq - start dhrystone benchmark - measure CPU power consumption during 10s - calculate Cx for OPPx - Cx = (Px - P1) / (Vx²fx - V1²f1) [1] using the following units: mW / Ghz / V [2] - C = avg(C2, ..., Cn) [1] see commit 4daa001a1773 ("arm64: dts: juno: Add cpu dynamic-power-coefficient information") [2] https://patchwork.kernel.org/patch/10493615/#22158551 FTR, these are the values for the different OPPs: freq (kHz) mV Px (mW) Cx 126000 900 39 216000 900 66 370 312000 900 95 372 408000 900 122 363 600000 900 177 359 696000 950 230 363 816000 1000 297 361 1008000 1050 404 362 1200000 1100 528 362 1416000 1200 770 377 1512000 1300 984 385 1608000 1350 1156 394 Signed-off-by: Matthias Kaehlcke --- I couldn't find any really comprehensive information on determining the dynamic-power-coefficient, the method used is my understanding mostly derived from the sources mentioned above, the resulting value is within a reasonable range and the range of the intermediate Cx values is consistent. If someone knows better and things should be done differently please share your knowledge :) --- arch/arm/boot/dts/rk3288.dtsi | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/arm/boot/dts/rk3288.dtsi b/arch/arm/boot/dts/rk3288.dtsi index 23e9c5253019..f0d92b045c57 100644 --- a/arch/arm/boot/dts/rk3288.dtsi +++ b/arch/arm/boot/dts/rk3288.dtsi @@ -61,6 +61,7 @@ reg = <0x500>; resets = <&cru SRST_CORE0>; operating-points-v2 = <&cpu_opp_table>; + dynamic-power-coefficient = <370>; #cooling-cells = <2>; /* min followed by max */ clock-latency = <40000>; clocks = <&cru ARMCLK>; @@ -71,6 +72,7 @@ reg = <0x501>; resets = <&cru SRST_CORE1>; operating-points = <&cpu_opp_table>; + dynamic-power-coefficient = <370>; #cooling-cells = <2>; /* min followed by max */ clock-latency = <40000>; clocks = <&cru ARMCLK>; @@ -81,6 +83,7 @@ reg = <0x502>; resets = <&cru SRST_CORE2>; operating-points = <&cpu_opp_table>; + dynamic-power-coefficient = <370>; #cooling-cells = <2>; /* min followed by max */ clock-latency = <40000>; clocks = <&cru ARMCLK>; @@ -91,6 +94,7 @@ reg = <0x503>; resets = <&cru SRST_CORE3>; operating-points = <&cpu_opp_table>; + dynamic-power-coefficient = <370>; #cooling-cells = <2>; /* min followed by max */ clock-latency = <40000>; clocks = <&cru ARMCLK>;