2022-03-17 04:29:30

by Matthias Kaehlcke

[permalink] [raw]
Subject: [PATCH v1 1/4] arm64: dts: qcom: sc7280: Rename crd to crd-r3

There are multiple revisions of CRD boards. The current sc7280-crd.dts
describes revision 3 and 4 (aka CRD 1.0 and 2.0). Support for a newer
version will be added by another patch. Add the revision number to
distinguish it from the versionn. Also add the revision numbers to
the compatible string.

Signed-off-by: Matthias Kaehlcke <[email protected]>
---

arch/arm64/boot/dts/qcom/Makefile | 2 +-
.../arm64/boot/dts/qcom/{sc7280-crd.dts => sc7280-crd-r3.dts} | 4 ++--
2 files changed, 3 insertions(+), 3 deletions(-)
rename arch/arm64/boot/dts/qcom/{sc7280-crd.dts => sc7280-crd-r3.dts} (91%)

diff --git a/arch/arm64/boot/dts/qcom/Makefile b/arch/arm64/boot/dts/qcom/Makefile
index f9e6343acd03..38d41b1d70ad 100644
--- a/arch/arm64/boot/dts/qcom/Makefile
+++ b/arch/arm64/boot/dts/qcom/Makefile
@@ -87,7 +87,7 @@ dtb-$(CONFIG_ARCH_QCOM) += sc7280-herobrine-herobrine-r0.dtb
dtb-$(CONFIG_ARCH_QCOM) += sc7280-herobrine-herobrine-r1.dtb
dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp.dtb
dtb-$(CONFIG_ARCH_QCOM) += sc7280-idp2.dtb
-dtb-$(CONFIG_ARCH_QCOM) += sc7280-crd.dtb
+dtb-$(CONFIG_ARCH_QCOM) += sc7280-crd-r3.dtb
dtb-$(CONFIG_ARCH_QCOM) += sdm630-sony-xperia-ganges-kirin.dtb
dtb-$(CONFIG_ARCH_QCOM) += sdm630-sony-xperia-nile-discovery.dtb
dtb-$(CONFIG_ARCH_QCOM) += sdm630-sony-xperia-nile-pioneer.dtb
diff --git a/arch/arm64/boot/dts/qcom/sc7280-crd.dts b/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts
similarity index 91%
rename from arch/arm64/boot/dts/qcom/sc7280-crd.dts
rename to arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts
index e2efbdde53a3..7a028b9248c3 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-crd.dts
+++ b/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts
@@ -11,8 +11,8 @@
#include "sc7280-idp-ec-h1.dtsi"

/ {
- model = "Qualcomm Technologies, Inc. sc7280 CRD platform";
- compatible = "qcom,sc7280-crd", "google,hoglin", "qcom,sc7280";
+ model = "Qualcomm Technologies, Inc. sc7280 CRD platform (rev3 - 4)";
+ compatible = "qcom,sc7280-crd", "google,hoglin-rev3", "google,hoglin-rev4", "qcom,sc7280";

aliases {
serial0 = &uart5;
--
2.35.1.723.g4982287a31-goog


2022-03-17 05:03:19

by Matthias Kaehlcke

[permalink] [raw]
Subject: [PATCH v1 3/4] arm64: dts: qcom: sc7280: herobrine: disable some regulators by default

Not all herobrine boards have a world facing camera or a fingerprint
sensor, disable the regulators that feed these devices by default and
only enable them for the boards that use them.

Similarly the audio configuration can vary between boards, not all
boards have the regulator pp3300_codec, disable it by default.

Signed-off-by: Matthias Kaehlcke <[email protected]>
---

.../qcom/sc7280-herobrine-herobrine-r1.dts | 30 +++++++++++++++++++
.../arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 6 ++++
2 files changed, 36 insertions(+)

diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts b/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts
index f95273052da0..29c4ca095294 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts
+++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine-herobrine-r1.dts
@@ -14,6 +14,36 @@ / {
compatible = "google,herobrine", "qcom,sc7280";
};

+/*
+ * ADDITIONS TO FIXED REGULATORS DEFINED IN PARENT DEVICE TREE FILES
+ *
+ * Sort order matches the order in the parent files (parents before children).
+ */
+
+&pp3300_codec {
+ status = "okay";
+};
+
+&pp3300_fp_mcu {
+ status = "okay";
+};
+
+&pp2850_vcm_wf_cam {
+ status = "okay";
+};
+
+&pp2850_wf_cam {
+ status = "okay";
+};
+
+&pp1800_wf_cam {
+ status = "okay";
+};
+
+&pp1200_wf_cam {
+ status = "okay";
+};
+
/* ADDITIONS TO NODES DEFINED IN PARENT DEVICE TREE FILES */

&ap_spi_fp {
diff --git a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
index dc17f2079695..40cca69b1414 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
+++ b/arch/arm64/boot/dts/qcom/sc7280-herobrine.dtsi
@@ -92,6 +92,7 @@ pp3300_codec: pp3300-codec-regulator {
pinctrl-0 = <&en_pp3300_codec>;

vin-supply = <&pp3300_z1>;
+ status = "disabled";
};

pp3300_left_in_mlb: pp3300-left-in-mlb-regulator {
@@ -132,6 +133,7 @@ pp3300_fp_mcu: pp3300-fp-regulator {
pinctrl-0 = <&en_fp_rails>;

vin-supply = <&pp3300_z1>;
+ status = "disabled";
};

pp3300_hub: pp3300-hub-regulator {
@@ -194,6 +196,7 @@ pp2850_vcm_wf_cam: pp2850-vcm-wf-cam-regulator {
pinctrl-0 = <&wf_cam_en>;

vin-supply = <&pp3300_z1>;
+ status = "disabled";
};

pp2850_wf_cam: pp2850-wf-cam-regulator {
@@ -214,6 +217,7 @@ pp2850_wf_cam: pp2850-wf-cam-regulator {
*/

vin-supply = <&pp3300_z1>;
+ status = "disabled";
};

pp1800_fp: pp1800-fp-regulator {
@@ -258,6 +262,7 @@ pp1800_wf_cam: pp1800-wf-cam-regulator {
*/

vin-supply = <&vreg_l19b_s0>;
+ status = "disabled";
};

pp1200_wf_cam: pp1200-wf-cam-regulator {
@@ -278,6 +283,7 @@ pp1200_wf_cam: pp1200-wf-cam-regulator {
*/

vin-supply = <&pp3300_z1>;
+ status = "disabled";
};

/* BOARD-SPECIFIC TOP LEVEL NODES */
--
2.35.1.723.g4982287a31-goog

2022-03-17 06:15:41

by Matthias Kaehlcke

[permalink] [raw]
Subject: [PATCH v1 2/4] arm64: dts: qcom: sc7280: Add 'piglin' to the crd-r3 compatible strings

With newer bootloader versions the crd-r3 (aka CRD 1.0 and 2.0) is
identified as a 'piglin' board (like the IDP2 board), instead of 'hoglin'
Add the compatible strings 'google,piglin-rev{3,4}'. The hoglin entries
are kept to make sure the board keeps booting with older bootloader
versions.

The compatible string 'google,piglin' (without revision information) is
still used by the IDP2 board, which is not expected to evolve further.

Signed-off-by: Matthias Kaehlcke <[email protected]>
---

arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts b/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts
index 7a028b9248c3..344338ad8a01 100644
--- a/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts
+++ b/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts
@@ -12,7 +12,10 @@

/ {
model = "Qualcomm Technologies, Inc. sc7280 CRD platform (rev3 - 4)";
- compatible = "qcom,sc7280-crd", "google,hoglin-rev3", "google,hoglin-rev4", "qcom,sc7280";
+ compatible = "qcom,sc7280-crd",
+ "google,hoglin-rev3", "google,hoglin-rev4",
+ "google,piglin-rev3", "google,piglin-rev4",
+ "qcom,sc7280";

aliases {
serial0 = &uart5;
--
2.35.1.723.g4982287a31-goog

2022-03-17 17:27:59

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH v1 2/4] arm64: dts: qcom: sc7280: Add 'piglin' to the crd-r3 compatible strings

Hi,

On Wed, Mar 16, 2022 at 5:28 PM Matthias Kaehlcke <[email protected]> wrote:
>
> With newer bootloader versions the crd-r3 (aka CRD 1.0 and 2.0) is
> identified as a 'piglin' board (like the IDP2 board), instead of 'hoglin'
> Add the compatible strings 'google,piglin-rev{3,4}'. The hoglin entries
> are kept to make sure the board keeps booting with older bootloader
> versions.
>
> The compatible string 'google,piglin' (without revision information) is
> still used by the IDP2 board, which is not expected to evolve further.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---
>
> arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)

Reviewed-by: Douglas Anderson <[email protected]>

2022-03-17 19:16:58

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH v1 2/4] arm64: dts: qcom: sc7280: Add 'piglin' to the crd-r3 compatible strings

Quoting Matthias Kaehlcke (2022-03-16 17:28:18)
> With newer bootloader versions the crd-r3 (aka CRD 1.0 and 2.0) is
> identified as a 'piglin' board (like the IDP2 board), instead of 'hoglin'
> Add the compatible strings 'google,piglin-rev{3,4}'. The hoglin entries
> are kept to make sure the board keeps booting with older bootloader
> versions.
>
> The compatible string 'google,piglin' (without revision information) is
> still used by the IDP2 board, which is not expected to evolve further.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>

2022-03-17 19:35:56

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH v1 3/4] arm64: dts: qcom: sc7280: herobrine: disable some regulators by default

Hi,

On Wed, Mar 16, 2022 at 5:28 PM Matthias Kaehlcke <[email protected]> wrote:
>
> Not all herobrine boards have a world facing camera or a fingerprint
> sensor, disable the regulators that feed these devices by default and
> only enable them for the boards that use them.
>
> Similarly the audio configuration can vary between boards, not all
> boards have the regulator pp3300_codec, disable it by default.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---
>
> .../qcom/sc7280-herobrine-herobrine-r1.dts | 30 +++++++++++++++++++
> .../arm64/boot/dts/qcom/sc7280-herobrine.dtsi | 6 ++++
> 2 files changed, 36 insertions(+)

Reviewed-by: Douglas Anderson <[email protected]>

2022-03-17 20:28:24

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] arm64: dts: qcom: sc7280: Rename crd to crd-r3

Quoting Matthias Kaehlcke (2022-03-16 17:28:17)
> There are multiple revisions of CRD boards. The current sc7280-crd.dts
> describes revision 3 and 4 (aka CRD 1.0 and 2.0). Support for a newer
> version will be added by another patch. Add the revision number to
> distinguish it from the versionn. Also add the revision numbers to
> the compatible string.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---

Reviewed-by: Stephen Boyd <[email protected]>

2022-03-17 20:41:01

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] arm64: dts: qcom: sc7280: Rename crd to crd-r3

Hi,

On Wed, Mar 16, 2022 at 5:28 PM Matthias Kaehlcke <[email protected]> wrote:
>
> There are multiple revisions of CRD boards. The current sc7280-crd.dts
> describes revision 3 and 4 (aka CRD 1.0 and 2.0). Support for a newer
> version will be added by another patch. Add the revision number to
> distinguish it from the versionn. Also add the revision numbers to
> the compatible string.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---
>
> arch/arm64/boot/dts/qcom/Makefile | 2 +-
> .../arm64/boot/dts/qcom/{sc7280-crd.dts => sc7280-crd-r3.dts} | 4 ++--
> 2 files changed, 3 insertions(+), 3 deletions(-)

Reviewed-by: Douglas Anderson <[email protected]>

2022-03-17 20:41:44

by Stephen Boyd

[permalink] [raw]
Subject: Re: [PATCH v1 3/4] arm64: dts: qcom: sc7280: herobrine: disable some regulators by default

Quoting Matthias Kaehlcke (2022-03-16 17:28:19)
> Not all herobrine boards have a world facing camera or a fingerprint
> sensor, disable the regulators that feed these devices by default and
> only enable them for the boards that use them.
>
> Similarly the audio configuration can vary between boards, not all
> boards have the regulator pp3300_codec, disable it by default.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---

This seems complicated. Maybe we should introduce some sort of mixin dts
file for fingerprint and world facing camera and audio type so that
boards can pick and choose what they want. Either way, that can come
later when we get there.

Reviewed-by: Stephen Boyd <[email protected]>

2022-03-21 08:47:31

by Rajendra Nayak

[permalink] [raw]
Subject: Re: [PATCH v1 2/4] arm64: dts: qcom: sc7280: Add 'piglin' to the crd-r3 compatible strings


On 3/17/2022 5:58 AM, Matthias Kaehlcke wrote:
> With newer bootloader versions the crd-r3 (aka CRD 1.0 and 2.0) is
> identified as a 'piglin' board (like the IDP2 board), instead of 'hoglin'
> Add the compatible strings 'google,piglin-rev{3,4}'. The hoglin entries
> are kept to make sure the board keeps booting with older bootloader
> versions.

The older bootloaders really look for the google,hoglin-rev3/google,hoglin-rev4
compatibles or just google,hoglin? If its just google,hoglin, won;t it pick the
crd-rev5+ dtb now?

>
> The compatible string 'google,piglin' (without revision information) is
> still used by the IDP2 board, which is not expected to evolve further.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---
>
> arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts b/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts
> index 7a028b9248c3..344338ad8a01 100644
> --- a/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts
> +++ b/arch/arm64/boot/dts/qcom/sc7280-crd-r3.dts
> @@ -12,7 +12,10 @@
>
> / {
> model = "Qualcomm Technologies, Inc. sc7280 CRD platform (rev3 - 4)";
> - compatible = "qcom,sc7280-crd", "google,hoglin-rev3", "google,hoglin-rev4", "qcom,sc7280";
> + compatible = "qcom,sc7280-crd",
> + "google,hoglin-rev3", "google,hoglin-rev4",
> + "google,piglin-rev3", "google,piglin-rev4",
> + "qcom,sc7280";
>
> aliases {
> serial0 = &uart5;

2022-03-21 21:16:18

by Matthias Kaehlcke

[permalink] [raw]
Subject: Re: [PATCH v1 2/4] arm64: dts: qcom: sc7280: Add 'piglin' to the crd-r3 compatible strings

On Mon, Mar 21, 2022 at 11:14:56AM +0530, Rajendra Nayak wrote:
>
> On 3/17/2022 5:58 AM, Matthias Kaehlcke wrote:
> > With newer bootloader versions the crd-r3 (aka CRD 1.0 and 2.0) is
> > identified as a 'piglin' board (like the IDP2 board), instead of 'hoglin'
> > Add the compatible strings 'google,piglin-rev{3,4}'. The hoglin entries
> > are kept to make sure the board keeps booting with older bootloader
> > versions.
>
> The older bootloaders really look for the google,hoglin-rev3/google,hoglin-rev4
> compatibles or just google,hoglin? If its just google,hoglin, won;t it pick the
> crd-rev5+ dtb now?

They look for the -revN compatible, I confirmed that on my CRD 2.0.

2022-03-21 22:44:24

by Doug Anderson

[permalink] [raw]
Subject: Re: [PATCH v1 2/4] arm64: dts: qcom: sc7280: Add 'piglin' to the crd-r3 compatible strings

"Hi,

On Mon, Mar 21, 2022 at 8:14 AM Matthias Kaehlcke <[email protected]> wrote:
>
> On Mon, Mar 21, 2022 at 11:14:56AM +0530, Rajendra Nayak wrote:
> >
> > On 3/17/2022 5:58 AM, Matthias Kaehlcke wrote:
> > > With newer bootloader versions the crd-r3 (aka CRD 1.0 and 2.0) is
> > > identified as a 'piglin' board (like the IDP2 board), instead of 'hoglin'
> > > Add the compatible strings 'google,piglin-rev{3,4}'. The hoglin entries
> > > are kept to make sure the board keeps booting with older bootloader
> > > versions.
> >
> > The older bootloaders really look for the google,hoglin-rev3/google,hoglin-rev4
> > compatibles or just google,hoglin? If its just google,hoglin, won;t it pick the
> > crd-rev5+ dtb now?
>
> They look for the -revN compatible, I confirmed that on my CRD 2.0.

Thanks for confirming Matthias! I'll also note that, in general, these
"google,board-revX" type compatible strings are all programmatically
generated. You can see at:

https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/heads/main/src/boot/fit.c#70

...and whenever it's using this normal logic then it has a standard
fallback mechanism in place. On a random board in front of me
depthcharge prints out:

Compat preference: google,lazor-rev3-sku0 google,lazor-rev3
google,lazor-sku0 google,lazor

So it'll first try the very specific verison with rev and sku. Then
just by rev. Then just by sku. ...and if none of those match it'll
pick a device tree that has neither. The "newest" device tree always
has no revision number specified and that way if software doesn't
change but the revision bumps then we have no problem. We only add the
revision info for old boards.

There are a few cases where we add special compatible strings and
these don't match on board/rev. This is fairly uncommon, though. You
might be aware of the special case of adding "qcom,sc7180-idp"
(without rev/sku matching) for "bubs". See:

https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/heads/main/src/board/trogdor/board.c#136


-Doug

2022-03-22 04:57:25

by Rajendra Nayak

[permalink] [raw]
Subject: Re: [PATCH v1 2/4] arm64: dts: qcom: sc7280: Add 'piglin' to the crd-r3 compatible strings


On 3/21/2022 11:30 PM, Doug Anderson wrote:
> "Hi,
>
> On Mon, Mar 21, 2022 at 8:14 AM Matthias Kaehlcke <[email protected]> wrote:
>>
>> On Mon, Mar 21, 2022 at 11:14:56AM +0530, Rajendra Nayak wrote:
>>>
>>> On 3/17/2022 5:58 AM, Matthias Kaehlcke wrote:
>>>> With newer bootloader versions the crd-r3 (aka CRD 1.0 and 2.0) is
>>>> identified as a 'piglin' board (like the IDP2 board), instead of 'hoglin'
>>>> Add the compatible strings 'google,piglin-rev{3,4}'. The hoglin entries
>>>> are kept to make sure the board keeps booting with older bootloader
>>>> versions.
>>>
>>> The older bootloaders really look for the google,hoglin-rev3/google,hoglin-rev4
>>> compatibles or just google,hoglin? If its just google,hoglin, won;t it pick the
>>> crd-rev5+ dtb now?
>>
>> They look for the -revN compatible, I confirmed that on my CRD 2.0.
>
> Thanks for confirming Matthias! I'll also note that, in general, these
> "google,board-revX" type compatible strings are all programmatically
> generated. You can see at:
>
> https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/heads/main/src/boot/fit.c#70
>
> ...and whenever it's using this normal logic then it has a standard
> fallback mechanism in place. On a random board in front of me
> depthcharge prints out:
>
> Compat preference: google,lazor-rev3-sku0 google,lazor-rev3
> google,lazor-sku0 google,lazor
>
> So it'll first try the very specific verison with rev and sku. Then
> just by rev. Then just by sku. ...and if none of those match it'll
> pick a device tree that has neither. The "newest" device tree always
> has no revision number specified and that way if software doesn't
> change but the revision bumps then we have no problem. We only add the
> revision info for old boards.

Thanks Matthias/Doug for the clarification,

Reviewed-by: Rajendra Nayak <[email protected]>

>
> There are a few cases where we add special compatible strings and
> these don't match on board/rev. This is fairly uncommon, though. You
> might be aware of the special case of adding "qcom,sc7180-idp"
> (without rev/sku matching) for "bubs". See:
>
> https://chromium.googlesource.com/chromiumos/platform/depthcharge/+/refs/heads/main/src/board/trogdor/board.c#136
>
>
> -Doug

2022-03-22 05:01:34

by Rajendra Nayak

[permalink] [raw]
Subject: Re: [PATCH v1 1/4] arm64: dts: qcom: sc7280: Rename crd to crd-r3


On 3/17/2022 5:58 AM, Matthias Kaehlcke wrote:
> There are multiple revisions of CRD boards. The current sc7280-crd.dts
> describes revision 3 and 4 (aka CRD 1.0 and 2.0). Support for a newer
> version will be added by another patch. Add the revision number to
> distinguish it from the versionn. Also add the revision numbers to
> the compatible string.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---
>

Reviewed-by: Rajendra Nayak <[email protected]>

2022-03-24 21:20:12

by Rajendra Nayak

[permalink] [raw]
Subject: Re: [PATCH v1 3/4] arm64: dts: qcom: sc7280: herobrine: disable some regulators by default



On 3/17/2022 5:58 AM, Matthias Kaehlcke wrote:
> Not all herobrine boards have a world facing camera or a fingerprint
> sensor, disable the regulators that feed these devices by default and
> only enable them for the boards that use them.
>
> Similarly the audio configuration can vary between boards, not all
> boards have the regulator pp3300_codec, disable it by default.
>
> Signed-off-by: Matthias Kaehlcke <[email protected]>
> ---

Reviewed-by: Rajendra Nayak <[email protected]>