summaryrefslogtreecommitdiff
path: root/meta-hpe
diff options
context:
space:
mode:
authorAndrew Neyland <andrew.neyland@hpe.com>2023-08-29 22:48:27 +0300
committerJean-Marie Verdun <jean-marie.verdun@hpe.com>2023-09-19 23:14:47 +0300
commit7ebaff397ac2316ee51719f3f36b1b4e75e815e8 (patch)
treeb98b57314e176b4bd01b5e901c9e5211c4470522 /meta-hpe
parentcf8f746c599ccd0c133ab4e652eb31a32f46cb50 (diff)
downloadopenbmc-7ebaff397ac2316ee51719f3f36b1b4e75e815e8.tar.xz
meta-hpe: adding host-boot-enable for DL360 G11
Change-Id: I35c8fbcc03beafdcca17381177dc2167fe655cb4 Signed-off-by: Andrew Neyland <andrew.neyland@hpe.com>
Diffstat (limited to 'meta-hpe')
-rw-r--r--meta-hpe/meta-dl360-g11/recipes-hpe/host/host-boot-enable.bbappend1
-rw-r--r--meta-hpe/meta-dl360-g11/recipes-hpe/host/host-boot-enable/host-boot-enable.sh75
2 files changed, 76 insertions, 0 deletions
diff --git a/meta-hpe/meta-dl360-g11/recipes-hpe/host/host-boot-enable.bbappend b/meta-hpe/meta-dl360-g11/recipes-hpe/host/host-boot-enable.bbappend
new file mode 100644
index 0000000000..4fc41d0580
--- /dev/null
+++ b/meta-hpe/meta-dl360-g11/recipes-hpe/host/host-boot-enable.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
diff --git a/meta-hpe/meta-dl360-g11/recipes-hpe/host/host-boot-enable/host-boot-enable.sh b/meta-hpe/meta-dl360-g11/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
new file mode 100644
index 0000000000..f25495056f
--- /dev/null
+++ b/meta-hpe/meta-dl360-g11/recipes-hpe/host/host-boot-enable/host-boot-enable.sh
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+findmtd() {
+ m=$(grep -xl "$1" /sys/class/mtd/*/name)
+ m=${m%/name}
+ m=${m##*/}
+ echo "$m"
+}
+
+hostPrime=$(findmtd host-prime)
+if test -z "$hostPrime"
+then
+ echo "Unable to find mtd partition for ${hostPrime}"
+ exit 1
+fi
+
+hostSecond=$(findmtd host-second)
+if test -z "$hostSecond"
+then
+ echo "Unable to find mtd partition for ${hostSecond}"
+ exit 1
+fi
+
+vromPrime=$(findmtd vrom-prime)
+if test -z "$vromPrime"
+then
+ echo "Unable to find mtd partition for ${vromPrime}"
+ exit 1
+fi
+
+vromSecond=$(findmtd vrom-second)
+if test -z "$vromSecond"
+then
+ echo "Unable to find mtd partition for ${vromSecond}"
+ exit 1
+fi
+
+
+#enable vrom
+# host-prime to vrom-prime
+dd if=/dev/"${hostPrime}" of=/dev/"${vromPrime}"
+# host-second to vrom-second
+dd if=/dev/"${hostSecond}" of=/dev/"${vromSecond}"
+
+# enable UART on rl300
+systemctl start obmc-console@ttyS3.service
+
+echo 0x1800008a > /sys/class/soc/srom/vromoff
+
+devmem 0xd1000008 8 128
+devmem 0xd1000009 8 36
+devmem 0xd1000041 8 255
+devmem 0xd100004b 8 8
+# setup PCIe ID
+devmem 0x802f002e 16 0x03d8
+#enable debug vsp output
+devmem 0x80fc0230 8 0x1
+
+# Check the current power status
+
+currentstate=$(busctl get-property xyz.openbmc_project.State.Chassis0 /xyz/openbmc_project/state/chassis0 xyz.openbmc_project.State.Chassis CurrentPowerState | awk '{ print $2 }')
+
+
+if [ "$currentstate" = "\"xyz.openbmc_project.State.Chassis.PowerState.On\"" ]
+then
+ systemctl stop phosphor-virtual-sensor.service
+ sleep 2
+ devmem 0x80fc0230 8 0x1
+ systemctl start phosphor-virtual-sensor.service
+fi
+
+while 'true'
+do
+ sleep 1
+done \ No newline at end of file