Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp329166imu; Wed, 2 Jan 2019 07:29:46 -0800 (PST) X-Google-Smtp-Source: ALg8bN6gr1fJh/zY/B9AAf/DS/IATlD21jHMRooiP5OqaQbtU91yrJGNKOL1ltL72rQ6Af5jTA8G X-Received: by 2002:a62:6cc9:: with SMTP id h192mr31670826pfc.223.1546442986430; Wed, 02 Jan 2019 07:29:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546442986; cv=none; d=google.com; s=arc-20160816; b=JH9lwc5ex6SvMTfywcCAuxPRJCDHSYWMFf3w7wFkLauCxyD/bLaL28ciBpSNaYhnKW +h/8OcKs9Ma9zL3P3iOHcXjQ/0NP/6fIukGkig0I+ptWREyupmwbk8pI+QPeqLLmkZqn qHQ43uDHiI7EBwoa7FDf8FKMw95ohI4pUTrTcHlrp+Z9xEcq81r9KhXjG7vIdsusVK25 9MavIZARUA9LYCfydUKOyEkWMteklQ926cd4a1wX4wfb3/h7svAVpI1q0mYNnhVzsixD qDI8xgWPZpruj4k8Khki+Du8SRBtN/Nm/PKqwMaMoIqEFm73CUzDZ5ZTkSOTkLCFMh51 owaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=JIaveeHsOYVSPOtLGEZUEIdOhghYuWINXNoRIfqKZiw=; b=h/TLygAFT48nvP10Zqk8F7IA+MNv3hVDNpIHifL8FasCyZCW8ficgzZuhFpLNKRWGN NsnoENNtB1VHmBMvef4vD+03dWMkzuO/9u6xyYX25tQNN9O592VPvwUKO706mJ5Z5DM7 Pfnq2lpHUcADmt1rz5BN1rDqOihw4CCQPAknhLwK+c/aIw/1BEYLDnLuujgYyWbuIsVK frZpZutYWdyphjVwGdaY5E2OjvuvkekLIZO04qIjrYNasXWVsij+J+Q60qRQF3ZadVZ2 rdLJxe/t3Gk2EYCH13jFeLVDrhu3CtA5oE3ntxLnNNbEPAyR2GY5Un8ejYwDBkx2nhYx Nvzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si30921999pge.76.2019.01.02.07.29.29; Wed, 02 Jan 2019 07:29:46 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730071AbfABOBM (ORCPT + 99 others); Wed, 2 Jan 2019 09:01:12 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:43549 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1730037AbfABOBK (ORCPT ); Wed, 2 Jan 2019 09:01:10 -0500 X-UUID: 687966a58fb148b980ee04a7b6288323-20190102 X-UUID: 687966a58fb148b980ee04a7b6288323-20190102 Received: from mtkcas07.mediatek.inc [(172.21.101.84)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 2092205902; Wed, 02 Jan 2019 22:00:58 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs03n2.mediatek.inc (172.21.101.182) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Wed, 2 Jan 2019 22:00:56 +0800 Received: from mtkslt205.mediatek.inc (10.21.15.75) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Wed, 2 Jan 2019 22:00:56 +0800 From: Henry Chen To: Viresh Kumar , Stephen Boyd , Rob Herring , Matthias Brugger , Ulf Hansson CC: Mark Rutland , Fan Chen , Weiyi Lu , James Liao , Kees Cook , , , , , , Henry Chen Subject: [RFC PATCH 2/7] dt-bindings: soc: Add opp table on scpsys bindings Date: Wed, 2 Jan 2019 21:43:59 +0800 Message-ID: <1546436644-19234-3-git-send-email-henryc.chen@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1546436644-19234-1-git-send-email-henryc.chen@mediatek.com> References: <1546436644-19234-1-git-send-email-henryc.chen@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 4075F505C38E141132BECD6AE62071DC329A276F3553991198627A0974579ABC2000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add opp table on scpsys dt-bindings for Mediatek SoC. Signed-off-by: Henry Chen --- Documentation/devicetree/bindings/opp/mtk-opp.txt | 24 +++++++++++++ .../devicetree/bindings/soc/mediatek/scpsys.txt | 42 ++++++++++++++++++++++ 2 files changed, 66 insertions(+) create mode 100644 Documentation/devicetree/bindings/opp/mtk-opp.txt diff --git a/Documentation/devicetree/bindings/opp/mtk-opp.txt b/Documentation/devicetree/bindings/opp/mtk-opp.txt new file mode 100644 index 0000000..036be1c --- /dev/null +++ b/Documentation/devicetree/bindings/opp/mtk-opp.txt @@ -0,0 +1,24 @@ +Mediatek OPP bindings to descibe OPP nodes with level values + +OPP tables for devices on Mediatek platforms require an additional +platform specific level value to be specified. +This value is passed on to the mediatek Power Management Unit by the +CPU, which then takes the necessary actions to set a voltage rail +to an appropriate voltage based on the value passed. + +The bindings are based on top of the operating-points-v2 bindings +described in Documentation/devicetree/bindings/opp/opp.txt +Additional properties are described below. + +* OPP Table Node + +Required properties: +- compatible: Allow OPPs to express their compatibility. It should be: + "operating-points-v2-mtk-level" + +* OPP Node + +Required properties: +- mtk,level: On Mediatek platforms an OPP node can describe a positive value +representing a level that's communicated with a our power management hardware +which then translates it into a certain voltage on a voltage rail. diff --git a/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt b/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt index b4728ce..299b526 100644 --- a/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt +++ b/Documentation/devicetree/bindings/soc/mediatek/scpsys.txt @@ -63,6 +63,10 @@ Optional properties: - mfg_2d-supply: Power supply for the mfg_2d power domain - mfg-supply: Power supply for the mfg power domain +- operating-points-v2: Phandle to the OPP table for the Power domain. + Refer to Documentation/devicetree/bindings/power/power_domain.txt + and Documentation/devicetree/bindings/opp/mtk-opp.txt for more details + Example: scpsys: scpsys@10006000 { @@ -75,6 +79,27 @@ Example: <&topckgen CLK_TOP_VENC_SEL>, <&topckgen CLK_TOP_VENC_LT_SEL>; clock-names = "mfg", "mm", "venc", "venc_lt"; + operating-points-v2 = <&dvfsrc_opp_table>; + + dvfsrc_opp_table: opp-table { + compatible = "operating-points-v2-mtk-level"; + + dvfsrc_vol_min: opp1 { + mtk,level = ; + }; + + dvfsrc_freq_medium: opp2 { + mtk,level = ; + }; + + dvfsrc_freq_max: opp3 { + mtk,level = ; + }; + + dvfsrc_vol_max: opp4 { + mtk,level = ; + }; + }; }; Example consumer: @@ -82,4 +107,21 @@ Example consumer: afe: mt8173-afe-pcm@11220000 { compatible = "mediatek,mt8173-afe-pcm"; power-domains = <&scpsys MT8173_POWER_DOMAIN_AUDIO>; + operating-points-v2 = <&aud_opp_table>; + }; + + aud_opp_table: aud-opp-table { + compatible = "operating-points-v2"; + opp1 { + opp-hz = /bits/ 64 <793000000>; + required-opps = <&dvfsrc_vol_min>; + }; + opp2 { + opp-hz = /bits/ 64 <910000000>; + required-opps = <&dvfsrc_vol_max>; + }; + opp3 { + opp-hz = /bits/ 64 <1014000000>; + required-opps = <&dvfsrc_vol_max>; + }; }; -- 1.9.1