diff options
author | Mike Garrett <mike.garrett@hpe.com> | 2021-08-28 00:59:09 +0300 |
---|---|---|
committer | Mike Garrett <mike.garrett@hpe.com> | 2021-09-07 21:35:05 +0300 |
commit | c088ff2d4619f46a5d200d90e79f094be3b8bc09 (patch) | |
tree | cab7d23d61d188c05422b03ce459c82120416e4f /meta-hpe | |
parent | 2a61651573dd5081be3c1d4c2424f3190829d615 (diff) | |
download | openbmc-c088ff2d4619f46a5d200d90e79f094be3b8bc09.tar.xz |
meta-hpe: Fix host-boot enable override function
Code restructured to make the DL360poc the override case
Signed-off-by: Mike Garrett <mike.garrett@hpe.com>
Change-Id: I615e040a3329d1af7f8861d751794be5f4a31836
Diffstat (limited to 'meta-hpe')
6 files changed, 116 insertions, 2 deletions
diff --git a/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable.bb b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable.bb new file mode 100644 index 0000000000..58cc921a50 --- /dev/null +++ b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable.bb @@ -0,0 +1,20 @@ +SUMMARY = "Enable Host Boot" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${HPEBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +inherit obmc-phosphor-systemd + +HOST_BOOT_SERVICE = "host-boot-enable.service" +SYSTEMD_SERVICE:${PN} += "${HOST_BOOT_SERVICE}" + +HOST_BOOT_FMT = "../${HOST_BOOT_SERVICE}:multi-user.target.wants/${HOST_BOOT_SERVICE}" +SYSTEMD_LINK_${PN} += "${HOST_BOOT_FMT}" + +SRC_URI += "file://host-boot-enable.service" +SRC_URI += "file://host-boot-enable.sh" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/host-boot-enable.sh ${D}${bindir} +} diff --git a/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.service b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.service new file mode 100644 index 0000000000..58f8c5d251 --- /dev/null +++ b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.service @@ -0,0 +1,15 @@ +[Unit] +Description=Enable Host Boot +Wants=phosphor-ipmi-host.service +After=phosphor-ipmi-host.service + +[Service] +Type=simple +ExecStart=/bin/sh -c "host-boot-enable.sh" +SyslogIdentifier=host-boot-enable +Restart=always +RestartSec=5 +StartLimitInterval=0 + +[Install] +WantedBy=multi-user.target diff --git a/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.sh b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.sh new file mode 100644 index 0000000000..1798607e0a --- /dev/null +++ b/meta-hpe/meta-common/recipes-hpe/host/host-boot-enable/host-boot-enable.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +findmtd() { + m=$(grep -xl "$1" /sys/class/mtd/*/name) + m=${m%/name} + m=${m##*/} + echo $m +} + +rom_lists=(host-prime host-second vrom-prime vrom-second) +rom_mtd_list=() + +for f in "${rom_lists[@]}" +do + image=$(findmtd ${f}) + if test -z "$image" + then + echo "Unable to find mtd partition for ${f}" + exit 1 + fi + rom_mtd_list+=($image) +done + +#enable vrom +# host-prime to vrom-prime +dd if=/dev/${rom_mtd_list[0]} of=/dev/${rom_mtd_list[2]} +# host-second to vrom-second +dd if=/dev/${rom_mtd_list[1]} of=/dev/${rom_mtd_list[3]} + +echo 0x1800008a > /sys/class/soc/srom/vromoff + +val=$(( ("$(devmem 0xd1000006 8)" && 0xff) | 0x04 )) +devmem 0xd1000006 8 $val +devmem 0xd1000018 8 0xff +while [ true ] +do + devmem 0xd100000f 8 0x14 + sleep 1 +done + diff --git a/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable.bbappend b/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable.bbappend new file mode 100644 index 0000000000..4fc41d0580 --- /dev/null +++ b/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable.bbappend @@ -0,0 +1 @@ +FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" diff --git a/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh b/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh new file mode 100644 index 0000000000..08b882d6d2 --- /dev/null +++ b/meta-hpe/meta-dl360poc/recipes-hpe/host/host-boot-enable/host-boot-enable.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +findmtd() { + m=$(grep -xl "$1" /sys/class/mtd/*/name) + m=${m%/name} + m=${m##*/} + echo $m +} + +rom_lists=(host-prime host-second vrom-prime vrom-second) +rom_mtd_list=() + +for f in "${rom_lists[@]}" +do + image=$(findmtd ${f}) + if test -z "$image" + then + echo "Unable to find mtd partition for ${f}" + exit 1 + fi + rom_mtd_list+=($image) +done + +#enable vrom +# host-prime to vrom-prime +dd if=/dev/${rom_mtd_list[0]} of=/dev/${rom_mtd_list[2]} +# host-second to vrom-second +dd if=/dev/${rom_mtd_list[1]} of=/dev/${rom_mtd_list[3]} + +echo 0x1800008a > /sys/class/soc/srom/vromoff + +while [ true ] +do + devmem 0x8000005C 8 0 + devmem 0xd1000306 8 5 + devmem 0xd1000318 8 0x03 + devmem 0xd100030f 8 0x04 + sleep 1 +done + diff --git a/meta-hpe/meta-dl360poc/recipes-phosphor/image/obmc-phosphor-image.bbappend b/meta-hpe/meta-dl360poc/recipes-phosphor/image/obmc-phosphor-image.bbappend index ad672452a9..fc239be987 100644 --- a/meta-hpe/meta-dl360poc/recipes-phosphor/image/obmc-phosphor-image.bbappend +++ b/meta-hpe/meta-dl360poc/recipes-phosphor/image/obmc-phosphor-image.bbappend @@ -1,5 +1,3 @@ - - do_generate_hpe_image() { # Add gxp-bootblock to hpe-section dd bs=1k conv=notrunc seek=64 \ |