diff options
author | Peter Yin <peter.yin@quantatw.com> | 2024-01-18 12:39:19 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2024-01-24 15:40:27 +0300 |
commit | ad06f332cdcee394a86ad21871d7c1e887046296 (patch) | |
tree | 309ef79b7cca81ecaddb47edb691390d6abe07ce | |
parent | a396c57aeda90eebbb75a3acc9d0248040be3d1f (diff) | |
download | openbmc-ad06f332cdcee394a86ad21871d7c1e887046296.tar.xz |
meta-facebook: harma: fix bios spi path
Bios SPI path has been changed from spi1.0 to spi3.0 due to the addition of gpio_spi.
root@harma:~# ls /sys/bus/spi/devices/ -al
drwxr-xr-x 2 root root 0 Dec 31 1969 .
drwxr-xr-x 4 root root 0 Dec 31 1969 ..
lrwxrwxrwx 1 root root 0 Dec 31 1969 spi1.0 -> ../../../devices/platform/spi-gpio/spi_master/spi1/spi1.0
lrwxrwxrwx 1 root root 0 Dec 31 1969 spi2.0 -> ../../../devices/platform/ahb/1e620000.spi/spi_master/spi2/spi2.0
lrwxrwxrwx 1 root root 0 Dec 31 1969 spi2.1 -> ../../../devices/platform/ahb/1e620000.spi/spi_master/spi2/spi2.1
lrwxrwxrwx 1 root root 0 Dec 31 1969 spi3.0 -> ../../../devices/platform/ahb/1e631000.spi/spi_master/spi3/spi3.0
Change-Id: I1ccb6f3dff555a7f1267d0f583fc733853129814
Signed-off-by: Peter Yin <peter.yin@quantatw.com>
-rwxr-xr-x | meta-facebook/meta-harma/recipes-phosphor/flash/phosphor-software-manager/bios-update.sh | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/meta-facebook/meta-harma/recipes-phosphor/flash/phosphor-software-manager/bios-update.sh b/meta-facebook/meta-harma/recipes-phosphor/flash/phosphor-software-manager/bios-update.sh index 0d52876a08..b21c5d2ead 100755 --- a/meta-facebook/meta-harma/recipes-phosphor/flash/phosphor-software-manager/bios-update.sh +++ b/meta-facebook/meta-harma/recipes-phosphor/flash/phosphor-software-manager/bios-update.sh @@ -7,7 +7,8 @@ source /usr/libexec/phosphor-state-manager/power-cmd IMAGE_FILE=$1 -SPI_DEV="spi1.0" +# SPI Get Link name +SPI_DEV=$(find /sys/bus/spi/devices/ -type l -exec sh -c 'readlink "$1" | grep -q "1e631000.spi" && basename "$1"' _ {} \;) SPI_PATH="/sys/bus/spi/drivers/spi-nor" set_gpio_to_bmc() @@ -46,7 +47,7 @@ set_gpio_to_bmc #Bind spi driver to access flash echo "bind aspeed-smc spi driver" -echo -n $SPI_DEV > $SPI_PATH/bind +echo -n "$SPI_DEV" > "$SPI_PATH"/bind sleep 1 #Flashcp image to device. @@ -76,7 +77,7 @@ fi #Unbind spi driver sleep 1 echo "Unbind aspeed-smc spi driver" -echo -n $SPI_DEV > $SPI_PATH/unbind +echo -n "$SPI_DEV" > "$SPI_PATH"/unbind sleep 10 #Flip GPIO back for host to access SPI flash |