2024-06-08 08:12:12

by Frank Wunderlich

[permalink] [raw]
Subject: [PATCH v3 0/2] rework bpi-r3 dts overlays and add SATA dtso

From: Frank Wunderlich <[email protected]>

This Series adds check for bpi-r3 dts overlays on buildtime
required by rob herring [1] and adds SATA overlay

Last version seems to get lost so posting v3 with updated sata
overlay syntax (removing the fragment).

[1] https://lore.kernel.org/all/CAL_Jsq+f9bq5Mab9m1pzDeiw304TMeNDmJk+ofG6M8J9QD3cvQ@mail.gmail.com/

Frank Wunderlich (2):
arm64: dts: mt7986: add dtbs with applied overlays for bpi-r3
arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3

arch/arm64/boot/dts/mediatek/Makefile | 26 ++++++++++++++
.../mt7986a-bananapi-bpi-r3-sata.dtso | 35 +++++++++++++++++++
2 files changed, 61 insertions(+)
create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso

--
2.34.1



2024-06-08 08:12:31

by Frank Wunderlich

[permalink] [raw]
Subject: [PATCH v3 2/2] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3

From: Frank Wunderlich <[email protected]>

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 <[email protected]>
---
v3:
- make sata overlay better readable
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 | 35 +++++++++++++++++++
2 files changed, 44 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 0ec5b904d35d..ac0af5ffe97d 100644
--- a/arch/arm64/boot/dts/mediatek/Makefile
+++ b/arch/arm64/boot/dts/mediatek/Makefile
@@ -14,26 +14,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
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..17659545470e
--- /dev/null
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso
@@ -0,0 +1,35 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+&{/} {
+ compatible = "bananapi,bpi-r3", "mediatek,mt7986a";
+
+ 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