diff options
author | Ben_Pai <ben_pai@wistron.com> | 2019-07-15 11:19:02 +0300 |
---|---|---|
committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-08-14 20:10:14 +0300 |
commit | b24a3e589e1a6eac0cb69d4c1ba2d1be36d1d2cb (patch) | |
tree | 7ea45a9cecb32ee49d64507bfc5fe96d4699f617 /meta-ibm/meta-witherspoon/recipes-phosphor/gpio | |
parent | 5117a7b4186280a54369292afecbcb2edcb7707e (diff) | |
download | openbmc-b24a3e589e1a6eac0cb69d4c1ba2d1be36d1d2cb.tar.xz |
Add mihawk platform to meta-ibm
The contents of this up-stream include the following items
1.Basic function
2.Led settings
3.GPIO monitor (id button and power supply)
4.Linux dts patch.
(From meta-ibm rev: c53430a2234917b71f29d7e61d6aea749c45a2fc)
Change-Id: Id0e47fd9197c8b2a70cbc94888bd572255664cdd
Signed-off-by: Ben Pai <Ben_Pai@wistron.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-ibm/meta-witherspoon/recipes-phosphor/gpio')
7 files changed, 85 insertions, 0 deletions
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button.bb b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button.bb new file mode 100644 index 0000000000..cdbdf778de --- /dev/null +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button.bb @@ -0,0 +1,30 @@ +SUMMARY = "ID Button pressed application" +PR = "r1" +LICENSE = "Apache-2.0" +LIC_FILES_CHKSUM = "file://${IBMBASE}/COPYING.apache-2.0;md5=34400b68072d710fecd0a2940a0d1658" + +inherit obmc-phosphor-systemd + +DEPENDS += "virtual/obmc-gpio-monitor" +RDEPENDS_${PN} += "virtual/obmc-gpio-monitor" + +S = "${WORKDIR}" +SRC_URI += "file://toggle_identify_led.sh" + +do_install() { + install -d ${D}${bindir} + install -m 0755 ${WORKDIR}/toggle_identify_led.sh \ + ${D}${bindir}/toggle_identify_led.sh +} + +SYSTEMD_ENVIRONMENT_FILE_${PN} +="obmc/gpio/id_button" + +ID_BUTTON_SERVICE = "id_button" + +TMPL = "phosphor-gpio-monitor@.service" +INSTFMT = "phosphor-gpio-monitor@{0}.service" +TGT = "multi-user.target" +FMT = "../${TMPL}:${TGT}.requires/${INSTFMT}" + +SYSTEMD_SERVICE_${PN} += "id-button-pressed.service" +SYSTEMD_LINK_${PN} += "${@compose_list(d, 'FMT', 'ID_BUTTON_SERVICE')}" diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button/id-button-pressed.service b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button/id-button-pressed.service new file mode 100644 index 0000000000..c4f939cc36 --- /dev/null +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button/id-button-pressed.service @@ -0,0 +1,9 @@ +[Unit] +Description=ID Button Pressed Service +Wants=mapper-wait@-xyz-openbmc_project-led-groups.service +After=mapper-wait@-xyz-openbmc_project-led-groups.service +StartLimitIntervalSec=0 + +[Service] +Type=oneshot +ExecStart=/usr/bin/toggle_identify_led.sh diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button/obmc/gpio/id_button b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button/obmc/gpio/id_button new file mode 100644 index 0000000000..370e609cd8 --- /dev/null +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button/obmc/gpio/id_button @@ -0,0 +1,5 @@ +DEVPATH=/dev/input/by-path/platform-gpio-keys-event +KEY=41 +POLARITY=1 +TARGET=id-button-pressed.service +EXTRA_ARGS=--continue diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button/toggle_identify_led.sh b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button/toggle_identify_led.sh new file mode 100644 index 0000000000..cd44c4b6bd --- /dev/null +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/id-button/toggle_identify_led.sh @@ -0,0 +1,27 @@ +#!/bin/sh +# Toggle the state of identify LED Group + +SERVICE="xyz.openbmc_project.LED.GroupManager" +INTERFACE="xyz.openbmc_project.Led.Group" +PROPERTY="Asserted" + +# Get current state +object=$(busctl tree $SERVICE --list | grep identify) +led=$(cat /sys/devices/platform/leds/leds/rear-id/brightness) +if [ "$led" == "0" ]; then + busctl set-property $SERVICE $object $INTERFACE $PROPERTY b false +else + busctl set-property $SERVICE $object $INTERFACE $PROPERTY b true +fi + +state=$(busctl get-property $SERVICE $object $INTERFACE $PROPERTY \ + | awk '{print $NF;}') + +if [ "$state" == "false" ]; then + target='true' +else + target='false' +fi + +# Set target state +busctl set-property $SERVICE $object $INTERFACE $PROPERTY b $target diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/mihawk/obmc/gpio/phosphor-power-supply-0.conf b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/mihawk/obmc/gpio/phosphor-power-supply-0.conf new file mode 100755 index 0000000000..577548792e --- /dev/null +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/mihawk/obmc/gpio/phosphor-power-supply-0.conf @@ -0,0 +1,6 @@ +INVENTORY=/system/chassis/motherboard/powersupply0 +DEVPATH=/dev/input/by-path/platform-gpio-keys-event +KEY=200 +NAME=powersupply0 +DRIVERS=/sys/bus/i2c/drivers/ibm-cffps,3-005b +EXTRA_IFACES=xyz.openbmc_project.Inventory.Item.PowerSupply diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/mihawk/obmc/gpio/phosphor-power-supply-1.conf b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/mihawk/obmc/gpio/phosphor-power-supply-1.conf new file mode 100755 index 0000000000..4d76afb4d5 --- /dev/null +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/mihawk/obmc/gpio/phosphor-power-supply-1.conf @@ -0,0 +1,6 @@ +INVENTORY=/system/chassis/motherboard/powersupply1 +DEVPATH=/dev/input/by-path/platform-gpio-keys-event +KEY=202 +NAME=powersupply1 +DRIVERS=/sys/bus/i2c/drivers/ibm-cffps,3-0058 +EXTRA_IFACES=xyz.openbmc_project.Inventory.Item.PowerSupply diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend index 032056c264..6919edf7c0 100644 --- a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend +++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend @@ -6,7 +6,9 @@ POWERSUPPLY_TGT = "multi-user.target" FMT_POWERSUPPLY = "../${TMPL_POWERSUPPLY}:${POWERSUPPLY_TGT}.requires/${INSTFMT_POWERSUPPLY}" SYSTEMD_LINK_${PN}-presence_append_ibm-ac-server = " ${@compose_list(d, 'FMT_POWERSUPPLY', 'OBMC_POWER_SUPPLY_INSTANCES')}" +SYSTEMD_LINK_${PN}-presence_append_mihawk = " ${@compose_list(d, 'FMT_POWERSUPPLY', 'OBMC_POWER_SUPPLY_INSTANCES')}" POWERSUPPLY_ENV_FMT = "obmc/gpio/phosphor-power-supply-{0}.conf" SYSTEMD_ENVIRONMENT_FILE_${PN}-presence_append_ibm-ac-server = " ${@compose_list(d, 'POWERSUPPLY_ENV_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}" +SYSTEMD_ENVIRONMENT_FILE_${PN}-presence_append_mihawk = " ${@compose_list(d, 'POWERSUPPLY_ENV_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}" |