meta-quanta: gbs: update some changes to gbs-sysinit script

- remove unnecessary reset PHY action
- check the FIU node for different kernel version
- rebind the module for the I2C switch on I2C bus 11
  as it only can work with the normal power

Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: I9b4390d146902484c75bdce20ef6eead2833fc14
diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh b/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh
index d0453ec..8c7cbd5 100644
--- a/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh
+++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh
@@ -128,9 +128,21 @@
   fi
 }
 
-KERNEL_FIU_ID="c0000000.fiu"
+KERNEL_FIU_ID="c0000000.spi"
 KERNEL_SYSFS_FIU="/sys/bus/platform/drivers/NPCM-FIU"
 
+# the node of FIU is spi for kernel 5.10, but
+# for less than or equal kernel 5.4, the node
+# is fiu
+for fname in $(find ${KERNEL_SYSFS_FIU} -type l)
+do
+    if [ "${fname##*\.}" == "fiu" ]
+    then
+        KERNEL_FIU_ID="c0000000.fiu"
+        break
+    fi
+done
+
 bind_host_mtd() {
   set_gpio_direction 'SPI_SW_SELECT' high
   if [[ -d ${KERNEL_SYSFS_FIU}/${KERNEL_FIU_ID} ]]; then
@@ -173,13 +185,6 @@
   unbind_host_mtd
 }
 
-reset_phy() {
-  ifconfig eth1 down
-  set_gpio_direction 'RST_BMC_PHY_N' low
-  set_gpio_direction 'RST_BMC_PHY_N' high
-  ifconfig eth1 up
-}
-
 parse_pe_fru() {
   pe_fruid=3
   for i in {1..2};
@@ -225,6 +230,14 @@
     echo $res0
 }
 
+clk_buf_bus_switch="11-0076"
+clk_buf_driver="/sys/bus/i2c/drivers/pca954x/"
+
+bind_clk_buf_switch() {
+  echo "Re-bind i2c bus 11 clk_buf_switch"
+  echo "${clk_buf_bus_switch}" > "${clk_buf_driver}"/bind
+}
+
 main() {
   get_board_rev_id
   get_board_sku_id
@@ -238,8 +251,6 @@
 
   check_board_sku
 
-  reset_phy
-
   if [[ $(check_power_status) != \
        'xyz.openbmc_project.State.Chassis.PowerState.On' ]]; then
     verify_host_bios
@@ -257,6 +268,9 @@
         xyz.openbmc_project.State.Host \
         RequestedHostTransition s \
         xyz.openbmc_project.State.Host.Transition.On
+
+    sleep 1
+    bind_clk_buf_switch
   else
     echo "Host is already running, doing nothing!" >&2
   fi