summaryrefslogtreecommitdiff
path: root/meta-quanta
diff options
context:
space:
mode:
authorGeorge Hung <george.hung@quantatw.com>2021-07-01 07:22:16 +0300
committerGeorge Hung <george.hung@quantatw.com>2021-07-01 07:22:16 +0300
commit8350dd75800e82102c6154d63f7134b2c999933d (patch)
tree714ad51aba7021f2343577109bc21439f9bfc3f5 /meta-quanta
parent1d7fe62be329e47b0e7baeb0f06ba077b0fe5ab8 (diff)
downloadopenbmc-8350dd75800e82102c6154d63f7134b2c999933d.tar.xz
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
Diffstat (limited to 'meta-quanta')
-rw-r--r--meta-quanta/meta-gbs/recipes-gbs/gbs-sysinit/files/gbs-sysinit.sh34
1 files changed, 24 insertions, 10 deletions
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