diff options
author | Yang Chen <yang.chen@quantatw.com> | 2024-05-15 15:39:20 +0300 |
---|---|---|
committer | Patrick Williams <patrick@stwcx.xyz> | 2024-05-15 20:53:07 +0300 |
commit | b70890e322073c4d8f7cf77e1ae0b0fa28669f96 (patch) | |
tree | 339c208d0f4518789378b029b06e170250ef4834 /meta-facebook | |
parent | e758ab0afd33826684188b9141a15aa9ce1716ee (diff) | |
download | openbmc-b70890e322073c4d8f7cf77e1ae0b0fa28669f96.tar.xz |
meta-facebook: minerva: add 99-platform-init
Add 99-platform-init to archive the following items:
1. Disable FMC_WDT2
AsT2600 uses the FMC_WDT2 register to archive the ABR feature.
Use this script to disable FMC_WDT2 before the systemd starts.
2. Detect boot flash source
Read the boot source for FMC_WDT2 and write into /run/media/slot
0: boot from primary source
1: boot from alternate source
Change-Id: I1219b870381a7292394635f7ecc29040eac8f555
Signed-off-by: Yang Chen <yang.chen@quantatw.com>
Diffstat (limited to 'meta-facebook')
2 files changed, 25 insertions, 0 deletions
diff --git a/meta-facebook/meta-minerva/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bbappend b/meta-facebook/meta-minerva/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bbappend new file mode 100644 index 0000000000..8469d95d79 --- /dev/null +++ b/meta-facebook/meta-minerva/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init.bbappend @@ -0,0 +1,2 @@ +FILESEXTRAPATHS:append := ":${THISDIR}/${PN}" +SOURCE_FILES:append = " 99-platform-init" diff --git a/meta-facebook/meta-minerva/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/99-platform-init b/meta-facebook/meta-minerva/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/99-platform-init new file mode 100644 index 0000000000..d9def86a2a --- /dev/null +++ b/meta-facebook/meta-minerva/recipes-phosphor/initrdscripts/phosphor-static-norootfs-init/99-platform-init @@ -0,0 +1,23 @@ +#bin/sh + +# Create /dev/mem +if [ ! -c /dev/mem ]; then + /bin/mknod /dev/mem c 1 1 +fi + +# 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 |