Skip to contentSkip to conversation

Add DTS for BPI-R3

PATCH Superseded Frank Wunderlich 2 participants 4 messages Apr 7, 2023 – Apr 8, 2023

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover Add DTS for BPI-R3

From: Frank Wunderlich <[email protected]>

Add board specific devicetree for BananaPi R3.

It is taken from openwrt
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch;hb=HEAD
only enabled the factory button which was disabled because a HW-bug in rev 1.0 of r3.

Daniel Golle (1):
board: mediatek: add Bananapi-R3 devicetree

Frank Wunderlich (1):
configs: change bpi-r3 to board specific dts and change prompt

 arch/arm/dts/Makefile                |   2 +
 arch/arm/dts/mt7986a-bpi-r3-emmc.dts |  32 ++++
 arch/arm/dts/mt7986a-bpi-r3-sd.dts   | 268 +++++++++++++++++++++++++++
 configs/mt7986a_bpir3_emmc_defconfig |   6 +-
 configs/mt7986a_bpir3_sd_defconfig   |   6 +-
 5 files changed, 308 insertions(+), 6 deletions(-)
 create mode 100644 arch/arm/dts/mt7986a-bpi-r3-emmc.dts
 create mode 100644 arch/arm/dts/mt7986a-bpi-r3-sd.dts
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/2 board: mediatek: add Bananapi-R3 devicetree

From: Daniel Golle <[email protected]>

Add board specific devicetree for Bananapi R3 SBC.

---
taken from openwrt
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch;hb=HEAD
only enabled the factory button which was disabled because a HW-bug in rev 1.0 of r3.

---
 arch/arm/dts/Makefile                |   2 +
 arch/arm/dts/mt7986a-bpi-r3-emmc.dts |  32 ++++
 arch/arm/dts/mt7986a-bpi-r3-sd.dts   | 268 +++++++++++++++++++++++++++
 3 files changed, 302 insertions(+)
 create mode 100644 arch/arm/dts/mt7986a-bpi-r3-emmc.dts
 create mode 100644 arch/arm/dts/mt7986a-bpi-r3-sd.dts
arch/arm/dts/Makefile +2 -0
index 0a9b1f7749d5..de0c0e35b8c3 100644
@@ -1296,6 +1296,8 @@ dtb-$(CONFIG_ARCH_MEDIATEK) += \
 	mt7981-rfb.dtb \
 	mt7981-emmc-rfb.dtb \
 	mt7981-sd-rfb.dtb \
+	mt7986a-bpi-r3-sd.dtb \
+	mt7986a-bpi-r3-emmc.dtb \
 	mt7986a-rfb.dtb \
 	mt7986b-rfb.dtb \
 	mt7986a-sd-rfb.dtb \
arch/arm/dts/mt7986a-bpi-r3-emmc.dts new file +32 -0
new file mode 100644
index 000000000000..4e2e5262f536
@@ -0,0 +1,32 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Copyright (c) 2021 MediaTek Inc.
+ * Author: Sam Shih <[email protected]>
+ */
+
+/dts-v1/;
+#include "mt7986a-bpi-r3-sd.dts"
+#include <dt-bindings/gpio/gpio.h>
+/ {
+	reg_1p8v: regulator-1p8v {
+		compatible = "regulator-fixed";
+		regulator-name = "fixed-1.8V";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+		regulator-boot-on;
+		regulator-always-on;
+	};
+};
+
+&mmc0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&mmc0_pins_default>;
+	bus-width = <8>;
+	max-frequency = <200000000>;
+	cap-mmc-highspeed;
+	cap-mmc-hw-reset;
+	vmmc-supply = <&reg_3p3v>;
+	vqmmc-supply = <&reg_1p8v>;
+	non-removable;
+	status = "okay";
+};
arch/arm/dts/mt7986a-bpi-r3-sd.dts new file +268 -0

268 lines not on this page · raw message

Signature · 1 line
2.34.1
#2 lore raw

Aw: [v1 1/2] board: mediatek: add Bananapi-R3 devicetree

Hi

noticed that i need to change the label of wps button back to "wps" when enabling the factory button (else there will be 2 buttons with same label).

Quoted 22 lines

Gesendet: Freitag, 07. April 2023 um 23:26 Uhr
Von: "Frank Wunderlich" <[email protected]>
Betreff: [v1 1/2] board: mediatek: add Bananapi-R3 devicetree

From: Daniel Golle <[email protected]>

Add board specific devicetree for Bananapi R3 SBC.

---
taken from openwrt
https://git.openwrt.org/?p=openwrt/openwrt.git;a=blob;f=package/boot/uboot-mediatek/patches/430-add-bpi-r3.patch;hb=HEAD
only enabled the factory button which was disabled because a HW-bug in rev 1.0 of r3.
---

arch/arm/dts/mt7986a-bpi-r3-sd.dts new file +0 -0
new file mode 100644
index 000000000000..82a3975c7de8
 

arch/arm/dts/mt7986a-bpi-r3-sd.dts line 40

Quoted 10 lines
arch/arm/dts/mt7986a-bpi-r3-sd.dts new file +10 -0
+	keys {
+		compatible = "gpio-keys";
+
+		factory {
+			label = "reset";
+			gpios = <&gpio 9 GPIO_ACTIVE_LOW>;
+		};
+
+		wps {
+			label = "reset";

label was changed in openwrt to use this button for reset, but hw bug fixed in newer v1.1 versions of the board. I will change this to "wps" like in linux in next version.

just tell me if the structure is right or if there any other things need to be changed.

arch/arm/dts/mt7986a-bpi-r3-sd.dts line 43

Quoted 3 lines
arch/arm/dts/mt7986a-bpi-r3-sd.dts new file +3 -0
+			gpios = <&gpio 10 GPIO_ACTIVE_LOW>;
+		};
+	};

regards Frank

#3 lore raw

PATCH 2/2 configs: change bpi-r3 to board specific dts and change prompt

In reply to Frank Wunderlich

From: Frank Wunderlich <[email protected]>

Use own devicetree for the board and change the prompt.

---
 configs/mt7986a_bpir3_emmc_defconfig | 6 +++---
 configs/mt7986a_bpir3_sd_defconfig   | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
configs/mt7986a_bpir3_emmc_defconfig +3 -3
index 2d4876f299f4..5b76512a46f6 100644
@@ -7,15 +7,15 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x80000
 CONFIG_ENV_OFFSET=0x300000
-CONFIG_DEFAULT_DEVICE_TREE="mt7986a-emmc-rfb"
-CONFIG_SYS_PROMPT="MT7986> "
+CONFIG_DEFAULT_DEVICE_TREE="mt7986a-bpi-r3-emmc"
+CONFIG_SYS_PROMPT="BPI-R3> "
 CONFIG_TARGET_MT7986=y
 CONFIG_DEBUG_UART_BASE=0x11002000
 CONFIG_DEBUG_UART_CLOCK=40000000
 CONFIG_SYS_LOAD_ADDR=0x46000000
 CONFIG_DEBUG_UART=y
 # CONFIG_AUTOBOOT is not set
-CONFIG_DEFAULT_FDT_FILE="mt7986a-emmc-rfb"
+CONFIG_DEFAULT_FDT_FILE="mt7986a-bpi-r3-emmc"
 CONFIG_LOGLEVEL=7
 CONFIG_LOG=y
 CONFIG_SYS_CBSIZE=512
configs/mt7986a_bpir3_sd_defconfig +3 -3
index 08edfe7ac409..36547db91423 100644
@@ -7,15 +7,15 @@ CONFIG_SYS_MALLOC_F_LEN=0x4000
 CONFIG_NR_DRAM_BANKS=1
 CONFIG_ENV_SIZE=0x80000
 CONFIG_ENV_OFFSET=0x300000
-CONFIG_DEFAULT_DEVICE_TREE="mt7986a-sd-rfb"
-CONFIG_SYS_PROMPT="MT7986> "
+CONFIG_DEFAULT_DEVICE_TREE="mt7986a-bpi-r3-sd"
+CONFIG_SYS_PROMPT="BPI-R3> "
 CONFIG_TARGET_MT7986=y
 CONFIG_DEBUG_UART_BASE=0x11002000
 CONFIG_DEBUG_UART_CLOCK=40000000
 CONFIG_SYS_LOAD_ADDR=0x46000000
 CONFIG_DEBUG_UART=y
 # CONFIG_AUTOBOOT is not set
-CONFIG_DEFAULT_FDT_FILE="mt7986a-sd-rfb"
+CONFIG_DEFAULT_FDT_FILE="mt7986a-bpi-r3-sd"
 CONFIG_LOGLEVEL=7
 CONFIG_LOG=y
 CONFIG_SYS_CBSIZE=512
Signature · 1 line
2.34.1