meta-facebook: harma: add gpio presence monitoring

add gpio presence monitoring

Testing:
systemctl status phosphor-multi-gpio-presence.service
● phosphor-multi-gpio-presence.service - Phosphor Multi GPIO presence
     Loaded: loaded (/usr/lib/systemd/system/
        phosphor-multi-gpio-presence.service; enabled;
        preset: enabled)

     Active: active (running) since
        Sun 2024-04-21 23:51:56 PDT; 3h 21min ago

   Main PID: 470 (phosphor-multi-)
        CPU: 49ms
     CGroup: /system.slice/phosphor-multi-gpio-presence.service
             └─470 /usr/bin/phosphor-multi-gpio-presence --config
                /usr/share/phosphor-gpio-monitor/
                phosphor-multi-gpio-presence.json

root@bmc:~# busctl tree xyz.openbmc_project.Inventory.Manager
└─ /xyz
 └─ /...
  └─ /.../inventory
   └─ /.../inventory/system
    └─ /.../inventory/system/board
     └─ /.../inventory/system/board/Harma_MB
      ├─ /.../inventory/system/board/Harma_MB/presence_asic_modules_0
      ├─ /.../inventory/system/board/Harma_MB/presence_asic_modules_1
      ├─ /.../inventory/system/board/Harma_MB/presence_e1s_0
      ├─ /.../inventory/system/board/Harma_MB/presence_e1s_1
      └─ /.../inventory/system/board/Harma_MB/presence_ocp_0

Change-Id: I10c432c11415869ee8167fd07e7ec0b6105520be
Signed-off-by: Daniel Hsu <Daniel-Hsu@quantatw.com>
diff --git a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/plat-phosphor-multi-gpio-presence.json b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/plat-phosphor-multi-gpio-presence.json
new file mode 100644
index 0000000..d406147
--- /dev/null
+++ b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor/plat-phosphor-multi-gpio-presence.json
@@ -0,0 +1,37 @@
+[
+    {
+        "Name": "presence-ocp-0",
+        "LineName": "reset-control-pcie-expansion-0",
+        "ActiveLow": true,
+        "Bias": "DISABLE",
+        "Inventory": "/system/board/Harma_MB/presence_ocp_0"
+    },
+    {
+        "Name": "presence-e1s-0",
+        "LineName": "presence-e1s-0",
+        "ActiveLow": true,
+        "Bias": "DISABLE",
+        "Inventory": "/system/board/Harma_MB/presence_e1s_0"
+    },
+    {
+        "Name": "presence-e1s-1",
+        "LineName": "presence-e1s-1",
+        "ActiveLow": true,
+        "Bias": "DISABLE",
+        "Inventory": "/system/board/Harma_MB/presence_e1s_1"
+    },
+    {
+        "Name": "presence-asic-modules-0",
+        "LineName": "presence-asic-modules-0",
+        "ActiveLow": true,
+        "Bias": "DISABLE",
+        "Inventory": "/system/board/Harma_MB/presence_asic_modules_0"
+    },
+    {
+        "Name": "presence-asic-modules-1",
+        "LineName": "presence-asic-modules-1",
+        "ActiveLow": true,
+        "Bias": "DISABLE",
+        "Inventory": "/system/board/Harma_MB/presence_asic_modules_1"
+    }
+]
\ No newline at end of file
diff --git a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
index 2eeee68..46b9d2d 100644
--- a/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
+++ b/meta-facebook/meta-harma/recipes-phosphor/gpio/phosphor-gpio-monitor_%.bbappend
@@ -3,6 +3,7 @@
 inherit obmc-phosphor-systemd systemd
 
 SRC_URI += "file://plat-phosphor-multi-gpio-monitor.json \
+            file://plat-phosphor-multi-gpio-presence.json \
             file://assert-reset-button.service \
             file://assert-power-good.service \
             file://assert-post-end.service \
@@ -42,6 +43,8 @@
     install -d ${D}${datadir}/phosphor-gpio-monitor
     install -m 0644 ${WORKDIR}/plat-phosphor-multi-gpio-monitor.json \
                     ${D}${datadir}/phosphor-gpio-monitor/phosphor-multi-gpio-monitor.json
+    install -m 0644 ${WORKDIR}/plat-phosphor-multi-gpio-presence.json \
+                    ${D}${datadir}/phosphor-gpio-monitor/phosphor-multi-gpio-presence.json
 
     install -d ${D}${systemd_system_unitdir}/
     install -m 0644 ${WORKDIR}/*.service ${D}${systemd_system_unitdir}/
diff --git a/meta-facebook/meta-harma/recipes-phosphor/images/fb-harma-phosphor-image.inc b/meta-facebook/meta-harma/recipes-phosphor/images/fb-harma-phosphor-image.inc
index 851d964..2f63dba 100644
--- a/meta-facebook/meta-harma/recipes-phosphor/images/fb-harma-phosphor-image.inc
+++ b/meta-facebook/meta-harma/recipes-phosphor/images/fb-harma-phosphor-image.inc
@@ -20,3 +20,8 @@
     obmc-phosphor-buttons-signals \
     obmc-phosphor-buttons-handler \
 "
+
+# Monitor gpio status
+OBMC_IMAGE_EXTRA_INSTALL:append = " \
+    phosphor-gpio-monitor-presence \
+"
\ No newline at end of file