From 35ec913d0091245b12623c0364a3c7acb3058628 Mon Sep 17 00:00:00 2001 From: Patrick Yavitz Date: Tue, 7 Jan 2025 09:14:34 -0500 Subject: [PATCH] BananaPi BPI-M4-Zero: U-Boot: `Reflect kernel DTS changes` Signed-off-by: Patrick Yavitz --- ... 001-Add-board-BananaPi-BPI-M4-Zero.patch} | 159 +++++++++--------- 1 file changed, 82 insertions(+), 77 deletions(-) rename patch/u-boot/v2024.04/board_bananapim4zero/{001-Add-board-BananaPi-BPI-M4-ZERO.patch => 001-Add-board-BananaPi-BPI-M4-Zero.patch} (84%) diff --git a/patch/u-boot/v2024.04/board_bananapim4zero/001-Add-board-BananaPi-BPI-M4-ZERO.patch b/patch/u-boot/v2024.04/board_bananapim4zero/001-Add-board-BananaPi-BPI-M4-Zero.patch similarity index 84% rename from patch/u-boot/v2024.04/board_bananapim4zero/001-Add-board-BananaPi-BPI-M4-ZERO.patch rename to patch/u-boot/v2024.04/board_bananapim4zero/001-Add-board-BananaPi-BPI-M4-Zero.patch index e960dde88..70483a8a9 100644 --- a/patch/u-boot/v2024.04/board_bananapim4zero/001-Add-board-BananaPi-BPI-M4-ZERO.patch +++ b/patch/u-boot/v2024.04/board_bananapim4zero/001-Add-board-BananaPi-BPI-M4-Zero.patch @@ -1,57 +1,64 @@ -From 541e7fa9913826de6712faedbb895293e77f1921 Mon Sep 17 00:00:00 2001 +From 6c977d4b0ef9d4cbbb28157b3843b9cbda468ad9 Mon Sep 17 00:00:00 2001 From: Patrick Yavitz -Date: Mon, 7 Oct 2024 06:59:53 -0400 -Subject: [PATCH] Add board BananaPi BPI-M4-ZERO - -sun50i-h618-bananapi-m4-zero.dts -sun50i-h618-bananapi-m4.dtsi -bananapi_m4zero_defconfig +Date: Tue, 7 Jan 2025 07:32:05 -0500 +Subject: [PATCH] Add board BananaPi BPI-M4-Zero Signed-off-by: Patrick Yavitz --- arch/arm/dts/Makefile | 1 + - arch/arm/dts/sun50i-h616.dtsi | 12 +- - arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts | 43 +++ - arch/arm/dts/sun50i-h618-bananapi-m4.dtsi | 244 ++++++++++++++++++ + arch/arm/dts/sun50i-h616.dtsi | 25 ++- + arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts | 77 +++++++ + arch/arm/dts/sun50i-h618-bananapi-m4.dtsi | 208 ++++++++++++++++++ configs/bananapi_m4zero_defconfig | 29 +++ - 5 files changed, 327 insertions(+), 2 deletions(-) + 5 files changed, 339 insertions(+), 1 deletion(-) create mode 100644 arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts create mode 100644 arch/arm/dts/sun50i-h618-bananapi-m4.dtsi create mode 100644 configs/bananapi_m4zero_defconfig diff --git a/arch/arm/dts/Makefile b/arch/arm/dts/Makefile -index 8fb6a8a1f1..380b326ad0 100644 +index b102ffb5f68..57f94860fd5 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -679,6 +679,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \ - sun50i-h6-tanix-tx6.dtb \ +@@ -839,6 +839,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \ sun50i-h6-tanix-tx6-mini.dtb dtb-$(CONFIG_MACH_SUN50I_H616) += \ -+ sun50i-h618-bananapi-m4-zero.dtb \ sun50i-h616-orangepi-zero2.dtb \ ++ sun50i-h618-bananapi-m4-zero.dtb \ sun50i-h618-orangepi-zero2w.dtb \ sun50i-h618-orangepi-zero3.dtb \ + sun50i-h618-transpeed-8k618-t.dtb \ diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi -index d549d277d9..3a424a249e 100644 +index d549d277d97..ccd83ba1b9c 100644 --- a/arch/arm/dts/sun50i-h616.dtsi +++ b/arch/arm/dts/sun50i-h616.dtsi -@@ -245,17 +245,25 @@ - function = "uart0"; +@@ -176,7 +176,7 @@ }; -- /omit-if-no-ref/ - uart1_pins: uart1-pins { - pins = "PG6", "PG7"; - function = "uart1"; + i2c0_pins: i2c0-pins { +- pins = "PI6", "PI7"; ++ pins = "PI5", "PI6"; + function = "i2c0"; }; -- /omit-if-no-ref/ - uart1_rts_cts_pins: uart1-rts-cts-pins { +@@ -256,6 +256,29 @@ pins = "PG8", "PG9"; function = "uart1"; }; + -+ uart5_ph_pins: uart5-ph-pins { ++ /omit-if-no-ref/ ++ uart4_pi_pins: uart4-pi-pins { ++ pins = "PI13", "PI14"; ++ function = "uart4"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart4_pi_rts_cts_pins: uart4-pi-rts-cts-pins { ++ pins = "PI15", "PI16"; ++ function = "uart4"; ++ }; ++ ++ /omit-if-no-ref/ ++ uart5_pins: uart5-pins { + pins = "PH2", "PH3"; + function = "uart5"; + }; @@ -65,10 +72,10 @@ index d549d277d9..3a424a249e 100644 gic: interrupt-controller@3021000 { diff --git a/arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts b/arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts new file mode 100644 -index 0000000000..76ba077bc6 +index 00000000000..dde03092cf0 --- /dev/null +++ b/arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts -@@ -0,0 +1,43 @@ +@@ -0,0 +1,77 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2024 Patrick Yavitz @@ -85,11 +92,22 @@ index 0000000000..76ba077bc6 + aliases { + serial5 = &uart5; + }; ++ ++ leds { ++ compatible = "gpio-leds"; ++ ++ led-0 { ++ color = ; ++ function = LED_FUNCTION_STATUS; ++ gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */ ++ linux,default-trigger = "heartbeat"; ++ }; ++ }; +}; + +/* Connected to an on-board RTL8821CU USB WiFi chip. */ +&ehci1 { -+ status = "okay"; ++ status = "disabled"; +}; + +&ehci3 { @@ -100,6 +118,29 @@ index 0000000000..76ba077bc6 + status = "disabled"; +}; + ++/* SDIO */ ++&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>; ++ ++ cd-gpios = <&pio 6 15 GPIO_ACTIVE_HIGH>; /* PG15 */ ++ vmmc-supply = <®_vcc3v3>; ++ ++ sdio: wifi@1 { ++ reg = <1>; ++ compatible = "brcm,bcm4329-fmac"; ++ }; ++}; ++ +&ohci3 { + status = "okay"; +}; @@ -114,10 +155,10 @@ index 0000000000..76ba077bc6 +}; diff --git a/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi b/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi new file mode 100644 -index 0000000000..dd0e2ea7bf +index 00000000000..650f533e8b4 --- /dev/null +++ b/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi -@@ -0,0 +1,244 @@ +@@ -0,0 +1,208 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2024 Patrick Yavitz @@ -141,17 +182,6 @@ index 0000000000..dd0e2ea7bf + stdout-path = "serial0:115200n8"; + }; + -+ leds { -+ compatible = "gpio-leds"; -+ -+ led-0 { -+ color = ; -+ function = LED_FUNCTION_STATUS; -+ gpios = <&pio 2 12 GPIO_ACTIVE_HIGH>; /* PC12 */ -+ linux,default-trigger = "heartbeat"; -+ }; -+ }; -+ + reg_usb_vbus: regulator-usb-vbus { + /* Separate discrete regulator for the USB ports */ + compatible = "regulator-fixed"; @@ -227,6 +257,7 @@ index 0000000000..dd0e2ea7bf + }; +}; + ++/* SD card */ +&mmc0 { + status = "okay"; + bus-width = <4>; @@ -238,28 +269,7 @@ index 0000000000..dd0e2ea7bf + vmmc-supply = <®_vcc3v3>; +}; + -+&mmc1 { -+ status = "okay"; -+ 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>; -+ -+ cd-gpios = <&pio 6 15 GPIO_ACTIVE_HIGH>; /* PG15 */ -+ vmmc-supply = <®_vcc3v3>; -+ -+ sdio: wifi@1 { -+ reg = <1>; -+ compatible = "brcm,bcm4329-fmac"; -+ }; -+}; -+ ++/* eMMC */ +&mmc2 { + status = "okay"; + bus-width = <8>; @@ -341,30 +351,25 @@ index 0000000000..dd0e2ea7bf +}; + +&uart1 { -+ status = "okay"; -+ pinctrl-0 = <&uart1_pins>, <&uart1_rts_cts_pins>; ++ status = "disabled"; ++ pinctrl-0 = <&uart1_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 = <®_vcc3v3>; -+ vddio-supply = <®_vcc1v8>; -+ }; ++&uart4 { ++ status = "disabled"; ++ pinctrl-0 = <&uart4_pi_pins>; ++ pinctrl-names = "default"; +}; + +&uart5 { + status = "okay"; -+ pinctrl-0 = <&uart5_ph_pins>; ++ pinctrl-0 = <&uart5_pins>; + pinctrl-names = "default"; +}; diff --git a/configs/bananapi_m4zero_defconfig b/configs/bananapi_m4zero_defconfig new file mode 100644 -index 0000000000..3442bd0c77 +index 00000000000..3442bd0c77b --- /dev/null +++ b/configs/bananapi_m4zero_defconfig @@ -0,0 +1,29 @@