diff options
author | Peter Yin <peter.yin@quantatw.com> | 2023-12-06 13:08:31 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2024-01-04 16:18:47 +0300 |
commit | 331473560270bfb11b03cd8162b7213c3de01cad (patch) | |
tree | d61298586d5bfac6f91d52520fe4d719d135ab8c | |
parent | 3a36a0f215c6143126315b48be23681a7c106f39 (diff) | |
download | openbmc-331473560270bfb11b03cd8162b7213c3de01cad.tar.xz |
meta-facebook: harma: initrdscripts
1.Enable ESPI register
2.Disable WDT2 for Dual image.
Change-Id: Id3dc4cefeb10b58b5bb24f6ac5470e82758b4b5a
Signed-off-by: Peter Yin <peter.yin@quantatw.com>
2 files changed, 26 insertions, 0 deletions
diff --git a/meta-facebook/meta-harma/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bbappend b/meta-facebook/meta-harma/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bbappend new file mode 100644 index 0000000000..a718b14f7b --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" +SOURCE_FILES:append = " 99-platform-init"
\ No newline at end of file diff --git a/meta-facebook/meta-harma/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/99-platform-init b/meta-facebook/meta-harma/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/99-platform-init new file mode 100644 index 0000000000..80373cb02e --- /dev/null +++ b/meta-facebook/meta-harma/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/99-platform-init @@ -0,0 +1,24 @@ +#bin/sh + +# Create /dev/mem +if [ ! -c /dev/mem ]; then + /bin/mknod /dev/mem c 1 1 +fi + +# This +# Disable FMC_WDT2 +FMC_WDT2_CTRL_VAL=$(/sbin/devmem 0x1e620064) +FMC_WDT2_CTRL_VAL=$((16#${FMC_WDT2_CTRL_VAL#"0x"})) +SET_VAL=$((FMC_WDT2_CTRL_VAL & 0xFFFFFFFE)) +/sbin/devmem 0x1e620064 32 "$SET_VAL" + +# Detect boot flash source +SLOT_FILE="/run/media/slot" +mkdir -p "$(dirname "${SLOT_FILE}")" +if [ "$((FMC_WDT2_CTRL_VAL & 0x00000010))" != "0" ]; then + echo "1" > "$SLOT_FILE" +else + echo "0" > "$SLOT_FILE" +fi + +exit 0 |