diff --git a/initrd/bin/flash.sh b/initrd/bin/flash.sh index 0d2f5ba4..bb563016 100755 --- a/initrd/bin/flash.sh +++ b/initrd/bin/flash.sh @@ -16,9 +16,6 @@ case "$CONFIG_BOARD" in "kgpe-d16" ) FLASHROM_OPTIONS='--force --noverify --programmer internal' ;; - "kgpe-d16-openbmc" ) - FLASHROM_OPTIONS='--programmer="ast1100:spibus=2,cpu=reset" -c "S25FL128P......0"' - ;; * ) die "ERROR: No board has been configured!\n\nEach board requires specific flashrom options and it's unsafe to flash without them.\n\nAborting." ;; diff --git a/initrd/bin/flashrom-kgpe-d16-openbmc.sh b/initrd/bin/flashrom-kgpe-d16-openbmc.sh new file mode 100755 index 00000000..138ce035 --- /dev/null +++ b/initrd/bin/flashrom-kgpe-d16-openbmc.sh @@ -0,0 +1,16 @@ +#!/bin/sh +. /etc/functions + +ROM="$1" +if [ -z "$1" ]; then + die "Usage: $0 /media/kgpe-d16-openbmc.rom" +fi + +cp "$ROM" /tmp/kgpe-d16-openbmc.rom +sha256sum /tmp/kgpe-d16-openbmc.rom + +flashrom --programmer="ast1100:spibus=2,cpu=reset" -c "S25FL128P......0" -w /tmp/kgpe-d16-openbmc.rom \ +|| die "$ROM: Flash failed" + +warn "Reboot and hopefully it works..." +exit 0