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: 10897101 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 0FCE2139A for ; Fri, 12 Apr 2019 00:02:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ED4EA28E2A for ; Fri, 12 Apr 2019 00:02:18 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E0EC728E2E; Fri, 12 Apr 2019 00:02:18 +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=unavailable 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 87E7128E2C for ; Fri, 12 Apr 2019 00:02:18 +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=tIVJwqjRsyDXct6+fURW2qslFtWCvuws57K3GJHbZog=; b=E5c5Q0lv3ySZfa xpEx5xwLmBC5qPOu+Bqq/1FsxBVBbviSXneh7+kcZVMFiV0iTvXtOO6LMLj6kafWDWo/LRJWPHapb AFokZaGYxcjbqs4rWJR88EYsId5RXEKFeQEO518aJ3aeUfaocFQXyxBR+TohwfBT/vCvxJ0kqkJFZ OOe3WvI7NdJG8plGvO5JblgmrJK3sKTtNLwBfSqH+3hf9FKAkP0r14mObosYIef4JMH3AyKhjIoXi 21MvwFCWGhU7ZPjHsfFnNURzcPoRbIvHVQnYqUrxPSOk0DmM5NhwKCv/gTdQK8W8ARBjJXdYeRygA Iisnipv13OnzE399PN/g==; 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 1hEje1-0008N2-BG; Fri, 12 Apr 2019 00:02:13 +0000 Received: from mail-pl1-x641.google.com ([2607:f8b0:4864:20::641]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEjds-0008Fx-JB for linux-rockchip@lists.infradead.org; Fri, 12 Apr 2019 00:02:06 +0000 Received: by mail-pl1-x641.google.com with SMTP id y6so4151054pll.13 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=OB6nSFd3N563IGpdtvpBxzzJZyEBlbbXUgshAijpSzIEet0JpneEVi7Y8SITLJd99U BaLnQUmqVcN6TPXNSc9/ykxirmk4u8tUWesc2JSwHS4czecQqqr5toTGotpBfIGHJsfz r1Gia7KQfczbHjwZjRE3oy3Jj3GUPo+BZbAaiJQAQWUywqD9YA9PWH4dTdDqeEEa0fWn vOjaUqxt8sPi6wl2XMZpjyAQtSwOXV91MzN0enDLg/F6whLIdHJ4neW+sZF00Bh/Cq+R 1MVnzl3Hf7j7KWcwO/rBIqd53PbBkXeKkNuFa5FS+eyG2pA5sifUirdM2GWLmL4acg+g 4v+A== X-Gm-Message-State: APjAAAVQ+Zf3kmCKKTZcDODSWZ4lwbHxx/EiJZlPUrpUMi8WagHHO69O ffjtnFXSdJBN4j1QQglVC9S5BQ== 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_659795_16325898 X-CRM114-Status: GOOD ( 11.66 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms 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-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=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>;