From patchwork Tue Mar 7 13:17:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Mergnat X-Patchwork-Id: 13163509 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 043ACC678D5 for ; Tue, 7 Mar 2023 13:28:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:Cc:To:In-Reply-To:References:Message-Id :MIME-Version:Subject:Date:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=RXw4/Q9sb2BKYO9tFtdybDeMrS4MUm3OFs/GGs91Aug=; b=lpVhnXtDyZNKLL o1bsiIf1RGO95sqVk3ZwKzWz/i65XwdP8YLTUrrz4gvmnU9v5xP+etmPTUx5u7ergGvXrMIVYWhSM wMpOFxg9Alt0wUYVt5JDp3bn3m68RdDMddpvg4JPOagwfxUv7xbpiKdBMEiPURs0CJaYPKaJC6+cw y6VaFC+twrCnT3zl6BdM2eTDV7XNOmRme+rMmr4FwTF8a/YSswExXABBELjcGFOb4ZGz/Abz5C90D arPK2atqOV/cc45XbG2H9nezpVXRzhjLalUbNIqiHWzxt5aIGGJgpwZqCrkKN5alv/3EpwVg4W9vH v3aaFYLLN53qTbREVrQw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZXLO-000Nhd-UY; Tue, 07 Mar 2023 13:27:07 +0000 Received: from mail-wm1-x335.google.com ([2a00:1450:4864:20::335]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1pZXCu-000Jeb-BM for linux-arm-kernel@lists.infradead.org; Tue, 07 Mar 2023 13:18:21 +0000 Received: by mail-wm1-x335.google.com with SMTP id c18so7742884wmr.3 for ; Tue, 07 Mar 2023 05:18:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20210112.gappssmtp.com; s=20210112; t=1678195100; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=mJVpBJj7Q47tDVHQbQFKEbwqf8M1r6OvMJv941rag94=; b=IZg32YgLf+Ob3FqrwsTYqi5GHtsL3B2+OzidEnAamlmCMYWXlNM5iF8j9UVsn6jyu/ lUUx95nLxxea/evaLSGlxEnFi/BajfETqf7bY8NpRCro/Wjg8thXKvKwAojLINPM+H5S zkzfQNAncIg3Ve2YK2HWUBhVoiqEVN9A8ZPsEdejTIoSbr0LCisrkAiSQbLTr7ZTudJK 2KGG8T1o1DLTICSz/TkEFlRBOMq1qQxfKrV05KuqD/vwjgp2PKfAY2UY+kH0TwGsJ2Rh EuvI15oB89y+ST8wtn2gpP1BOsgsomd5aNMIxrCCz8LzYOMYucQ+Q373gEJn79qCixba Hxxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678195100; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mJVpBJj7Q47tDVHQbQFKEbwqf8M1r6OvMJv941rag94=; b=11PZJIugbitj5BrDB0piK9yx5z3Vp7s5G4YO3fWOMxnYaQqJnC7bMJg6NdBSIpDf8u pBxteCq3SsxW4M8a4ZEsGk2hBHVEnQiHJkFJ1zhKhtcHpI7/skCGyAQNA8jjrciN5QcV PDp7vA4Q5VZhmHyarTf+3ZiKTKX3lcSi0DWm9VA9VHRvUxGg1jprhVOzU58heqFPJeOY eBjPU7iYmWz41voK5dQZZTCgO+ZYTxXK8cl0f1bEUL+uXV9JnvlzppX1WLZFyJx/ROSb C2QoxWWzmidyVRtLFnoE2LXjEMAgG7P+sJEOVP7p3v2XBVm80XEC3ea5DrJDLuI+Pu41 dV+g== X-Gm-Message-State: AO0yUKU126Y623jDgTYSMy4ajjzsJ25TNFI+FaNd9FIKfozSrXr2l+Yc nVA8A0O+ZFfgb1kwFGaPzoRLyQ== X-Google-Smtp-Source: AK7set/i25Rk5nwLo2x3J80rqpfPHXWm+zuJxnKC4fugCyM7LvMbur3zuZ3u/JjGdfIiWtZP1OnthA== X-Received: by 2002:a05:600c:468b:b0:3df:fcbd:3159 with SMTP id p11-20020a05600c468b00b003dffcbd3159mr9947470wmo.3.1678195099918; Tue, 07 Mar 2023 05:18:19 -0800 (PST) Received: from [127.0.1.1] (laubervilliers-658-1-213-31.w90-63.abo.wanadoo.fr. [90.63.244.31]) by smtp.googlemail.com with ESMTPSA id hu21-20020a05600ca29500b003eaee9e0d22sm12986242wmb.33.2023.03.07.05.18.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Mar 2023 05:18:19 -0800 (PST) From: Alexandre Mergnat Date: Tue, 07 Mar 2023 14:17:47 +0100 Subject: [PATCH v2 18/18] arm64: dts: mediatek: Add CPU Idle support MIME-Version: 1.0 Message-Id: <20230203-evk-board-support-v2-18-6ec7cdb10ccf@baylibre.com> References: <20230203-evk-board-support-v2-0-6ec7cdb10ccf@baylibre.com> In-Reply-To: <20230203-evk-board-support-v2-0-6ec7cdb10ccf@baylibre.com> To: =?unknown-8bit?q?Zhiyong_Tao_=3Czhiyong=2Etao=40mediatek=2Ecom=3E=2C_Gue?= =?unknown-8bit?q?nter_Roeck_=3Clinux=40roeck-us=2Enet=3E=2C_Linus_Walleij_?= =?unknown-8bit?q?=3Clinus=2Ewalleij=40linaro=2Eorg=3E=2C?= =?unknown-8bit?q?_Bernhard_Rosenkr=C3=A4nzer_=3Cbero=40baylibre=2Ecom=3E=2C_?= =?unknown-8bit?q?AngeloGioacchino_Del_Regno_=3Cangelogioacchino=2Edelregno?= =?unknown-8bit?q?=40collabora=2Ecom=3E=2C?= =?unknown-8bit?q?_Ulf_Hansson_=3Culf=2Ehansson=40linaro=2Eorg=3E=2C_Wim_Van_?= =?unknown-8bit?q?Sebroeck_=3Cwim=40linux-watchdog=2Eorg=3E=2C?= =?unknown-8bit?q?_Krzysztof_Kozlowski_=3Ckrzysztof=2Ekozlowski+dt=40linaro?= =?unknown-8bit?q?=2Eorg=3E=2C_Chaotian_Jing_=3Cchaotian=2Ejing=40mediatek?= =?unknown-8bit?q?=2Ecom=3E=2C?= =?unknown-8bit?q?_Rob_Herring_=3Crobh+dt=40kernel=2Eorg=3E=2C_Wenbin_Mei_=3C?= =?unknown-8bit?q?wenbin=2Emei=40mediatek=2Ecom=3E=2C_Matthias_Brugger_=3Cma?= =?unknown-8bit?q?tthias=2Ebgg=40gmail=2Ecom=3E?= Cc: linux-mmc@vger.kernel.org, Alexandre Bailon , devicetree@vger.kernel.org, Amjad Ouled-Ameur , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-watchdog@vger.kernel.org, Alexandre Mergnat , linux-mediatek@lists.infradead.org, Fabien Parent X-Mailer: b4 0.10.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=2609; i=amergnat@baylibre.com; h=from:subject:message-id; bh=PpXbegqyhWKQM1ZMMzVId+LMr9Lt16YQvGeGFjFB8IY=; b=owEBbQKS/ZANAwAKAStGSZ1+MdRFAcsmYgBkBzmFTOpOgQPHjN244A+ti+23VUEeI0ssQNVxIX1S QjiLHWqJAjMEAAEKAB0WIQQjG17X8+qqcA5g/osrRkmdfjHURQUCZAc5hQAKCRArRkmdfjHURdaZD/ 9OsOd8QzUcRygK5Z4CW5UnTYxlvCOS/vUvVxIGwHtJg9z98s8WA3oKbQl4BOAqKVJGm3jzHrgSEbDJ cj9nNv9An3T2UVh+hJ8jI2dsh5Cb63tB6P7SMGwlBFVdC80E9yovd5CQROrT/J7cQeBLTT+MSHK6Zx 2Q3DWeaegqXQHTZpbIsWZY3xpRYYyR45/ojmig6ZOrq5MJwnTVENqb5nsuWmKR6Jb4LpxLRyW3drpt 4dJujkWx/uVKogPLyCUQdMVAvDa3I3Kbyefxdkz3qRVQXTAlkddBWbcLseZEzOhLCOj2duGDV6fOFw t0GmQyIcQKfaSWcCb/Y4Tp0SkryKhaXw3A84mXEepahjA5i2zEG2ScUlOC26Sc0vy66teApn94S3U6 1Lk1CZqclWL6YL+4nGbtcs+I1FymmsmCgP1Z2yloFvFB34xSueFFNeMivNnVkBNre1htNOxfzrh/7J xEfgoExFsckKhVBIU5C7w6lt6RUFxqjlti1xs/kPoK8cUG2pAXMYD+zQEyfhym5V2K7UFPxa3nMUV8 7kRneDYtcanK64kg4r1gfOpuCct7ZHl2f2/+xBXWHbDlgdF+3Cp8ihSZw38Rpa3Xl+qe8gb1rCI1hg xNK+e0opvI/kzs5dHGvrRpcui+l2CJO3g87N1DVn5G++3of8VZD5XareiSow== X-Developer-Key: i=amergnat@baylibre.com; a=openpgp; fpr=231B5ED7F3EAAA700E60FE8B2B46499D7E31D445 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230307_051820_473016_14CB5EBE X-CRM114-Status: GOOD ( 11.40 ) 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 From: Amjad Ouled-Ameur MT8365 has 3 CPU Idle states: - MCDI_CPU. (Multi-Core-Deep-Idle) - MCDI_CLUSTER. - DPIDLE. (Deep-Idle) Signed-off-by: Amjad Ouled-Ameur Signed-off-by: Alexandre Mergnat --- arch/arm64/boot/dts/mediatek/mt8365.dtsi | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/arch/arm64/boot/dts/mediatek/mt8365.dtsi b/arch/arm64/boot/dts/mediatek/mt8365.dtsi index 959d8533c24c..b5f5c77f7f84 100644 --- a/arch/arm64/boot/dts/mediatek/mt8365.dtsi +++ b/arch/arm64/boot/dts/mediatek/mt8365.dtsi @@ -112,6 +112,7 @@ cpu0: cpu@0 { reg = <0x0>; #cooling-cells = <2>; enable-method = "psci"; + cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>; i-cache-size = <0x8000>; i-cache-line-size = <64>; i-cache-sets = <256>; @@ -131,6 +132,7 @@ cpu1: cpu@1 { reg = <0x1>; #cooling-cells = <2>; enable-method = "psci"; + cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>; i-cache-size = <0x8000>; i-cache-line-size = <64>; i-cache-sets = <256>; @@ -150,6 +152,7 @@ cpu2: cpu@2 { reg = <0x2>; #cooling-cells = <2>; enable-method = "psci"; + cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>; i-cache-size = <0x8000>; i-cache-line-size = <64>; i-cache-sets = <256>; @@ -169,6 +172,7 @@ cpu3: cpu@3 { reg = <0x3>; #cooling-cells = <2>; enable-method = "psci"; + cpu-idle-states = <&CPU_MCDI &CLUSTER_MCDI &CLUSTER_DPIDLE>; i-cache-size = <0x8000>; i-cache-line-size = <64>; i-cache-sets = <256>; @@ -182,6 +186,37 @@ cpu3: cpu@3 { operating-points-v2 = <&cluster0_opp>; }; + idle-states { + entry-method = "psci"; + + CPU_MCDI: cpu-mcdi { + compatible = "arm,idle-state"; + local-timer-stop; + arm,psci-suspend-param = <0x00010001>; + entry-latency-us = <300>; + exit-latency-us = <200>; + min-residency-us = <1000>; + }; + + CLUSTER_MCDI: cluster-mcdi { + compatible = "arm,idle-state"; + local-timer-stop; + arm,psci-suspend-param = <0x01010001>; + entry-latency-us = <350>; + exit-latency-us = <250>; + min-residency-us = <1200>; + }; + + CLUSTER_DPIDLE: cluster-dpidle { + compatible = "arm,idle-state"; + local-timer-stop; + arm,psci-suspend-param = <0x01010004>; + entry-latency-us = <300>; + exit-latency-us = <800>; + min-residency-us = <3300>; + }; + }; + l2: l2-cache { compatible = "cache"; cache-level = <2>;