From patchwork Wed Dec 13 14:21:06 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Valentin Schneider X-Patchwork-Id: 10110055 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4898860327 for ; Wed, 13 Dec 2017 14:23:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A48C286DC for ; Wed, 13 Dec 2017 14:23:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2D89A28B99; Wed, 13 Dec 2017 14:23:51 +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=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.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 AB953286DC for ; Wed, 13 Dec 2017 14:23:50 +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:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id: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=bb0hUagdpL5Bnm6P+PonKBLwDMkDpBx71REHWyB6IfM=; b=h3H Ypq3Ap1CRIITyfziBMvILRPxuv8JG65lAWtofJpKx0wX04ktyFVEen/+jDli7/e7M2LrP8zteqdoS p/I3ctqMYyl9LOnuBVy/wapJ+9lx4iqztq8lR3TCBhdDVvTMsIV04v+qA3ITlCrwIuK6L5LnTv+XW V8YH0Bq4jb6eRJ9iGtvXXX6TLeiOGIUZie7BeF00kHqYaa+Q9lzHwpbLV5pMlQJH7dOinmkxZ/zae lCFdZ0uuWauSLZ2xIvrnqHfvPVnTR9B8lSL76uIsZCeNAygnFPoTxPhXo2zCJMgy+TtHb443d55No AsJpsVUJ5NyBLabXcx7yXbfFv+ISppg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eP7ws-00083Z-2a; Wed, 13 Dec 2017 14:23:50 +0000 Received: from foss.arm.com ([217.140.101.70]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eP7wJ-0007f6-6Z for linux-arm-kernel@lists.infradead.org; Wed, 13 Dec 2017 14:23:19 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1D9351529; Wed, 13 Dec 2017 06:22:55 -0800 (PST) Received: from e113632-lin.cambridge.arm.com (e113632-lin.cambridge.arm.com [10.1.206.74]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5138E3F220; Wed, 13 Dec 2017 06:22:53 -0800 (PST) From: Valentin Schneider To: linux-kernel@vger.kernel.org Subject: [PATCH] arm64: dts: hisilicon: Add hi3660 cpu capacity-dmips-mhz information Date: Wed, 13 Dec 2017 14:21:06 +0000 Message-Id: <1513174866-6678-1-git-send-email-valentin.schneider@arm.com> X-Mailer: git-send-email 2.7.4 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171213_062315_328337_9FC384C6 X-CRM114-Status: UNSURE ( 7.78 ) X-CRM114-Notice: Please train this message. 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: Mark Rutland , devicetree@vger.kernel.org, Catalin Marinas , Will Deacon , Wei Xu , Rob Herring , Dietmar Eggemann , linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 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 following dt entries are added: cpus [0-3] (Cortex A53): - capacity-dmips-mhz = <592>; cpus [4-7] (Cortex A73): - capacity-dmips-mhz = <1024>; Those values were obtained by running dhrystone 2.1 on a HiKey960 with the following procedure: - Offline all CPUs but CPU0 (A53) - Set CPU0 frequency to maximum - Run Dhrystone 2.1 for 20 seconds - Offline all CPUs but CPU4 (A73) - set CPU4 frequency to maximum - Run Dhrystone 2.1 for 20 seconds The results are as follows: A53: 129633887 loops A73: 287034147 loops By scaling those values so that the A73s use 1024, we end up with 462 for the A53s. However, they have different maximum frequencies: 1.844GHz for A53s and 2.362GHz for A73s. Thus, we can scale the A53 value to truly represent dmips per MHz, and we end up with 592. The impact of this change can be verified on HiKey960: $ cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq 1844000 1844000 1844000 1844000 2362000 2362000 2362000 2362000 $ cat /sys/devices/system/cpu/cpu*/cpu_capacity 462 462 462 462 1024 1024 1024 1024 Signed-off-by: Valentin Schneider Reviewed-by: Leo Yan --- arch/arm64/boot/dts/hisilicon/hi3660.dtsi | 8 ++++++++ 1 file changed, 8 insertions(+) -- 2.7.4 diff --git a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi index ab0b95b..04a8d28 100644 --- a/arch/arm64/boot/dts/hisilicon/hi3660.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi3660.dtsi @@ -61,6 +61,7 @@ enable-method = "psci"; next-level-cache = <&A53_L2>; cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; + capacity-dmips-mhz = <592>; }; cpu1: cpu@1 { @@ -70,6 +71,7 @@ enable-method = "psci"; next-level-cache = <&A53_L2>; cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; + capacity-dmips-mhz = <592>; }; cpu2: cpu@2 { @@ -79,6 +81,7 @@ enable-method = "psci"; next-level-cache = <&A53_L2>; cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; + capacity-dmips-mhz = <592>; }; cpu3: cpu@3 { @@ -88,6 +91,7 @@ enable-method = "psci"; next-level-cache = <&A53_L2>; cpu-idle-states = <&CPU_SLEEP &CLUSTER_SLEEP_0>; + capacity-dmips-mhz = <592>; }; cpu4: cpu@100 { @@ -101,6 +105,7 @@ &CPU_SLEEP &CLUSTER_SLEEP_1 >; + capacity-dmips-mhz = <1024>; }; cpu5: cpu@101 { @@ -114,6 +119,7 @@ &CPU_SLEEP &CLUSTER_SLEEP_1 >; + capacity-dmips-mhz = <1024>; }; cpu6: cpu@102 { @@ -127,6 +133,7 @@ &CPU_SLEEP &CLUSTER_SLEEP_1 >; + capacity-dmips-mhz = <1024>; }; cpu7: cpu@103 { @@ -140,6 +147,7 @@ &CPU_SLEEP &CLUSTER_SLEEP_1 >; + capacity-dmips-mhz = <1024>; }; idle-states {