Rainier power supply presence detects
Update rainier.conf to indicate the four power supply instances.
Update bbappend for Rainier SYSTEMD_LINK and SYSTEMD_ENVIRONMENT_FILE.
Add in subdirectory and power supply configuration files for GPIO
presence detect of the Rainier power supplies.
Use aspeed-gpio.sh from https://github.com/bradbishop/gpio-keys to
determine gpio-key values. Use 7-bit I2C addresses on BMC.
+-----+--------+----------+----+
| PSU | GPIO | gpio-key | AA |
+-----+--------+----------+----+
| ps0 | GPIOS0 | 144 | 68 |
+-----+--------+----------+----+
| ps1 | GPIOS1 | 145 | 69 |
+-----+--------+----------+----+
| ps2 | GPIOS2 | 146 | 6a |
+-----+--------+----------+----+
| ps3 | GPIOS3 | 147 | 6b |
+-----+--------+----------+----+
(From meta-ibm rev: 3e8f174546cf440fda56ce47523030d4d403edbd)
Change-Id: Ia55f80e4d857e7a477385d73c12f9719e3065f95
Signed-off-by: Brandon Wyman <bjwyman@gmail.com>
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/meta-ibm/meta-witherspoon/conf/machine/rainier.conf b/meta-ibm/meta-witherspoon/conf/machine/rainier.conf
index 628a45a..78ffbbc 100644
--- a/meta-ibm/meta-witherspoon/conf/machine/rainier.conf
+++ b/meta-ibm/meta-witherspoon/conf/machine/rainier.conf
@@ -1,6 +1,8 @@
KERNEL_DEVICETREE = "aspeed-bmc-ibm-rainier.dtb"
UBOOT_MACHINE = "evb-ast2600_defconfig"
+OBMC_POWER_SUPPLY_INSTANCES = "0 1 2 3"
+
require conf/machine/include/ast2600.inc
require conf/machine/include/obmc-bsp-common.inc
require conf/machine/include/openpower.inc
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-0.conf b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-0.conf
new file mode 100644
index 0000000..07564e9
--- /dev/null
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/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=144
+NAME=powersupply0
+DRIVERS=/sys/bus/i2c/drivers/ibm-cffps,3-0068
+EXTRA_IFACES=xyz.openbmc_project.Inventory.Item.PowerSupply
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-1.conf b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-1.conf
new file mode 100644
index 0000000..304442f
--- /dev/null
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/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=145
+NAME=powersupply1
+DRIVERS=/sys/bus/i2c/drivers/ibm-cffps,3-0069
+EXTRA_IFACES=xyz.openbmc_project.Inventory.Item.PowerSupply
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-2.conf b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-2.conf
new file mode 100644
index 0000000..0f2a9c4
--- /dev/null
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-2.conf
@@ -0,0 +1,6 @@
+INVENTORY=/system/chassis/motherboard/powersupply2
+DEVPATH=/dev/input/by-path/platform-gpio-keys-event
+KEY=146
+NAME=powersupply2
+DRIVERS=/sys/bus/i2c/drivers/ibm-cffps,3-006a
+EXTRA_IFACES=xyz.openbmc_project.Inventory.Item.PowerSupply
diff --git a/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-3.conf b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-3.conf
new file mode 100644
index 0000000..3ea74ac
--- /dev/null
+++ b/meta-ibm/meta-witherspoon/recipes-phosphor/gpio/phosphor-gpio-monitor/rainier/obmc/gpio/phosphor-power-supply-3.conf
@@ -0,0 +1,6 @@
+INVENTORY=/system/chassis/motherboard/powersupply3
+DEVPATH=/dev/input/by-path/platform-gpio-keys-event
+KEY=147
+NAME=powersupply3
+DRIVERS=/sys/bus/i2c/drivers/ibm-cffps,3-006b
+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 6919edf..04399f8 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
@@ -7,8 +7,10 @@
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')}"
+SYSTEMD_LINK_${PN}-presence_append_rainier = " ${@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')}"
+SYSTEMD_ENVIRONMENT_FILE_${PN}-presence_append_rainier = " ${@compose_list(d, 'POWERSUPPLY_ENV_FMT', 'OBMC_POWER_SUPPLY_INSTANCES')}"