public inbox for linux-mediatek@lists.infradead.org
 help / color / mirror / Atom feed
From: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
To: Frank Wunderlich <linux@fw-web.de>, linux-mediatek@lists.infradead.org
Cc: Conor Dooley <conor+dt@kernel.org>,
	Daniel Golle <daniel@makrotopia.org>,
	linux-kernel@vger.kernel.org, Rob Herring <robh+dt@kernel.org>,
	Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
	Eric Woudstra <ericwouds@gmail.com>,
	Matthias Brugger <matthias.bgg@gmail.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH v2 5/5] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3
Date: Thu, 26 Oct 2023 10:03:08 +0200	[thread overview]
Message-ID: <831e792e-683b-4305-a451-16bb6736280a@collabora.com> (raw)
In-Reply-To: <20231025170832.78727-6-linux@fw-web.de>

Il 25/10/23 19:08, Frank Wunderlich ha scritto:
> 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>
> ---
> v2:
> - rebase on the patch "add dtbs with applied overlays for bpi-r3"
> - add sata-overlay to the full dtbs
> ---
>   arch/arm64/boot/dts/mediatek/Makefile         | 13 +++++--
>   .../mt7986a-bananapi-bpi-r3-sata.dtso         | 39 +++++++++++++++++++
>   2 files changed, 48 insertions(+), 4 deletions(-)
>   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 24eeba0703ce..c3b236a47513 100644
> --- a/arch/arm64/boot/dts/mediatek/Makefile
> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> @@ -13,26 +13,31 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3.dtb
>   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-sata.dtbo
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd.dtbo

The devicetree overlays make no sense without a base devicetree, right? :-)

dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-nor.dtbo <-- makes no sense!

Check how it's done in freescale (nxp) and renesas... and there's also one instance
of overlays in qualcomm.

In short:
  - Remove all of the dtb-$(CONFIG_ARCH_MEDIATEK) += blah.dtbo
  - xxxx-dtbs:= blah.dtb blah-overlay.dtbo, dtb-$(CONFIG_ARCH_MEDIATEK) += xxxx.dtb
    is correct.

>   mt7986a-bananapi-bpi-r3-emmc-nand-dtbs := \
>   	mt7986a-bananapi-bpi-r3.dtb \
>   	mt7986a-bananapi-bpi-r3-emmc.dtbo \
> -	mt7986a-bananapi-bpi-r3-nand.dtbo
> +	mt7986a-bananapi-bpi-r3-nand.dtbo \
> +	mt7986a-bananapi-bpi-r3-sata.dtbo
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc-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
> +	mt7986a-bananapi-bpi-r3-nor.dtbo \
> +	mt7986a-bananapi-bpi-r3-sata.dtbo
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-emmc-nor.dtb
>   mt7986a-bananapi-bpi-r3-sd-nand-dtbs := \
>   	mt7986a-bananapi-bpi-r3.dtb \
>   	mt7986a-bananapi-bpi-r3-sd.dtbo \
> -	mt7986a-bananapi-bpi-r3-nand.dtbo
> +	mt7986a-bananapi-bpi-r3-nand.dtbo \
> +	mt7986a-bananapi-bpi-r3-sata.dtbo
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nand.dtb
>   mt7986a-bananapi-bpi-r3-sd-nor-dtbs := \
>   	mt7986a-bananapi-bpi-r3.dtb \
>   	mt7986a-bananapi-bpi-r3-sd.dtbo \
> -	mt7986a-bananapi-bpi-r3-nor.dtbo
> +	mt7986a-bananapi-bpi-r3-nor.dtbo \
> +	mt7986a-bananapi-bpi-r3-sata.dtbo
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nor.dtb
>   
>   dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.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__ {

This could be easier, I think.

&{/} {

	reg_sata12v: regulator-sata12v {
		....
	};

	something_else: something-else { ... };
};

Regards,
Angelo

> +			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>;
> +			};
> +		};
> +	};
> +};
> +



  reply	other threads:[~2023-10-26  8:03 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-25 17:08 [PATCH v2 0/5] mt7986 DTS Patches Frank Wunderlich
2023-10-25 17:08 ` [PATCH v2 1/5] arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization Frank Wunderlich
2023-11-29 13:27   ` AngeloGioacchino Del Regno
2023-10-25 17:08 ` [PATCH v2 2/5] arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3 Frank Wunderlich
2023-11-29 13:27   ` AngeloGioacchino Del Regno
2023-10-25 17:08 ` [PATCH v2 3/5] arm64: dts: mt7986: change cooling trips Frank Wunderlich
2023-11-20 13:41   ` AngeloGioacchino Del Regno
2023-11-29 13:27   ` AngeloGioacchino Del Regno
2023-10-25 17:08 ` [PATCH v2 4/5] arm64: dts: mt7986: add dtbs with applied overlays for bpi-r3 Frank Wunderlich
2023-12-09 14:56   ` Aw: " Frank Wunderlich
2024-06-04 17:01     ` Frank Wunderlich
2023-10-25 17:08 ` [PATCH v2 5/5] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3 Frank Wunderlich
2023-10-26  8:03   ` AngeloGioacchino Del Regno [this message]
2023-10-26  9:01     ` Frank Wunderlich

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=831e792e-683b-4305-a451-16bb6736280a@collabora.com \
    --to=angelogioacchino.delregno@collabora.com \
    --cc=conor+dt@kernel.org \
    --cc=daniel@makrotopia.org \
    --cc=ericwouds@gmail.com \
    --cc=krzysztof.kozlowski+dt@linaro.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mediatek@lists.infradead.org \
    --cc=linux@fw-web.de \
    --cc=matthias.bgg@gmail.com \
    --cc=robh+dt@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox