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 index 6a262f0c22..e960dde883 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,27 +1,29 @@ -From 7d8e0f45333efa9556feb71650f54df1a19304cd Mon Sep 17 00:00:00 2001 +From 541e7fa9913826de6712faedbb895293e77f1921 Mon Sep 17 00:00:00 2001 From: Patrick Yavitz -Date: Thu, 3 Oct 2024 00:06:37 -0400 +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 Signed-off-by: Patrick Yavitz --- arch/arm/dts/Makefile | 1 + - arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts | 39 ++++ - arch/arm/dts/sun50i-h618-bananapi-m4.dtsi | 211 ++++++++++++++++++ + 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 ++++++++++++++++++ configs/bananapi_m4zero_defconfig | 29 +++ - 4 files changed, 280 insertions(+) + 5 files changed, 327 insertions(+), 2 deletions(-) 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 b102ffb5f6..60ea478509 100644 +index 8fb6a8a1f1..380b326ad0 100644 --- a/arch/arm/dts/Makefile +++ b/arch/arm/dts/Makefile -@@ -838,6 +838,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \ +@@ -679,6 +679,7 @@ dtb-$(CONFIG_MACH_SUN50I_H6) += \ sun50i-h6-tanix-tx6.dtb \ sun50i-h6-tanix-tx6-mini.dtb dtb-$(CONFIG_MACH_SUN50I_H616) += \ @@ -29,12 +31,44 @@ index b102ffb5f6..60ea478509 100644 sun50i-h616-orangepi-zero2.dtb \ sun50i-h618-orangepi-zero2w.dtb \ sun50i-h618-orangepi-zero3.dtb \ +diff --git a/arch/arm/dts/sun50i-h616.dtsi b/arch/arm/dts/sun50i-h616.dtsi +index d549d277d9..3a424a249e 100644 +--- a/arch/arm/dts/sun50i-h616.dtsi ++++ b/arch/arm/dts/sun50i-h616.dtsi +@@ -245,17 +245,25 @@ + function = "uart0"; + }; + +- /omit-if-no-ref/ + uart1_pins: uart1-pins { + pins = "PG6", "PG7"; + function = "uart1"; + }; + +- /omit-if-no-ref/ + uart1_rts_cts_pins: uart1-rts-cts-pins { + pins = "PG8", "PG9"; + function = "uart1"; + }; ++ ++ uart5_ph_pins: uart5-ph-pins { ++ pins = "PH2", "PH3"; ++ function = "uart5"; ++ }; ++ ++ x32clk_fanout_pin: x32clk-fanout-pin { ++ pins = "PG10"; ++ function = "clock"; ++ }; + }; + + 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..1d234abdb0 +index 0000000000..76ba077bc6 --- /dev/null +++ b/arch/arm/dts/sun50i-h618-bananapi-m4-zero.dts -@@ -0,0 +1,39 @@ +@@ -0,0 +1,43 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2024 Patrick Yavitz @@ -47,6 +81,10 @@ index 0000000000..1d234abdb0 +/ { + model = "BananaPi BPI-M4-Zero"; + compatible = "sinovoip,bpi-m4-zero", "allwinner,sun50i-h618"; ++ ++ aliases { ++ serial5 = &uart5; ++ }; +}; + +/* Connected to an on-board RTL8821CU USB WiFi chip. */ @@ -76,10 +114,10 @@ index 0000000000..1d234abdb0 +}; 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..9b1381a764 +index 0000000000..dd0e2ea7bf --- /dev/null +++ b/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi -@@ -0,0 +1,211 @@ +@@ -0,0 +1,244 @@ +// SPDX-License-Identifier: (GPL-2.0+ OR MIT) +/* + * Copyright (c) 2024 Patrick Yavitz @@ -96,7 +134,6 @@ index 0000000000..9b1381a764 + +/ { + aliases { -+ ethernet0 = &emac0; + serial0 = &uart0; + }; + @@ -104,16 +141,6 @@ index 0000000000..9b1381a764 + stdout-path = "serial0:115200n8"; + }; + -+ gpio-keys { -+ compatible = "gpio-keys"; -+ -+ key-sw3 { -+ label = "sw3"; -+ linux,code = ; -+ gpios = <&pio 2 7 GPIO_ACTIVE_LOW>; /* PC7 */ -+ }; -+ }; -+ + leds { + compatible = "gpio-leds"; + @@ -128,19 +155,37 @@ index 0000000000..9b1381a764 + 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 = <®_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 = <®_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 = <®_vcc3v3>; + }; + + wifi_pwrseq: wifi-pwrseq { @@ -184,38 +229,48 @@ index 0000000000..9b1381a764 + +&mmc0 { + status = "okay"; -+ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ -+ disable-wp; + bus-width = <4>; + max-frequency = <50000000>; -+ vmmc-supply = <®_dldo1>; ++ ++ disable-wp; ++ ++ cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 */ ++ vmmc-supply = <®_vcc3v3>; +}; + +&mmc1 { -+ status = "disabled"; ++ status = "okay"; + bus-width = <4>; -+ non-removable; -+ mmc-pwrseq = <&wifi_pwrseq>; -+ vmmc-supply = <®_dldo1>; -+ vqmmc-supply = <®_aldo1>; ++ max-frequency = <100000000>; + -+ sdio_wifi: wifi@1 { ++ 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"; -+ 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 = <®_dldo1>; -+ vqmmc-supply = <®_aldo1>; ++ ++ non-removable; ++ disable-wp; ++ ++ vmmc-supply = <®_vcc3v3>; ++ vqmmc-supply = <®_vcc1v8>; +}; + +&pio { @@ -290,6 +345,22 @@ index 0000000000..9b1381a764 + 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 = <®_vcc3v3>; ++ vddio-supply = <®_vcc1v8>; ++ }; ++}; ++ ++&uart5 { ++ status = "okay"; ++ pinctrl-0 = <&uart5_ph_pins>; ++ pinctrl-names = "default"; +}; diff --git a/configs/bananapi_m4zero_defconfig b/configs/bananapi_m4zero_defconfig new file mode 100644 @@ -329,32 +400,3 @@ index 0000000000..3442bd0c77 -- 2.39.5 -From 80a712ebaba783f51cf852cf4c7dea76085ab406 Mon Sep 17 00:00:00 2001 -From: Patrick Yavitz -Date: Thu, 3 Oct 2024 00:28:43 -0400 -Subject: [PATCH] Add pinctrl: x32clk_fanout_pin - -Signed-off-by: Patrick Yavitz ---- - arch/arm/dts/sun50i-h618-bananapi-m4.dtsi | 5 +++++ - 1 file changed, 5 insertions(+) - -diff --git a/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi b/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi -index 9b1381a764..d231d80946 100644 ---- a/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi -+++ b/arch/arm/dts/sun50i-h618-bananapi-m4.dtsi -@@ -142,6 +142,11 @@ - vcc-pg-supply = <®_dldo1>; - vcc-ph-supply = <®_dldo1>; - vcc-pi-supply = <®_dldo1>; -+ -+ x32clk_fanout_pin: x32clk-fanout-pin { -+ pins = "PG10"; -+ function = "clock"; -+ }; - }; - - &r_i2c { --- -2.39.5 -