Skip to contentSkip to conversation

Add Bananapi R4 Pro support

PATCH Applied Frank Wunderlich 5 participants 18 messages Oct 27, 2025 – Nov 10, 2025

Subsystems (4)

v1 of 2 Applied Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add Bananapi R4 Pro support

From: Frank Wunderlich <[email protected]>

BananaPi R4 Pro is a MT7988A based board which exists in 2 different hardware versions:

- 4E: 4 GB RAM and using internal 2.5G Phy for WAN-Combo
- 8X: 8 GB RAM and 2x Aeonsemi AS21010P 10G phys

common parts:

- MediaTek MT7988A Quad-core Arm Corex-A73,1.8GHz processor
- 8GB eMMC flash
- 256MB SPI-NAND Flash
- Micro SD card slot
- 1x 10G SFP+ WAN
- 1x 10G SFP+ LAN
- 4x 2.5G RJ45 LAN (MxL86252C)
- 1x 1G RJ45 LAN (MT7988 internal switch)
- 2x miniPCIe slots with PCIe3.0 2lane interface for Wi-Fi NIC
- 2x M.2 M-KEY slots with PCIe3.0 1lane interface for NVME SSD
- 3x M.2 B-KEY slots with USB3.2 for 5G Module (PCIe shared with key-m)
- 1x USB3.2 slot
- 1x USB2.0 slot
- 1x USB TypeC Debug Console
- 2x13 PIN Header for expanding application

official product information:
https://docs.banana-pi.org/en/BPI-R4_Pro/BananaPi_BPI-R4_Pro

The PCIe is per default in key-m state and can be changed to key-b with the pcie-overlays.

Frank Wunderlich (6):
dt-bindings: pinctrl: mt7988: allow gpio-hogs
dt-bindings: arm: mediatek: add BPI-R4 Pro board
arm64: dts: mediatek: mt7988a: Add label for ssusb0
arm64: dts: mt7988: Add devicetree for BananaPi R4 Pro
arm64: dts: mediatek: mt7988a-bpi-r4-pro: add PCIe overlays
arm64: dts: mediatek: mt7988a-bpi-r4pro: Add mmc overlays

 .../devicetree/bindings/arm/mediatek.yaml     |   6 +
 .../pinctrl/mediatek,mt7988-pinctrl.yaml      |   5 +
 arch/arm64/boot/dts/mediatek/Makefile         |   8 +
 .../mt7988a-bananapi-bpi-r4-pro-4e.dts        |  16 +
 .../mt7988a-bananapi-bpi-r4-pro-8x.dts        |  16 +
 .../mt7988a-bananapi-bpi-r4-pro-cn15.dtso     |  20 +
 .../mt7988a-bananapi-bpi-r4-pro-cn18.dtso     |  20 +
 .../mt7988a-bananapi-bpi-r4-pro-emmc.dtso     |  33 ++
 .../mt7988a-bananapi-bpi-r4-pro-sd.dtso       |  31 +
 .../mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi | 559 ++++++++++++++++++
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi     |   2 +-
 11 files changed, 715 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-4e.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-8x.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn15.dtso
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn18.dtso
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-emmc.dtso
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-sd.dtso
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi
Signature · 1 line
2.43.0
#1 lore raw

PATCH 1/6 dt-bindings: pinctrl: mt7988: allow gpio-hogs

From: Frank Wunderlich <[email protected]>

Allow gpio-hogs in pinctrl node for switching pcie on Bananapi R4 Pro.

---
 .../devicetree/bindings/pinctrl/mediatek,mt7988-pinctrl.yaml | 5 +++++
 1 file changed, 5 insertions(+)
Documentation/devicetree/bindings/pinctrl/mediatek,mt7988-pinctrl.yaml +5 -0
index 26dfe7e7735a..1f31b520cb43 100644
@@ -61,6 +61,11 @@ required:
   - "#gpio-cells"
 
 patternProperties:
+  "-hog(-[0-9]+)?$":
+    type: object
+    required:
+      - gpio-hog
+
   '-pins$':
     type: object
     additionalProperties: false
Signature · 1 line
2.43.0
Reviewed-by on v1 1/6
#2 lore raw

Re: [PATCH v1 1/6] dt-bindings: pinctrl: mt7988: allow gpio-hogs

Quoted 9 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Allow gpio-hogs in pinctrl node for switching pcie on Bananapi R4 Pro.

---
 .../devicetree/bindings/pinctrl/mediatek,mt7988-pinctrl.yaml | 5 +++++
 1 file changed, 5 insertions(+)

Best regards,
Krzysztof

#5 lore raw

PATCH 2/6 dt-bindings: arm: mediatek: add BPI-R4 Pro board

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add compatibles for Bananapi R4 Pro boards.

---
 Documentation/devicetree/bindings/arm/mediatek.yaml | 6 ++++++
 1 file changed, 6 insertions(+)
Documentation/devicetree/bindings/arm/mediatek.yaml +6 -0
index f04277873694..d09732ec8c89 100644
@@ -113,6 +113,12 @@ properties:
           - const: bananapi,bpi-r4-2g5
           - const: bananapi,bpi-r4
           - const: mediatek,mt7988a
+      - items:
+          - enum:
+              - bananapi,bpi-r4-pro-4e
+              - bananapi,bpi-r4-pro-8x
+          - const: bananapi,bpi-r4-pro
+          - const: mediatek,mt7988a
       - items:
           - enum:
               - mediatek,mt8127-moose
Signature · 1 line
2.43.0
#7 lore raw

PATCH 3/6 arm64: dts: mediatek: mt7988a: Add label for ssusb0

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add label for ssusb0 node which is used for BPI-R4-Pro.

---
 arch/arm64/boot/dts/mediatek/mt7988a.dtsi | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/mediatek/mt7988a.dtsi +1 -1
index 366203a72d6d..623fb450f898 100644
@@ -418,7 +418,7 @@ lvts: lvts@1100a000 {
 			nvmem-cell-names = "lvts-calib-data-1";
 		};
 
-		usb@11190000 {
+		ssusb0: usb@11190000 {
 			compatible = "mediatek,mt7988-xhci", "mediatek,mtk-xhci";
 			reg = <0 0x11190000 0 0x2e00>,
 			      <0 0x11193e00 0 0x0100>;
Signature · 1 line
2.43.0
#8 lore raw

Re: [PATCH v1 3/6] arm64: dts: mediatek: mt7988a: Add label for ssusb0

Quoted 3 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add label for ssusb0 node which is used for BPI-R4-Pro.

This makes no sense on its own. We do not add labels because they have 0 impact.

Please drop or squash.

Best regards,
Krzysztof

#9 lore raw

Re: [PATCH v1 3/6] arm64: dts: mediatek: mt7988a: Add label for ssusb0

Am 27. Oktober 2025 19:58:23 MEZ schrieb Krzysztof Kozlowski <[email protected]>:

Quoted 9 lines · Frank Wunderlich
Quoted 3 lines

From: Frank Wunderlich <[email protected]>

Add label for ssusb0 node which is used for BPI-R4-Pro.

This makes no sense on its own. We do not add labels because they have 0 impact.

Please drop or squash.

Thank you for the review.

I reference this label in part 4 and tried to separate changes in soc dtsi and board layer.
But of course i can squash this to part 4.

Quoted 2 lines

Best regards,
Krzysztof

regards Frank

#10 lore raw

Re: [PATCH v1 3/6] arm64: dts: mediatek: mt7988a: Add label for ssusb0

Il 27/10/25 20:04, Frank Wunderlich ha scritto:

Quoted 17 lines

Am 27. Oktober 2025 19:58:23 MEZ schrieb Krzysztof Kozlowski <[email protected]>:

Quoted 9 lines · Frank Wunderlich
Quoted 3 lines

From: Frank Wunderlich <[email protected]>

Add label for ssusb0 node which is used for BPI-R4-Pro.

This makes no sense on its own. We do not add labels because they have 0 impact.

Please drop or squash.

Thank you for the review.

I reference this label in part 4 and tried to separate changes in soc dtsi and board layer.
But of course i can squash this to part 4.

Quoted 5 lines
Quoted 2 lines

Best regards,
Krzysztof

regards Frank

Yes, please squash this to the patch where you actually use the label.

Cheers,
Angelo

#11 lore raw

PATCH 4/6 arm64: dts: mt7988: Add devicetree for BananaPi R4 Pro

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add devicetree for Bpi-R4-Pro.

BananaPi R4 Pro is a MT7988A based board which exists in 2 different hardware versions:

- 4E: 4 GB RAM and using internal 2.5G Phy for WAN-Combo
- 8X: 8 GB RAM and 2x Aeonsemi AS21010P 10G phys

common parts:

- MediaTek MT7988A Quad-core Arm Corex-A73,1.8GHz processor
- 8GB eMMC flash
- 256MB SPI-NAND Flash
- Micro SD card slot
- 1x 10G SFP+ WAN
- 1x 10G SFP+ LAN
- 4x 2.5G RJ45 LAN (MxL86252C)
- 1x 1G RJ45 LAN (MT7988 internal switch)
- 2x miniPCIe slots with PCIe3.0 2lane interface for Wi-Fi NIC
- 2x M.2 M-KEY slots with PCIe3.0 1lane interface for NVME SSD
- 3x M.2 B-KEY slots with USB3.2 for 5G Module (PCIe shared with key-m)
- 1x USB3.2 slot
- 1x USB2.0 slot
- 1x USB TypeC Debug Console
- 2x13 PIN Header for expanding application

https://docs.banana-pi.org/en/BPI-R4_Pro/BananaPi_BPI-R4_Pro

The PCIe is per default in key-m state and can be changed to key-b with the pcie-overlays.

---
 arch/arm64/boot/dts/mediatek/Makefile         |   4 +
 .../mt7988a-bananapi-bpi-r4-pro-4e.dts        |  16 +
 .../mt7988a-bananapi-bpi-r4-pro-8x.dts        |  16 +
 .../mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi | 559 ++++++++++++++++++
 4 files changed, 595 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-4e.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-8x.dts
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi
arch/arm64/boot/dts/mediatek/Makefile +4 -0
index a4df4c21399e..8640e5f32d4b 100644
@@ -24,6 +24,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-4e.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-8x.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb
@@ -111,4 +113,6 @@ DTC_FLAGS_mt7986a-bananapi-bpi-r3 := -@
 DTC_FLAGS_mt7986a-bananapi-bpi-r3-mini := -@
 DTC_FLAGS_mt7988a-bananapi-bpi-r4 := -@
 DTC_FLAGS_mt7988a-bananapi-bpi-r4-2g5 := -@
+DTC_FLAGS_mt7988a-bananapi-bpi-r4-pro-4e := -@
+DTC_FLAGS_mt7988a-bananapi-bpi-r4-pro-8x := -@
 DTC_FLAGS_mt8395-radxa-nio-12l := -@
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-4e.dts new file +16 -0
new file mode 100644
index 000000000000..c7ea6e88c4f4
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "mt7988a-bananapi-bpi-r4-pro.dtsi"
+
+/ {
+	model = "Bananapi BPI-R4";
+	compatible = "bananapi,bpi-r4-pro-4e",
+		     "bananapi,bpi-r4-pro",
+		     "mediatek,mt7988a";
+};
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-8x.dts new file +16 -0
new file mode 100644
index 000000000000..c9a0e69e9dd5
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "mt7988a-bananapi-bpi-r4-pro.dtsi"
+
+/ {
+	model = "Bananapi BPI-R4";
+	compatible = "bananapi,bpi-r4-pro-8x",
+		     "bananapi,bpi-r4-pro",
+		     "mediatek,mt7988a";
+};
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +559 -0

559 lines not on this page · raw message

Signature · 1 line
2.43.0
#12 lore raw

Re: [PATCH v1 4/6] arm64: dts: mt7988: Add devicetree for BananaPi R4 Pro

Quoted 7 lines · Frank Wunderlich
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +7 -0
+
+/ {
+	aliases {
+		ethernet0 = &gmac0;
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 51

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+		/* PCA9548 (0-0070) provides 4 i2c channels */
+		i2c3 = &imux0;
+		i2c4 = &imux1_sfp1;
+		i2c5 = &imux2_sfp2;
+		i2c6 = &imux3_wifi;
+	};
+
+	chosen {
+		stdout-path = &serial0;
+		bootargs = "console=ttyS0,115200n1 \

Drop, stdout-path is for that.

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 52

Quoted 1 line
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +1 -0
+			    earlycon=uart8250,mmio32,0x11000000";

earlycon is debugging, not for mainline usage, so also drop.

Review

Quoted 2 lines
(quoted diff) +2 -0
+	};
+

Best regards,
Krzysztof

#13 lore raw

Re: [PATCH v1 4/6] arm64: dts: mt7988: Add devicetree for BananaPi R4 Pro

In reply to Frank Wunderlich

Il 27/10/25 14:28, Frank Wunderlich ha scritto:

Quoted 3 lines

From: Frank Wunderlich <[email protected]>

Add devicetree for Bpi-R4-Pro.

Thanks for this!

Overall, this looks good - there are just a few small things to fix, but hey, I bet you're getting this upstream as early as v2 :-D

Quoted 135 lines

BananaPi R4 Pro is a MT7988A based board which exists in 2 different hardware versions:

- 4E: 4 GB RAM and using internal 2.5G Phy for WAN-Combo
- 8X: 8 GB RAM and 2x Aeonsemi AS21010P 10G phys

common parts:

- MediaTek MT7988A Quad-core Arm Corex-A73,1.8GHz processor
- 8GB eMMC flash
- 256MB SPI-NAND Flash
- Micro SD card slot
- 1x 10G SFP+ WAN
- 1x 10G SFP+ LAN
- 4x 2.5G RJ45 LAN (MxL86252C)
- 1x 1G RJ45 LAN (MT7988 internal switch)
- 2x miniPCIe slots with PCIe3.0 2lane interface for Wi-Fi NIC
- 2x M.2 M-KEY slots with PCIe3.0 1lane interface for NVME SSD
- 3x M.2 B-KEY slots with USB3.2 for 5G Module (PCIe shared with key-m)
- 1x USB3.2 slot
- 1x USB2.0 slot
- 1x USB TypeC Debug Console
- 2x13 PIN Header for expanding application

https://docs.banana-pi.org/en/BPI-R4_Pro/BananaPi_BPI-R4_Pro

The PCIe is per default in key-m state and can be changed to key-b with the pcie-overlays.

---
  arch/arm64/boot/dts/mediatek/Makefile         |   4 +
  .../mt7988a-bananapi-bpi-r4-pro-4e.dts        |  16 +
  .../mt7988a-bananapi-bpi-r4-pro-8x.dts        |  16 +
  .../mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi | 559 ++++++++++++++++++
  4 files changed, 595 insertions(+)

create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-4e.dts create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-8x.dts create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi

arch/arm64/boot/dts/mediatek/Makefile +4 -0
index a4df4c21399e..8640e5f32d4b 100644
@@ -24,6 +24,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-4e.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-8x.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb
@@ -111,4 +113,6 @@ DTC_FLAGS_mt7986a-bananapi-bpi-r3 := -@
  DTC_FLAGS_mt7986a-bananapi-bpi-r3-mini := -@
  DTC_FLAGS_mt7988a-bananapi-bpi-r4 := -@
  DTC_FLAGS_mt7988a-bananapi-bpi-r4-2g5 := -@
+DTC_FLAGS_mt7988a-bananapi-bpi-r4-pro-4e := -@
+DTC_FLAGS_mt7988a-bananapi-bpi-r4-pro-8x := -@
  DTC_FLAGS_mt8395-radxa-nio-12l := -@
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-4e.dts new file +16 -0
new file mode 100644
index 000000000000..c7ea6e88c4f4
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "mt7988a-bananapi-bpi-r4-pro.dtsi"
+
+/ {
+	model = "Bananapi BPI-R4";
+	compatible = "bananapi,bpi-r4-pro-4e",
+		     "bananapi,bpi-r4-pro",
+		     "mediatek,mt7988a";
+};
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-8x.dts new file +16 -0
new file mode 100644
index 000000000000..c9a0e69e9dd5
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "mt7988a-bananapi-bpi-r4-pro.dtsi"
+
+/ {
+	model = "Bananapi BPI-R4";
+	compatible = "bananapi,bpi-r4-pro-8x",
+		     "bananapi,bpi-r4-pro",
+		     "mediatek,mt7988a";
+};
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +24 -0
new file mode 100644
index 000000000000..44406e23c042
@@ -0,0 +1,559 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Sam.Shih <[email protected]>
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "mt7988a.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
+
+/*
+ * ----------------------------------- Bananapi Bpi R4 Pro PINs ---------------------------------
+ * |    | Function                               | Function                                |    |
+ * |----|----------------------------------------|-----------------------------------------|----|
+ * | 1  | 3V3                                    | 5V                                      | 2  |
+ * | 3  | GPIO18/I2C_1_SDA                       | 5V                                      | 4  |
+ * | 5  | GPIO17/I2C_1_SCL                       | GND                                     | 6  |
+ * | 7  | GPIO62/JTAG_JTRST_N/PWM6/I2P5G_LED1_P0 | GPIO59/JTAG_JTDO/UART2_TX/GBE_LED1_P1   | 8  |
+ * | 9  | GND                                    | GPIO58/JTAG_JTDI/UART2_RX/GBE_LED1_P0   | 10 |

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 34

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+ * | 11 | GPIO81/UART1_TXD                       | GPIO51/PCM_CLK_I2S_BCLK                 | 12 |
+ * | 13 | GPIO80/UART1_RXD                       | GND                                     | 14 |
+ * | 15 | GPIO50/PCM_FS_I2S_LRCK                 | GPIO61/JTAG_JTCLK/UART2_RTS/GBE_LED1_P3 | 16 |
+ * | 17 | 3v3                                    | GPIO60/JTAG_JTMS/UART2_CTS/GBE_LED1_P2  | 18 |
+ * | 19 | GPIO30/SPI1_MOSI                       | GND                                     | 20 |
+ * | 21 | GPIO29/SPI1_MISO                       | GPIO53/PCM_DTX_I2S_DOUT                 | 22 |
+ * | 23 | GPIO31/SPI1_CLK                        | GPIO28/SPI1_CSB                         | 24 |
+ * | 25 | GND                                    | GPIO52/PCM_DRX_I2S_DIN                  | 26 |
+ * |----|----------------------------------------|-----------------------------------------|----|
+ */

Nice! Is this a "raspberry pi header" thingy?

Let's say that the header is called "CON89" on the schematics (if unsure, you should find that name by looking at the PCB), so a better title would be:

* ------------------------------------- CON89 Pi header pins -----------------------------------

Also this relates to PIO, right? You could move that as a pio node comment, either before or inside of your PIO overrides.
After all, this comment is mapping "header pin number" to "PIO pin number" ;-)

Quoted 8 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +8 -0
+
+/ {
+	aliases {
+		ethernet0 = &gmac0;
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		/* PCA9548 (0-0070) provides 4 i2c channels */

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 52

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+		i2c3 = &imux0;
+		i2c4 = &imux1_sfp1;
+		i2c5 = &imux2_sfp2;
+		i2c6 = &imux3_wifi;
+	};
+
+	chosen {
+		stdout-path = &serial0;
+		bootargs = "console=ttyS0,115200n1 \
+			    earlycon=uart8250,mmio32,0x11000000";

No, don't use bootargs - besides, earlycon is supposed to be for development purposes only, and it *has to* be unnecessary after development, on upstreamed devicetrees.

Quoted 9 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +9 -0
+	};
+
+	fan: pwm-fan {
+		compatible = "pwm-fan";
+		/* cooling level (0, 1, 2, 3) : (0% duty, 30% duty, 50% duty, 100% duty) */
+		cooling-levels = <0 80 128 255>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pwm0_pins>;
+		pwms = <&pwm 0 50000>;

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 71

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+		#cooling-cells = <2>;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		button-reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 13 GPIO_ACTIVE_LOW>;

Please treat the linux,code property as a vendor property. Means...

label =
gpios =
linux,code =

Quoted 18 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +18 -0
+		};
+
+		button-wps {
+			label = "WPS";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&pio 14 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		led_red: sys-led-red {
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&pca9555 15 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 99

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+		led_blue: sys-led-blue {
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pca9555 14 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+	};
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";

Have you got the board schematics?

If so, can you please change the regulator-name to the one from the schematics?

Quoted 12 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +12 -0
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 121

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+		regulator-always-on;
+	};
+
+	/* SFP1 cage (LAN) */
+	sfp1: sfp1 {
+		compatible = "sff,sfp";
+		i2c-bus = <&imux1_sfp1>;
+		los-gpios = <&pio 70 GPIO_ACTIVE_HIGH>;//change4
+		mod-def0-gpios = <&pio 69 GPIO_ACTIVE_LOW>; //change3
+		tx-disable-gpios = <&pio 21 GPIO_ACTIVE_HIGH>; //change1

What does "change4", "change3", "change1" even mean?

Please remove.

Quoted 14 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +14 -0
+		maximum-power-milliwatt = <3000>;
+	};
+
+	/* SFP2 cage (WAN) */
+	sfp2: sfp2 {
+		compatible = "sff,sfp";
+		i2c-bus = <&imux2_sfp2>;
+		los-gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+		tx-disable-gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
+		maximum-power-milliwatt = <3000>;
+	};
+};
+

..snip..

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 228

Quoted 13 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +13 -0
+
+&gmac0 {
+	status = "okay";
+};
+
+&gsw_phy0 {
+	pinctrl-names = "gbe-led";
+	pinctrl-0 = <&gbe0_led0_pins>;
+};
+
+&gsw_phy0_led0 {
+	status = "okay";
+	color = <LED_COLOR_ID_YELLOW>;

color first, status last

Quoted 2 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +2 -0
+};
+

..snip..

Quoted 5 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +5 -0
+
+&i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_pins>;
+	status = "okay";

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 333

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+};
+
+&i2c2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c2_1_pins>;
+	status = "okay";
+
+	pca9545: i2c-mux@70 {
+		reg = <0x70>;
+		compatible = "nxp,pca9545";

compatible goes first. Check dts-coding-style.rst.

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 340

Quoted 7 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +7 -0
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		imux0: i2c@0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0>;

reg goes first.

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 343

Quoted 3 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +3 -0
+
+			pca9555: i2c-gpio-expander@20 {
+				compatible = "nxp,pca9555";

reg after compatible please

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+				gpio-controller;
+				#gpio-cells = <2>;
+				reg = <0x20>;
+			};
+
+			rtc@51 {
+				compatible = "nxp,pcf8563";
+				reg = <0x51>;
+			};
+

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 363

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+			eeprom@57 {
+				compatible = "atmel,24c02";
+				reg = <0x57>;
+				address-width = <8>;
+				pagesize = <8>;
+				size = <256>;
+			};
+		};
+
+		imux1_sfp1: i2c@1 {

reg first, cells later;

reg = <1>;
#address-cells = <1>;
#size-cells = <0>;

here and everywhere else.

Quoted 34 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +34 -0
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <1>;
+		};
+
+		imux2_sfp2: i2c@2 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <2>;
+		};
+
+		imux3_wifi: i2c@3 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <3>;
+		};
+	};
+};
+
+&int_2p5g_phy {
+	status = "disabled";
+};
+
+/* mPCIe SIM2 (11300000) */
+&pcie0 {
+	status = "okay";
+};
+
+/* mPCIe (11310000 near leds) SIM3 */
+&pcie1 {
+	status = "okay";
+};
+
+/* M.2 (11280000) 1L0 key-m SSD1 CN13 / key-b SIM1 CN15 */

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 407

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+&pcie2 {
+	status = "okay";
+};
+
+/* M.2 (11290000) 1L1 key-m SSD2 CN14 / key-b SIM2 CN18 */
+&pcie3 {
+	status = "okay";
+};
+
+&pio {

--snip..

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 462

Quoted 9 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +9 -0
+
+	mmc0_pins_sdcard: mmc0-sdcard-pins {
+		mux {
+			function = "flash";
+			groups = "sdcard";
+		};
+	};
+
+	// 1L0 0=key-b (CN15), 1=key-m (CN13)

Please fix the comments
/* 1L0 0=key-b (CN15), 1=key-m (CN13) */

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 467

Quoted 5 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +5 -0
+	pcie-2-hog {
+		gpio-hog;
+		gpios = <79 GPIO_ACTIVE_HIGH>;
+		output-high;
+	};

Extra space here please, and

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 468

Quoted 1 line
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +1 -0
+	// 1L1 0=key-b (CN18), 1=key-m (CN14)

/* 1L1 0=key-b (CN18), 1=key-m (CN14) */

Quoted 21 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +21 -0
+	pcie-3-hog {
+		gpio-hog;
+		gpios = <63 GPIO_ACTIVE_HIGH>;
+		output-high;
+	};
+
+	pwm0_pins: pwm0-pins {
+		mux {
+			groups = "pwm0";
+			function = "pwm";
+		};
+	};
+
+	spi0_flash_pins: spi0-flash-pins {
+		mux {
+			function = "spi";
+			groups = "spi0", "spi0_wp_hold";
+		};
+	};
+};
+

..snip..

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 535

Quoted 7 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +7 -0
+
+/* back USB */
+&ssusb0 {
+	/* Use U2P only instead of both U3P/U2P due to U3P serdes shared with pcie2 */
+	phys = <&xphyu2port0 PHY_TYPE_USB2>;
+	mediatek,u3p-dis-msk = <1>;
+	/delete-property/ mediatek,p0_speed_fixup;

Where's that property defined, even?
Am I blind, or it's nowhere to be found (in any dtsi)?

(no, seriously, I'm not sarcastic :P)

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 210

Quoted 3 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +3 -0
+	status = "okay";
+};
+

Cheers,
Angelo

#14 lore raw

Re: [PATCH v1 4/6] arm64: dts: mt7988: Add devicetree for BananaPi R4 Pro

Am 5. November 2025 13:55:43 MEZ schrieb AngeloGioacchino Del Regno <[email protected]>:

Quoted 158 lines

Il 27/10/25 14:28, Frank Wunderlich ha scritto:

Quoted 3 lines

From: Frank Wunderlich <[email protected]>

Add devicetree for Bpi-R4-Pro.

Thanks for this!

Overall, this looks good - there are just a few small things to fix, but hey, I bet you're getting this upstream as early as v2 :-D

Quoted 135 lines

BananaPi R4 Pro is a MT7988A based board which exists in 2 different hardware versions:

- 4E: 4 GB RAM and using internal 2.5G Phy for WAN-Combo
- 8X: 8 GB RAM and 2x Aeonsemi AS21010P 10G phys

common parts:

- MediaTek MT7988A Quad-core Arm Corex-A73,1.8GHz processor
- 8GB eMMC flash
- 256MB SPI-NAND Flash
- Micro SD card slot
- 1x 10G SFP+ WAN
- 1x 10G SFP+ LAN
- 4x 2.5G RJ45 LAN (MxL86252C)
- 1x 1G RJ45 LAN (MT7988 internal switch)
- 2x miniPCIe slots with PCIe3.0 2lane interface for Wi-Fi NIC
- 2x M.2 M-KEY slots with PCIe3.0 1lane interface for NVME SSD
- 3x M.2 B-KEY slots with USB3.2 for 5G Module (PCIe shared with key-m)
- 1x USB3.2 slot
- 1x USB2.0 slot
- 1x USB TypeC Debug Console
- 2x13 PIN Header for expanding application

https://docs.banana-pi.org/en/BPI-R4_Pro/BananaPi_BPI-R4_Pro

The PCIe is per default in key-m state and can be changed to key-b with the pcie-overlays.

---
  arch/arm64/boot/dts/mediatek/Makefile         |   4 +
  .../mt7988a-bananapi-bpi-r4-pro-4e.dts        |  16 +
  .../mt7988a-bananapi-bpi-r4-pro-8x.dts        |  16 +
  .../mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi | 559 ++++++++++++++++++
  4 files changed, 595 insertions(+)

create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-4e.dts create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-8x.dts create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi

arch/arm64/boot/dts/mediatek/Makefile +4 -0
index a4df4c21399e..8640e5f32d4b 100644
@@ -24,6 +24,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7986b-rfb.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-4e.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-8x.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
  dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb
@@ -111,4 +113,6 @@ DTC_FLAGS_mt7986a-bananapi-bpi-r3 := -@
  DTC_FLAGS_mt7986a-bananapi-bpi-r3-mini := -@
  DTC_FLAGS_mt7988a-bananapi-bpi-r4 := -@
  DTC_FLAGS_mt7988a-bananapi-bpi-r4-2g5 := -@
+DTC_FLAGS_mt7988a-bananapi-bpi-r4-pro-4e := -@
+DTC_FLAGS_mt7988a-bananapi-bpi-r4-pro-8x := -@
  DTC_FLAGS_mt8395-radxa-nio-12l := -@
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-4e.dts new file +16 -0
new file mode 100644
index 000000000000..c7ea6e88c4f4
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "mt7988a-bananapi-bpi-r4-pro.dtsi"
+
+/ {
+	model = "Bananapi BPI-R4";
+	compatible = "bananapi,bpi-r4-pro-4e",
+		     "bananapi,bpi-r4-pro",
+		     "mediatek,mt7988a";
+};
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-8x.dts new file +16 -0
new file mode 100644
index 000000000000..c9a0e69e9dd5
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "mt7988a-bananapi-bpi-r4-pro.dtsi"
+
+/ {
+	model = "Bananapi BPI-R4";
+	compatible = "bananapi,bpi-r4-pro-8x",
+		     "bananapi,bpi-r4-pro",
+		     "mediatek,mt7988a";
+};
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +24 -0
new file mode 100644
index 000000000000..44406e23c042
@@ -0,0 +1,559 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Sam.Shih <[email protected]>
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+
+#include "mt7988a.dtsi"
+#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
+#include <dt-bindings/leds/common.h>
+#include <dt-bindings/regulator/richtek,rt5190a-regulator.h>
+
+/*
+ * ----------------------------------- Bananapi Bpi R4 Pro PINs ---------------------------------
+ * |    | Function                               | Function                                |    |
+ * |----|----------------------------------------|-----------------------------------------|----|
+ * | 1  | 3V3                                    | 5V                                      | 2  |
+ * | 3  | GPIO18/I2C_1_SDA                       | 5V                                      | 4  |
+ * | 5  | GPIO17/I2C_1_SCL                       | GND                                     | 6  |
+ * | 7  | GPIO62/JTAG_JTRST_N/PWM6/I2P5G_LED1_P0 | GPIO59/JTAG_JTDO/UART2_TX/GBE_LED1_P1   | 8  |
+ * | 9  | GND                                    | GPIO58/JTAG_JTDI/UART2_RX/GBE_LED1_P0   | 10 |

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 34

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+ * | 11 | GPIO81/UART1_TXD                       | GPIO51/PCM_CLK_I2S_BCLK                 | 12 |
+ * | 13 | GPIO80/UART1_RXD                       | GND                                     | 14 |
+ * | 15 | GPIO50/PCM_FS_I2S_LRCK                 | GPIO61/JTAG_JTCLK/UART2_RTS/GBE_LED1_P3 | 16 |
+ * | 17 | 3v3                                    | GPIO60/JTAG_JTMS/UART2_CTS/GBE_LED1_P2  | 18 |
+ * | 19 | GPIO30/SPI1_MOSI                       | GND                                     | 20 |
+ * | 21 | GPIO29/SPI1_MISO                       | GPIO53/PCM_DTX_I2S_DOUT                 | 22 |
+ * | 23 | GPIO31/SPI1_CLK                        | GPIO28/SPI1_CSB                         | 24 |
+ * | 25 | GND                                    | GPIO52/PCM_DRX_I2S_DIN                  | 26 |
+ * |----|----------------------------------------|-----------------------------------------|----|
+ */

Nice! Is this a "raspberry pi header" thingy?

Quoted 8 lines

Let's say that the header is called "CON89" on the schematics (if unsure, you should find that name by looking at the PCB), so a better title would be:

* ------------------------------------- CON89 Pi header pins -----------------------------------

Also this relates to PIO, right? You could move that as a pio node comment, either before or inside of your PIO overrides.
After all, this comment is mapping "header pin number" to "PIO pin number" ;-)

I think i drop it on v2 as the "raspberry like" gpio header is not yet adressed here. Current dts is only first part.

Quoted 14 lines
Quoted 14 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +14 -0
+
+/ {
+	aliases {
+		ethernet0 = &gmac0;
+		i2c0 = &i2c0;
+		i2c1 = &i2c1;
+		i2c2 = &i2c2;
+		/* PCA9548 (0-0070) provides 4 i2c channels */
+		i2c3 = &imux0;
+		i2c4 = &imux1_sfp1;
+		i2c5 = &imux2_sfp2;
+		i2c6 = &imux3_wifi;
+	};
+
Quoted 8 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 52

Quoted 4 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +4 -0
+	chosen {
+		stdout-path = &serial0;
+		bootargs = "console=ttyS0,115200n1 \
+			    earlycon=uart8250,mmio32,0x11000000";

No, don't use bootargs - besides, earlycon is supposed to be for development purposes only, and it *has to* be unnecessary after development, on upstreamed devicetrees.

Yes that's already changed in my tree based on comment from krzysztof

Quoted 22 lines
Quoted 9 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +9 -0
+	};
+
+	fan: pwm-fan {
+		compatible = "pwm-fan";
+		/* cooling level (0, 1, 2, 3) : (0% duty, 30% duty, 50% duty, 100% duty) */
+		cooling-levels = <0 80 128 255>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&pwm0_pins>;
+		pwms = <&pwm 0 50000>;

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 71

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+		#cooling-cells = <2>;
+	};
+
+	gpio-keys {
+		compatible = "gpio-keys";
+
+		button-reset {
+			label = "reset";
+			linux,code = <KEY_RESTART>;
+			gpios = <&pio 13 GPIO_ACTIVE_LOW>;

Please treat the linux,code property as a vendor property. Means...

Quoted 3 lines

label =
gpios =
linux,code =

Ok

Quoted 31 lines
Quoted 18 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +18 -0
+		};
+
+		button-wps {
+			label = "WPS";
+			linux,code = <KEY_WPS_BUTTON>;
+			gpios = <&pio 14 GPIO_ACTIVE_LOW>;
+		};
+	};
+
+	gpio-leds {
+		compatible = "gpio-leds";
+
+		led_red: sys-led-red {
+			color = <LED_COLOR_ID_RED>;
+			gpios = <&pca9555 15 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 99

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+		led_blue: sys-led-blue {
+			color = <LED_COLOR_ID_BLUE>;
+			gpios = <&pca9555 14 GPIO_ACTIVE_HIGH>;
+			default-state = "on";
+		};
+	};
+
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";

Have you got the board schematics?

Quoted 1 line

If so, can you please change the regulator-name to the one from the schematics?

Yes,have to look for it.

Quoted 25 lines
Quoted 12 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +12 -0
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+
+	reg_3p3v: regulator-3p3v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-3.3V";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		regulator-boot-on;

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 121

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+		regulator-always-on;
+	};
+
+	/* SFP1 cage (LAN) */
+	sfp1: sfp1 {
+		compatible = "sff,sfp";
+		i2c-bus = <&imux1_sfp1>;
+		los-gpios = <&pio 70 GPIO_ACTIVE_HIGH>;//change4
+		mod-def0-gpios = <&pio 69 GPIO_ACTIVE_LOW>; //change3
+		tx-disable-gpios = <&pio 21 GPIO_ACTIVE_HIGH>; //change1

What does "change4", "change3", "change1" even mean?

Quoted 1 line

Please remove.

Sorry that was my comments from changes between v0 and the v1 now.

Quoted 17 lines
Quoted 14 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +14 -0
+		maximum-power-milliwatt = <3000>;
+	};
+
+	/* SFP2 cage (WAN) */
+	sfp2: sfp2 {
+		compatible = "sff,sfp";
+		i2c-bus = <&imux2_sfp2>;
+		los-gpios = <&pio 2 GPIO_ACTIVE_HIGH>;
+		mod-def0-gpios = <&pio 1 GPIO_ACTIVE_LOW>;
+		tx-disable-gpios = <&pio 0 GPIO_ACTIVE_HIGH>;
+		maximum-power-milliwatt = <3000>;
+	};
+};
+

..snip..

Quoted 15 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 228

Quoted 13 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +13 -0
+
+&gmac0 {
+	status = "okay";
+};
+
+&gsw_phy0 {
+	pinctrl-names = "gbe-led";
+	pinctrl-0 = <&gbe0_led0_pins>;
+};
+
+&gsw_phy0_led0 {
+	status = "okay";
+	color = <LED_COLOR_ID_YELLOW>;

color first, status last

Ok

Quoted 14 lines
Quoted 2 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +2 -0
+};
+

..snip..

Quoted 9 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +9 -0
+
+&i2c1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_pins>;
+	status = "okay";
+};
+
+&i2c2 {
+	pinctrl-names = "default";
Quoted 8 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 333

Quoted 6 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +6 -0
+	pinctrl-0 = <&i2c2_1_pins>;
+	status = "okay";
+
+	pca9545: i2c-mux@70 {
+		reg = <0x70>;
+		compatible = "nxp,pca9545";

compatible goes first. Check dts-coding-style.rst.

Ok,missed this

Quoted 9 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 340

Quoted 7 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +7 -0
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		imux0: i2c@0 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <0>;

reg goes first.

Ok

Quoted 5 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 343

Quoted 3 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +3 -0
+
+			pca9555: i2c-gpio-expander@20 {
+				compatible = "nxp,pca9555";

reg after compatible please

Ok

Quoted 23 lines
Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+				gpio-controller;
+				#gpio-cells = <2>;
+				reg = <0x20>;
+			};
+
+			rtc@51 {
+				compatible = "nxp,pcf8563";
+				reg = <0x51>;
+			};
+

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 363

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+			eeprom@57 {
+				compatible = "atmel,24c02";
+				reg = <0x57>;
+				address-width = <8>;
+				pagesize = <8>;
+				size = <256>;
+			};
+		};
+
+		imux1_sfp1: i2c@1 {

reg first, cells later;

Quoted 5 lines

reg = <1>;
#address-cells = <1>;
#size-cells = <0>;

here and everywhere else.

I do

Quoted 68 lines
Quoted 34 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +34 -0
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <1>;
+		};
+
+		imux2_sfp2: i2c@2 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <2>;
+		};
+
+		imux3_wifi: i2c@3 {
+			#address-cells = <1>;
+			#size-cells = <0>;
+			reg = <3>;
+		};
+	};
+};
+
+&int_2p5g_phy {
+	status = "disabled";
+};
+
+/* mPCIe SIM2 (11300000) */
+&pcie0 {
+	status = "okay";
+};
+
+/* mPCIe (11310000 near leds) SIM3 */
+&pcie1 {
+	status = "okay";
+};
+
+/* M.2 (11280000) 1L0 key-m SSD1 CN13 / key-b SIM1 CN15 */

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 407

Quoted 10 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +10 -0
+&pcie2 {
+	status = "okay";
+};
+
+/* M.2 (11290000) 1L1 key-m SSD2 CN14 / key-b SIM2 CN18 */
+&pcie3 {
+	status = "okay";
+};
+
+&pio {

--snip..

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 462

Quoted 9 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +9 -0
+
+	mmc0_pins_sdcard: mmc0-sdcard-pins {
+		mux {
+			function = "flash";
+			groups = "sdcard";
+		};
+	};
+
+	// 1L0 0=key-b (CN15), 1=key-m (CN13)

Please fix the comments
/* 1L0 0=key-b (CN15), 1=key-m (CN13) */

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 467

Quoted 5 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +5 -0
+	pcie-2-hog {
+		gpio-hog;
+		gpios = <79 GPIO_ACTIVE_HIGH>;
+		output-high;
+	};

Extra space here please, and

Quoted 3 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 468

Quoted 1 line
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +1 -0
+	// 1L1 0=key-b (CN18), 1=key-m (CN14)

/* 1L1 0=key-b (CN18), 1=key-m (CN14) */

Ok

Quoted 35 lines
Quoted 21 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +21 -0
+	pcie-3-hog {
+		gpio-hog;
+		gpios = <63 GPIO_ACTIVE_HIGH>;
+		output-high;
+	};
+
+	pwm0_pins: pwm0-pins {
+		mux {
+			groups = "pwm0";
+			function = "pwm";
+		};
+	};
+
+	spi0_flash_pins: spi0-flash-pins {
+		mux {
+			function = "spi";
+			groups = "spi0", "spi0_wp_hold";
+		};
+	};
+};
+

..snip..

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 535

Quoted 7 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +7 -0
+
+/* back USB */
+&ssusb0 {
+	/* Use U2P only instead of both U3P/U2P due to U3P serdes shared with pcie2 */
+	phys = <&xphyu2port0 PHY_TYPE_USB2>;
+	mediatek,u3p-dis-msk = <1>;
+	/delete-property/ mediatek,p0_speed_fixup;

Where's that property defined, even?
Am I blind, or it's nowhere to be found (in any dtsi)?

Quoted 1 line

(no, seriously, I'm not sarcastic :P)

Possibly forgot to drop while adding node from sdk dts :p

Quoted 6 lines

arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi line 210

Quoted 3 lines
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro.dtsi new file +3 -0
+	status = "okay";
+};
+

Cheers,
Angelo

Hi Angelo

Thanks for review
regards Frank

#15 lore raw

PATCH 5/6 arm64: dts: mediatek: mt7988a-bpi-r4-pro: add PCIe overlays

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add overlays to switch between key-m and key-e slots.

---
 arch/arm64/boot/dts/mediatek/Makefile         |  2 ++
 .../mt7988a-bananapi-bpi-r4-pro-cn15.dtso     | 20 +++++++++++++++++++
 .../mt7988a-bananapi-bpi-r4-pro-cn18.dtso     | 20 +++++++++++++++++++
 3 files changed, 42 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn15.dtso
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn18.dtso
arch/arm64/boot/dts/mediatek/Makefile +2 -0
index 8640e5f32d4b..8e99f6e33b25 100644
@@ -26,6 +26,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-2g5.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-emmc.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-4e.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-8x.dtb
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-cn15.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-cn18.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn15.dtso new file +20 -0
new file mode 100644
index 000000000000..9750916042de
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/* This enables key-b slot CN15 on pcie2(11280000 1L0) on BPI-R4-Pro */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	compatible = "bananapi,bpi-r4-pro", "mediatek,mt7988a";
+};
+
+&{/soc/pinctrl@1001f000/pcie-2-hog} {
+	output-low;
+};
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-cn18.dtso new file +20 -0
new file mode 100644
index 000000000000..9830fb0fd97a
@@ -0,0 +1,20 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2025 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/* This enables key-b slot CN18 on pcie3(11290000 1L1) on BPI-R4-Pro */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	compatible = "bananapi,bpi-r4-pro", "mediatek,mt7988a";
+};
+
+&{/soc/pinctrl@1001f000/pcie-3-hog} {
+	output-low;
+};
Signature · 1 line
2.43.0
#16 lore raw

PATCH 6/6 arm64: dts: mediatek: mt7988a-bpi-r4pro: Add mmc overlays

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Add MMC overlays for BPI-R4 Pro.

---
 arch/arm64/boot/dts/mediatek/Makefile         |  2 ++
 .../mt7988a-bananapi-bpi-r4-pro-emmc.dtso     | 33 +++++++++++++++++++
 .../mt7988a-bananapi-bpi-r4-pro-sd.dtso       | 31 +++++++++++++++++
 3 files changed, 66 insertions(+)
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-emmc.dtso
 create mode 100644 arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-sd.dtso
arch/arm64/boot/dts/mediatek/Makefile +2 -0
index 8e99f6e33b25..776b9274e8fa 100644
@@ -28,6 +28,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-4e.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-8x.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-cn15.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-cn18.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-emmc.dtbo
+dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-pro-sd.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt7988a-bananapi-bpi-r4-sd.dtbo
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8167-pumpkin.dtb
 dtb-$(CONFIG_ARCH_MEDIATEK) += mt8173-elm.dtb
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-emmc.dtso new file +33 -0
new file mode 100644
index 000000000000..5ed2f0a6bd66
@@ -0,0 +1,33 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2021 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+/plugin/;
+
+/ {
+	compatible = "bananapi,bpi-r4-pro", "mediatek,mt7988a";
+};
+
+&{/soc/mmc@11230000} {
+	pinctrl-names = "default", "state_uhs";
+	pinctrl-0 = <&mmc0_pins_emmc_51>;
+	pinctrl-1 = <&mmc0_pins_emmc_51>;
+	bus-width = <8>;
+	max-frequency = <200000000>;
+	cap-mmc-highspeed;
+	mmc-hs200-1_8v;
+	mmc-hs400-1_8v;
+	hs400-ds-delay = <0x12814>;
+	vqmmc-supply = <&reg_1p8v>;
+	vmmc-supply = <&reg_3p3v>;
+	non-removable;
+	no-sd;
+	no-sdio;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+};
+
arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-pro-sd.dtso new file +31 -0
new file mode 100644
index 000000000000..1ec1a9fbd8ba
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: (GPL-2.0 OR MIT)
+/*
+ * Copyright (C) 2023 MediaTek Inc.
+ * Author: Frank Wunderlich <[email protected]>
+ */
+
+/dts-v1/;
+/plugin/;
+
+#include <dt-bindings/gpio/gpio.h>
+
+/ {
+	compatible = "bananapi,bpi-r4-pro", "mediatek,mt7988a";
+};
+
+&{/soc/mmc@11230000} {
+	pinctrl-names = "default", "state_uhs";
+	pinctrl-0 = <&mmc0_pins_sdcard>;
+	pinctrl-1 = <&mmc0_pins_sdcard>;
+	cd-gpios = <&pio 12 GPIO_ACTIVE_LOW>;
+	bus-width = <4>;
+	max-frequency = <48000000>;
+	cap-sd-highspeed;
+	vmmc-supply = <&reg_3p3v>;
+	vqmmc-supply = <&reg_3p3v>;
+	no-mmc;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	status = "okay";
+};
+
Signature · 1 line
2.43.0
maintainer Applied
#17 lore raw

Re: (subset) [PATCH v1 0/6] Add Bananapi R4 Pro support

In reply to Frank Wunderlich
Quoted 9 lines · Frank Wunderlich

From: Frank Wunderlich <[email protected]>

BananaPi R4 Pro is a MT7988A based board which exists in 2 different hardware versions:

- 4E: 4 GB RAM and using internal 2.5G Phy for WAN-Combo
- 8X: 8 GB RAM and 2x Aeonsemi AS21010P 10G phys

[...]

Applied to v6.18-next/dts64, thanks!

[2/6] dt-bindings: arm: mediatek: add BPI-R4 Pro board

      commit: b88827cb0bd1a192855db40494970bbdd7aad939

Cheers,
Angelo