From 8350dd75800e82102c6154d63f7134b2c999933d Mon Sep 17 00:00:00 2001 From: George Hung Date: Thu, 1 Jul 2021 12:22:16 +0800 Subject: 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 Change-Id: I9b4390d146902484c75bdce20ef6eead2833fc14 --- .../recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh | 34 +++++++++++++++------- 1 file changed, 24 insertions(+), 10 deletions(-) (limited to 'meta-quanta/meta-gbs') 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 d0453ec5e..8c7cbd54a 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 @@ set_hdd_prsnt() { 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 @@ verify_host_bios() { 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 @@ check_power_status() { 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 @@ main() { check_board_sku - reset_phy - if [[ $(check_power_status) != \ 'xyz.openbmc_project.State.Chassis.PowerState.On' ]]; then verify_host_bios @@ -257,6 +268,9 @@ main() { 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 -- cgit v1.2.3