meta-facebook: minerva: enable OCP debug card support

Support OCP debug card use in the Minerva system.

Change-Id: I9436f8556556f1dd2a4ef8cbccb712bbfdf9564c
Signed-off-by: Yang Chen <yang.chen@quantatw.com>
diff --git a/meta-facebook/meta-minerva/recipes-phosphor/chassis/obmc-phosphor-buttons/gpio_defs.json b/meta-facebook/meta-minerva/recipes-phosphor/chassis/obmc-phosphor-buttons/gpio_defs.json
new file mode 100644
index 0000000..9ee3336
--- /dev/null
+++ b/meta-facebook/meta-minerva/recipes-phosphor/chassis/obmc-phosphor-buttons/gpio_defs.json
@@ -0,0 +1,20 @@
+{
+    "gpio_definitions": [
+        {
+            "name": "POWER_BUTTON",
+            "pin": "P0",
+            "direction": "both"
+        },
+        {
+            "name": "DEBUG_SELECTOR_BUTTON",
+            "pin": "Q7",
+            "direction": "both"
+        },
+        {
+            "name": "HOST_SELECTOR",
+            "group_gpio_config" : [],
+            "max_position" : 0,
+            "host_selector_map" : {}
+        }
+    ]
+}
diff --git a/meta-facebook/meta-minerva/recipes-phosphor/chassis/obmc-phosphor-buttons_%.bbappend b/meta-facebook/meta-minerva/recipes-phosphor/chassis/obmc-phosphor-buttons_%.bbappend
new file mode 100644
index 0000000..91e994e
--- /dev/null
+++ b/meta-facebook/meta-minerva/recipes-phosphor/chassis/obmc-phosphor-buttons_%.bbappend
@@ -0,0 +1,10 @@
+FILESEXTRAPATHS:append := "${THISDIR}/${PN}:"
+
+SRC_URI += "file://gpio_defs.json"
+
+do_install:append() {
+        install -d ${D}${sysconfdir}/default/obmc/gpio/
+        install -m 0644 ${WORKDIR}/gpio_defs.json ${D}/${sysconfdir}/default/obmc/gpio/
+}
+
+FILES:${PN}-signals:append = " ${sysconfdir}/default/obmc/gpio/gpio_defs.json"
diff --git a/meta-facebook/meta-minerva/recipes-phosphor/images/fb-minerva-phosphor-image.inc b/meta-facebook/meta-minerva/recipes-phosphor/images/fb-minerva-phosphor-image.inc
index 986a99a..fc194ef 100644
--- a/meta-facebook/meta-minerva/recipes-phosphor/images/fb-minerva-phosphor-image.inc
+++ b/meta-facebook/meta-minerva/recipes-phosphor/images/fb-minerva-phosphor-image.inc
@@ -14,3 +14,11 @@
 OBMC_IMAGE_EXTRA_INSTALL:append = " \
     obmc-console \
 "
+
+# Enable for debug card function
+OBMC_IMAGE_EXTRA_INSTALL:append = " \
+    phosphor-ipmi-ipmb \
+    fb-ipmi-oem \
+    obmc-phosphor-buttons-signals \
+    obmc-phosphor-buttons-handler \
+"
diff --git a/meta-facebook/meta-minerva/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend b/meta-facebook/meta-minerva/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend
new file mode 100644
index 0000000..b56e0f8
--- /dev/null
+++ b/meta-facebook/meta-minerva/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend
@@ -0,0 +1,6 @@
+IPMB_CHANNELS:minerva = "\
+    /dev/ipmb-14 \
+    "
+IPMB_REMOTE_ADDR:minerva = "\
+    96 \
+    "