meta-facebook: minerva: Add monitor AC power good on each blade

Monitor AC power good on each blade (16 MTIA blades + 6 network blades).

Change-Id: Idf074289e9f5439956cae2f2859ca16d7e47ec05
Signed-off-by: Yang Chen <yang.chen@quantatw.com>
diff --git a/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/ac-power-good-assert@.service b/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/ac-power-good-assert@.service
new file mode 100644
index 0000000..b390836
--- /dev/null
+++ b/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/ac-power-good-assert@.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=%i AC Power Good Status Assert
+
+[Service]
+Type=oneshot
+ExecStart=/usr/libexec/phosphor-gpio-monitor/logging "%i AC power good assert" "BLADE" "%i"
+SyslogIdentifier=%i-AC-power-good-assert
diff --git a/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/ac-power-good-deassert@.service b/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/ac-power-good-deassert@.service
new file mode 100644
index 0000000..6a55141
--- /dev/null
+++ b/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/ac-power-good-deassert@.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=%i AC Power Good Status Deassert
+
+[Service]
+Type=oneshot
+ExecStart=/usr/libexec/phosphor-gpio-monitor/logging "%i AC power good deassert" "BLADE" "%i"
+SyslogIdentifier=%i-AC-power-good-deassert
diff --git a/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/minerva-phosphor-multi-gpio-monitor.json b/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/minerva-phosphor-multi-gpio-monitor.json
index cf13d6a..8f25dcb 100644
--- a/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/minerva-phosphor-multi-gpio-monitor.json
+++ b/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor/minerva-phosphor-multi-gpio-monitor.json
@@ -858,6 +858,248 @@
         "Continue": true
     },
     {
+        "Name": "PWRGD_MTIA_BLADE0_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 156,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-0.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-0.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE1_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 158,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-1.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-1.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE2_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 160,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-2.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-2.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE3_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 162,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-3.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-3.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE4_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 164,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-4.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-4.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE5_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 166,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-5.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-5.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE6_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 168,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-6.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-6.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE7_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 170,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-7.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-7.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE8_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 172,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-8.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-8.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE9_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 174,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-9.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-9.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE10_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 176,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-10.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-10.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE11_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 178,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-11.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-11.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE12_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 180,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-12.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-12.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE13_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 182,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-13.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-13.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE14_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 184,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-14.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-14.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_MTIA_BLADE15_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 186,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@mtia-blade-15.service"],
+            "RISING": ["ac-power-good-deassert@mtia-blade-15.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_NW_BLADE0_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 188,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@network-blade-0.service"],
+            "RISING": ["ac-power-good-deassert@network-blade-0.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_NW_BLADE1_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 190,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@network-blade-1.service"],
+            "RISING": ["ac-power-good-deassert@network-blade-1.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_NW_BLADE2_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 192,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@network-blade-2.service"],
+            "RISING": ["ac-power-good-deassert@network-blade-2.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_NW_BLADE3_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 194,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@network-blade-3.service"],
+            "RISING": ["ac-power-good-deassert@network-blade-3.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_NW_BLADE4_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 196,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@network-blade-4.service"],
+            "RISING": ["ac-power-good-deassert@network-blade-4.service"]
+        },
+        "Continue": true
+    },
+    {
+        "Name": "PWRGD_NW_BLADE5_HSC_PWROK_N",
+        "ChipId": "2",
+        "GpioNum": 198,
+        "EventMon": "BOTH",
+        "Targets": {
+            "FALLING": ["ac-power-good-assert@network-blade-5.service"],
+            "RISING": ["ac-power-good-deassert@network-blade-5.service"]
+        },
+        "Continue": true
+    },
+    {
         "Name": "RPU_READY",
         "ChipId": "2",
         "GpioNum": 200,
diff --git a/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
index a862cd4..cc6c54c 100644
--- a/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
+++ b/meta-facebook/meta-minerva/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
@@ -14,6 +14,8 @@
                 cable-present-deassert@.service \
                 sfp-present-assert.service \
                 sfp-present-deassert.service \
+                ac-power-good-assert@.service \
+                ac-power-good-deassert@.service \
                 "
 
 SERVICE_FILE_FMT = "file://{0}"