[rdkb][mt7988][bsp][Add filogic 880 system init]
[Description]
Add filogic 880 system init
1. add THREE_GMACS_SUPPORT flag for hal-ethsw
2. init-bridge and init-MacAddr support three GMACS
[Release-log]
diff --git a/recipes-ccsp/hal/hal-ethsw-generic_git.bbappend b/recipes-ccsp/hal/hal-ethsw-generic_git.bbappend
index c50feee..4f9c9ed 100644
--- a/recipes-ccsp/hal/hal-ethsw-generic_git.bbappend
+++ b/recipes-ccsp/hal/hal-ethsw-generic_git.bbappend
@@ -4,6 +4,8 @@
CFLAGS_append = "${@bb.utils.contains('DISTRO_FEATURES', 'rdkb_wan_manager', ' -DFEATURE_RDKB_WAN_MANAGER ', '', d)}"
+CFLAGS_append_mt7988 = " -DTHREE_GMACS_SUPPORT"
+
do_configure_prepend(){
if ${@bb.utils.contains('DISTRO_FEATURES','switch_gsw_mode','true','false',d)}; then
ln -sf ${S}/rdkb_hal/src/ethsw/ccsp_hal_ethsw_gsw.c ${S}/ccsp_hal_ethsw.c
diff --git a/recipes-devtools/init-filogic/files/init-bridge.sh b/recipes-devtools/init-filogic/files/init-bridge.sh
index 0e63661..012e4d9 100644
--- a/recipes-devtools/init-filogic/files/init-bridge.sh
+++ b/recipes-devtools/init-filogic/files/init-bridge.sh
@@ -1,11 +1,12 @@
#!/bin/sh
-
+lan_ip=`syscfg get lan_ipaddr`
+lan_mask=`syscfg get lan_netmask`
#Setting brlan0 bridge
if [ ! -d /sys/class/net/brlan0 ]
then
brctl addbr brlan0
ip link set brlan0 address `cat /sys/class/net/eth1/address`
- ifconfig brlan0 10.0.0.1 netmask 255.255.255.0 up
+ ifconfig brlan0 $lan_ip netmask $lan_mask up
fi
#Work around for Ethernet connected clients
@@ -29,8 +30,13 @@
fi
ifconfig eth1 up
+board_name=`cat /proc/device-tree/model`
+if [[ $board_name == *"7988"* ]]; then
+ brctl addif brlan0 eth3
+ ifconfig eth3 up
+fi
#workaround: creating /opt/secure folder for ssh service
if [ ! -d /opt/secure ]; then
- mkdir /opt/secure
+ mkdir -p /opt/secure
fi
\ No newline at end of file
diff --git a/recipes-devtools/mtk-factory-rw/files/init-MacAddr.sh b/recipes-devtools/mtk-factory-rw/files/init-MacAddr.sh
index da83f2b..669cce4 100644
--- a/recipes-devtools/mtk-factory-rw/files/init-MacAddr.sh
+++ b/recipes-devtools/mtk-factory-rw/files/init-MacAddr.sh
@@ -1,6 +1,7 @@
#!/bin/sh
lan_mac=`/usr/sbin/mtk_factory_rw.sh -r lan`
+lan2_mac=`/usr/sbin/mtk_factory_rw.sh -r lan2`
wan_mac=`/usr/sbin/mtk_factory_rw.sh -r wan`
@@ -17,6 +18,14 @@
fi
fi
+ if [[ "$vif" == "eth3" ]]; then
+ current_mac=`cat /sys/class/net/$vif/address`
+ if [[ "$lan_mac" != "ff:ff:ff:ff:ff:ff " ]] && [[ "$lan2_mac" != "$current_mac " ]]; then
+ ifconfig $vif down
+ ifconfig $vif hw ether $lan2_mac
+ fi
+ fi
+
if [[ "$vif" == "eth2" ]] ; then
current_wan_mac=`cat /sys/class/net/$vif/address`
if [[ "$wan_mac" != "ff:ff:ff:ff:ff:ff " ]] && [[ "$wan_mac" != "$current_wan_mac " ]]; then