Message ID | 20230214095435.2192153-3-konrad.dybcio@linaro.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2873432wrn; Tue, 14 Feb 2023 01:57:01 -0800 (PST) X-Google-Smtp-Source: AK7set/fokOnKOZoRFpp/70IwukKhXNPwT0faAWp7ZtWW6YvKyPDAHZWURqmxlNXDJN7jSWeoNgT X-Received: by 2002:a17:906:8395:b0:8af:54d2:36af with SMTP id p21-20020a170906839500b008af54d236afmr2077584ejx.76.1676368620900; Tue, 14 Feb 2023 01:57:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1676368620; cv=none; d=google.com; s=arc-20160816; b=HgFcup1qct4Cpqd+LxEaAXiFo7+O3tVMSurwNbd6aG2o5JBtYLFVvaya3aOAPd6bqZ Gpt8K1ngb//gv7gTntCDWZByHkn1cqHNeVX6YKhOHvnT8nhy9GM2UhEGpGpkCTOAA620 +c3GadanddwTQaEIDzwfucvl/iTb0k3h+BypXRIdEvTEpYmDnRNPfDtI0syGvxXAtp8h dLeux+io7bboOhz9Vq6eUuohulX47omCZWKcpMiL4+zyEndw23od4F85TN/BrYPncWDH UQDxVZz9a2NmmKo9I1PWD4UDMygu4kCEvzVczbMpQ7KhMIvRY0uvR0/ntZcHDqQEDi46 txFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ojz/IndadzvCh/MxBOcdddWP2Cz3VxxnwtTNlpFnCXE=; b=mdaY0ixVu9Vf2wvM3WncwAcqIED3UpyFjJbFVBy9ap3ta0G7oLUnJiToKYT6rI8mB0 Zlnw5cm+y+3ZgvoxdXBG7kkzi9GTpI7C4fPAAtLpvueGZgCvLuzWFrqAYr/JIcDyxxPm W82TCKZQgQv5BD6DhJgR8+Lwp0Qk+VuRixDs9vuXLeGTmjvblKvbhST5uKxV6PiG1YRz xCH6p04WqPhFIlAqjuimIaDc8Yr9m4AxM/TuSIrphYsHd9APEX8f5m/CvchVvNbcv5i3 6MMEyhrC70mRULnL98X7plBZdj0VfmcaEWfbRBJNAM+biVx5OnXbaa1h89OFSI9QYFxX ftyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w2V6QzHc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bp8-20020a170907918800b008b12a1979fdsi1935635ejb.535.2023.02.14.01.56.37; Tue, 14 Feb 2023 01:57:00 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=w2V6QzHc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232080AbjBNJzQ (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Tue, 14 Feb 2023 04:55:16 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232226AbjBNJyv (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Tue, 14 Feb 2023 04:54:51 -0500 Received: from mail-ej1-x62d.google.com (mail-ej1-x62d.google.com [IPv6:2a00:1450:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28B0B7DA6 for <linux-kernel@vger.kernel.org>; Tue, 14 Feb 2023 01:54:46 -0800 (PST) Received: by mail-ej1-x62d.google.com with SMTP id rp23so38632208ejb.7 for <linux-kernel@vger.kernel.org>; Tue, 14 Feb 2023 01:54:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ojz/IndadzvCh/MxBOcdddWP2Cz3VxxnwtTNlpFnCXE=; b=w2V6QzHcVqzF2wUIpdMO09Z2XGoYsyl0FM9aS96R0HywOimqrhl7w6q9vMefbhDsGT L8YKL2Nh+2plQ9p6wjduMlSwsMC88dH8JFB9AdcD4y6XIo0LsEOdwm1LDYornK41kKam GCMaKCuvIE+lWzGNlRhEf0c8yZt/uStZtNaIRBkFGVCLcoh+BK/pQr4ZfSO3ajbug6zd aG2xjYchretIafCeup7GRu7hA60nUGaFTV/H0mqSUP7AG7xLFNOkOTrK5UxFq2XWR1YA SPbAE6YAhpWHr4/F5Xf2FfpigwwF8O6IN+G8JDHXtpMmVo4+xwgTYgfIYZ9zm+Txkifr 6haw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ojz/IndadzvCh/MxBOcdddWP2Cz3VxxnwtTNlpFnCXE=; b=fO3VtwTFFjxaOndFoW1xc476B7YQtaJMdITqmhXGONT77yC97wwIgOtvMDALwC5unY /6ESUeMWLBg8O0cPwcj8ZDDpCF8UFsGh5o6wX50LNlU+Kj9BKxrhGd4ZWBckJKzl4UNb 2q0j/Wpfw5KBuYtD6yuzSkAB3vibxJqSVRwyDGmse/GY9/6+qOT8o+rax7+VcYl69/u2 L0HhF7wBpMVYGAIOhc9b4CEYX+j87oGVDTqlToI8v/wCHHki6yRMF1JP6qdJQyBqpBUy 7oKEDAKWNa8Qapu66v6gWQsnEYOvWTXzGKG1thQ3JFt/FK4TzusMBHYHzQLjEGv94jyI GItw== X-Gm-Message-State: AO0yUKXZVvc6WD2nRoIXFgaRWgPIEMng9spZe8MxbyUUo8t1f4VzLj6k fjoi4Z7v0GYRg356VbdOpSYwBA== X-Received: by 2002:a17:906:3019:b0:8b1:2fbe:7d6b with SMTP id 25-20020a170906301900b008b12fbe7d6bmr1581981ejz.73.1676368484734; Tue, 14 Feb 2023 01:54:44 -0800 (PST) Received: from localhost.localdomain (abxh117.neoplus.adsl.tpnet.pl. [83.9.1.117]) by smtp.gmail.com with ESMTPSA id b12-20020a170906038c00b0088f464ac276sm7936172eja.30.2023.02.14.01.54.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 14 Feb 2023 01:54:44 -0800 (PST) From: Konrad Dybcio <konrad.dybcio@linaro.org> To: linux-arm-msm@vger.kernel.org, andersson@kernel.org, agross@kernel.org, krzysztof.kozlowski@linaro.org Cc: marijn.suijten@somainline.org, Konrad Dybcio <konrad.dybcio@linaro.org>, Rob Herring <robh+dt@kernel.org>, Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 3/3] arm64: dts: qcom: Split out SA8155P and use correct RPMh power domains Date: Tue, 14 Feb 2023 10:54:35 +0100 Message-Id: <20230214095435.2192153-3-konrad.dybcio@linaro.org> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230214095435.2192153-1-konrad.dybcio@linaro.org> References: <20230214095435.2192153-1-konrad.dybcio@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1757799902831838744?= X-GMAIL-MSGID: =?utf-8?q?1757799902831838744?= |
Series |
[1/3] dt-bindings: power: qcom,rpmpd: Add SA8155P
|
|
Commit Message
Konrad Dybcio
Feb. 14, 2023, 9:54 a.m. UTC
The RPMhPD setup on SA8155P is different compared to SM8150. Correct
it to ensure the platform will not try accessing forbidden/missing
RPMh entries at boot, as a bad vote will hang the machine.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org>
---
arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 2 +-
arch/arm64/boot/dts/qcom/sa8155p.dtsi | 51 ++++++++++++++++++++++++
2 files changed, 52 insertions(+), 1 deletion(-)
create mode 100644 arch/arm64/boot/dts/qcom/sa8155p.dtsi
Comments
On Tue, Feb 14, 2023 at 10:54:35AM +0100, Konrad Dybcio wrote: > The RPMhPD setup on SA8155P is different compared to SM8150. Correct > it to ensure the platform will not try accessing forbidden/missing > RPMh entries at boot, as a bad vote will hang the machine. > I don't see that this will scale, as soon as someone adds a new device in sm8150.dtsi that has the need to scale a power rail this will be forgotten and we will have a mix of references to the SM8150 and SA8155P value space. That said, I think it's reasonable to avoid duplicating the entire sm8150.dtsi. How about making the SA8155P_* macros match the SM8150_* macros? That way things will fail gracefully if a device node references a resource not defined for either platform... Regards, Bjorn > Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > --- > arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 2 +- > arch/arm64/boot/dts/qcom/sa8155p.dtsi | 51 ++++++++++++++++++++++++ > 2 files changed, 52 insertions(+), 1 deletion(-) > create mode 100644 arch/arm64/boot/dts/qcom/sa8155p.dtsi > > diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts > index 459384ec8f23..9454e8e4e517 100644 > --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts > +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts > @@ -7,7 +7,7 @@ > > #include <dt-bindings/regulator/qcom,rpmh-regulator.h> > #include <dt-bindings/gpio/gpio.h> > -#include "sm8150.dtsi" > +#include "sa8155p.dtsi" > #include "pmm8155au_1.dtsi" > #include "pmm8155au_2.dtsi" > > diff --git a/arch/arm64/boot/dts/qcom/sa8155p.dtsi b/arch/arm64/boot/dts/qcom/sa8155p.dtsi > new file mode 100644 > index 000000000000..f2fd7c28764e > --- /dev/null > +++ b/arch/arm64/boot/dts/qcom/sa8155p.dtsi > @@ -0,0 +1,51 @@ > +// SPDX-License-Identifier: BSD-3-Clause > +/* > + * Copyright (c) 2023, Linaro Limited > + * > + * SA8155P is an automotive variant of SM8150, with some minor changes. > + * Most notably, the RPMhPD setup differs: MMCX and LCX/LMX rails are gone. > + */ > + > +#include "sm8150.dtsi" > + > +&dispcc { > + power-domains = <&rpmhpd SA8155P_CX>; > +}; > + > +&mdss_mdp { > + power-domains = <&rpmhpd SA8155P_CX>; > +}; > + > +&mdss_dsi0 { > + power-domains = <&rpmhpd SA8155P_CX>; > +}; > + > +&mdss_dsi1 { > + power-domains = <&rpmhpd SA8155P_CX>; > +}; > + > +&remoteproc_adsp { > + power-domains = <&rpmhpd SA8155P_CX>; > +}; > + > +&remoteproc_cdsp { > + power-domains = <&rpmhpd SA8155P_CX>; > +}; > + > +&remoteproc_mpss { > + power-domains = <&rpmhpd SA8155P_CX>, > + <&rpmhpd SA8155P_MSS>; > +}; > + > +&remoteproc_slpi { > + power-domains = <&rpmhpd SA8155P_CX>, > + <&rpmhpd SA8155P_MX>; > +}; > + > +&rpmhpd { > + compatible = "qcom,sa8155p-rpmhpd"; > +}; > + > +&sdhc_2 { > + power-domains = <&rpmhpd SA8155P_CX>; > +}; > -- > 2.39.1 >
On 14.03.2023 01:10, Bjorn Andersson wrote: > On Tue, Feb 14, 2023 at 10:54:35AM +0100, Konrad Dybcio wrote: >> The RPMhPD setup on SA8155P is different compared to SM8150. Correct >> it to ensure the platform will not try accessing forbidden/missing >> RPMh entries at boot, as a bad vote will hang the machine. >> > > I don't see that this will scale, as soon as someone adds a new device > in sm8150.dtsi that has the need to scale a power rail this will be > forgotten and we will have a mix of references to the SM8150 and SA8155P > value space. > > That said, I think it's reasonable to avoid duplicating the entire > sm8150.dtsi. Yeah, this problem has no obvious good solutions and even though it's not very elegant, this seems to be the less bad one.. > > How about making the SA8155P_* macros match the SM8150_* macros? > That way things will fail gracefully if a device node references a > resource not defined for either platform... Okay, let's do that Konrad > > Regards, > Bjorn > >> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >> --- >> arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 2 +- >> arch/arm64/boot/dts/qcom/sa8155p.dtsi | 51 ++++++++++++++++++++++++ >> 2 files changed, 52 insertions(+), 1 deletion(-) >> create mode 100644 arch/arm64/boot/dts/qcom/sa8155p.dtsi >> >> diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts >> index 459384ec8f23..9454e8e4e517 100644 >> --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts >> +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts >> @@ -7,7 +7,7 @@ >> >> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> >> #include <dt-bindings/gpio/gpio.h> >> -#include "sm8150.dtsi" >> +#include "sa8155p.dtsi" >> #include "pmm8155au_1.dtsi" >> #include "pmm8155au_2.dtsi" >> >> diff --git a/arch/arm64/boot/dts/qcom/sa8155p.dtsi b/arch/arm64/boot/dts/qcom/sa8155p.dtsi >> new file mode 100644 >> index 000000000000..f2fd7c28764e >> --- /dev/null >> +++ b/arch/arm64/boot/dts/qcom/sa8155p.dtsi >> @@ -0,0 +1,51 @@ >> +// SPDX-License-Identifier: BSD-3-Clause >> +/* >> + * Copyright (c) 2023, Linaro Limited >> + * >> + * SA8155P is an automotive variant of SM8150, with some minor changes. >> + * Most notably, the RPMhPD setup differs: MMCX and LCX/LMX rails are gone. >> + */ >> + >> +#include "sm8150.dtsi" >> + >> +&dispcc { >> + power-domains = <&rpmhpd SA8155P_CX>; >> +}; >> + >> +&mdss_mdp { >> + power-domains = <&rpmhpd SA8155P_CX>; >> +}; >> + >> +&mdss_dsi0 { >> + power-domains = <&rpmhpd SA8155P_CX>; >> +}; >> + >> +&mdss_dsi1 { >> + power-domains = <&rpmhpd SA8155P_CX>; >> +}; >> + >> +&remoteproc_adsp { >> + power-domains = <&rpmhpd SA8155P_CX>; >> +}; >> + >> +&remoteproc_cdsp { >> + power-domains = <&rpmhpd SA8155P_CX>; >> +}; >> + >> +&remoteproc_mpss { >> + power-domains = <&rpmhpd SA8155P_CX>, >> + <&rpmhpd SA8155P_MSS>; >> +}; >> + >> +&remoteproc_slpi { >> + power-domains = <&rpmhpd SA8155P_CX>, >> + <&rpmhpd SA8155P_MX>; >> +}; >> + >> +&rpmhpd { >> + compatible = "qcom,sa8155p-rpmhpd"; >> +}; >> + >> +&sdhc_2 { >> + power-domains = <&rpmhpd SA8155P_CX>; >> +}; >> -- >> 2.39.1 >>
On 14.03.2023 12:36, Konrad Dybcio wrote: > > > On 14.03.2023 01:10, Bjorn Andersson wrote: >> On Tue, Feb 14, 2023 at 10:54:35AM +0100, Konrad Dybcio wrote: >>> The RPMhPD setup on SA8155P is different compared to SM8150. Correct >>> it to ensure the platform will not try accessing forbidden/missing >>> RPMh entries at boot, as a bad vote will hang the machine. >>> >> >> I don't see that this will scale, as soon as someone adds a new device >> in sm8150.dtsi that has the need to scale a power rail this will be >> forgotten and we will have a mix of references to the SM8150 and SA8155P >> value space. >> >> That said, I think it's reasonable to avoid duplicating the entire >> sm8150.dtsi. > Yeah, this problem has no obvious good solutions and even though it's > not very elegant, this seems to be the less bad one.. > >> >> How about making the SA8155P_* macros match the SM8150_* macros? >> That way things will fail gracefully if a device node references a >> resource not defined for either platform... > Okay, let's do that Re-thinking it, it's good that the indices don't match, as this way the board will (should) refuse to function properly if there's an oversight, which may have gone unnoticed if they were matching, so this only guards us against programmer error which is not great :/ Konrad > > Konrad >> >> Regards, >> Bjorn >> >>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>> --- >>> arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 2 +- >>> arch/arm64/boot/dts/qcom/sa8155p.dtsi | 51 ++++++++++++++++++++++++ >>> 2 files changed, 52 insertions(+), 1 deletion(-) >>> create mode 100644 arch/arm64/boot/dts/qcom/sa8155p.dtsi >>> >>> diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts >>> index 459384ec8f23..9454e8e4e517 100644 >>> --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts >>> +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts >>> @@ -7,7 +7,7 @@ >>> >>> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> >>> #include <dt-bindings/gpio/gpio.h> >>> -#include "sm8150.dtsi" >>> +#include "sa8155p.dtsi" >>> #include "pmm8155au_1.dtsi" >>> #include "pmm8155au_2.dtsi" >>> >>> diff --git a/arch/arm64/boot/dts/qcom/sa8155p.dtsi b/arch/arm64/boot/dts/qcom/sa8155p.dtsi >>> new file mode 100644 >>> index 000000000000..f2fd7c28764e >>> --- /dev/null >>> +++ b/arch/arm64/boot/dts/qcom/sa8155p.dtsi >>> @@ -0,0 +1,51 @@ >>> +// SPDX-License-Identifier: BSD-3-Clause >>> +/* >>> + * Copyright (c) 2023, Linaro Limited >>> + * >>> + * SA8155P is an automotive variant of SM8150, with some minor changes. >>> + * Most notably, the RPMhPD setup differs: MMCX and LCX/LMX rails are gone. >>> + */ >>> + >>> +#include "sm8150.dtsi" >>> + >>> +&dispcc { >>> + power-domains = <&rpmhpd SA8155P_CX>; >>> +}; >>> + >>> +&mdss_mdp { >>> + power-domains = <&rpmhpd SA8155P_CX>; >>> +}; >>> + >>> +&mdss_dsi0 { >>> + power-domains = <&rpmhpd SA8155P_CX>; >>> +}; >>> + >>> +&mdss_dsi1 { >>> + power-domains = <&rpmhpd SA8155P_CX>; >>> +}; >>> + >>> +&remoteproc_adsp { >>> + power-domains = <&rpmhpd SA8155P_CX>; >>> +}; >>> + >>> +&remoteproc_cdsp { >>> + power-domains = <&rpmhpd SA8155P_CX>; >>> +}; >>> + >>> +&remoteproc_mpss { >>> + power-domains = <&rpmhpd SA8155P_CX>, >>> + <&rpmhpd SA8155P_MSS>; >>> +}; >>> + >>> +&remoteproc_slpi { >>> + power-domains = <&rpmhpd SA8155P_CX>, >>> + <&rpmhpd SA8155P_MX>; >>> +}; >>> + >>> +&rpmhpd { >>> + compatible = "qcom,sa8155p-rpmhpd"; >>> +}; >>> + >>> +&sdhc_2 { >>> + power-domains = <&rpmhpd SA8155P_CX>; >>> +}; >>> -- >>> 2.39.1 >>>
On Tue, Mar 14, 2023 at 12:41:45PM +0100, Konrad Dybcio wrote: > > > On 14.03.2023 12:36, Konrad Dybcio wrote: > > > > > > On 14.03.2023 01:10, Bjorn Andersson wrote: > >> On Tue, Feb 14, 2023 at 10:54:35AM +0100, Konrad Dybcio wrote: > >>> The RPMhPD setup on SA8155P is different compared to SM8150. Correct > >>> it to ensure the platform will not try accessing forbidden/missing > >>> RPMh entries at boot, as a bad vote will hang the machine. > >>> > >> > >> I don't see that this will scale, as soon as someone adds a new device > >> in sm8150.dtsi that has the need to scale a power rail this will be > >> forgotten and we will have a mix of references to the SM8150 and SA8155P > >> value space. > >> > >> That said, I think it's reasonable to avoid duplicating the entire > >> sm8150.dtsi. > > Yeah, this problem has no obvious good solutions and even though it's > > not very elegant, this seems to be the less bad one.. > > > >> > >> How about making the SA8155P_* macros match the SM8150_* macros? > >> That way things will fail gracefully if a device node references a > >> resource not defined for either platform... > > Okay, let's do that > Re-thinking it, it's good that the indices don't match, as this way the > board will (should) refuse to function properly if there's an oversight, > which may have gone unnoticed if they were matching, so this only guards > us against programmer error which is not great :/ > Right, ensuring that the resource indices never collides would be a good way to capture this issue, as well as copy-paste errors etc. My pragmatic proposal is that we make SA8155P_x == SM8150_x where a match exist, and for the ones that doesn't match we pick numbers that doesn't collide between the platforms. The alternative is to start SA8155P_x at 11, but it's different and forces sa8155p.dtsi to redefine every single power-domains property... This does bring back the feeling that it was a mistake to include the platform name in these defines in the first place... Not sure if it's worth mixing generic defines into the picture at this point, given that we I don't see a way to use them on any existing platform. Regards, Bjorn > Konrad > > > > Konrad > >> > >> Regards, > >> Bjorn > >> > >>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> > >>> --- > >>> arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 2 +- > >>> arch/arm64/boot/dts/qcom/sa8155p.dtsi | 51 ++++++++++++++++++++++++ > >>> 2 files changed, 52 insertions(+), 1 deletion(-) > >>> create mode 100644 arch/arm64/boot/dts/qcom/sa8155p.dtsi > >>> > >>> diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts > >>> index 459384ec8f23..9454e8e4e517 100644 > >>> --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts > >>> +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts > >>> @@ -7,7 +7,7 @@ > >>> > >>> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> > >>> #include <dt-bindings/gpio/gpio.h> > >>> -#include "sm8150.dtsi" > >>> +#include "sa8155p.dtsi" > >>> #include "pmm8155au_1.dtsi" > >>> #include "pmm8155au_2.dtsi" > >>> > >>> diff --git a/arch/arm64/boot/dts/qcom/sa8155p.dtsi b/arch/arm64/boot/dts/qcom/sa8155p.dtsi > >>> new file mode 100644 > >>> index 000000000000..f2fd7c28764e > >>> --- /dev/null > >>> +++ b/arch/arm64/boot/dts/qcom/sa8155p.dtsi > >>> @@ -0,0 +1,51 @@ > >>> +// SPDX-License-Identifier: BSD-3-Clause > >>> +/* > >>> + * Copyright (c) 2023, Linaro Limited > >>> + * > >>> + * SA8155P is an automotive variant of SM8150, with some minor changes. > >>> + * Most notably, the RPMhPD setup differs: MMCX and LCX/LMX rails are gone. > >>> + */ > >>> + > >>> +#include "sm8150.dtsi" > >>> + > >>> +&dispcc { > >>> + power-domains = <&rpmhpd SA8155P_CX>; > >>> +}; > >>> + > >>> +&mdss_mdp { > >>> + power-domains = <&rpmhpd SA8155P_CX>; > >>> +}; > >>> + > >>> +&mdss_dsi0 { > >>> + power-domains = <&rpmhpd SA8155P_CX>; > >>> +}; > >>> + > >>> +&mdss_dsi1 { > >>> + power-domains = <&rpmhpd SA8155P_CX>; > >>> +}; > >>> + > >>> +&remoteproc_adsp { > >>> + power-domains = <&rpmhpd SA8155P_CX>; > >>> +}; > >>> + > >>> +&remoteproc_cdsp { > >>> + power-domains = <&rpmhpd SA8155P_CX>; > >>> +}; > >>> + > >>> +&remoteproc_mpss { > >>> + power-domains = <&rpmhpd SA8155P_CX>, > >>> + <&rpmhpd SA8155P_MSS>; > >>> +}; > >>> + > >>> +&remoteproc_slpi { > >>> + power-domains = <&rpmhpd SA8155P_CX>, > >>> + <&rpmhpd SA8155P_MX>; > >>> +}; > >>> + > >>> +&rpmhpd { > >>> + compatible = "qcom,sa8155p-rpmhpd"; > >>> +}; > >>> + > >>> +&sdhc_2 { > >>> + power-domains = <&rpmhpd SA8155P_CX>; > >>> +}; > >>> -- > >>> 2.39.1 > >>>
On 16.03.2023 00:00, Bjorn Andersson wrote: > On Tue, Mar 14, 2023 at 12:41:45PM +0100, Konrad Dybcio wrote: >> >> >> On 14.03.2023 12:36, Konrad Dybcio wrote: >>> >>> >>> On 14.03.2023 01:10, Bjorn Andersson wrote: >>>> On Tue, Feb 14, 2023 at 10:54:35AM +0100, Konrad Dybcio wrote: >>>>> The RPMhPD setup on SA8155P is different compared to SM8150. Correct >>>>> it to ensure the platform will not try accessing forbidden/missing >>>>> RPMh entries at boot, as a bad vote will hang the machine. >>>>> >>>> >>>> I don't see that this will scale, as soon as someone adds a new device >>>> in sm8150.dtsi that has the need to scale a power rail this will be >>>> forgotten and we will have a mix of references to the SM8150 and SA8155P >>>> value space. >>>> >>>> That said, I think it's reasonable to avoid duplicating the entire >>>> sm8150.dtsi. >>> Yeah, this problem has no obvious good solutions and even though it's >>> not very elegant, this seems to be the less bad one.. >>> >>>> >>>> How about making the SA8155P_* macros match the SM8150_* macros? >>>> That way things will fail gracefully if a device node references a >>>> resource not defined for either platform... >>> Okay, let's do that >> Re-thinking it, it's good that the indices don't match, as this way the >> board will (should) refuse to function properly if there's an oversight, >> which may have gone unnoticed if they were matching, so this only guards >> us against programmer error which is not great :/ >> > > Right, ensuring that the resource indices never collides would be a good > way to capture this issue, as well as copy-paste errors etc. My > pragmatic proposal is that we make SA8155P_x == SM8150_x where a match > exist, and for the ones that doesn't match we pick numbers that doesn't > collide between the platforms. > > The alternative is to start SA8155P_x at 11, but it's different and > forces sa8155p.dtsi to redefine every single power-domains property... > > > This does bring back the feeling that it was a mistake to include the > platform name in these defines in the first place... Not sure if it's > worth mixing generic defines into the picture at this point, given that > we I don't see a way to use them on any existing platform. TBF we could, think: sm1234_rpmpds[] = { [CX] = &foobar1, [CX_AO] = &foobar1_ao, [...] /* Legacy DT bindings */ [SM1234_CX] = &foobar1, [SM1234_CX_AO] = &foobar1_ao, }; WDYT? Konrad > > Regards, > Bjorn > >> Konrad >>> >>> Konrad >>>> >>>> Regards, >>>> Bjorn >>>> >>>>> Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org> >>>>> --- >>>>> arch/arm64/boot/dts/qcom/sa8155p-adp.dts | 2 +- >>>>> arch/arm64/boot/dts/qcom/sa8155p.dtsi | 51 ++++++++++++++++++++++++ >>>>> 2 files changed, 52 insertions(+), 1 deletion(-) >>>>> create mode 100644 arch/arm64/boot/dts/qcom/sa8155p.dtsi >>>>> >>>>> diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts >>>>> index 459384ec8f23..9454e8e4e517 100644 >>>>> --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts >>>>> +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts >>>>> @@ -7,7 +7,7 @@ >>>>> >>>>> #include <dt-bindings/regulator/qcom,rpmh-regulator.h> >>>>> #include <dt-bindings/gpio/gpio.h> >>>>> -#include "sm8150.dtsi" >>>>> +#include "sa8155p.dtsi" >>>>> #include "pmm8155au_1.dtsi" >>>>> #include "pmm8155au_2.dtsi" >>>>> >>>>> diff --git a/arch/arm64/boot/dts/qcom/sa8155p.dtsi b/arch/arm64/boot/dts/qcom/sa8155p.dtsi >>>>> new file mode 100644 >>>>> index 000000000000..f2fd7c28764e >>>>> --- /dev/null >>>>> +++ b/arch/arm64/boot/dts/qcom/sa8155p.dtsi >>>>> @@ -0,0 +1,51 @@ >>>>> +// SPDX-License-Identifier: BSD-3-Clause >>>>> +/* >>>>> + * Copyright (c) 2023, Linaro Limited >>>>> + * >>>>> + * SA8155P is an automotive variant of SM8150, with some minor changes. >>>>> + * Most notably, the RPMhPD setup differs: MMCX and LCX/LMX rails are gone. >>>>> + */ >>>>> + >>>>> +#include "sm8150.dtsi" >>>>> + >>>>> +&dispcc { >>>>> + power-domains = <&rpmhpd SA8155P_CX>; >>>>> +}; >>>>> + >>>>> +&mdss_mdp { >>>>> + power-domains = <&rpmhpd SA8155P_CX>; >>>>> +}; >>>>> + >>>>> +&mdss_dsi0 { >>>>> + power-domains = <&rpmhpd SA8155P_CX>; >>>>> +}; >>>>> + >>>>> +&mdss_dsi1 { >>>>> + power-domains = <&rpmhpd SA8155P_CX>; >>>>> +}; >>>>> + >>>>> +&remoteproc_adsp { >>>>> + power-domains = <&rpmhpd SA8155P_CX>; >>>>> +}; >>>>> + >>>>> +&remoteproc_cdsp { >>>>> + power-domains = <&rpmhpd SA8155P_CX>; >>>>> +}; >>>>> + >>>>> +&remoteproc_mpss { >>>>> + power-domains = <&rpmhpd SA8155P_CX>, >>>>> + <&rpmhpd SA8155P_MSS>; >>>>> +}; >>>>> + >>>>> +&remoteproc_slpi { >>>>> + power-domains = <&rpmhpd SA8155P_CX>, >>>>> + <&rpmhpd SA8155P_MX>; >>>>> +}; >>>>> + >>>>> +&rpmhpd { >>>>> + compatible = "qcom,sa8155p-rpmhpd"; >>>>> +}; >>>>> + >>>>> +&sdhc_2 { >>>>> + power-domains = <&rpmhpd SA8155P_CX>; >>>>> +}; >>>>> -- >>>>> 2.39.1 >>>>>
On Thu, Mar 16, 2023 at 12:50:49AM +0100, Konrad Dybcio wrote: > On 16.03.2023 00:00, Bjorn Andersson wrote: > > On Tue, Mar 14, 2023 at 12:41:45PM +0100, Konrad Dybcio wrote: > >> > >> > >> On 14.03.2023 12:36, Konrad Dybcio wrote: > >>> > >>> > >>> On 14.03.2023 01:10, Bjorn Andersson wrote: > >>>> On Tue, Feb 14, 2023 at 10:54:35AM +0100, Konrad Dybcio wrote: > >>>>> The RPMhPD setup on SA8155P is different compared to SM8150. Correct > >>>>> it to ensure the platform will not try accessing forbidden/missing > >>>>> RPMh entries at boot, as a bad vote will hang the machine. > >>>>> > >>>> > >>>> I don't see that this will scale, as soon as someone adds a new device > >>>> in sm8150.dtsi that has the need to scale a power rail this will be > >>>> forgotten and we will have a mix of references to the SM8150 and SA8155P > >>>> value space. > >>>> > >>>> That said, I think it's reasonable to avoid duplicating the entire > >>>> sm8150.dtsi. > >>> Yeah, this problem has no obvious good solutions and even though it's > >>> not very elegant, this seems to be the less bad one.. > >>> > >>>> > >>>> How about making the SA8155P_* macros match the SM8150_* macros? > >>>> That way things will fail gracefully if a device node references a > >>>> resource not defined for either platform... > >>> Okay, let's do that > >> Re-thinking it, it's good that the indices don't match, as this way the > >> board will (should) refuse to function properly if there's an oversight, > >> which may have gone unnoticed if they were matching, so this only guards > >> us against programmer error which is not great :/ > >> > > > > Right, ensuring that the resource indices never collides would be a good > > way to capture this issue, as well as copy-paste errors etc. My > > pragmatic proposal is that we make SA8155P_x == SM8150_x where a match > > exist, and for the ones that doesn't match we pick numbers that doesn't > > collide between the platforms. > > > > The alternative is to start SA8155P_x at 11, but it's different and > > forces sa8155p.dtsi to redefine every single power-domains property... > > > > > > This does bring back the feeling that it was a mistake to include the > > platform name in these defines in the first place... Not sure if it's > > worth mixing generic defines into the picture at this point, given that > > we I don't see a way to use them on any existing platform. > TBF we could, think: > > sm1234_rpmpds[] = { > [CX] = &foobar1, > [CX_AO] = &foobar1_ao, > > [...] > > /* Legacy DT bindings */ > [SM1234_CX] = &foobar1, > [SM1234_CX_AO] = &foobar1_ao, > }; > > WDYT? Given that every platform got these defines different we'd have to start at the new generic list at 17 (which would throw away 136 bytes per platform), if we're going to allow the scheme for existing platforms. Which I don't fancy. It's not super-pretty to mix and match, but I think I would be okay switching to this scheme for new platforms. PS. We'd better prefix the defines with something (perhaps RPM_?) Regards, Bjorn
On 20.03.2023 03:19, Bjorn Andersson wrote: > On Thu, Mar 16, 2023 at 12:50:49AM +0100, Konrad Dybcio wrote: >> On 16.03.2023 00:00, Bjorn Andersson wrote: >>> On Tue, Mar 14, 2023 at 12:41:45PM +0100, Konrad Dybcio wrote: >>>> >>>> >>>> On 14.03.2023 12:36, Konrad Dybcio wrote: >>>>> >>>>> >>>>> On 14.03.2023 01:10, Bjorn Andersson wrote: >>>>>> On Tue, Feb 14, 2023 at 10:54:35AM +0100, Konrad Dybcio wrote: >>>>>>> The RPMhPD setup on SA8155P is different compared to SM8150. Correct >>>>>>> it to ensure the platform will not try accessing forbidden/missing >>>>>>> RPMh entries at boot, as a bad vote will hang the machine. >>>>>>> >>>>>> >>>>>> I don't see that this will scale, as soon as someone adds a new device >>>>>> in sm8150.dtsi that has the need to scale a power rail this will be >>>>>> forgotten and we will have a mix of references to the SM8150 and SA8155P >>>>>> value space. >>>>>> >>>>>> That said, I think it's reasonable to avoid duplicating the entire >>>>>> sm8150.dtsi. >>>>> Yeah, this problem has no obvious good solutions and even though it's >>>>> not very elegant, this seems to be the less bad one.. >>>>> >>>>>> >>>>>> How about making the SA8155P_* macros match the SM8150_* macros? >>>>>> That way things will fail gracefully if a device node references a >>>>>> resource not defined for either platform... >>>>> Okay, let's do that >>>> Re-thinking it, it's good that the indices don't match, as this way the >>>> board will (should) refuse to function properly if there's an oversight, >>>> which may have gone unnoticed if they were matching, so this only guards >>>> us against programmer error which is not great :/ >>>> >>> >>> Right, ensuring that the resource indices never collides would be a good >>> way to capture this issue, as well as copy-paste errors etc. My >>> pragmatic proposal is that we make SA8155P_x == SM8150_x where a match >>> exist, and for the ones that doesn't match we pick numbers that doesn't >>> collide between the platforms. >>> >>> The alternative is to start SA8155P_x at 11, but it's different and >>> forces sa8155p.dtsi to redefine every single power-domains property... >>> >>> >>> This does bring back the feeling that it was a mistake to include the >>> platform name in these defines in the first place... Not sure if it's >>> worth mixing generic defines into the picture at this point, given that >>> we I don't see a way to use them on any existing platform. >> TBF we could, think: >> >> sm1234_rpmpds[] = { >> [CX] = &foobar1, >> [CX_AO] = &foobar1_ao, >> >> [...] >> >> /* Legacy DT bindings */ >> [SM1234_CX] = &foobar1, >> [SM1234_CX_AO] = &foobar1_ao, >> }; >> >> WDYT? > > Given that every platform got these defines different we'd have to start > at the new generic list at 17 (which would throw away 136 bytes per > platform), if we're going to allow the scheme for existing platforms. > Which I don't fancy. > > It's not super-pretty to mix and match, but I think I would be okay > switching to this scheme for new platforms. > > PS. We'd better prefix the defines with something (perhaps RPM_?) Perhaps just VDD_{CX/MX/..}? We reference the rpm(h)pd's phandle each time it's used, anyway. Konrad > > Regards, > Bjorn
On 20.03.2023 11:39, Konrad Dybcio wrote: > > > On 20.03.2023 03:19, Bjorn Andersson wrote: >> On Thu, Mar 16, 2023 at 12:50:49AM +0100, Konrad Dybcio wrote: >>> On 16.03.2023 00:00, Bjorn Andersson wrote: >>>> On Tue, Mar 14, 2023 at 12:41:45PM +0100, Konrad Dybcio wrote: >>>>> >>>>> >>>>> On 14.03.2023 12:36, Konrad Dybcio wrote: >>>>>> >>>>>> >>>>>> On 14.03.2023 01:10, Bjorn Andersson wrote: >>>>>>> On Tue, Feb 14, 2023 at 10:54:35AM +0100, Konrad Dybcio wrote: >>>>>>>> The RPMhPD setup on SA8155P is different compared to SM8150. Correct >>>>>>>> it to ensure the platform will not try accessing forbidden/missing >>>>>>>> RPMh entries at boot, as a bad vote will hang the machine. >>>>>>>> >>>>>>> >>>>>>> I don't see that this will scale, as soon as someone adds a new device >>>>>>> in sm8150.dtsi that has the need to scale a power rail this will be >>>>>>> forgotten and we will have a mix of references to the SM8150 and SA8155P >>>>>>> value space. >>>>>>> >>>>>>> That said, I think it's reasonable to avoid duplicating the entire >>>>>>> sm8150.dtsi. >>>>>> Yeah, this problem has no obvious good solutions and even though it's >>>>>> not very elegant, this seems to be the less bad one.. >>>>>> >>>>>>> >>>>>>> How about making the SA8155P_* macros match the SM8150_* macros? >>>>>>> That way things will fail gracefully if a device node references a >>>>>>> resource not defined for either platform... >>>>>> Okay, let's do that >>>>> Re-thinking it, it's good that the indices don't match, as this way the >>>>> board will (should) refuse to function properly if there's an oversight, >>>>> which may have gone unnoticed if they were matching, so this only guards >>>>> us against programmer error which is not great :/ >>>>> >>>> >>>> Right, ensuring that the resource indices never collides would be a good >>>> way to capture this issue, as well as copy-paste errors etc. My >>>> pragmatic proposal is that we make SA8155P_x == SM8150_x where a match >>>> exist, and for the ones that doesn't match we pick numbers that doesn't >>>> collide between the platforms. >>>> >>>> The alternative is to start SA8155P_x at 11, but it's different and >>>> forces sa8155p.dtsi to redefine every single power-domains property... >>>> >>>> >>>> This does bring back the feeling that it was a mistake to include the >>>> platform name in these defines in the first place... Not sure if it's >>>> worth mixing generic defines into the picture at this point, given that >>>> we I don't see a way to use them on any existing platform. >>> TBF we could, think: >>> >>> sm1234_rpmpds[] = { >>> [CX] = &foobar1, >>> [CX_AO] = &foobar1_ao, >>> >>> [...] >>> >>> /* Legacy DT bindings */ >>> [SM1234_CX] = &foobar1, >>> [SM1234_CX_AO] = &foobar1_ao, >>> }; >>> >>> WDYT? >> >> Given that every platform got these defines different we'd have to start >> at the new generic list at 17 (which would throw away 136 bytes per >> platform), if we're going to allow the scheme for existing platforms. >> Which I don't fancy. >> >> It's not super-pretty to mix and match, but I think I would be okay >> switching to this scheme for new platforms. >> >> PS. We'd better prefix the defines with something (perhaps RPM_?) > Perhaps just VDD_{CX/MX/..}? We reference the rpm(h)pd's phandle > each time it's used, anyway. So, back to this patch.. do you want me to make any changes or should we take it as-is to fix 8155? Konrad > > Konrad >> >> Regards, >> Bjorn
diff --git a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts index 459384ec8f23..9454e8e4e517 100644 --- a/arch/arm64/boot/dts/qcom/sa8155p-adp.dts +++ b/arch/arm64/boot/dts/qcom/sa8155p-adp.dts @@ -7,7 +7,7 @@ #include <dt-bindings/regulator/qcom,rpmh-regulator.h> #include <dt-bindings/gpio/gpio.h> -#include "sm8150.dtsi" +#include "sa8155p.dtsi" #include "pmm8155au_1.dtsi" #include "pmm8155au_2.dtsi" diff --git a/arch/arm64/boot/dts/qcom/sa8155p.dtsi b/arch/arm64/boot/dts/qcom/sa8155p.dtsi new file mode 100644 index 000000000000..f2fd7c28764e --- /dev/null +++ b/arch/arm64/boot/dts/qcom/sa8155p.dtsi @@ -0,0 +1,51 @@ +// SPDX-License-Identifier: BSD-3-Clause +/* + * Copyright (c) 2023, Linaro Limited + * + * SA8155P is an automotive variant of SM8150, with some minor changes. + * Most notably, the RPMhPD setup differs: MMCX and LCX/LMX rails are gone. + */ + +#include "sm8150.dtsi" + +&dispcc { + power-domains = <&rpmhpd SA8155P_CX>; +}; + +&mdss_mdp { + power-domains = <&rpmhpd SA8155P_CX>; +}; + +&mdss_dsi0 { + power-domains = <&rpmhpd SA8155P_CX>; +}; + +&mdss_dsi1 { + power-domains = <&rpmhpd SA8155P_CX>; +}; + +&remoteproc_adsp { + power-domains = <&rpmhpd SA8155P_CX>; +}; + +&remoteproc_cdsp { + power-domains = <&rpmhpd SA8155P_CX>; +}; + +&remoteproc_mpss { + power-domains = <&rpmhpd SA8155P_CX>, + <&rpmhpd SA8155P_MSS>; +}; + +&remoteproc_slpi { + power-domains = <&rpmhpd SA8155P_CX>, + <&rpmhpd SA8155P_MX>; +}; + +&rpmhpd { + compatible = "qcom,sa8155p-rpmhpd"; +}; + +&sdhc_2 { + power-domains = <&rpmhpd SA8155P_CX>; +};