meta-yadro: vegman: add IPMI configuration

Setup ipmi stack for Yadro VEGMAN machines.

Signed-off-by: Andrei Kartashev <a.kartashev@yadro.com>
Change-Id: I13f5e51dd5b7ac169a71ee046ad61dbfa2bffe9b
diff --git a/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
new file mode 100644
index 0000000..4fc41d0
--- /dev/null
+++ b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-config.bbappend
@@ -0,0 +1 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
diff --git a/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json
new file mode 100644
index 0000000..86ecbb2
--- /dev/null
+++ b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-config/channel_config.json
@@ -0,0 +1,178 @@
+{
+  "0" : {
+    "name" : "Ipmb",
+    "is_valid" : true,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "ipmb",
+      "protocol_type" : "ipmb-1.0",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "1" : {
+    "name" : "eth0",
+    "is_valid" : true,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "lan-802.3",
+      "protocol_type" : "ipmb-1.0",
+      "session_supported" : "multi-session",
+      "is_ipmi" : true
+    }
+  },
+  "2" : {
+    "name" : "eth1",
+    "is_valid" : true,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "lan-802.3",
+      "protocol_type" : "ipmb-1.0",
+      "session_supported" : "multi-session",
+      "is_ipmi" : true
+    }
+  },
+  "3" : {
+    "name" : "RESERVED",
+    "is_valid" : false,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "reserved",
+      "protocol_type" : "na",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "4" : {
+    "name" : "RESERVED",
+    "is_valid" : false,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "reserved",
+      "protocol_type" : "na",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "5" : {
+    "name" : "RESERVED",
+    "is_valid" : false,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "reserved",
+      "protocol_type" : "na",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "6" : {
+    "name" : "SMLINK",
+    "is_valid" : true,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "ipmb",
+      "protocol_type" : "ipmb-1.0",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "7" : {
+    "name" : "ipmi_kcs4",
+    "is_valid" : true,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "system-interface",
+      "protocol_type" : "kcs",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "8" : {
+    "name" : "INTRABMC",
+    "is_valid" : true,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "oem",
+      "protocol_type" : "oem",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "9" : {
+    "name" : "SIPMB",
+    "is_valid" : true,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "ipmb",
+      "protocol_type" : "ipmb-1.0",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "10" : {
+    "name" : "PCIE",
+    "is_valid" : true,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "ipmb",
+      "protocol_type" : "ipmb-1.0",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "11" : {
+    "name" : "RESERVED",
+    "is_valid" : false,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "reserved",
+      "protocol_type" : "na",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "12" : {
+    "name" : "INTERNAL",
+    "is_valid" : false,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "ipmb",
+      "protocol_type" : "ipmb-1.0",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "13" : {
+    "name" : "RESERVED",
+    "is_valid" : false,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "reserved",
+      "protocol_type" : "na",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "14" : {
+    "name" : "SELF",
+    "is_valid" : false,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "unknown",
+      "protocol_type" : "na",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  },
+  "15" : {
+    "name" : "ipmi_kcs3",
+    "is_valid" : true,
+    "active_sessions" : 0,
+    "channel_info" : {
+      "medium_type" : "system-interface",
+      "protocol_type" : "kcs",
+      "session_supported" : "session-less",
+      "is_ipmi" : true
+    }
+  }
+}
diff --git a/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json
new file mode 100644
index 0000000..dfeac2d
--- /dev/null
+++ b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-config/dev_id.json
@@ -0,0 +1,8 @@
+{
+  "id": 0,
+  "revision": 0,
+  "addn_dev_support": 143,
+  "manuf_id": 49769,
+  "prod_id": 20,
+  "aux": 0
+}
diff --git a/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/ipmb-channels.json b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/ipmb-channels.json
new file mode 100644
index 0000000..c99f9b4
--- /dev/null
+++ b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-ipmb/ipmb-channels.json
@@ -0,0 +1,10 @@
+{
+  "channels": [
+    {
+      "type": "me",
+      "slave-path": "/dev/ipmb-5",
+      "bmc-addr": 32,
+      "remote-addr": 44
+    }
+  ]
+}
diff --git a/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend
new file mode 100644
index 0000000..4c1c55e
--- /dev/null
+++ b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-ipmb_%.bbappend
@@ -0,0 +1,8 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+SRC_URI:append = " file://ipmb-channels.json"
+
+do_install:append() {
+    install -m 0644 -D ${WORKDIR}/ipmb-channels.json \
+                   ${D}/usr/share/ipmbbridge/
+}
diff --git a/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-kcs/99-ipmi-kcs.rules b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-kcs/99-ipmi-kcs.rules
new file mode 100644
index 0000000..fae7f09
--- /dev/null
+++ b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-kcs/99-ipmi-kcs.rules
@@ -0,0 +1,3 @@
+# Replace the '-' to '_', since Dbus object/interface names do not allow '-'.
+KERNEL=="ipmi-kcs3", SYMLINK+="ipmi_kcs3"
+KERNEL=="ipmi-kcs4", SYMLINK+="ipmi_kcs4"
diff --git a/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend
new file mode 100644
index 0000000..b034d93
--- /dev/null
+++ b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-kcs_%.bbappend
@@ -0,0 +1,11 @@
+FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:"
+
+KCS_DEVICE = "ipmi_kcs3"
+SMM_DEVICE = "ipmi_kcs4"
+SYSTEMD_SERVICE:${PN}:append = " ${PN}@${SMM_DEVICE}.service "
+
+SRC_URI += "file://99-ipmi-kcs.rules"
+
+do_install:append() {
+    install -m 0644 ${WORKDIR}/99-ipmi-kcs.rules -D -t ${D}${nonarch_base_libdir}/udev/rules.d/
+}
diff --git a/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend
new file mode 100644
index 0000000..e0f7094
--- /dev/null
+++ b/meta-yadro/meta-vegman/recipes-phosphor/ipmi/phosphor-ipmi-net_%.bbappend
@@ -0,0 +1,5 @@
+RMCPP_EXTRA = "eth1"
+SYSTEMD_SERVICE:${PN} += " \
+        ${PN}@${RMCPP_EXTRA}.service \
+        ${PN}@${RMCPP_EXTRA}.socket \
+        "