Skip to content

Commit

Permalink
BananaPi BPI-M4-Zero: partial DTS re-write
Browse files Browse the repository at this point in the history
linux-6.11.y

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
  • Loading branch information
pyavitz committed Oct 9, 2024
1 parent 136e85a commit 99ac4a6
Show file tree
Hide file tree
Showing 2 changed files with 75 additions and 63 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
From ab89eadbd909022e7be9052e5765d1309f64984b Mon Sep 17 00:00:00 2001
From 57f3aa16ec2a46967b56f7849eaf7f34c09fe5b8 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@armbian.com>
Date: Thu, 3 Oct 2024 12:59:06 -0400
Subject: Add BPI-M4-ZERO sdio wifi bt overlay
Date: Wed, 9 Oct 2024 08:05:54 -0400
Subject: [PATCH] Add BPI-M4-ZERO sdio wifi bt overlay

sun50i-h616-bananapi-m4-sdio-wifi-bt.dtso

Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
---
.../arm64/boot/dts/allwinner/overlay/Makefile | 3 +-
.../sun50i-h616-bananapi-m4-sdio-wifi-bt.dtso | 45 +++++++++++++++++++
2 files changed, 47 insertions(+), 1 deletion(-)
.../sun50i-h616-bananapi-m4-sdio-wifi-bt.dtso | 29 +++++++++++++++++++
2 files changed, 31 insertions(+), 1 deletion(-)
create mode 100644 arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-bananapi-m4-sdio-wifi-bt.dtso

diff --git a/arch/arm64/boot/dts/allwinner/overlay/Makefile b/arch/arm64/boot/dts/allwinner/overlay/Makefile
index 24383cb63770..3d3f715c15d4 100644
index 76a4952e3ecc..b10db212cdf2 100644
--- a/arch/arm64/boot/dts/allwinner/overlay/Makefile
+++ b/arch/arm64/boot/dts/allwinner/overlay/Makefile
@@ -67,7 +67,8 @@ dtb-$(CONFIG_ARCH_SUNXI) += \
@@ -66,7 +66,8 @@ dtb-$(CONFIG_ARCH_SUNXI) += \
sun50i-h616-i2c0-pi.dtbo \
sun50i-h616-i2c1-pi.dtbo \
sun50i-h616-i2c2-pi.dtbo \
Expand All @@ -28,21 +28,13 @@ index 24383cb63770..3d3f715c15d4 100644
sun50i-a64-fixup.scr \
diff --git a/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-bananapi-m4-sdio-wifi-bt.dtso b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-bananapi-m4-sdio-wifi-bt.dtso
new file mode 100644
index 000000000000..f52d445dfc4f
index 000000000000..b672807fab66
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-bananapi-m4-sdio-wifi-bt.dtso
@@ -0,0 +1,45 @@
@@ -0,0 +1,29 @@
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/clock/sun50i-h616-ccu.h>
+#include <dt-bindings/clock/sun50i-h6-r-ccu.h>
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/clock/sun6i-rtc.h>
+#include <dt-bindings/reset/sun50i-h616-ccu.h>
+#include <dt-bindings/reset/sun50i-h6-r-ccu.h>
+
+/ {
+ compatible = "sinovoip,bpi-m4-zero", "allwinner,sun50i-h616", "allwinner,sun50i-h618";
+
Expand All @@ -65,18 +57,10 @@ index 000000000000..f52d445dfc4f
+ fragment@2 {
+ target = <&uart1>;
+ __overlay__ {
+ bluetooth {
+ compatible = "brcm,bcm43438-bt";
+ host-wakeup-gpios = <&pio 6 16 GPIO_ACTIVE_HIGH>;
+ device-wakeup-gpios = <&pio 6 17 GPIO_ACTIVE_HIGH>;
+ shutdown-gpios = <&pio 6 19 GPIO_ACTIVE_HIGH>;
+ max-speed = <1500000>;
+ vbat-supply = <&reg_dldo1>;
+ vddio-supply = <&reg_aldo1>;
+ };
+ status = "okay";
+ };
+ };
+};
--
2.35.3
2.39.5

Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
From 35466d40a5d04ad03ef7a5d5abf1512e5e1df1bd Mon Sep 17 00:00:00 2001
From 946c4756a270d64c9a128e629ff7c4789a5ff8c4 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@armbian.com>
Date: Thu, 3 Oct 2024 12:46:14 -0400
Subject: Add board BananaPi BPI-M4-ZERO
Date: Mon, 7 Oct 2024 08:37:08 -0400
Subject: [PATCH] Add board BananaPi BPI-M4-ZERO

sun50i-h618-bananapi-m4-zero.dts
sun50i-h618-bananapi-m4.dtsi
Expand All @@ -10,16 +10,16 @@ Signed-off-by: Patrick Yavitz <pyavitz@armbian.com>
---
arch/arm64/boot/dts/allwinner/Makefile | 1 +
.../sun50i-h618-bananapi-m4-zero.dts | 73 +++++
.../allwinner/sun50i-h618-bananapi-m4.dtsi | 252 ++++++++++++++++++
3 files changed, 326 insertions(+)
.../allwinner/sun50i-h618-bananapi-m4.dtsi | 280 ++++++++++++++++++
3 files changed, 354 insertions(+)
create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4-zero.dts
create mode 100644 arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi

diff --git a/arch/arm64/boot/dts/allwinner/Makefile b/arch/arm64/boot/dts/allwinner/Makefile
index a2ca84f2e3fe..0df5a842ce1f 100644
index 717ef4a7ca1c..c2922d51cee2 100644
--- a/arch/arm64/boot/dts/allwinner/Makefile
+++ b/arch/arm64/boot/dts/allwinner/Makefile
@@ -56,6 +56,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-cb1-emmc.dtb
@@ -58,6 +58,7 @@ dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-cb1-emmc.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-bigtreetech-pi.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-orangepi-zero2.dtb
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h616-x96-mate.dtb
Expand All @@ -29,7 +29,7 @@ index a2ca84f2e3fe..0df5a842ce1f 100644
dtb-$(CONFIG_ARCH_SUNXI) += sun50i-h618-orangepi-zero3.dtb
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4-zero.dts b/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4-zero.dts
new file mode 100644
index 000000000000..d7c6e0fdf2ff
index 000000000000..61829ab55218
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4-zero.dts
@@ -0,0 +1,73 @@
Expand Down Expand Up @@ -108,10 +108,10 @@ index 000000000000..d7c6e0fdf2ff
+};
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi
new file mode 100644
index 000000000000..9a975de996c6
index 000000000000..32fa9588efda
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi
@@ -0,0 +1,252 @@
@@ -0,0 +1,280 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright (c) 2024 Patrick Yavitz <pyavitz@armbian.com>
Expand Down Expand Up @@ -147,16 +147,6 @@ index 000000000000..9a975de996c6
+ };
+ };
+
+ gpio-keys {
+ compatible = "gpio-keys";
+
+ key-sw3 {
+ label = "sw3";
+ linux,code = <BTN_0>;
+ gpios = <&pio 2 7 GPIO_ACTIVE_LOW>; /* PC7 */
+ };
+ };
+
+ leds {
+ compatible = "gpio-leds";
+
Expand All @@ -171,19 +161,37 @@ index 000000000000..9a975de996c6
+ reg_usb_vbus: regulator-usb-vbus {
+ /* Separate discrete regulator for the USB ports */
+ compatible = "regulator-fixed";
+ regulator-name = "usb-vbus";
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-name = "usb-vbus";
+ vin-supply = <&reg_vcc5v>;
+ };
+
+ reg_vcc5v: regulator-vcc5v {
+ /* Board wide 5V supply directly from the USB-C socket */
+ compatible = "regulator-fixed";
+ regulator-name = "vcc-5v";
+ regulator-always-on;
+ regulator-min-microvolt = <5000000>;
+ regulator-max-microvolt = <5000000>;
+ regulator-name = "vcc-5v";
+ };
+
+ reg_vcc3v3: regulator-vcc3v3 {
+ compatible = "regulator-fixed";
+ regulator-always-on;
+ regulator-min-microvolt = <3300000>;
+ regulator-max-microvolt = <3300000>;
+ regulator-name = "vcc-3v3";
+ vin-supply = <&reg_vcc5v>;
+ };
+
+ reg_vcc1v8: regulator-vcc1v8 {
+ compatible = "regulator-fixed";
+ regulator-always-on;
+ regulator-min-microvolt = <1800000>;
+ regulator-max-microvolt = <1800000>;
+ regulator-name = "vcc-1v8";
+ vin-supply = <&reg_vcc3v3>;
+ };
+
+ wifi_pwrseq: wifi-pwrseq {
Expand Down Expand Up @@ -240,38 +248,48 @@ index 000000000000..9a975de996c6
+
+&mmc0 {
+ status = "okay";
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
+ disable-wp;
+ bus-width = <4>;
+ max-frequency = <50000000>;
+ vmmc-supply = <&reg_dldo1>;
+
+ disable-wp;
+
+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */
+ vmmc-supply = <&reg_vcc3v3>;
+};
+
+&mmc1 {
+ status = "disabled";
+ bus-width = <4>;
+ max-frequency = <100000000>;
+
+ non-removable;
+ disable-wp;
+
+ /* WiFi firmware requires power to be kept while in suspend */
+ keep-power-in-suspend;
+
+ mmc-pwrseq = <&wifi_pwrseq>;
+ vmmc-supply = <&reg_dldo1>;
+ vqmmc-supply = <&reg_aldo1>;
+
+ sdio_wifi: wifi@1 {
+ cd-gpios = <&pio 6 15 GPIO_ACTIVE_HIGH>; /* PG15 */
+ vmmc-supply = <&reg_vcc3v3>;
+
+ sdio: wifi@1 {
+ reg = <1>;
+ compatible = "brcm,bcm4329-fmac";
+ interrupt-parent = <&pio>;
+ interrupts = <6 15 IRQ_TYPE_LEVEL_LOW>; /* PG15 */
+ interrupt-names = "host-wake";
+ };
+};
+
+&mmc2 {
+ status = "okay";
+ bus-width = <8>;
+ non-removable;
+ cap-mmc-hw-reset;
+ mmc-hs200-1_8v;
+ vmmc-supply = <&reg_dldo1>;
+ vqmmc-supply = <&reg_aldo1>;
+
+ non-removable;
+ disable-wp;
+
+ vmmc-supply = <&reg_vcc3v3>;
+ vqmmc-supply = <&reg_vcc1v8>;
+};
+
+&pio {
Expand Down Expand Up @@ -353,10 +371,20 @@ index 000000000000..9a975de996c6
+};
+
+&uart1 {
+ status = "okay";
+ status = "disabled";
+ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>;
+ pinctrl-names = "default";
+ uart-has-rtscts;
+
+ bluetooth {
+ compatible = "brcm,bcm43540-bt";
+ host-wakeup-gpios = <&pio 6 16 GPIO_ACTIVE_HIGH>;
+ device-wakeup-gpios = <&pio 6 17 GPIO_ACTIVE_HIGH>;
+ shutdown-gpios = <&pio 6 19 GPIO_ACTIVE_HIGH>;
+ max-speed = <1500000>;
+ vbat-supply = <&reg_vcc3v3>;
+ vddio-supply = <&reg_vcc3v3>;
+ };
+};
+
+&uart5 {
Expand All @@ -365,5 +393,5 @@ index 000000000000..9a975de996c6
+ pinctrl-names = "default";
+};
--
2.35.3
2.39.5

0 comments on commit 99ac4a6

Please sign in to comment.