meta-quanta: gbs: monitor fans e-fuse PG GPIO signal

- add fans e-fuse PG GPIO config file
- add fans e-fuse PG GPIO as the sensor
- monitor fans e-fuse PG GPIO and when it assert low,
  record the SEL log

Signed-off-by: George Hung <george.hung@quantatw.com>
Change-Id: I32298097b1e79036b67edea65b84ef4d78cbacfc
diff --git a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh b/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh
index eec0a0b..dd5852a 100644
--- a/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh
+++ b/meta-quanta/meta-gbs/recipes-gbs/gbs-detect-gpio-present/files/detect-gpio-present.sh
@@ -10,7 +10,8 @@
 "/xyz/openbmc_project/inventory/system/chassis/cable/bp12v_cab_prsnt"
 "/xyz/openbmc_project/inventory/system/chassis/entity/sata0_prsnt"
 "/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot0_prsnt"
-"/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot1_prsnt")
+"/xyz/openbmc_project/inventory/system/chassis/entity/pe_slot1_prsnt"
+"/xyz/openbmc_project/inventory/system/chassis/entity/fans_efuse_pg")
 INTERFACE_NAME="xyz.openbmc_project.Inventory.Item"
 
 IPMI_LOG_SERVICE="xyz.openbmc_project.Logging.IPMI"
@@ -23,7 +24,7 @@
 LOG_ASSERT_FLAG="true"
 LOG_DEASSERT_FLAG="false"
 LOG_GENID_FLAG="0x0020"
-present_state=("true" "true" "true" "true" "true" "true" "true" "true" "true" "true")
+present_state=("true" "true" "true" "true" "true" "true" "true" "true" "true" "true" "true")
 
 for i in ${!PRESENT_OBJPATH[@]}
 do
diff --git a/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-sensors.yaml b/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-sensors.yaml
index e0eb0e1..043136b 100644
--- a/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-sensors.yaml
+++ b/meta-quanta/meta-gbs/recipes-phosphor/configuration/gbs-yaml-config/gbs-ipmi-sensors.yaml
@@ -1258,3 +1258,24 @@
   sensorReadingType: 0x6F
   sensorType: 0x23
   serviceInterface: org.freedesktop.DBus.Properties
+
+0xFC:
+  entityID: 0x1E
+  entityInstance: 0
+  interfaces:
+    xyz.openbmc_project.Inventory.Item:
+      Present:
+        Offsets:
+          0x00:
+            assert: true
+            type: bool
+          0x01:
+            assert: false
+            type: bool
+  mutability: Mutability::Write|Mutability::Read
+  path: /xyz/openbmc_project/inventory/system/chassis/entity/fans_efuse_pg
+  readingType: assertion
+  sensorNamePattern: nameLeaf
+  sensorReadingType: 0x6f
+  sensorType: 0x25
+  serviceInterface: org.freedesktop.DBus.Properties
diff --git a/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/gpios-10.conf b/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/gpios-10.conf
new file mode 100644
index 0000000..c1c05e3
--- /dev/null
+++ b/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor/obmc/gpio/gpios-10.conf
@@ -0,0 +1,6 @@
+#The gpio 146 is a real gpio, which is used to
+#store the PWRGD_P12V_ALL_FANS signal
+INVENTORY=/system/chassis/entity/fans_efuse_pg
+DEVPATH=/dev/input/event0
+KEY=146
+NAME=fans_efuse_pg
diff --git a/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
index d456366..4b9a841 100644
--- a/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
+++ b/meta-quanta/meta-gbs/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
@@ -18,7 +18,8 @@
 SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs +="obmc/gpio/gpios-7.conf"
 SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs +="obmc/gpio/gpios-8.conf"
 SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs +="obmc/gpio/gpios-9.conf"
-GBS_OBMC_PRESENT_INSTANCES = "0 1 2 3 4 5 6 7 8 9"
+SYSTEMD_ENVIRONMENT_FILE_${PN}_append_gbs +="obmc/gpio/gpios-10.conf"
+GBS_OBMC_PRESENT_INSTANCES = "0 1 2 3 4 5 6 7 8 9 10"
 
 SYSTEMD_LINK_${PN}-presence_append_gbs = " ${@compose_list(d, 'FMT_PRESENT', 'GBS_OBMC_PRESENT_INSTANCES')}"