2023-10-25 17:09:30

by Frank Wunderlich

[permalink] [raw]
Subject: [PATCH v2 0/5] mt7986 DTS Patches

From: Frank Wunderlich <[email protected]>

Hi,

i collected the open dts patches for mt7986 to make it easier for mtk
maintainer to pick them up.

so the following patches/series are superseeded:

- Fix emmc hs400 mode on mt7986
https://patchwork.kernel.org/project/linux-mediatek/list/?series=761293
- mt7986 DTS fixes (for thermal and sfp)
https://patchwork.kernel.org/project/linux-mediatek/list/?series=777712
- arm64: dts: mediatek: add dtbs with applied overlays for bpi-r3
https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/
- arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3
https://patchwork.kernel.org/project/linux-mediatek/patch/[email protected]/

updated the dtbs overlay patch to make it better readable based on
arm64/boot/dts/ti/Makefile and squashed 2 patches from the thermal-zone
series.

sidenote for angelo: after this series only the thermal driver patch is
open from the list i've sent to you if this goes through your tree.

regards Frank

Eric Woudstra (1):
arm64: dts: mt7986: fix emmc hs400 mode without uboot initialization

Frank Wunderlich (4):
arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3
arm64: dts: mt7986: change cooling trips
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 | 27 +++++++++++++
.../mt7986a-bananapi-bpi-r3-sata.dtso | 39 +++++++++++++++++++
.../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 12 +++---
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 24 ++++++++++--
4 files changed, 93 insertions(+), 9 deletions(-)
create mode 100644 arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3-sata.dtso

--
2.34.1


2023-10-25 17:09:31

by Frank Wunderlich

[permalink] [raw]
Subject: [PATCH v2 3/5] arm64: dts: mt7986: change cooling trips

From: Frank Wunderlich <[email protected]>

Add Critical and hot trips for emergency system shutdown and limiting
system load.

Change passive trip to active to make sure fan is activated on the
lowest trip.

Fixes: 1f5be05132f3 ("arm64: dts: mt7986: add thermal-zones")
Fixes: c26f779a2295 ("arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts")
Suggested-by: Daniel Golle <[email protected]>
Signed-off-by: Frank Wunderlich <[email protected]>
---
v2:
- squash patch for bpi-r3 as suggested by angelo
---
.../dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 10 +++++-----
arch/arm64/boot/dts/mediatek/mt7986a.dtsi | 20 +++++++++++++++----
2 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
index f9702284607a..b876e501216b 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
@@ -152,16 +152,16 @@ cpu-active-high {
trip = <&cpu_trip_active_high>;
};

- cpu-active-low {
+ cpu-active-med {
/* active: set fan to cooling level 1 */
cooling-device = <&fan 1 1>;
- trip = <&cpu_trip_active_low>;
+ trip = <&cpu_trip_active_med>;
};

- cpu-passive {
- /* passive: set fan to cooling level 0 */
+ cpu-active-low {
+ /* active: set fan to cooling level 0 */
cooling-device = <&fan 0 0>;
- trip = <&cpu_trip_passive>;
+ trip = <&cpu_trip_active_low>;
};
};
};
diff --git a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
index 77ddd9e44ed2..fc751e049953 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
+++ b/arch/arm64/boot/dts/mediatek/mt7986a.dtsi
@@ -614,22 +614,34 @@ cpu_thermal: cpu-thermal {
thermal-sensors = <&thermal 0>;

trips {
+ cpu_trip_crit: crit {
+ temperature = <125000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+
+ cpu_trip_hot: hot {
+ temperature = <120000>;
+ hysteresis = <2000>;
+ type = "hot";
+ };
+
cpu_trip_active_high: active-high {
temperature = <115000>;
hysteresis = <2000>;
type = "active";
};

- cpu_trip_active_low: active-low {
+ cpu_trip_active_med: active-med {
temperature = <85000>;
hysteresis = <2000>;
type = "active";
};

- cpu_trip_passive: passive {
- temperature = <40000>;
+ cpu_trip_active_low: active-low {
+ temperature = <60000>;
hysteresis = <2000>;
- type = "passive";
+ type = "active";
};
};
};
--
2.34.1

2023-10-25 17:09:34

by Frank Wunderlich

[permalink] [raw]
Subject: [PATCH v2 2/5] arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3

From: Frank Wunderlich <[email protected]>

All SFP power supplies are connected to the system VDD33 which is 3v3/8A.
Set 3A per SFP slot to allow SFPs work which need more power than the
default 1W.

Fixes: 8e01fb15b815 ("arm64: dts: mt7986: add Bananapi R3")
Signed-off-by: Frank Wunderlich <[email protected]>
Reviewed-by: AngeloGioacchino Del Regno <[email protected]>
---
arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts | 2 ++
1 file changed, 2 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
index af4a4309bda4..f9702284607a 100644
--- a/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
+++ b/arch/arm64/boot/dts/mediatek/mt7986a-bananapi-bpi-r3.dts
@@ -126,6 +126,7 @@ sfp1: sfp-1 {
compatible = "sff,sfp";
i2c-bus = <&i2c_sfp1>;
los-gpios = <&pio 46 GPIO_ACTIVE_HIGH>;
+ maximum-power-milliwatt = <3000>;
mod-def0-gpios = <&pio 49 GPIO_ACTIVE_LOW>;
tx-disable-gpios = <&pio 20 GPIO_ACTIVE_HIGH>;
tx-fault-gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
@@ -137,6 +138,7 @@ sfp2: sfp-2 {
i2c-bus = <&i2c_sfp2>;
los-gpios = <&pio 31 GPIO_ACTIVE_HIGH>;
mod-def0-gpios = <&pio 47 GPIO_ACTIVE_LOW>;
+ maximum-power-milliwatt = <3000>;
tx-disable-gpios = <&pio 15 GPIO_ACTIVE_HIGH>;
tx-fault-gpios = <&pio 48 GPIO_ACTIVE_HIGH>;
};
--
2.34.1

2023-10-25 17:09:48

by Frank Wunderlich

[permalink] [raw]
Subject: [PATCH v2 5/5] 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]>
---
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
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 <[email protected]>
+ */
+
+/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

2023-10-25 17:09:54

by Frank Wunderlich

[permalink] [raw]
Subject: [PATCH v2 4/5] arm64: dts: mt7986: add dtbs with applied overlays for bpi-r3

From: Frank Wunderlich <[email protected]>

Build devicetree binaries for testing overlays and providing users
full dtb without using overlays.

Suggested-by: Rob Herring <[email protected]>
Signed-off-by: Frank Wunderlich <[email protected]>
---
https://lore.kernel.org/all/CAL_JsqK_3xxD0DFwipXO85P=q=EYjUdjE1_8g1MKtvw3vVzx5A@mail.gmail.com/
https://lore.kernel.org/all/CAL_JsqJSi=kJSix=f3787ULZnaCy_Y26Phdhy5y9fat_vkDuUw@mail.gmail.com/

v2:
make full dtbs multiline for better readability
---
arch/arm64/boot/dts/mediatek/Makefile | 22 ++++++++++++++++++++++
1 file changed, 22 insertions(+)

diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
index c99c3372a4b5..24eeba0703ce 100644
--- a/arch/arm64/boot/dts/mediatek/Makefile
+++ b/arch/arm64/boot/dts/mediatek/Makefile
@@ -8,11 +8,33 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-evb.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb
+
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-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
+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
+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
+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
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nor.dtb
+
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
--
2.34.1

Subject: Re: [PATCH v2 5/5] arm64: dts: mt7986: add overlay for SATA power socket on BPI-R3

Il 25/10/23 19:08, Frank Wunderlich ha scritto:
> 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]>
> ---
> 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 <[email protected]>
> + */
> +
> +/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>;
> + };
> + };
> + };
> +};
> +

2023-10-26 09:02:28

by Frank Wunderlich

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

Hi Angelo

Bpi-r3 can boot with only 1 mmc device and 1 spi-device. Some users may not use the sata overlay. Using overlays in fit have the advantage to probe hardware in uboot and load the required overlays instead of loading a full dtb.

Am 26. Oktober 2023 10:03:08 MESZ schrieb AngeloGioacchino Del Regno <[email protected]>:
>Il 25/10/23 19:08, Frank Wunderlich ha scritto:
>> 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]>
>> ---
>> 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? :-)

The base-dtb is needed,but i prefer have 1 base-dt and overlays (in 1 fit image dynamically load in uboot) instead of 4+ full dtbs,but some people prefer using the full dtbs.

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

Depends on users preference :) full dtb is easier to load,but less flexible.

>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.

That will break my current way :( openwrt uses same.

>> 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 <[email protected]>
>> + */
>> +
>> +/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 { ... };
>};

Need to try this.

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


regards Frank

Subject: Re: [PATCH v2 3/5] arm64: dts: mt7986: change cooling trips


On Wed, 25 Oct 2023 19:08:30 +0200, Frank Wunderlich wrote:
> Add Critical and hot trips for emergency system shutdown and limiting
> system load.
>
> Change passive trip to active to make sure fan is activated on the
> lowest trip.
>
>
> [...]

Applied, thanks!

[3/5] arm64: dts: mt7986: change cooling trips
(no commit info)

Best regards,
--
AngeloGioacchino Del Regno <[email protected]>

Subject: Re: [PATCH v2 2/5] arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3


On Wed, 25 Oct 2023 19:08:29 +0200, Frank Wunderlich wrote:
> All SFP power supplies are connected to the system VDD33 which is 3v3/8A.
> Set 3A per SFP slot to allow SFPs work which need more power than the
> default 1W.
>
>

Applied, thanks!

[2/5] arm64: dts: mt7986: define 3W max power to both SFP on BPI-R3
(no commit info)

Best regards,
--
AngeloGioacchino Del Regno <[email protected]>

Subject: Re: [PATCH v2 3/5] arm64: dts: mt7986: change cooling trips

Il 25/10/23 19:08, Frank Wunderlich ha scritto:
> From: Frank Wunderlich <[email protected]>
>
> Add Critical and hot trips for emergency system shutdown and limiting
> system load.
>
> Change passive trip to active to make sure fan is activated on the
> lowest trip.
>
> Fixes: 1f5be05132f3 ("arm64: dts: mt7986: add thermal-zones")
> Fixes: c26f779a2295 ("arm64: dts: mt7986: add pwm-fan and cooling-maps to BPI-R3 dts")
> Suggested-by: Daniel Golle <[email protected]>
> Signed-off-by: Frank Wunderlich <[email protected]>

Reviewed-by: AngeloGioacchino Del Regno <[email protected]>


2023-12-09 15:07:32

by Frank Wunderlich

[permalink] [raw]
Subject: Aw: [PATCH v2 4/5] arm64: dts: mt7986: add dtbs with applied overlays for bpi-r3

Hi

Parts 1-3 are applied here, but how to proceed with this? to add further devicetrees like
for mt7988 we have to fix the "broken" dt-overlays first.

i want to keep to build the dtbo to allow dynamic apply in bootloader, but they should be checked in
compiletime too and full dtb should be created for users not wanting to handle overlays.

regards Frank


> Gesendet: Mittwoch, 25. Oktober 2023 um 18:08 Uhr
> Von: "Frank Wunderlich" <[email protected]>

> Build devicetree binaries for testing overlays and providing users
> full dtb without using overlays.
>
> Suggested-by: Rob Herring <[email protected]>
> Signed-off-by: Frank Wunderlich <[email protected]>
> ---
> https://lore.kernel.org/all/CAL_JsqK_3xxD0DFwipXO85P=q=EYjUdjE1_8g1MKtvw3vVzx5A@mail.gmail.com/
> https://lore.kernel.org/all/CAL_JsqJSi=kJSix=f3787ULZnaCy_Y26Phdhy5y9fat_vkDuUw@mail.gmail.com/
>
> v2:
> make full dtbs multiline for better readability
> ---
> arch/arm64/boot/dts/mediatek/Makefile | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> index c99c3372a4b5..24eeba0703ce 100644
> --- a/arch/arm64/boot/dts/mediatek/Makefile
> +++ b/arch/arm64/boot/dts/mediatek/Makefile
> @@ -8,11 +8,33 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-evb.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb
> +
> 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-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
> +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
> +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
> +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
> +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nor.dtb
> +
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
> dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb

2024-06-04 17:01:52

by Frank Wunderlich

[permalink] [raw]
Subject: Aw: [PATCH v2 4/5] arm64: dts: mt7986: add dtbs with applied overlays for bpi-r3

Hi,

how to proceed here?

regards Frank


> Gesendet: Samstag, 09. Dezember 2023 um 16:56 Uhr
> Von: "Frank Wunderlich" <[email protected]>
> An: "Frank Wunderlich" <[email protected]>
> Cc: [email protected], "Matthias Brugger" <[email protected]>, "AngeloGioacchino Del Regno" <[email protected]>, "Rob Herring" <[email protected]>, "Krzysztof Kozlowski" <[email protected]>, "Conor Dooley" <[email protected]>, "Daniel Golle" <[email protected]>, [email protected], [email protected], "Eric Woudstra" <[email protected]>
> Betreff: Aw: [PATCH v2 4/5] arm64: dts: mt7986: add dtbs with applied overlays for bpi-r3
>
> Hi
>
> Parts 1-3 are applied here, but how to proceed with this? to add further devicetrees like
> for mt7988 we have to fix the "broken" dt-overlays first.
>
> i want to keep to build the dtbo to allow dynamic apply in bootloader, but they should be checked in
> compiletime too and full dtb should be created for users not wanting to handle overlays.
>
> regards Frank
>
>
> > Gesendet: Mittwoch, 25. Oktober 2023 um 18:08 Uhr
> > Von: "Frank Wunderlich" <[email protected]>
>
> > Build devicetree binaries for testing overlays and providing users
> > full dtb without using overlays.
> >
> > Suggested-by: Rob Herring <[email protected]>
> > Signed-off-by: Frank Wunderlich <[email protected]>
> > ---
> > https://lore.kernel.org/all/CAL_JsqK_3xxD0DFwipXO85P=q=EYjUdjE1_8g1MKtvw3vVzx5A@mail.gmail.com/
> > https://lore.kernel.org/all/CAL_JsqJSi=kJSix=f3787ULZnaCy_Y26Phdhy5y9fat_vkDuUw@mail.gmail.com/
> >
> > v2:
> > make full dtbs multiline for better readability
> > ---
> > arch/arm64/boot/dts/mediatek/Makefile | 22 ++++++++++++++++++++++
> > 1 file changed, 22 insertions(+)
> >
> > diff --git a/arch/arm64/boot/dts/mediatek/Makefile b/arch/arm64/boot/dts/mediatek/Makefile
> > index c99c3372a4b5..24eeba0703ce 100644
> > --- a/arch/arm64/boot/dts/mediatek/Makefile
> > +++ b/arch/arm64/boot/dts/mediatek/Makefile
> > @@ -8,11 +8,33 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-evb.dtb
> > dtb-$(CONFIG_ARCH_MEDIATEK) += mt6797-x20-dev.dtb
> > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-rfb1.dtb
> > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7622-bananapi-bpi-r64.dtb
> > +
> > 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-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
> > +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
> > +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
> > +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
> > +dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-bananapi-bpi-r3-sd-nor.dtb
> > +
> > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986a-rfb.dtb
> > dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
> > dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
>
>
>