devicetree.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3
@ 2023-09-01  7:27 Frank Wunderlich
  2023-09-11 19:51 ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Wunderlich @ 2023-09-01  7:27 UTC (permalink / raw)
  To: linux-mediatek
  Cc: Frank Wunderlich, Matthias Brugger, AngeloGioacchino Del Regno,
	Rob Herring, Krzysztof Kozlowski, Conor Dooley, linux-kernel,
	linux-arm-kernel, devicetree

From: Frank Wunderlich <frank-w@public-files.de>

Bananapi R3 has a Power socket entended for using external SATA drives.
This Socket is off by default but can be switched with gpio 8.

Add an overlay to activate it.

Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
---
 arch/arm64/boot/dts/mediatek/Makefile         |  1 +
 .../mt7986a-bananapi-bpi-r3-sata.dtso         | 39 +++++++++++++++++++
 2 files changed, 40 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso

diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
index c99c3372a4b5..822d3e36d3df 100644
--- a/arch/arm64/boot/dts/mediatek/Makefile
+++ b/arch/arm64/boot/dts/mediatek/Makefile
@@ -13,6 +13,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
new file mode 100644
index 000000000000..6ab06813412a
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
@@ -0,0 +1,39 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ * Author: Frank Wunderlich <frank-w@public-files.de>
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	compatible = "bananapi,bpi-r3", "mediatek,mt7986a";
+
+	fragment@0 {
+		target-path = "/";
+		__overlay__ {
+			reg_sata12v: regulator-sata12v {
+				compatible = "regulator-fixed";
+				regulator-name = "sata12v";
+				regulator-min-microvolt = <12000000>;
+				regulator-max-microvolt = <12000000>;
+				gpio = <&pio 8 GPIO_ACTIVE_HIGH>;
+				enable-active-high;
+				regulator-always-on;
+			};
+
+			reg_sata5v: regulator-sata5v {
+				compatible = "regulator-fixed";
+				regulator-name = "sata5v";
+				regulator-min-microvolt = <5000000>;
+				regulator-max-microvolt = <5000000>;
+				regulator-always-on;
+				vin-supply = <&reg_sata12v>;
+			};
+		};
+	};
+};
+
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3
  2023-09-01  7:27 [PATCH v1] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3 Frank Wunderlich
@ 2023-09-11 19:51 ` Rob Herring
  2023-09-11 20:10   ` Frank Wunderlich
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2023-09-11 19:51 UTC (permalink / raw)
  To: Frank Wunderlich
  Cc: linux-mediatek, Frank Wunderlich, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski, Conor Dooley,
	linux-kernel, linux-arm-kernel, devicetree

On Fri, Sep 1, 2023 at 2:27 AM Frank Wunderlich <linux@fw-web.de> wrote:
>
> From: Frank Wunderlich <frank-w@public-files.de>
>
> Bananapi R3 has a Power socket entended for using external SATA drives.
> This Socket is off by default but can be switched with gpio 8.
>
> Add an overlay to activate it.
>
> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> ---
>  arch/arm64/boot/dts/mediatek/Makefile         |  1 +
>  .../mt7986a-bananapi-bpi-r3-sata.dtso         | 39 +++++++++++++++++++
>  2 files changed, 40 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
>
> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> index c99c3372a4b5..822d3e36d3df 100644
> --- a/arch/arm64/boot/dts/mediatek/Makefile
> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> @@ -13,6 +13,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo
>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo
>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo
>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo

The requirement for overlays is they have a target base dt in tree and
that you apply the overlay to it. All these existing overlays have the
same problem which I pointed out when you submitted them. Please fix
the existing ones before adding more.


Rob

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3
  2023-09-11 19:51 ` Rob Herring
@ 2023-09-11 20:10   ` Frank Wunderlich
  2023-09-11 21:06     ` Rob Herring
  0 siblings, 1 reply; 5+ messages in thread
From: Frank Wunderlich @ 2023-09-11 20:10 UTC (permalink / raw)
  To: Rob Herring, Frank Wunderlich
  Cc: linux-mediatek, Matthias Brugger, AngeloGioacchino Del Regno,
	Krzysztof Kozlowski, Conor Dooley, linux-kernel, linux-arm-kernel,
	devicetree

Am 11. September 2023 21:51:42 MESZ schrieb Rob Herring <robh+dt@kernel.org>:
>On Fri, Sep 1, 2023 at 2:27 AM Frank Wunderlich <linux@fw-web.de> wrote:
>>
>> From: Frank Wunderlich <frank-w@public-files.de>
>>
>> Bananapi R3 has a Power socket entended for using external SATA drives.
>> This Socket is off by default but can be switched with gpio 8.
>>
>> Add an overlay to activate it.
>>
>> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
>> ---
>>  arch/arm64/boot/dts/mediatek/Makefile         |  1 +
>>  .../mt7986a-bananapi-bpi-r3-sata.dtso         | 39 +++++++++++++++++++
>>  2 files changed, 40 insertions(+)
>>  create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
>>
>> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
>> index c99c3372a4b5..822d3e36d3df 100644
>> --- a/arch/arm64/boot/dts/mediatek/Makefile
>> +++ b/arch/arm64/boot/dts/mediatek/Makefile
>> @@ -13,6 +13,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo
>>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo
>>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo
>>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo
>> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo
>
>The requirement for overlays is they have a target base dt in tree and
>that you apply the overlay to it. All these existing overlays have the
>same problem which I pointed out when you submitted them. Please fix
>the existing ones before adding more.
>
>
>Rob

Hi Rob,

i do not understand the problem as there is a target base dt...mt7986a-bananapi-bpi-r3.dtb.

Do you mean that overlays should be merged with basedt at compiletime?

We pack the base-dt and all overlays into one fit image and let uboot dynamically select the combination to apply. E.g. check if emmc is available, if yes apply emmc overlay else the sd one,same for nand/nor.

Else i do not know *how* to fix as i don't see it as broken.

regards Frank

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3
  2023-09-11 20:10   ` Frank Wunderlich
@ 2023-09-11 21:06     ` Rob Herring
  2023-09-12 16:03       ` Aw: " Frank Wunderlich
  0 siblings, 1 reply; 5+ messages in thread
From: Rob Herring @ 2023-09-11 21:06 UTC (permalink / raw)
  To: frank-w
  Cc: Frank Wunderlich, linux-mediatek, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski, Conor Dooley,
	linux-kernel, linux-arm-kernel, devicetree

On Mon, Sep 11, 2023 at 3:11 PM Frank Wunderlich
<frank-w@public-files.de> wrote:
>
> Am 11. September 2023 21:51:42 MESZ schrieb Rob Herring <robh+dt@kernel.org>:
> >On Fri, Sep 1, 2023 at 2:27 AM Frank Wunderlich <linux@fw-web.de> wrote:
> >>
> >> From: Frank Wunderlich <frank-w@public-files.de>
> >>
> >> Bananapi R3 has a Power socket entended for using external SATA drives.
> >> This Socket is off by default but can be switched with gpio 8.
> >>
> >> Add an overlay to activate it.
> >>
> >> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> >> ---
> >>  arch/arm64/boot/dts/mediatek/Makefile         |  1 +
> >>  .../mt7986a-bananapi-bpi-r3-sata.dtso         | 39 +++++++++++++++++++
> >>  2 files changed, 40 insertions(+)
> >>  create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
> >>
> >> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> >> index c99c3372a4b5..822d3e36d3df 100644
> >> --- a/arch/arm64/boot/dts/mediatek/Makefile
> >> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> >> @@ -13,6 +13,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo
> >>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo
> >>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo
> >>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo
> >> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo
> >
> >The requirement for overlays is they have a target base dt in tree and
> >that you apply the overlay to it. All these existing overlays have the
> >same problem which I pointed out when you submitted them. Please fix
> >the existing ones before adding more.
> >
> >
> >Rob
>
> Hi Rob,
>
> i do not understand the problem as there is a target base dt...mt7986a-bananapi-bpi-r3.dtb.
>
> Do you mean that overlays should be merged with basedt at compiletime?

Yes, because we want to know an overlay can actually apply to what's upstream.

> We pack the base-dt and all overlays into one fit image and let uboot dynamically select the combination to apply. E.g. check if emmc is available, if yes apply emmc overlay else the sd one,same for nand/nor.

That's irrelevant.

Though do you really want to wait until that point to find out you
made some mistake in your overlay that it doesn't apply when you could
find out much sooner?

> Else i do not know *how* to fix as i don't see it as broken.

You need what I pointed out last time[1].

Rob

[1] https://lore.kernel.org/all/CAL_JsqK_3xxD0DFwipXO85P=q=EYjUdjE1_8g1MKtvw3vVzx5A@mail.gmail.com/

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Aw: Re: [PATCH v1] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3
  2023-09-11 21:06     ` Rob Herring
@ 2023-09-12 16:03       ` Frank Wunderlich
  0 siblings, 0 replies; 5+ messages in thread
From: Frank Wunderlich @ 2023-09-12 16:03 UTC (permalink / raw)
  To: Rob Herring
  Cc: Frank Wunderlich, linux-mediatek, Matthias Brugger,
	AngeloGioacchino Del Regno, Krzysztof Kozlowski, Conor Dooley,
	linux-kernel, linux-arm-kernel, devicetree

Hi

> Gesendet: Montag, 11. September 2023 um 23:06 Uhr
> Von: "Rob Herring" <robh+dt@kernel.org>
> An: frank-w@public-files.de
> Cc: "Frank Wunderlich" <linux@fw-web.de>, linux-mediatek@lists.infradead.org, "Matthias Brugger" <matthias.bgg@gmail.com>, "AngeloGioacchino Del Regno" <angelogioacchino.delregno@collabora.com>, "Krzysztof Kozlowski" <krzysztof.kozlowski+dt@linaro.org>, "Conor Dooley" <conor+dt@kernel.org>, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org
> Betreff: Re: [PATCH v1] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3
>
> On Mon, Sep 11, 2023 at 3:11 PM Frank Wunderlich
> <frank-w@public-files.de> wrote:
> >
> > Am 11. September 2023 21:51:42 MESZ schrieb Rob Herring <robh+dt@kernel.org>:
> > >On Fri, Sep 1, 2023 at 2:27 AM Frank Wunderlich <linux@fw-web.de> wrote:
> > >>
> > >> From: Frank Wunderlich <frank-w@public-files.de>
> > >>
> > >> Bananapi R3 has a Power socket entended for using external SATA drives.
> > >> This Socket is off by default but can be switched with gpio 8.
> > >>
> > >> Add an overlay to activate it.
> > >>
> > >> Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
> > >> ---
> > >>  arch/arm64/boot/dts/mediatek/Makefile         |  1 +
> > >>  .../mt7986a-bananapi-bpi-r3-sata.dtso         | 39 +++++++++++++++++++
> > >>  2 files changed, 40 insertions(+)
> > >>  create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
> > >>
> > >> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> > >> index c99c3372a4b5..822d3e36d3df 100644
> > >> --- a/arch/arm64/boot/dts/mediatek/Makefile
> > >> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> > >> @@ -13,6 +13,7 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc.dtbo
> > >>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nand.dtbo
> > >>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo
> > >>  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo
> > >> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sata.dtbo
> > >
> > >The requirement for overlays is they have a target base dt in tree and
> > >that you apply the overlay to it. All these existing overlays have the
> > >same problem which I pointed out when you submitted them. Please fix
> > >the existing ones before adding more.
> > >
> > >
> > >Rob
> >
> > Hi Rob,
> >
> > i do not understand the problem as there is a target base dt...mt7986a-bananapi-bpi-r3.dtb.
> >
> > Do you mean that overlays should be merged with basedt at compiletime?
> 
> Yes, because we want to know an overlay can actually apply to what's upstream.

so you want this only as compile-time-check or to provide dtbs for users in all possible combinations?

for compiletime-check i would add only these 4 lines:

mt7986a-bananapi-bpi-r3-sd-nand-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-sd.dtbo mt7986a-bananapi-bpi-r3-nand.dtbo
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nand.dtb
mt7986a-bananapi-bpi-r3-emmc-nor-dtbs := mt7986a-bananapi-bpi-r3.dtb mt7986a-bananapi-bpi-r3-emmc.dtbo mt7986a-bananapi-bpi-r3-nor.dtbo
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc-nor.dtb

for all possible situations we need 8 lines as i wrote in the thread you've linked (sd-nand, sd-nor, emmc-nand, emmc-nor)
and this will double the lines in makefile with each additional overlay (e.g. the sata one here resulting in 16 lines total).

if the basic syntax is ok (maybe naming the dtbs differently?) and i know compiletest vs. all possibilities i can send patch
for correcting this.

> > We pack the base-dt and all overlays into one fit image and let uboot dynamically select the combination to apply. E.g. check if emmc is available, if yes apply emmc overlay else the sd one,same for nand/nor.
> 
> That's irrelevant.
> 
> Though do you really want to wait until that point to find out you
> made some mistake in your overlay that it doesn't apply when you could
> find out much sooner?
> 
> > Else i do not know *how* to fix as i don't see it as broken.
> 
> You need what I pointed out last time[1].
> 
> Rob
> 
> [1] https://lore.kernel.org/all/CAL_JsqK_3xxD0DFwipXO85P=q=EYjUdjE1_8g1MKtvw3vVzx5A@mail.gmail.com/
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-09-12 16:03 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-01  7:27 [PATCH v1] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3 Frank Wunderlich
2023-09-11 19:51 ` Rob Herring
2023-09-11 20:10   ` Frank Wunderlich
2023-09-11 21:06     ` Rob Herring
2023-09-12 16:03       ` Aw: " Frank Wunderlich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).