mediatek: filogic: adapt BananaPi-R4 for use with upstream DT

* the variant with 2.5G PHY instead of LAN SFP is called '2p5'
   upstream and 'poe' in our downstream Linux 6.6 DT. Use the right
   DTS depending on the kernel version and set an additional
   compatible.

 * drop additional DT overlay for WiFi.
   The final version of the board uses a physical switch for the 12V
   power of the WiFi module and the I2C EEPROM of the module always
   comes empty (instead of with a MAC address).

Signed-off-by: Daniel Golle <daniel@makrotopia.org>
This commit is contained in:
Daniel Golle 2025-05-08 17:51:44 +01:00
parent b992aa119c
commit 465249f2b3
7 changed files with 14 additions and 1 deletions

View file

@ -12,6 +12,7 @@ unielec,u7623-02)
bananapi,bpi-r3|\ bananapi,bpi-r3|\
bananapi,bpi-r3-mini|\ bananapi,bpi-r3-mini|\
bananapi,bpi-r4|\ bananapi,bpi-r4|\
bananapi,bpi-r4-2g5|\
bananapi,bpi-r4-poe) bananapi,bpi-r4-poe)
[ -z "$(fw_printenv -n ethaddr 2>/dev/null)" ] && [ -z "$(fw_printenv -n ethaddr 2>/dev/null)" ] &&
fw_setenv ethaddr "$(cat /sys/class/net/eth0/address)" fw_setenv ethaddr "$(cat /sys/class/net/eth0/address)"

View file

@ -42,6 +42,7 @@ bananapi,bpi-r3-mini)
ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan-2" "phy1-ap0" ucidef_set_led_netdev "wlan5g" "WLAN5G" "blue:wlan-2" "phy1-ap0"
;; ;;
bananapi,bpi-r4|\ bananapi,bpi-r4|\
bananapi,bpi-r4-2g5|\
bananapi,bpi-r4-poe) bananapi,bpi-r4-poe)
ucidef_set_led_netdev "wan" "wan" "mt7530-0:00:green:wan" "wan" "link tx rx" ucidef_set_led_netdev "wan" "wan" "mt7530-0:00:green:wan" "wan" "link tx rx"
ucidef_set_led_netdev "lan1" "lan1" "mt7530-0:01:green:lan" "lan1" "link tx rx" ucidef_set_led_netdev "lan1" "lan1" "mt7530-0:01:green:lan" "lan1" "link tx rx"

View file

@ -79,6 +79,7 @@ mediatek_setup_interfaces()
bananapi,bpi-r4) bananapi,bpi-r4)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 sfp-lan" "wan sfp-wan" ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 sfp-lan" "wan sfp-wan"
;; ;;
bananapi,bpi-r4-2g5|\
bananapi,bpi-r4-poe) bananapi,bpi-r4-poe)
ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan sfp-wan" ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan sfp-wan"
;; ;;

View file

@ -12,6 +12,7 @@ case "$(board_name)" in
ucidef_set_compat_version "1.1" ucidef_set_compat_version "1.1"
;; ;;
bananapi,bpi-r4|\ bananapi,bpi-r4|\
bananapi,bpi-r4-2g5|\
bananapi,bpi-r4-poe) bananapi,bpi-r4-poe)
ucidef_set_compat_version "1.1" ucidef_set_compat_version "1.1"
;; ;;

View file

@ -55,6 +55,7 @@ case "$board" in
[ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "1" ] && macaddr_add $addr 3 > /sys${DEVPATH}/macaddress
;; ;;
bananapi,bpi-r4|\ bananapi,bpi-r4|\
bananapi,bpi-r4-2g5|\
bananapi,bpi-r4-poe) bananapi,bpi-r4-poe)
addr=$(cat /sys/class/net/eth0/address) addr=$(cat /sys/class/net/eth0/address)
[ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress [ "$PHYNBR" = "0" ] && macaddr_add $addr 2 > /sys${DEVPATH}/macaddress

View file

@ -71,6 +71,7 @@ platform_do_upgrade() {
bananapi,bpi-r3|\ bananapi,bpi-r3|\
bananapi,bpi-r3-mini|\ bananapi,bpi-r3-mini|\
bananapi,bpi-r4|\ bananapi,bpi-r4|\
bananapi,bpi-r4-2g5|\
bananapi,bpi-r4-poe|\ bananapi,bpi-r4-poe|\
cmcc,a10-ubootmod|\ cmcc,a10-ubootmod|\
cmcc,rax3000m|\ cmcc,rax3000m|\
@ -203,6 +204,7 @@ platform_check_image() {
bananapi,bpi-r3|\ bananapi,bpi-r3|\
bananapi,bpi-r3-mini|\ bananapi,bpi-r3-mini|\
bananapi,bpi-r4|\ bananapi,bpi-r4|\
bananapi,bpi-r4-2g5|\
bananapi,bpi-r4-poe|\ bananapi,bpi-r4-poe|\
cmcc,a10-ubootmod|\ cmcc,a10-ubootmod|\
cmcc,rax3000m|\ cmcc,rax3000m|\
@ -254,6 +256,7 @@ platform_copy_config() {
bananapi,bpi-r3|\ bananapi,bpi-r3|\
bananapi,bpi-r3-mini|\ bananapi,bpi-r3-mini|\
bananapi,bpi-r4|\ bananapi,bpi-r4|\
bananapi,bpi-r4-2g5|\
bananapi,bpi-r4-poe|\ bananapi,bpi-r4-poe|\
cmcc,rax3000m) cmcc,rax3000m)
if [ "$CI_METHOD" = "emmc" ]; then if [ "$CI_METHOD" = "emmc" ]; then

View file

@ -460,7 +460,7 @@ define Device/bananapi_bpi-r4-common
DEVICE_VENDOR := Bananapi DEVICE_VENDOR := Bananapi
DEVICE_DTS_DIR := $(DTS_DIR)/ DEVICE_DTS_DIR := $(DTS_DIR)/
DEVICE_DTS_LOADADDR := 0x45f00000 DEVICE_DTS_LOADADDR := 0x45f00000
DEVICE_DTS_OVERLAY:= mt7988a-bananapi-bpi-r4-emmc mt7988a-bananapi-bpi-r4-rtc mt7988a-bananapi-bpi-r4-sd mt7988a-bananapi-bpi-r4-wifi-mt7996a DEVICE_DTS_OVERLAY:= mt7988a-bananapi-bpi-r4-emmc mt7988a-bananapi-bpi-r4-rtc mt7988a-bananapi-bpi-r4-sd
DEVICE_DTC_FLAGS := --pad 4096 DEVICE_DTC_FLAGS := --pad 4096
DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \ DEVICE_PACKAGES := kmod-hwmon-pwmfan kmod-i2c-mux-pca954x kmod-eeprom-at24 kmod-mt7996-firmware kmod-mt7996-233-firmware \
kmod-rtc-pcf8563 kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs mt7988-wo-firmware kmod-rtc-pcf8563 kmod-sfp kmod-usb3 e2fsprogs f2fsck mkf2fs mt7988-wo-firmware
@ -510,10 +510,15 @@ TARGET_DEVICES += bananapi_bpi-r4
define Device/bananapi_bpi-r4-poe define Device/bananapi_bpi-r4-poe
DEVICE_MODEL := BPi-R4 2.5GE DEVICE_MODEL := BPi-R4 2.5GE
ifneq ($(CONFIG_LINUX_6_6),)
DEVICE_DTS := mt7988a-bananapi-bpi-r4-poe DEVICE_DTS := mt7988a-bananapi-bpi-r4-poe
else
DEVICE_DTS := mt7988a-bananapi-bpi-r4-2g5
endif
DEVICE_DTS_CONFIG := config-mt7988a-bananapi-bpi-r4-poe DEVICE_DTS_CONFIG := config-mt7988a-bananapi-bpi-r4-poe
$(call Device/bananapi_bpi-r4-common) $(call Device/bananapi_bpi-r4-common)
DEVICE_PACKAGES += mt7988-2p5g-phy-firmware DEVICE_PACKAGES += mt7988-2p5g-phy-firmware
SUPPORTED_DEVICES += bananapi,bpi-r4-2g5
endef endef
TARGET_DEVICES += bananapi_bpi-r4-poe TARGET_DEVICES += bananapi_bpi-r4-poe