BananaPi BPI-M4-Zero: Add fixed-clock bluetooth fixup

Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
This commit is contained in:
Patrick Yavitz
2025-06-29 20:38:04 -04:00
committed by Igor
parent 4db95c6122
commit 8677a9af21
4 changed files with 120 additions and 10 deletions

View File

@@ -237,10 +237,10 @@ index 000000000000..99c7e2b8c5f6
+};
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..307f6e5e921c
index 000000000000..7880fd1450b4
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-bananapi-m4-sdio-wifi-bt.dtso
@@ -0,0 +1,44 @@
@@ -0,0 +1,59 @@
+/dts-v1/;
+/plugin/;
+
@@ -256,8 +256,21 @@ index 000000000000..307f6e5e921c
+ };
+ };
+
+ /* SDIO WIFI */
+ /* FIXED CLOCK */
+ fragment@1 {
+ target-path = "/";
+ __overlay__ {
+ osc32k: osc32k-clk {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <32768>;
+ clock-output-names = "ext-osc32k";
+ };
+ };
+ };
+
+ /* SDIO WIFI */
+ fragment@2 {
+ target = <&mmc1>;
+ __overlay__ {
+ status = "okay";
@@ -265,7 +278,7 @@ index 000000000000..307f6e5e921c
+ };
+
+ /* BLUETOOTH */
+ fragment@2 {
+ fragment@3 {
+ target = <&uart1>;
+ __overlay__ {
+ status = "okay";
@@ -274,7 +287,9 @@ index 000000000000..307f6e5e921c
+ uart-has-rtscts;
+
+ bluetooth {
+ compatible = "brcm,bcm43540-bt";
+ compatible = "brcm,bcm43438-bt";
+ clocks = <&osc32k>;
+ clock-names = "lpo";
+ 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>;

View File

@@ -405,3 +405,43 @@ index 000000000000..e9640439e02c
--
2.35.3
From dbcb96e7024ee3c4994ac7aaa5da2cd5b5f300c2 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Sun, 29 Jun 2025 19:25:09 -0400
Subject: [PATCH] BananaPi BPI-M4-Zero: Add fixed clock
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
---
.../boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi
index e9640439e02c..15c7e1290146 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi
@@ -33,6 +33,13 @@ hdmi_con_in: endpoint {
};
};
+ osc32k: osc32k-clk {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <32768>;
+ clock-output-names = "ext-osc32k";
+ };
+
reg_usb_vbus: regulator-usb-vbus {
/* Separate discrete regulator for the USB ports */
compatible = "regulator-fixed";
@@ -71,7 +78,7 @@ reg_vcc1v8: regulator-vcc1v8 {
wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple";
- clocks = <&rtc CLK_OSC32K_FANOUT>;
+ clocks = <&osc32k>;
clock-names = "ext_clock";
pinctrl-0 = <&x32clk_fanout_pin>;
pinctrl-names = "default";
--
2.43.0

View File

@@ -237,10 +237,10 @@ index 000000000000..99c7e2b8c5f6
+};
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..307f6e5e921c
index 000000000000..7880fd1450b4
--- /dev/null
+++ b/arch/arm64/boot/dts/allwinner/overlay/sun50i-h616-bananapi-m4-sdio-wifi-bt.dtso
@@ -0,0 +1,44 @@
@@ -0,0 +1,59 @@
+/dts-v1/;
+/plugin/;
+
@@ -256,8 +256,21 @@ index 000000000000..307f6e5e921c
+ };
+ };
+
+ /* SDIO WIFI */
+ /* FIXED CLOCK */
+ fragment@1 {
+ target-path = "/";
+ __overlay__ {
+ osc32k: osc32k-clk {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <32768>;
+ clock-output-names = "ext-osc32k";
+ };
+ };
+ };
+
+ /* SDIO WIFI */
+ fragment@2 {
+ target = <&mmc1>;
+ __overlay__ {
+ status = "okay";
@@ -265,7 +278,7 @@ index 000000000000..307f6e5e921c
+ };
+
+ /* BLUETOOTH */
+ fragment@2 {
+ fragment@3 {
+ target = <&uart1>;
+ __overlay__ {
+ status = "okay";
@@ -274,7 +287,9 @@ index 000000000000..307f6e5e921c
+ uart-has-rtscts;
+
+ bluetooth {
+ compatible = "brcm,bcm43540-bt";
+ compatible = "brcm,bcm43438-bt";
+ clocks = <&osc32k>;
+ clock-names = "lpo";
+ 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>;

View File

@@ -405,3 +405,43 @@ index 000000000000..e9640439e02c
--
2.35.3
From dbcb96e7024ee3c4994ac7aaa5da2cd5b5f300c2 Mon Sep 17 00:00:00 2001
From: Patrick Yavitz <pyavitz@gmail.com>
Date: Sun, 29 Jun 2025 19:25:09 -0400
Subject: [PATCH] BananaPi BPI-M4-Zero: Add fixed clock
Signed-off-by: Patrick Yavitz <pyavitz@gmail.com>
---
.../boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi b/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi
index e9640439e02c..15c7e1290146 100644
--- a/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi
+++ b/arch/arm64/boot/dts/allwinner/sun50i-h618-bananapi-m4.dtsi
@@ -33,6 +33,13 @@ hdmi_con_in: endpoint {
};
};
+ osc32k: osc32k-clk {
+ #clock-cells = <0>;
+ compatible = "fixed-clock";
+ clock-frequency = <32768>;
+ clock-output-names = "ext-osc32k";
+ };
+
reg_usb_vbus: regulator-usb-vbus {
/* Separate discrete regulator for the USB ports */
compatible = "regulator-fixed";
@@ -71,7 +78,7 @@ reg_vcc1v8: regulator-vcc1v8 {
wifi_pwrseq: wifi-pwrseq {
compatible = "mmc-pwrseq-simple";
- clocks = <&rtc CLK_OSC32K_FANOUT>;
+ clocks = <&osc32k>;
clock-names = "ext_clock";
pinctrl-0 = <&x32clk_fanout_pin>;
pinctrl-names = "default";
--
2.43.0