Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp5977668imm; Tue, 26 Jun 2018 23:28:01 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKPrRvCtmiyT/ECRauCJQBUCPF9oiIIqcezwnFqKwZ7+7fLDe4Nk01Bkx+S1yT54IeVcsTG X-Received: by 2002:a17:902:d808:: with SMTP id a8-v6mr4775123plz.188.1530080880962; Tue, 26 Jun 2018 23:28:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530080880; cv=none; d=google.com; s=arc-20160816; b=hHzALfG3GN93O20mmNK7FQDDiwGAU8ISVuYWm6IvUJkQhtYlDdcF/w5IMJLFJk8NOc XhT9yWzoI12Is8vXQOb+vNXCEOfgrgcdpdAZmiAyt0Tj+k2YypjKXLFy1JE05WvUbUzp zK5Phc++bWQQ8ZKvni8n95eOZEP2bYmpYx8UZ6apQJuPy0fYAVY15dsfUC1AabvLWzBX KAj5qI5jGfVk2sKrAiBejLiBDqH9SdE+29h0Qq9t9ufIB7LpYYbiZdvo2VL2xFHbnyrT 4jNzOUNpxWYTYmdOk/sP8yWz59CtrZRCFTPBRRKcDtd8qv/vXikF5oLCX3iKsK+UAdna JvDw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=wlUWsXhQTq0N1F2rey/QtZj2DIjz4I3U/iXloZawt3Q=; b=xEHx+iRlTQFxj9mr24WUslySv2lbMY88P5ljw86w1QPf9H8DGkIr51c1m8HmqilQNH CgQQS7gasbjKI3HJ2e6VvUOWUxrPAY2vK40RWtb8AOZBYHezOfMNFjcUZO1liYlSGcCv Rkfl7cL2ZOVK7XTRBHfgjDcqL7JVIF/Yk21jFjG01omMFuqJ++4ScfdPODNqGhE0u+kN u8mZsyg81nCyUTngO64PiDfmJNQ0pwcboIA2PVuzyoq6nkEtReJmwelNNXDtK3d0yxsC PzJKQB7Dj2ISPhsPtuj/TEgkHQ9UsKIVIwz4SBgMgpq4KxpKFK0notBuDWjusb14pERy SdlQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=Ef5xfpAH; dkim=pass header.i=@codeaurora.org header.s=default header.b=efsxcyIz; 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 h1-v6si3047571pfn.285.2018.06.26.23.27.43; Tue, 26 Jun 2018 23:28:00 -0700 (PDT) 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; dkim=pass header.i=@codeaurora.org header.s=default header.b=Ef5xfpAH; dkim=pass header.i=@codeaurora.org header.s=default header.b=efsxcyIz; 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 S1753125AbeF0ExP (ORCPT + 99 others); Wed, 27 Jun 2018 00:53:15 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:57672 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932671AbeF0ExK (ORCPT ); Wed, 27 Jun 2018 00:53:10 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 8C8E260AFF; Wed, 27 Jun 2018 04:53:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530075189; bh=uLuiLy0dbJD4PNU1ptjqMAN3YWXHRpBdcmzfgE+QCTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Ef5xfpAHJrBLn7mwkX2y2j43wqdjrTuywcHv/fZvmN6hPAYJ1pGx7EErnp4QmNelA FVO9dcJTX2zDmg6cTcBT6f+91d1sx7Y1LB2FqBmoq5tW9cWMdx5nSJI1SgiplUWVI0 K7NX1VBJ6N123xenBWYWS4gZc5ma0roigBweUTgU= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from blr-ubuntu-173.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id C7EB46081B; Wed, 27 Jun 2018 04:53:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1530075188; bh=uLuiLy0dbJD4PNU1ptjqMAN3YWXHRpBdcmzfgE+QCTc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=efsxcyIzD9R0azYG4Y0uI/c//L6Brs2t29CyJHfVA2SJP3gpGnJ/M3hsrVGsKNeCe znJOoiZ4zuy3Npq8QCJ1Al/KKy+Eo7289AgI+Bvm11vepd4KaTMKI4P4el0Hcq0oNd W/uTVYwpMe1m8LWCKnmSAoYEc7InFgB7RaeTtztM= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org C7EB46081B Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rnayak@codeaurora.org From: Rajendra Nayak To: viresh.kumar@linaro.org, sboyd@kernel.org, andy.gross@linaro.org, ulf.hansson@linaro.org, collinsd@codeaurora.org, mka@chromium.org Cc: devicetree@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Rajendra Nayak Subject: [PATCH v4 2/6] dt-bindings: power: Add qcom rpm power domain driver bindings Date: Wed, 27 Jun 2018 10:22:30 +0530 Message-Id: <20180627045234.27403-3-rnayak@codeaurora.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180627045234.27403-1-rnayak@codeaurora.org> References: <20180627045234.27403-1-rnayak@codeaurora.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add DT bindings to describe the rpm/rpmh power domains found on Qualcomm Technologies, Inc. SoCs. These power domains communicate a performance state to RPM/RPMh, which then translates it into corresponding voltage on a PMIC rail. Signed-off-by: Rajendra Nayak Signed-off-by: Viresh Kumar Reviewed-by: Ulf Hansson --- .../devicetree/bindings/power/qcom,rpmpd.txt | 146 ++++++++++++++++++ include/dt-bindings/power/qcom-rpmpd.h | 39 +++++ 2 files changed, 185 insertions(+) create mode 100644 Documentation/devicetree/bindings/power/qcom,rpmpd.txt create mode 100644 include/dt-bindings/power/qcom-rpmpd.h diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.txt b/Documentation/devicetree/bindings/power/qcom,rpmpd.txt new file mode 100644 index 000000000000..8825080afa5a --- /dev/null +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.txt @@ -0,0 +1,146 @@ +Qualcomm RPM/RPMh Power domains + +For RPM/RPMh Power domains, we communicate a performance state to RPM/RPMh +which then translates it into a corresponding voltage on a rail + +Required Properties: + - compatible: Should be one of the following + * qcom,msm8996-rpmpd: RPM Power domain for the msm8996 family of SoC + * qcom,sdm845-rpmhpd: RPMh Power domain for the sdm845 family of SoC + - power-domain-cells: number of cells in Power domain specifier + must be 1. + - 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/qcom-opp.txt for more details + +Refer to for the level values for +various OPPs for different platforms as well as Power domain indexes + +Example: rpmh power domain controller and OPP table + +#include + +qcom,level values specified in the OPP tables for RPMh power domains +should use the RPMH_REGULATOR_LEVEL_* constants from + + + rpmhpd: power-controller { + compatible = "qcom,sdm845-rpmhpd"; + #power-domain-cells = <1>; + operating-points-v2 = <&rpmhpd_opp_table>; + }; + + rpmhpd_opp_table: opp-table { + compatible = "operating-points-v2-qcom-level"; + + rpmhpd_opp_ret: opp1 { + qcom,level = ; + }; + + rpmhpd_opp_min_svs: opp2 { + qcom,level = ; + }; + + rpmhpd_opp_low_svs: opp3 { + qcom,level = ; + }; + + rpmhpd_opp_svs: opp4 { + qcom,level = ; + }; + + rpmhpd_opp_svs_l1: opp5 { + qcom,level = ; + }; + + rpmhpd_opp_nom: opp6 { + qcom,level = ; + }; + + rpmhpd_opp_nom_l1: opp7 { + qcom,level = ; + }; + + rpmhpd_opp_nom_l2: opp8 { + qcom,level = ; + }; + + rpmhpd_opp_turbo: opp9 { + qcom,level = ; + }; + + rpmhpd_opp_turbo_l1: opp10 { + qcom,level = ; + }; + }; + +Example: rpm power domain controller and OPP table + + rpmpd: power-controller { + compatible = "qcom,msm8996-rpmpd"; + #power-domain-cells = <1>; + operating-points-v2 = <&rpmpd_opp_table>; + }; + + rpmpd_opp_table: opp-table { + compatible = "operating-points-v2-qcom-level"; + + rpmpd_opp_low: opp1 { + qcom,level = <1>; + }; + + rpmpd_opp_ret: opp2 { + qcom,level = <2>; + }; + + rpmpd_opp_svs: opp3 { + qcom,level = <3>; + }; + + rpmpd_opp_normal: opp4 { + qcom,level = <4>; + }; + + rpmpd_opp_high: opp5 { + qcom,level = <5>; + }; + + rpmpd_opp_turbo: opp6 { + qcom,level = <6>; + }; + }; + +Example: Client/Consumer device using OPP table + + leaky-device0@12350000 { + compatible = "foo,i-leak-current"; + reg = <0x12350000 0x1000>; + power-domains = <&rpmhpd SDM845_MX>; + operating-points-v2 = <&leaky_opp_table>; + }; + + + leaky_opp_table: opp-table { + compatible = "operating-points-v2"; + + opp1 { + opp-hz = /bits/ 64 <144000>; + required-opps = <&rpmhpd_opp_low>; + }; + + opp2 { + opp-hz = /bits/ 64 <400000>; + required-opps = <&rpmhpd_opp_ret>; + }; + + opp3 { + opp-hz = /bits/ 64 <20000000>; + required-opps = <&rpmpd_opp_svs>; + }; + + opp4 { + opp-hz = /bits/ 64 <25000000>; + required-opps = <&rpmpd_opp_normal>; + }; + + }; diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h new file mode 100644 index 000000000000..87d9c6611682 --- /dev/null +++ b/include/dt-bindings/power/qcom-rpmpd.h @@ -0,0 +1,39 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* Copyright (c) 2018, The Linux Foundation. All rights reserved. */ + +#ifndef _DT_BINDINGS_POWER_QCOM_RPMPD_H +#define _DT_BINDINGS_POWER_QCOM_RPMPD_H + +/* SDM845 Power Domain Indexes */ +#define SDM845_EBI 0 +#define SDM845_MX 1 +#define SDM845_MX_AO 2 +#define SDM845_CX 3 +#define SDM845_CX_AO 4 +#define SDM845_LMX 5 +#define SDM845_LCX 6 +#define SDM845_GFX 7 +#define SDM845_MSS 8 + +/* SDM845 Power Domain performance levels */ +#define RPMH_REGULATOR_LEVEL_RETENTION 16 +#define RPMH_REGULATOR_LEVEL_MIN_SVS 48 +#define RPMH_REGULATOR_LEVEL_LOW_SVS 64 +#define RPMH_REGULATOR_LEVEL_SVS 128 +#define RPMH_REGULATOR_LEVEL_SVS_L1 192 +#define RPMH_REGULATOR_LEVEL_NOM 256 +#define RPMH_REGULATOR_LEVEL_NOM_L1 320 +#define RPMH_REGULATOR_LEVEL_NOM_L2 336 +#define RPMH_REGULATOR_LEVEL_TURBO 384 +#define RPMH_REGULATOR_LEVEL_TURBO_L1 416 + +/* MSM8996 Power Domain Indexes */ +#define MSM8996_VDDCX 0 +#define MSM8996_VDDCX_AO 1 +#define MSM8996_VDDCX_VFC 2 +#define MSM8996_VDDMX 3 +#define MSM8996_VDDMX_AO 4 +#define MSM8996_VDDSSCX 5 +#define MSM8996_VDDSSCX_VFC 6 + +#endif -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation