diff options
Diffstat (limited to 'meta-quanta/meta-gbs/recipes-gbs')
3 files changed, 38 insertions, 31 deletions
diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh b/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh index 3a215fa50..36dfa452c 100644 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh +++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-bios-update/files/bios-update.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright 2020 Google LLC # Copyright 2020 Quanta Computer Inc. # @@ -20,11 +20,23 @@ SPI_SW_SELECT=169 # Kernel control string for bind/unbind -KERNEL_FIU_ID="c0000000.fiu" +KERNEL_FIU_ID="c0000000.spi" # Kernel sysfs path for bind/unbind 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 + IMAGE_FILE="/tmp/image-bios" # Taken from /run/initramfs/update diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-nvme-pwr-ctrl/gbs-nvme-pwr-ctrl.bb b/meta-quanta/meta-gbs/recipes-gbs/gbs-nvme-pwr-ctrl/gbs-nvme-pwr-ctrl.bb deleted file mode 100644 index 21ef52c49..000000000 --- a/meta-quanta/meta-gbs/recipes-gbs/gbs-nvme-pwr-ctrl/gbs-nvme-pwr-ctrl.bb +++ /dev/null @@ -1,19 +0,0 @@ -SUMMARY = "NVMe Drives Power Control" -DESCRIPTION = "Daemon to monitor and control the power of NVMe drives" -PR = "r1" -LICENSE = "Apache-2.0" -LIC_FILES_CHKSUM = "file://${COREBASE}/meta/files/common-licenses/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10" - -inherit meson pkgconfig -inherit systemd - -DEPENDS += "sdbusplus" -DEPENDS += "boost" -DEPENDS += "libgpiod" - -SRC_URI = "git://github.com/quanta-bmc/nvme-power-control;protocol=git" -SRCREV = "3b39e92a8340d8ba1bd40a03af3f5a9049da3bc7" - -S = "${WORKDIR}/git" - -SYSTEMD_SERVICE_${PN} = "xyz.openbmc_project.Control.Nvme.Power.service" 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 |