From patchwork Wed Sep 16 10:41:26 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11780711 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 11EB3618 for ; Wed, 16 Sep 2020 20:12:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D206521973 for ; Wed, 16 Sep 2020 20:12:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="dJQ2vbyi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727769AbgIPUMM (ORCPT ); Wed, 16 Sep 2020 16:12:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33292 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727151AbgIPRdP (ORCPT ); Wed, 16 Sep 2020 13:33:15 -0400 Received: from mo6-p01-ob.smtp.rzone.de (mo6-p01-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5301::4]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F6B1C061A2A; Wed, 16 Sep 2020 04:14:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254282; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=/uk5x5cuOd9BfLYMS8NjZsfqNf1HR3jWycgorOhho7A=; b=dJQ2vbyiSohEUtMLb7hckWuGm3Pu8+ISWmLsy92pMq0kVccJVSnKS2/n/jhqOzlKQ7 p0+giaYinhJVncHhj8N8i31yqYPll2qd3/p+g/AOYfpVNTVzysO2ZoXLIbZFPxtdtqW1 z8g8Ud1qBSBZWVjHqDRuOB1VZdnM17Mn/9qldARqdNK5bzlmWgVwfW7bh91+qixH6SZq rTZO7N/XI6FMSyMFtxtDzpgQ4UYi0jBBkngptl9b9tNKUXn4Ir8hUlxILrXdNsuz4bkz gf+kYx28IdKjJ9cDskepDOObkwajQi1+TPY2vrUldjMXBWsS0NsvT+LN6dcpursq/9Tv 2O6w== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAfozlO (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:50 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 01/10] soc: qcom: rpmpd: Rename MAX_8996_RPMPD_STATE to MAX_CORNER_RPMPD_STATE Date: Wed, 16 Sep 2020 12:41:26 +0200 Message-Id: <20200916104135.25085-2-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Older SoCs like MSM8916, MSM8939, MSM8974, MSM8996, ... use "voltage corners" instead of "voltage levels". It seems like they all use exactly the same set of corner values, a value from 0-6 where 6 is the maximum corner (super turbo). In preparation to add the power domains for MSM8916, rename MAX_8996_RPMPD_STATE to MAX_CORNER_RPMPD_STATE to make it clear that this is the max_state to be used for all SoCs using corners. - Signed-off-by: Stephan Gerhold --- drivers/soc/qcom/rpmpd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c index f2168e4259b2..88eb458b13d0 100644 --- a/drivers/soc/qcom/rpmpd.c +++ b/drivers/soc/qcom/rpmpd.c @@ -35,7 +35,7 @@ #define KEY_FLOOR_LEVEL 0x6c6676 /* vfl */ #define KEY_LEVEL 0x6c766c76 /* vlvl */ -#define MAX_8996_RPMPD_STATE 6 +#define MAX_CORNER_RPMPD_STATE 6 #define DEFINE_RPMPD_PAIR(_platform, _name, _active, r_type, r_key, \ r_id) \ @@ -159,7 +159,7 @@ static struct rpmpd *msm8996_rpmpds[] = { static const struct rpmpd_desc msm8996_desc = { .rpmpds = msm8996_rpmpds, .num_pds = ARRAY_SIZE(msm8996_rpmpds), - .max_state = MAX_8996_RPMPD_STATE, + .max_state = MAX_CORNER_RPMPD_STATE, }; /* msm8998 RPM Power domains */ From patchwork Wed Sep 16 10:41:27 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11780719 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 659A9618 for ; Wed, 16 Sep 2020 20:12:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3C74421973 for ; Wed, 16 Sep 2020 20:12:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="LGMVw2u1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727282AbgIPUMa (ORCPT ); Wed, 16 Sep 2020 16:12:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33286 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727145AbgIPRdP (ORCPT ); Wed, 16 Sep 2020 13:33:15 -0400 Received: from mo6-p02-ob.smtp.rzone.de (mo6-p02-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5302::12]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FB8DC061A30; Wed, 16 Sep 2020 04:14:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254283; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=xNx2nYiBqTvwDNj3lkeSGDvTSffXCVKMpdIp0iYKFeg=; b=LGMVw2u1OABHMWwPe2OVkk5AWw2/j+JvbDMn5F2oqJ9gnFpsQdDsJ+ZP1Xtv5CXwuN 2WGmxLqEaZvPakxKDrfLLh6ZSMu6HtDFhGxu3TnCR36byfz+o3/1rRKZ+q4v78IPrAEF 6Tc3CM7auwCbrzLR0qNpGaeMB1BFnqdDyRJe5W2qGYBeKG3myljSPj66GrtZXa5qHGkk 4f7wO8Z+kIQlU/4q6bDbMZJpEoTWvnW4F5/YXMcoK+uH+bxMb6KCYrlcdXFTMgoLDWGo kvqqzqPY/0VUxm7cB1aG0PDNwIZNlRIRn/9nF1nCtwnIEsOaoBEIzkOwgWrhrKclUWhf weLA== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAfozlP (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:50 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 02/10] dt-bindings: power: rpmpd: Add MSM8916 RPM power domains Date: Wed, 16 Sep 2020 12:41:27 +0200 Message-Id: <20200916104135.25085-3-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org MSM8916 has two RPM power domains: VDDCX and VDDMX. Add the device tree bindings to manage them through rpmpd. Signed-off-by: Stephan Gerhold Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/power/qcom,rpmpd.yaml | 1 + include/dt-bindings/power/qcom-rpmpd.h | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml index 8058955fb3b9..f136d06b7fc8 100644 --- a/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml +++ b/Documentation/devicetree/bindings/power/qcom,rpmpd.yaml @@ -16,6 +16,7 @@ description: properties: compatible: enum: + - qcom,msm8916-rpmpd - qcom,msm8976-rpmpd - qcom,msm8996-rpmpd - qcom,msm8998-rpmpd diff --git a/include/dt-bindings/power/qcom-rpmpd.h b/include/dt-bindings/power/qcom-rpmpd.h index 5e61eaf73bdd..83dae2cabb60 100644 --- a/include/dt-bindings/power/qcom-rpmpd.h +++ b/include/dt-bindings/power/qcom-rpmpd.h @@ -64,6 +64,13 @@ #define RPMH_REGULATOR_LEVEL_TURBO 384 #define RPMH_REGULATOR_LEVEL_TURBO_L1 416 +/* MSM8916 Power Domain Indexes */ +#define MSM8916_VDDCX 0 +#define MSM8916_VDDCX_AO 1 +#define MSM8916_VDDCX_VFC 2 +#define MSM8916_VDDMX 3 +#define MSM8916_VDDMX_AO 4 + /* MSM8976 Power Domain Indexes */ #define MSM8976_VDDCX 0 #define MSM8976_VDDCX_AO 1 From patchwork Wed Sep 16 10:41:28 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11780531 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 41B94618 for ; Wed, 16 Sep 2020 19:04:02 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A49C206DB for ; Wed, 16 Sep 2020 19:04:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="gPzf3js/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727635AbgIPTD6 (ORCPT ); Wed, 16 Sep 2020 15:03:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727407AbgIPRsG (ORCPT ); Wed, 16 Sep 2020 13:48:06 -0400 Received: from mo6-p02-ob.smtp.rzone.de (mo6-p02-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5302::11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3C766C061A2B; Wed, 16 Sep 2020 04:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254283; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=TFNXvKJwdtFzCefcgMtOvafQoeaSFyYS/u0KKD5oVW8=; b=gPzf3js/HWVP5uFH/poWB0INhXvEnj87wp526vurWlxAnhwDpUl85re7xFY6QflPR8 J1Gp15d6gpsX2HOKAMsg2X2WaZqLoybYIm8zZVeNnnDvISw4a9Y4AzcLdP0Zw6OjjgKj e1Kc54fsCsd/NdXbkLODNKhfdyfzDlre0Con7GVzwGq2VwsnAqRnU3jfvegzsqdkxPwC XX+hUkdFbbGltaZ1TlfyDBmHO0dpbHtz9VbjSi8i0OQ+uzMXJART2ATh2E/yaVNU/34F IN15OIKq8MoUdEN+P/EjjWPiG+yw/EN/6ZM4w65qg8I+3gJY2A0NRiQR+Sxz6cgeG9jy riug== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAfpzlQ (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:51 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 03/10] soc: qcom: rpmpd: Add MSM8916 power domains Date: Wed, 16 Sep 2020 12:41:28 +0200 Message-Id: <20200916104135.25085-4-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org MSM8916 has two RPM power domains: VDDCX and VDDMX. Add the necessary definitions to manage them with rpmpd. Signed-off-by: Stephan Gerhold --- drivers/soc/qcom/rpmpd.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/drivers/soc/qcom/rpmpd.c b/drivers/soc/qcom/rpmpd.c index 88eb458b13d0..daeea119d48a 100644 --- a/drivers/soc/qcom/rpmpd.c +++ b/drivers/soc/qcom/rpmpd.c @@ -116,6 +116,26 @@ struct rpmpd_desc { static DEFINE_MUTEX(rpmpd_lock); +/* msm8916 RPM Power Domains */ +DEFINE_RPMPD_PAIR(msm8916, vddcx, vddcx_ao, SMPA, CORNER, 1); +DEFINE_RPMPD_PAIR(msm8916, vddmx, vddmx_ao, LDOA, CORNER, 3); + +DEFINE_RPMPD_VFC(msm8916, vddcx_vfc, SMPA, 1); + +static struct rpmpd *msm8916_rpmpds[] = { + [MSM8916_VDDCX] = &msm8916_vddcx, + [MSM8916_VDDCX_AO] = &msm8916_vddcx_ao, + [MSM8916_VDDCX_VFC] = &msm8916_vddcx_vfc, + [MSM8916_VDDMX] = &msm8916_vddmx, + [MSM8916_VDDMX_AO] = &msm8916_vddmx_ao, +}; + +static const struct rpmpd_desc msm8916_desc = { + .rpmpds = msm8916_rpmpds, + .num_pds = ARRAY_SIZE(msm8916_rpmpds), + .max_state = MAX_CORNER_RPMPD_STATE, +}; + /* msm8976 RPM Power Domains */ DEFINE_RPMPD_PAIR(msm8976, vddcx, vddcx_ao, SMPA, LEVEL, 2); DEFINE_RPMPD_PAIR(msm8976, vddmx, vddmx_ao, SMPA, LEVEL, 6); @@ -221,6 +241,7 @@ static const struct rpmpd_desc qcs404_desc = { }; static const struct of_device_id rpmpd_match_table[] = { + { .compatible = "qcom,msm8916-rpmpd", .data = &msm8916_desc }, { .compatible = "qcom,msm8976-rpmpd", .data = &msm8976_desc }, { .compatible = "qcom,msm8996-rpmpd", .data = &msm8996_desc }, { .compatible = "qcom,msm8998-rpmpd", .data = &msm8998_desc }, From patchwork Wed Sep 16 10:41:29 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11780709 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8E9BC618 for ; Wed, 16 Sep 2020 20:12:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 60ADA20936 for ; Wed, 16 Sep 2020 20:12:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="hGHJZNh+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728101AbgIPUMO (ORCPT ); Wed, 16 Sep 2020 16:12:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33288 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727149AbgIPRdP (ORCPT ); Wed, 16 Sep 2020 13:33:15 -0400 Received: from mo6-p02-ob.smtp.rzone.de (mo6-p02-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5302::11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 250E1C0611BE; Wed, 16 Sep 2020 04:14:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254260; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=KTYtuLjpG4q2FFVDMLYAxEmULX+z+h2JJwIQULJoCkA=; b=hGHJZNh+6JkVq8u8BHH6lPnZHyfHYMGWMlr0lPMKJyh6SxWazdgKDJH2b9WCOrQ7lm W9K9dEdMJBYQIn9ub1yvg7JADdDIGaEbS6vwiSWHSM+vZIakTietudzWQhkkkX3Ss92I D353f+ovwIJA/TV+UCGQ7nse3iE4un3V3WcdeZByhvKVbvjc+0gWyDfn5Ch5Gq6nAueh oeRcqXiqf/P2shR0B3DZ+/7lirlDkfCEUneti6oTIYguU6EN8ILVsrZD8dXrFoK2V+w8 fhCzlz7vvut5NEcQbQXLZoIJxG2abgiy8jqWcub2omTmpUWB9BZ8poNBTbmDAcB8dGC3 1afg== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAfpzlR (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:51 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 04/10] arm64: dts: qcom: msm8916: Add RPM power domains Date: Wed, 16 Sep 2020 12:41:29 +0200 Message-Id: <20200916104135.25085-5-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org MSM8916 has two RPM power domains: VDDCX and VDDMX. So far we have been managing them by voting for raw voltages through the regulator subsystem, but it's better to manage them with corners as actual power domains. Add the device tree node for rpmpd so we can manage them as real power domains instead of using the regulators. Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916.dtsi | 29 +++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index aaa21899f1a6..117804f94c35 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -289,6 +289,35 @@ rpmcc: clock-controller { compatible = "qcom,rpmcc-msm8916"; #clock-cells = <1>; }; + + rpmpd: power-controller { + compatible = "qcom,msm8916-rpmpd"; + #power-domain-cells = <1>; + operating-points-v2 = <&rpmpd_opp_table>; + + rpmpd_opp_table: opp-table { + compatible = "operating-points-v2"; + + rpmpd_opp_ret: opp1 { + opp-level = <1>; + }; + rpmpd_opp_svs_krait: opp2 { + opp-level = <2>; + }; + rpmpd_opp_svs_soc: opp3 { + opp-level = <3>; + }; + rpmpd_opp_nom: opp4 { + opp-level = <4>; + }; + rpmpd_opp_turbo: opp5 { + opp-level = <5>; + }; + rpmpd_opp_super_turbo: opp6 { + opp-level = <6>; + }; + }; + }; }; }; }; From patchwork Wed Sep 16 10:41:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11780551 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 79275112E for ; Wed, 16 Sep 2020 19:07:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 479D720708 for ; Wed, 16 Sep 2020 19:07:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="NVniFmbq" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727359AbgIPTHr (ORCPT ); Wed, 16 Sep 2020 15:07:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727370AbgIPRoz (ORCPT ); Wed, 16 Sep 2020 13:44:55 -0400 Received: from mo6-p02-ob.smtp.rzone.de (mo6-p02-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5302::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33C3FC061A27; Wed, 16 Sep 2020 04:14:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254273; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=oSgiL+AbBxRXhhY4lOKblC5UcEx6a7SRflvIOJJAAY8=; b=NVniFmbqS9EPIHB9A2WT51iqMVf+zqzR4+9y8S/xrQMAgR8joMZPK4Qt9xCUNrWLQv 7riRbU/c7c5+BWkpQcuLbwFSlOTnIzqAQGKda1BVCB4l/MNNPcS/DpEUIG2HE70RyLnD Wcmp930KyOJUqrO6DyegoedFrzAm6W5SJQnrvzjksLtdjnA+tPev5cCnK+cx/7Dw/jCZ zJbZDB3mrCfeHfNqspXwMLheJcj3+tNy9BJMR+U78hmwFYURnBcINoqt1bbQB5cslr9P ss6cvIPgOgNqg0QP5rvPOblvKKEHIPcCb1yst69kfbeq3oF2mNPYusG75bJK8zTBTlI6 Xojg== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAfqzlS (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:52 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 05/10] dt-bindings: remoteproc: qcom,q6v5: Deprecate regulators for PDs Date: Wed, 16 Sep 2020 12:41:30 +0200 Message-Id: <20200916104135.25085-6-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Newer platforms vote for necessary power domains through the power domain subsystem. For historical reasons older platforms like MSM8916 or MSM8974 still control these as regulators. Managing them as power domains is preferred since that allows us to vote for corners instead of raw voltages. Document that those should be specified as power domains and deprecate using them through the regulator interface. Signed-off-by: Stephan Gerhold Reviewed-by: Rob Herring --- .../devicetree/bindings/remoteproc/qcom,q6v5.txt | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt index 1f9a62e13ebe..7ccd5534b0ae 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt +++ b/Documentation/devicetree/bindings/remoteproc/qcom,q6v5.txt @@ -113,8 +113,8 @@ should be referenced as follows: For the compatible strings below the following supplies are required: "qcom,q6v5-pil" "qcom,msm8916-mss-pil", -- cx-supply: -- mx-supply: +- cx-supply: (deprecated, use power domain instead) +- mx-supply: (deprecated, use power domain instead) - pll-supply: Usage: required Value type: @@ -123,9 +123,9 @@ For the compatible strings below the following supplies are required: For the compatible string below the following supplies are required: "qcom,msm8974-mss-pil" -- cx-supply: +- cx-supply: (deprecated, use power domain instead) - mss-supply: -- mx-supply: +- mx-supply: (deprecated, use power domain instead) - pll-supply: Usage: required Value type: @@ -149,11 +149,11 @@ For the compatible string below the following supplies are required: Usage: required Value type: Definition: The power-domains needed depend on the compatible string: - qcom,q6v5-pil: qcom,ipq8074-wcss-pil: + no power-domain names required + qcom,q6v5-pil: qcom,msm8916-mss-pil: qcom,msm8974-mss-pil: - no power-domain names required qcom,msm8996-mss-pil: qcom,msm8998-mss-pil: must be "cx", "mx" From patchwork Wed Sep 16 10:41:31 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11780521 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EF5D6618 for ; Wed, 16 Sep 2020 19:03:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B393C221E7 for ; Wed, 16 Sep 2020 19:03:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="TSC1fLne" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728326AbgIPTDK (ORCPT ); Wed, 16 Sep 2020 15:03:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35712 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727404AbgIPRsf (ORCPT ); Wed, 16 Sep 2020 13:48:35 -0400 Received: from mo6-p02-ob.smtp.rzone.de (mo6-p02-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5302::9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2187C061A28; Wed, 16 Sep 2020 04:14:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254281; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=gViQdkst0VwAdrFW9lTsn+0Gd5Ffp1iW1Mb+zknUlnY=; b=TSC1fLneDjnJi/tg8RASnh8doafU2b87wNNOp20q3qn/jrtfJ/8q3tfieRvV2kc9EM R2/oAHPOQIp3NhowOA5Kdv0jl90h8scVjeLWb9ZHOEJ1XlanPhUb4UACHtc5lIK8MRp1 jq4O1kMsmd2wVHYJSdwEq2rbM+wCWP+Ahl/vBcxAiFBFhpTHM/7eDSnnGH1x+9Fi2Quw EvozqLiBfEr56Y/0LmrR9yH2Dca4uNPnd9MWgYTE+ehqN60nTKScMkiI8IoCE3M/Vyv9 JbCkjblESVceuWEDUqNLxzROxfbzjpGcRnisUi7P+TWnDOvzCUvwSrql6dPG/XknuchO UPVA== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAfqzlT (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:52 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 06/10] remoteproc: qcom_q6v5_mss: Allow replacing regulators with power domains Date: Wed, 16 Sep 2020 12:41:31 +0200 Message-Id: <20200916104135.25085-7-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Newer platforms vote for necessary power domains through the power domain subsystem. For historical reasons older platforms like MSM8916 or MSM8974 still control these as regulators. Managing them as power domains is preferred since that allows us to vote for corners instead of raw voltages. Make it possible for MSM8916 and MSM8974 to manage these as power domains. For compatibility with old device trees we still need to support falling back to the regulators when necessary. The way this is implemented here is that the deprecated regulators are defined as "fallback_proxy_supply". Only if attaching the power domains fails because they are not specified (-ENODATA) we request and manage the fallback regulators instead. Signed-off-by: Stephan Gerhold --- drivers/remoteproc/qcom_q6v5_mss.c | 68 ++++++++++++++++++++++++------ 1 file changed, 56 insertions(+), 12 deletions(-) diff --git a/drivers/remoteproc/qcom_q6v5_mss.c b/drivers/remoteproc/qcom_q6v5_mss.c index c401bcc263fa..98bf4230d8f4 100644 --- a/drivers/remoteproc/qcom_q6v5_mss.c +++ b/drivers/remoteproc/qcom_q6v5_mss.c @@ -132,6 +132,7 @@ struct qcom_mss_reg_res { struct rproc_hexagon_res { const char *hexagon_mba_image; struct qcom_mss_reg_res *proxy_supply; + struct qcom_mss_reg_res *fallback_proxy_supply; struct qcom_mss_reg_res *active_supply; char **proxy_clk_names; char **reset_clk_names; @@ -177,9 +178,11 @@ struct q6v5 { int proxy_pd_count; struct reg_info active_regs[1]; - struct reg_info proxy_regs[3]; + struct reg_info proxy_regs[1]; + struct reg_info fallback_proxy_regs[2]; int active_reg_count; int proxy_reg_count; + int fallback_proxy_reg_count; bool dump_mba_loaded; size_t current_dump_size; @@ -890,11 +893,18 @@ static int q6v5_mba_load(struct q6v5 *qproc) goto disable_active_pds; } + ret = q6v5_regulator_enable(qproc, qproc->fallback_proxy_regs, + qproc->fallback_proxy_reg_count); + if (ret) { + dev_err(qproc->dev, "failed to enable fallback proxy supplies\n"); + goto disable_proxy_pds; + } + ret = q6v5_regulator_enable(qproc, qproc->proxy_regs, qproc->proxy_reg_count); if (ret) { dev_err(qproc->dev, "failed to enable proxy supplies\n"); - goto disable_proxy_pds; + goto disable_fallback_proxy_reg; } ret = q6v5_clk_enable(qproc->dev, qproc->proxy_clks, @@ -997,6 +1007,9 @@ static int q6v5_mba_load(struct q6v5 *qproc) disable_proxy_reg: q6v5_regulator_disable(qproc, qproc->proxy_regs, qproc->proxy_reg_count); +disable_fallback_proxy_reg: + q6v5_regulator_disable(qproc, qproc->fallback_proxy_regs, + qproc->fallback_proxy_reg_count); disable_proxy_pds: q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count); disable_active_pds: @@ -1052,6 +1065,8 @@ static void q6v5_mba_reclaim(struct q6v5 *qproc) qproc->proxy_pd_count); q6v5_clk_disable(qproc->dev, qproc->proxy_clks, qproc->proxy_clk_count); + q6v5_regulator_disable(qproc, qproc->fallback_proxy_regs, + qproc->fallback_proxy_reg_count); q6v5_regulator_disable(qproc, qproc->proxy_regs, qproc->proxy_reg_count); } @@ -1413,6 +1428,8 @@ static void qcom_msa_handover(struct qcom_q6v5 *q6v5) qproc->proxy_clk_count); q6v5_regulator_disable(qproc, qproc->proxy_regs, qproc->proxy_reg_count); + q6v5_regulator_disable(qproc, qproc->fallback_proxy_regs, + qproc->fallback_proxy_reg_count); q6v5_pds_disable(qproc, qproc->proxy_pds, qproc->proxy_pd_count); } @@ -1707,11 +1724,22 @@ static int q6v5_probe(struct platform_device *pdev) ret = q6v5_pds_attach(&pdev->dev, qproc->proxy_pds, desc->proxy_pd_names); - if (ret < 0) { + /* Fallback to regulators for old device trees */ + if (ret == -ENODATA && desc->fallback_proxy_supply) { + ret = q6v5_regulator_init(&pdev->dev, + qproc->fallback_proxy_regs, + desc->fallback_proxy_supply); + if (ret < 0) { + dev_err(&pdev->dev, "Failed to get fallback proxy regulators.\n"); + goto detach_active_pds; + } + qproc->fallback_proxy_reg_count = ret; + } else if (ret < 0) { dev_err(&pdev->dev, "Failed to init power domains\n"); goto detach_active_pds; + } else { + qproc->proxy_pd_count = ret; } - qproc->proxy_pd_count = ret; qproc->has_alt_reset = desc->has_alt_reset; ret = q6v5_init_reset(qproc); @@ -1912,6 +1940,13 @@ static const struct rproc_hexagon_res msm8996_mss = { static const struct rproc_hexagon_res msm8916_mss = { .hexagon_mba_image = "mba.mbn", .proxy_supply = (struct qcom_mss_reg_res[]) { + { + .supply = "pll", + .uA = 100000, + }, + {} + }, + .fallback_proxy_supply = (struct qcom_mss_reg_res[]) { { .supply = "mx", .uV = 1050000, @@ -1920,10 +1955,6 @@ static const struct rproc_hexagon_res msm8916_mss = { .supply = "cx", .uA = 100000, }, - { - .supply = "pll", - .uA = 100000, - }, {} }, .proxy_clk_names = (char*[]){ @@ -1936,6 +1967,11 @@ static const struct rproc_hexagon_res msm8916_mss = { "mem", NULL }, + .proxy_pd_names = (char*[]){ + "mx", + "cx", + NULL + }, .need_mem_protection = false, .has_alt_reset = false, .has_mba_logs = false, @@ -1946,6 +1982,13 @@ static const struct rproc_hexagon_res msm8916_mss = { static const struct rproc_hexagon_res msm8974_mss = { .hexagon_mba_image = "mba.b00", .proxy_supply = (struct qcom_mss_reg_res[]) { + { + .supply = "pll", + .uA = 100000, + }, + {} + }, + .fallback_proxy_supply = (struct qcom_mss_reg_res[]) { { .supply = "mx", .uV = 1050000, @@ -1954,10 +1997,6 @@ static const struct rproc_hexagon_res msm8974_mss = { .supply = "cx", .uA = 100000, }, - { - .supply = "pll", - .uA = 100000, - }, {} }, .active_supply = (struct qcom_mss_reg_res[]) { @@ -1978,6 +2017,11 @@ static const struct rproc_hexagon_res msm8974_mss = { "mem", NULL }, + .proxy_pd_names = (char*[]){ + "mx", + "cx", + NULL + }, .need_mem_protection = false, .has_alt_reset = false, .has_mba_logs = false, From patchwork Wed Sep 16 10:41:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11780535 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9452959D for ; Wed, 16 Sep 2020 19:04:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 71F4D206DC for ; Wed, 16 Sep 2020 19:04:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="LBpMMN11" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727684AbgIPTEA (ORCPT ); Wed, 16 Sep 2020 15:04:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727468AbgIPRsG (ORCPT ); Wed, 16 Sep 2020 13:48:06 -0400 X-Greylist: delayed 625 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 16 Sep 2020 04:14:26 PDT Received: from mo6-p02-ob.smtp.rzone.de (mo6-p02-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5302::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69643C0611BD; Wed, 16 Sep 2020 04:14:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254260; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=jiyYMYZZNIoZ7veBFmVpfgQHbhhTN+QDRt6ZYIRb/ZI=; b=LBpMMN1198j+Utnu6y7plHoZ4aBh94yChIZh8LR9kAIH8UAZiJV+2uM6jFoiV9ivV1 S+O0nJwpwNqOWIpqF3eWc1krI73NiRzsJGKLDrZ1kQYCWAGj4xx1QhYPNZYfgXalsu8W 4oCLQDyLz3YShizg8RI4YN6bTzrQWXo11UEl7hxypXrI0KXfJmqTip3T9aQq/P51C9Ca NpnYuZx9triBsNBQkx40UycgWSgvovTbqnlxlVaOayJlHDLJlHNhq5JUaVRRevSp8e23 ALgdHGloFbifrviwPDARe+HT3X1JK1S4zrUsFJC6ODBFiy8xdA4BROnqW4odnMfu8CP0 qSew== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAfrzlU (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:53 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 07/10] dt-bindings: remoteproc: qcom,wcnss: Deprecate regulators for PDs Date: Wed, 16 Sep 2020 12:41:32 +0200 Message-Id: <20200916104135.25085-8-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org So far we have been doing all proxy votes by voting for raw voltages/load through the regulator interface. But actually VDDCX and VDDMX represent power domains that should be preferably managed using corner votes through the power domain interface. Document that those should be specified as power domains for qcom,pronto-v1/2-pil and deprecate using them through the regulator interface. Signed-off-by: Stephan Gerhold --- .../bindings/remoteproc/qcom,wcnss-pil.txt | 20 +++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt index d420f84ddfb0..cc0b7fc1c29b 100644 --- a/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt +++ b/Documentation/devicetree/bindings/remoteproc/qcom,wcnss-pil.txt @@ -34,14 +34,25 @@ on the Qualcomm WCNSS core. Definition: should be "wdog", "fatal", optionally followed by "ready", "handover", "stop-ack" -- vddmx-supply: -- vddcx-supply: +- vddmx-supply: (deprecated for qcom,pronto-v1/2-pil) +- vddcx-supply: (deprecated for qcom,pronto-v1/2-pil) - vddpx-supply: Usage: required Value type: Definition: reference to the regulators to be held on behalf of the booting of the WCNSS core +- power-domains: + Usage: required (for qcom,pronto-v1/2-pil) + Value type: + Definition: reference to the power domains to be held on behalf of the + booting of the WCNSS core + +- power-domain-names: + Usage: required (for qcom,pronto-v1/2-pil) + Value type: + Definition: must be "cx", "mx" + - qcom,smem-states: Usage: optional Value type: @@ -111,8 +122,9 @@ pronto@fb204000 { <&wcnss_smp2p_slave 3 0>; interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack"; - vddmx-supply = <&pm8841_s1>; - vddcx-supply = <&pm8841_s2>; + power-domains = <&rpmpd MSM8974_VDDCX>, <&rpmpd MSM8974_VDDMX>; + power-domain-names = "cx", "mx"; + vddpx-supply = <&pm8941_s3>; qcom,smem-states = <&wcnss_smp2p_out 0>; From patchwork Wed Sep 16 10:41:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11779869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0455D6CA for ; Wed, 16 Sep 2020 15:23:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DAEBF2245A for ; Wed, 16 Sep 2020 15:23:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="oYwTQpUP" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726269AbgIPPW6 (ORCPT ); Wed, 16 Sep 2020 11:22:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39658 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726361AbgIPPVk (ORCPT ); Wed, 16 Sep 2020 11:21:40 -0400 Received: from mo6-p03-ob.smtp.rzone.de (mo6-p03-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5303::11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF637C061A2E; Wed, 16 Sep 2020 04:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254284; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=J+iGngwCGYxclOGTcT3cISjTv2EqEawPbyBBaYfvQ4g=; b=oYwTQpUPB+NwwfRrk36R07EOEmhyhBNtuiwcNjvfXSmcakqSw/d6NiHBWfVK/OYA5/ YSV3Qe4tJfFSp/eA4unQpvD2YdnysvzXkHZ4yPGefq/y615Rti9HeRVy89ubwR58GtEf qbCAnL/zzuGW+kRP3Wpo0rYFDx/RZkJF2GeBGBpRL4gxa6et+70kt2ab+DMIrVmxLMck asT6OOEVVMaN6v6h+6XEpu0b4eQzldXKzulq49UTHAyjFvet8y4KOHkAF+g7sLdbgPXp 3DlEkOh/xZN/euUEOPpRA8JrUnM3c0cLoSHH9B+GYQRjIaDpr+vVt+YTPMUT+LGznmRS Se7Q== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAfrzlV (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:53 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 08/10] remoteproc: qcom_wcnss: Allow replacing regulators with power domains Date: Wed, 16 Sep 2020 12:41:33 +0200 Message-Id: <20200916104135.25085-9-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org So far we have been doing all proxy votes by voting for raw voltages/load through the regulator interface. But actually VDDCX and VDDMX represent power domains that should be preferably managed using corner votes through the power domain interface. Looking closer the code was actually never doing the proxy votes correctly: The vddcx regulator is specified as: { "vddcx", .super_turbo = true }, which is supposed to say that we should vote for the maximum corner of the VDDCX power domain. But actually "super_turbo" is unused so all we did so far is to enable the power domain. We did not vote for it to scale to the maximum performance state. Using them through the power domain interface allows voting for the maximum performance state. However, we still need to support using them through the regulator interface for old device trees. The way this is implemented here is that we check if attaching the two power domain succeeds. If yes, we skip the first "num_pd_vregs" regulators in the "vregs" list and only request the remaining ones. Signed-off-by: Stephan Gerhold --- drivers/remoteproc/qcom_wcnss.c | 109 +++++++++++++++++++++++++++----- 1 file changed, 93 insertions(+), 16 deletions(-) diff --git a/drivers/remoteproc/qcom_wcnss.c b/drivers/remoteproc/qcom_wcnss.c index e2573f79a137..f95854255c70 100644 --- a/drivers/remoteproc/qcom_wcnss.c +++ b/drivers/remoteproc/qcom_wcnss.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include #include #include @@ -51,12 +53,15 @@ #define WCNSS_PMU_XO_MODE_19p2 0 #define WCNSS_PMU_XO_MODE_48 3 +#define WCNSS_MAX_PDS 2 + struct wcnss_data { size_t pmu_offset; size_t spare_offset; + const char *pd_names[WCNSS_MAX_PDS]; const struct wcnss_vreg_info *vregs; - size_t num_vregs; + size_t num_vregs, num_pd_vregs; }; struct qcom_wcnss { @@ -80,6 +85,8 @@ struct qcom_wcnss { struct mutex iris_lock; struct qcom_iris *iris; + struct device *pds[WCNSS_MAX_PDS]; + size_t num_pds; struct regulator_bulk_data *vregs; size_t num_vregs; @@ -111,24 +118,28 @@ static const struct wcnss_data pronto_v1_data = { .pmu_offset = 0x1004, .spare_offset = 0x1088, + .pd_names = { "mx", "cx" }, .vregs = (struct wcnss_vreg_info[]) { { "vddmx", 950000, 1150000, 0 }, { "vddcx", .super_turbo = true}, { "vddpx", 1800000, 1800000, 0 }, }, - .num_vregs = 3, + .num_pd_vregs = 2, + .num_vregs = 1, }; static const struct wcnss_data pronto_v2_data = { .pmu_offset = 0x1004, .spare_offset = 0x1088, + .pd_names = { "mx", "cx" }, .vregs = (struct wcnss_vreg_info[]) { { "vddmx", 1287500, 1287500, 0 }, { "vddcx", .super_turbo = true }, { "vddpx", 1800000, 1800000, 0 }, }, - .num_vregs = 3, + .num_pd_vregs = 2, + .num_vregs = 1, }; void qcom_wcnss_assign_iris(struct qcom_wcnss *wcnss, @@ -219,7 +230,7 @@ static void wcnss_configure_iris(struct qcom_wcnss *wcnss) static int wcnss_start(struct rproc *rproc) { struct qcom_wcnss *wcnss = (struct qcom_wcnss *)rproc->priv; - int ret; + int ret, i; mutex_lock(&wcnss->iris_lock); if (!wcnss->iris) { @@ -228,9 +239,18 @@ static int wcnss_start(struct rproc *rproc) goto release_iris_lock; } + for (i = 0; i < wcnss->num_pds; i++) { + dev_pm_genpd_set_performance_state(wcnss->pds[i], INT_MAX); + ret = pm_runtime_get_sync(wcnss->pds[i]); + if (ret < 0) { + pm_runtime_put_noidle(wcnss->pds[i]); + goto disable_pds; + } + } + ret = regulator_bulk_enable(wcnss->num_vregs, wcnss->vregs); if (ret) - goto release_iris_lock; + goto disable_pds; ret = qcom_iris_enable(wcnss->iris); if (ret) @@ -262,6 +282,11 @@ static int wcnss_start(struct rproc *rproc) qcom_iris_disable(wcnss->iris); disable_regulators: regulator_bulk_disable(wcnss->num_vregs, wcnss->vregs); +disable_pds: + for (i--; i >= 0; i--) { + pm_runtime_put(wcnss->pds[i]); + dev_pm_genpd_set_performance_state(wcnss->pds[i], 0); + } release_iris_lock: mutex_unlock(&wcnss->iris_lock); @@ -371,14 +396,54 @@ static irqreturn_t wcnss_stop_ack_interrupt(int irq, void *dev) return IRQ_HANDLED; } +static int wcnss_init_pds(struct qcom_wcnss *wcnss, + const char * const pd_names[WCNSS_MAX_PDS]) +{ + int i, ret; + + for (i = 0; i < WCNSS_MAX_PDS; i++) { + if (!pd_names[i]) + break; + + wcnss->pds[i] = dev_pm_domain_attach_by_name(wcnss->dev, pd_names[i]); + if (IS_ERR_OR_NULL(wcnss->pds[i])) { + ret = PTR_ERR(wcnss->pds[i]) ? : -ENODATA; + for (i--; i >= 0; i--) + dev_pm_domain_detach(wcnss->pds[i], false); + return ret; + } + } + wcnss->num_pds = i; + + return 0; +} + +static void wcnss_release_pds(struct qcom_wcnss *wcnss) +{ + int i; + + for (i = 0; i < wcnss->num_pds; i++) + dev_pm_domain_detach(wcnss->pds[i], false); +} + static int wcnss_init_regulators(struct qcom_wcnss *wcnss, const struct wcnss_vreg_info *info, - int num_vregs) + int num_vregs, int num_pd_vregs) { struct regulator_bulk_data *bulk; int ret; int i; + /* + * If attaching the power domains suceeded we can skip requesting + * the regulators for the power domains. For old device trees we need to + * reserve extra space to manage them through the regulator interface. + */ + if (wcnss->num_pds) + info += num_pd_vregs; + else + num_vregs += num_pd_vregs; + bulk = devm_kcalloc(wcnss->dev, num_vregs, sizeof(struct regulator_bulk_data), GFP_KERNEL); @@ -514,33 +579,42 @@ static int wcnss_probe(struct platform_device *pdev) wcnss->pmu_cfg = mmio + data->pmu_offset; wcnss->spare_out = mmio + data->spare_offset; - ret = wcnss_init_regulators(wcnss, data->vregs, data->num_vregs); - if (ret) + /* + * We might need to fallback to regulators instead of power domains + * for old device trees. Don't report an error in that case. + */ + ret = wcnss_init_pds(wcnss, data->pd_names); + if (ret && (ret != -ENODATA || !data->num_pd_vregs)) goto free_rproc; + ret = wcnss_init_regulators(wcnss, data->vregs, data->num_vregs, + data->num_pd_vregs); + if (ret) + goto detach_pds; + ret = wcnss_request_irq(wcnss, pdev, "wdog", false, wcnss_wdog_interrupt); if (ret < 0) - goto free_rproc; + goto detach_pds; wcnss->wdog_irq = ret; ret = wcnss_request_irq(wcnss, pdev, "fatal", false, wcnss_fatal_interrupt); if (ret < 0) - goto free_rproc; + goto detach_pds; wcnss->fatal_irq = ret; ret = wcnss_request_irq(wcnss, pdev, "ready", true, wcnss_ready_interrupt); if (ret < 0) - goto free_rproc; + goto detach_pds; wcnss->ready_irq = ret; ret = wcnss_request_irq(wcnss, pdev, "handover", true, wcnss_handover_interrupt); if (ret < 0) - goto free_rproc; + goto detach_pds; wcnss->handover_irq = ret; ret = wcnss_request_irq(wcnss, pdev, "stop-ack", true, wcnss_stop_ack_interrupt); if (ret < 0) - goto free_rproc; + goto detach_pds; wcnss->stop_ack_irq = ret; if (wcnss->stop_ack_irq) { @@ -548,7 +622,7 @@ static int wcnss_probe(struct platform_device *pdev) &wcnss->stop_bit); if (IS_ERR(wcnss->state)) { ret = PTR_ERR(wcnss->state); - goto free_rproc; + goto detach_pds; } } @@ -556,15 +630,17 @@ static int wcnss_probe(struct platform_device *pdev) wcnss->sysmon = qcom_add_sysmon_subdev(rproc, "wcnss", WCNSS_SSCTL_ID); if (IS_ERR(wcnss->sysmon)) { ret = PTR_ERR(wcnss->sysmon); - goto free_rproc; + goto detach_pds; } ret = rproc_add(rproc); if (ret) - goto free_rproc; + goto detach_pds; return of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); +detach_pds: + wcnss_release_pds(wcnss); free_rproc: rproc_free(rproc); @@ -582,6 +658,7 @@ static int wcnss_remove(struct platform_device *pdev) qcom_remove_sysmon_subdev(wcnss->sysmon); qcom_remove_smd_subdev(wcnss->rproc, &wcnss->smd_subdev); + wcnss_release_pds(wcnss); rproc_free(wcnss->rproc); return 0; From patchwork Wed Sep 16 10:41:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11780523 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0C4B1618 for ; Wed, 16 Sep 2020 19:03:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D949B221E7 for ; Wed, 16 Sep 2020 19:03:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="g/FahEZN" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727279AbgIPTD0 (ORCPT ); Wed, 16 Sep 2020 15:03:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727414AbgIPRsf (ORCPT ); Wed, 16 Sep 2020 13:48:35 -0400 Received: from mo6-p03-ob.smtp.rzone.de (mo6-p03-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5303::7]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD057C061A2D; Wed, 16 Sep 2020 04:14:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254283; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=hi/PA+n3q3LCTeQ36n/1hS+OHW65T/N24KCCdA3v318=; b=g/FahEZNHPOPrPE0VS25nirG/vN4CBmaAxSA9NVnqBO36GNsn+O5GKQjNCyw5OZJeT fKdroBoxCgx242JjNayMTFWoNO6wE1QbquciDxESiiyJ7Qr//JdJYao9cC2pgz8GS8Xc aMP/5YRLbHlTouxvrYM5J0Lt3juqlC40DxM7rAZg0N0K7mqmWvf97Idk3ffcyS521EBU FZTxMa5Fh6PC4vKT56mDEIue4v19KpaKXrevDfK12KzbdTkyGKESoiMnz7c8mqc2NZ1d Ys46ZNrm8SB4+7FO3RtnhgpAzYhfaN1AI7XXq0ifobBooD/nxoGuXWVKD02aGsrUHo0d KRPA== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAfszlX (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:54 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 09/10] arm64: dts: qcom: msm8916: Use power domains for MSS/WCNSS remoteprocs Date: Wed, 16 Sep 2020 12:41:34 +0200 Message-Id: <20200916104135.25085-10-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org So far we have been making proxy votes for the remote processors through the regulator interface. Now that we have rpmpd it's better to vote for performance states through the power domain interface. This also allows us to move these supplies back to msm8916.dtsi because the device tree binding for RPMPD is independent of the underlying regulator/PMIC. Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi | 3 --- arch/arm64/boot/dts/qcom/msm8916.dtsi | 9 +++++++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi index cd626e7db599..513e433aa5f3 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi @@ -17,13 +17,10 @@ &dsi_phy0 { }; &mpss { - cx-supply = <&pm8916_s1>; - mx-supply = <&pm8916_l3>; pll-supply = <&pm8916_l7>; }; &pronto { - vddmx-supply = <&pm8916_l3>; vddpx-supply = <&pm8916_l7>; iris { diff --git a/arch/arm64/boot/dts/qcom/msm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916.dtsi index 117804f94c35..74aa50f3db10 100644 --- a/arch/arm64/boot/dts/qcom/msm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916.dtsi @@ -8,6 +8,7 @@ #include #include #include +#include #include #include @@ -1292,6 +1293,10 @@ mpss: remoteproc@4080000 { interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack"; + power-domains = <&rpmpd MSM8916_VDDCX>, + <&rpmpd MSM8916_VDDMX>; + power-domain-names = "cx", "mx"; + clocks = <&gcc GCC_MSS_CFG_AHB_CLK>, <&gcc GCC_MSS_Q6_BIMC_AXI_CLK>, <&gcc GCC_BOOT_ROM_AHB_CLK>, @@ -1689,6 +1694,10 @@ pronto: remoteproc@a21b000 { <&wcnss_smp2p_in 3 IRQ_TYPE_EDGE_RISING>; interrupt-names = "wdog", "fatal", "ready", "handover", "stop-ack"; + power-domains = <&rpmpd MSM8916_VDDCX>, + <&rpmpd MSM8916_VDDMX>; + power-domain-names = "cx", "mx"; + qcom,state = <&wcnss_smp2p_out 0>; qcom,state-names = "stop"; From patchwork Wed Sep 16 10:41:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stephan Gerhold X-Patchwork-Id: 11780539 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 137D359D for ; Wed, 16 Sep 2020 19:04:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E353020936 for ; Wed, 16 Sep 2020 19:04:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gerhold.net header.i=@gerhold.net header.b="Z8sXD4e/" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728363AbgIPTED (ORCPT ); Wed, 16 Sep 2020 15:04:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35646 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727466AbgIPRrx (ORCPT ); Wed, 16 Sep 2020 13:47:53 -0400 Received: from mo6-p03-ob.smtp.rzone.de (mo6-p03-ob.smtp.rzone.de [IPv6:2a01:238:20a:202:5303::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 40C39C061A10; Wed, 16 Sep 2020 04:14:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1600254268; s=strato-dkim-0002; d=gerhold.net; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=zk1JgRCfGN8d0WVKK0yFWGZXo6snBrcRKo+H1BWj0g0=; b=Z8sXD4e/9IrG0cR/8UdHcx/C8kHdCZr0rOT59UoEadsrNNHHkLMlPvtCfRbVxOPQle UOBD/wwAnfXJIQPiG1L2ZSxUuMEU9JwFKmtan08tMPlWYwchXPyC6ObEgyA4L6WNOafi E25fEDrHTaGt1cfYbsyHv6JiwZ294F7xPEabklI/9l2/acd8r2Zo3vrQ8d5CAfHGdWHi oukDc07XKsXqoliFFXUtr97kyOiQzGlYE4nsCiE+hXBasVCsImLtfNBi2mjAs8K/vFMd XEc6eDV3K2JqKRRolboIUDdI6Fiu/ldBFSPKM6UACk02BiA0VeFm880tcDNEI/jOCtZd ECnA== X-RZG-AUTH: ":P3gBZUipdd93FF5ZZvYFPugejmSTVR2nRPhVORvLd4SsytBXS7IYBkLahKxB4W6Nahc=" X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain by smtp.strato.de (RZmta 46.10.7 DYNA|AUTH) with ESMTPSA id g0b6c1w8GAftzlY (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Wed, 16 Sep 2020 12:41:55 +0200 (CEST) From: Stephan Gerhold To: Bjorn Andersson Cc: Andy Gross , Rob Herring , Ohad Ben-Cohen , Rajendra Nayak , linux-arm-msm@vger.kernel.org, devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, ~postmarketos/upstreaming@lists.sr.ht, Stephan Gerhold Subject: [PATCH 10/10] arm64: dts: qcom: msm8916-pm8916: Stop using s1/l3 as regulators Date: Wed, 16 Sep 2020 12:41:35 +0200 Message-Id: <20200916104135.25085-11-stephan@gerhold.net> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200916104135.25085-1-stephan@gerhold.net> References: <20200916104135.25085-1-stephan@gerhold.net> MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org s1 (VDDCX) and l3 (VDDMX) are now managed by rpmpd as power domains. This allows us to vote for voltage corners instead of voting for raw voltages. But we cannot manage these as regulator and power domain at the same time: The votes by rpmpd would conflict with the ones from the regulator driver. All users of these regulators have been converted to power domains. Make sure that no new users are added by removing s1 and l3 from the regulator definitions. This also allows us to remove the arbitrary voltage constraints we have been using for these regulators. Not all of the voltages listed there would actually have been safe for the boards. Signed-off-by: Stephan Gerhold --- arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi | 10 ---------- arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts | 10 ---------- arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi | 4 ++-- .../boot/dts/qcom/msm8916-samsung-a2015-common.dtsi | 10 ---------- 4 files changed, 2 insertions(+), 32 deletions(-) diff --git a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi index 3c7f97539390..3a9538e1ec97 100644 --- a/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi +++ b/arch/arm64/boot/dts/qcom/apq8016-sbc.dtsi @@ -417,11 +417,6 @@ &smd_rpm_regulators { vdd_l4_l5_l6-supply = <&pm8916_s4>; vdd_l7-supply = <&pm8916_s4>; - s1 { - regulator-min-microvolt = <375000>; - regulator-max-microvolt = <1562000>; - }; - s3 { regulator-min-microvolt = <375000>; regulator-max-microvolt = <1562000>; @@ -445,11 +440,6 @@ l2 { regulator-max-microvolt = <1200000>; }; - l3 { - regulator-min-microvolt = <375000>; - regulator-max-microvolt = <1525000>; - }; - l4 { regulator-min-microvolt = <1750000>; regulator-max-microvolt = <3337000>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts index b9d3c5d98dd0..2c204d535d66 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts +++ b/arch/arm64/boot/dts/qcom/msm8916-longcheer-l8150.dts @@ -98,11 +98,6 @@ &smd_rpm_regulators { vdd_l4_l5_l6-supply = <&pm8916_s4>; vdd_l7-supply = <&pm8916_s4>; - s1 { - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1300000>; - }; - s3 { regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1300000>; @@ -123,11 +118,6 @@ l2 { regulator-max-microvolt = <1200000>; }; - l3 { - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1287500>; - }; - l4 { regulator-min-microvolt = <2050000>; regulator-max-microvolt = <2050000>; diff --git a/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi b/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi index 513e433aa5f3..539823b2c36e 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-pm8916.dtsi @@ -50,13 +50,13 @@ &rpm_requests { smd_rpm_regulators: pm8916-regulators { compatible = "qcom,rpm-pm8916-regulators"; - pm8916_s1: s1 {}; + /* pm8916_s1 is managed by rpmpd (MSM8916_VDDCX) */ pm8916_s3: s3 {}; pm8916_s4: s4 {}; pm8916_l1: l1 {}; pm8916_l2: l2 {}; - pm8916_l3: l3 {}; + /* pm8916_l3 is managed by rpmpd (MSM8916_VDDMX) */ pm8916_l4: l4 {}; pm8916_l5: l5 {}; pm8916_l6: l6 {}; diff --git a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi index b18d21e42f59..0b0dfd3059de 100644 --- a/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi +++ b/arch/arm64/boot/dts/qcom/msm8916-samsung-a2015-common.dtsi @@ -164,11 +164,6 @@ &smd_rpm_regulators { vdd_l4_l5_l6-supply = <&pm8916_s4>; vdd_l7-supply = <&pm8916_s4>; - s1 { - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1300000>; - }; - s3 { regulator-min-microvolt = <1200000>; regulator-max-microvolt = <1300000>; @@ -189,11 +184,6 @@ l2 { regulator-max-microvolt = <1200000>; }; - l3 { - regulator-min-microvolt = <500000>; - regulator-max-microvolt = <1287500>; - }; - l4 { regulator-min-microvolt = <2050000>; regulator-max-microvolt = <2050000>;