meta-ampere: mtmitchell: led: support bmc_booted leds
This commit adds bmc_ready and sw_heartbeat leds to bmc_booted group.
When BMC's status is Ready, phosphor-led-manager shall assert bmc_ready
GPIO and create bmc/sw heart-beat signals to CPLD/HOST.
By the heartbeat signals are create by leds, the service to create
heartbeat signals is redundant, therefore ampere-bmc-heartbeat.service
shall be removed.
Tested:
1. Turn on/off, power cycle, reboot host features work correctly.
Signed-off-by: Thang Tran <thuutran@amperecomputing.com>
Change-Id: If21649c1a70a6b43acf8130561181e534f762b61
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init.bb b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init.bb
index 3a1eb2c..d79548a 100644
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init.bb
+++ b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init.bb
@@ -14,20 +14,17 @@
SRC_URI = " \
file://ampere-platform-init.service \
- file://ampere-bmc-heartbeat.service \
file://ampere_platform_init.sh \
- file://ampere_bmc_heartbeat.sh \
file://mtmitchell_platform_gpios_init.sh \
file://gpio-lib.sh \
"
SYSTEMD_PACKAGES = "${PN}"
-SYSTEMD_SERVICE:${PN} = "ampere-platform-init.service ampere-bmc-heartbeat.service"
+SYSTEMD_SERVICE:${PN} = "ampere-platform-init.service"
do_install () {
install -d ${D}${sbindir}
install -m 0755 ${WORKDIR}/gpio-lib.sh ${D}${sbindir}/
install -m 0755 ${WORKDIR}/ampere_platform_init.sh ${D}${sbindir}/
- install -m 0755 ${WORKDIR}/ampere_bmc_heartbeat.sh ${D}${sbindir}/
install -m 0755 ${WORKDIR}/mtmitchell_platform_gpios_init.sh ${D}${sbindir}/platform_gpios_init.sh
install -d ${D}${systemd_unitdir}/system/
install -m 0644 ${WORKDIR}/ampere-platform-init.service ${D}${systemd_unitdir}/system
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere-bmc-heartbeat.service b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere-bmc-heartbeat.service
deleted file mode 100644
index 9a860f3..0000000
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere-bmc-heartbeat.service
+++ /dev/null
@@ -1,12 +0,0 @@
-[Unit]
-Description=Ampere BMC heartbeat service
-
-[Service]
-Type=simple
-Restart=always
-ExecStart=/usr/sbin/ampere_bmc_heartbeat.sh
-SyslogIdentifier = "ampere-bmc-heartbeat"
-
-[Install]
-WantedBy=multi-user.target
-
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_bmc_heartbeat.sh b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_bmc_heartbeat.sh
deleted file mode 100644
index 0180996..0000000
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/ampere_bmc_heartbeat.sh
+++ /dev/null
@@ -1,18 +0,0 @@
-#!/bin/bash
-
-# shellcheck disable=SC2046
-
-value=0
-while true;
-do
- if [[ $value -eq 0 ]]; then
- value=1
- gpioset $(gpiofind led-sw-hb)=1
- gpioset $(gpiofind led-bmc-hb)=0
- else
- value=0
- gpioset $(gpiofind led-sw-hb)=0
- gpioset $(gpiofind led-bmc-hb)=1
- fi
- sleep 1s
-done
diff --git a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/mtmitchell_platform_gpios_init.sh b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/mtmitchell_platform_gpios_init.sh
index 74a7afd..3bb4e1e 100644
--- a/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/mtmitchell_platform_gpios_init.sh
+++ b/meta-ampere/meta-mitchell/recipes-ampere/platform/ampere-platform-init/mtmitchell_platform_gpios_init.sh
@@ -30,9 +30,6 @@
gpioset $(gpiofind host0-sysreset-n)=1
- # gpio-leds is controlling bmc-ready, not by gpio
- echo 1 > /sys/class/leds/bmc-ready/brightness
-
echo "Set default FAN speed to 60%"
for filename in /sys/class/hwmon/*/pwm*
do
diff --git a/meta-ampere/meta-mitchell/recipes-phosphor/leds/phosphor-led-manager/led-group-config.json b/meta-ampere/meta-mitchell/recipes-phosphor/leds/phosphor-led-manager/led-group-config.json
index 107b70c..098c3fd 100644
--- a/meta-ampere/meta-mitchell/recipes-phosphor/leds/phosphor-led-manager/led-group-config.json
+++ b/meta-ampere/meta-mitchell/recipes-phosphor/leds/phosphor-led-manager/led-group-config.json
@@ -3,6 +3,20 @@
{
"group": "bmc_booted",
"members": [
+ {
+ "Name": "bmc_ready",
+ "Action": "On",
+ "DutyOn": 50,
+ "Period": 0,
+ "Priority": "On"
+ },
+ {
+ "Name": "sw_heartbeat",
+ "Action": "Blink",
+ "DutyOn": 50,
+ "Period": 2000,
+ "Priority": "On"
+ }
]
},
{