[openwrt/openwrt] mediatek: filogic: bpi-r4: set netdev-name for sfp ports

LEDE Commits lede-commits at lists.infradead.org
Fri Dec 20 09:19:34 PST 2024


aparcar pushed a commit to openwrt/openwrt.git, branch main:
https://git.openwrt.org/cd8dcfef378044a1687adfa3738f01f9a9622baf

commit cd8dcfef378044a1687adfa3738f01f9a9622baf
Author: Jonas Jelonek <jelonek.jonas at gmail.com>
AuthorDate: Wed Nov 13 22:25:09 2024 +0000

    mediatek: filogic: bpi-r4: set netdev-name for sfp ports
    
    Sets openwrt,netdev-name for the gmac nodes in the dts of BPI-R4 which
    correspond to the two sfp slots. By default they are automatically
    named as eth1 and eth2 in bad order, however 'SFP1-WAN' and 'SFP2-LAN'
    are printed on the PCB and the official metal case has labels 'SFP-WAN'
    and 'SFP-LAN'. Thus, label the ports accordingly to match the
    board/case labels.
    The COMPAT_VERSION is increased to denote that configuration has to be
    adjusted manually.
    
    Signed-off-by: Jonas Jelonek <jelonek.jonas at gmail.com>
---
 .../arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts    | 1 +
 .../arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts        | 1 +
 .../arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi       | 1 +
 target/linux/mediatek/filogic/base-files/etc/board.d/02_network     | 6 ++++--
 .../linux/mediatek/filogic/base-files/etc/board.d/05_compat-version | 4 ++++
 target/linux/mediatek/image/filogic.mk                              | 2 ++
 6 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts
index efcf0ec358..910f60d11b 100644
--- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts
+++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4-poe.dts
@@ -17,6 +17,7 @@
 	phy-connection-type = "internal";
 	phy = <&int_2p5g_phy>;
 	status = "okay";
+	openwrt,netdev-name = "lan4";
 };
 
 &int_2p5g_phy {
diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
index d2c223b4ef..0f8b6e3d03 100644
--- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
+++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dts
@@ -29,6 +29,7 @@
 	managed = "in-band-status";
 	phy-mode = "usxgmii";
 	status = "okay";
+	openwrt,netdev-name = "sfp-lan";
 };
 
 &pca9545 {
diff --git a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
index c4455fbc74..8dba5b4275 100644
--- a/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
+++ b/target/linux/mediatek/files-6.6/arch/arm64/boot/dts/mediatek/mt7988a-bananapi-bpi-r4.dtsi
@@ -90,6 +90,7 @@
 	managed = "in-band-status";
 	phy-mode = "usxgmii";
 	status = "okay";
+	openwrt,netdev-name = "sfp-wan";
 };
 
 &switch {
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
index 85422fe1f6..12dca51712 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/02_network
@@ -65,9 +65,11 @@ mediatek_setup_interfaces()
 	edgecore,eap111)
 		ucidef_set_interfaces_lan_wan eth0 eth1
 		;;
-	bananapi,bpi-r4|\
+	bananapi,bpi-r4)
+		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 sfp-lan" "wan sfp-wan"
+		;;
 	bananapi,bpi-r4-poe)
-		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 eth1" "wan eth2"
+		ucidef_set_interfaces_lan_wan "lan1 lan2 lan3 lan4" "wan sfp-wan"
 		;;
 	comfast,cf-e393ax)
 		ucidef_set_interfaces_lan_wan "lan1" eth1
diff --git a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version
index 48c040613c..5ffc4e3374 100644
--- a/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version
+++ b/target/linux/mediatek/filogic/base-files/etc/board.d/05_compat-version
@@ -11,6 +11,10 @@ case "$(board_name)" in
 	routerich,ax3000)
 		ucidef_set_compat_version "1.1"
 		;;
+	bananapi,bpi-r4|\
+	bananapi,bpi-r4-poe)
+		ucidef_set_compat_version "1.1"
+		;;
 esac
 
 board_config_flush
diff --git a/target/linux/mediatek/image/filogic.mk b/target/linux/mediatek/image/filogic.mk
index 825e4abbad..abc6fc1e09 100644
--- a/target/linux/mediatek/image/filogic.mk
+++ b/target/linux/mediatek/image/filogic.mk
@@ -433,6 +433,8 @@ define Device/bananapi_bpi-r4-common
   DEVICE_DTC_FLAGS := --pad 4096
   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
+  DEVICE_COMPAT_VERSION := 1.1
+  DEVICE_COMPAT_MESSAGE := The non-switch ports were renamed to match the board/case labels
   IMAGES := sysupgrade.itb
   KERNEL_LOADADDR := 0x46000000
   KERNEL_INITRAMFS_SUFFIX := -recovery.itb




More information about the lede-commits mailing list