add BMC node properties for modular node system

In modular node system, there are several nodes in
one chassis, and each node has its BMC. One node
BMC takes primary role, BMC in other nodes works as
secondary.
Both primary BMC and secondary BMC manage their local
node source, they are peer to peer. Sometimes, they
need to communicate each other, for example, primary
BMC needs to show all event log including secondary
node event log, so it's needed to identify primary
and secondary BMC role.
In order to keep the modular node information in
each BMC, it's needed to define DBUS properties
to indicate BMC nodes and BMC role for each BMC
node, then knows how many nodes in system and
what's its BMC role in each node.
The interface is:
"xyz.openbmc_project.State.BMCRedundancy"
And the object path is:
"/xyz/openbmc_project/State/BMCRedundancy"
The "Associations" object path is:
"/xyz/openbmc_project/State/BMCRedundancy/Contained"

Tested:
It's tested in a modular system with multi-BMC.

Change-Id: I2383a059503c7a59abc839a1109c656b20745087
Signed-off-by: Chen Yugang <yugang.chen@linux.intel.com>
Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
diff --git a/gen/xyz/openbmc_project/State/BMCRedundancy/meson.build b/gen/xyz/openbmc_project/State/BMCRedundancy/meson.build
new file mode 100644
index 0000000..c00b356
--- /dev/null
+++ b/gen/xyz/openbmc_project/State/BMCRedundancy/meson.build
@@ -0,0 +1,14 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+    'xyz/openbmc_project/State/BMCRedundancy__cpp'.underscorify(),
+    input: [ meson.source_root() / 'xyz/openbmc_project/State/BMCRedundancy.interface.yaml',  ],
+    output: [ 'server.cpp', 'server.hpp', 'client.hpp',  ],
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'cpp',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.source_root(),
+        'xyz/openbmc_project/State/BMCRedundancy',
+    ],
+)
+
diff --git a/gen/xyz/openbmc_project/State/meson.build b/gen/xyz/openbmc_project/State/meson.build
index 63dbd21..d94d873 100644
--- a/gen/xyz/openbmc_project/State/meson.build
+++ b/gen/xyz/openbmc_project/State/meson.build
@@ -14,6 +14,21 @@
     build_by_default: true,
 )
 
+subdir('BMCRedundancy')
+generated_others += custom_target(
+    'xyz/openbmc_project/State/BMCRedundancy__markdown'.underscorify(),
+    input: [ meson.source_root() / 'xyz/openbmc_project/State/BMCRedundancy.interface.yaml',  ],
+    output: [ 'BMCRedundancy.md' ],
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'markdown',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.source_root(),
+        'xyz/openbmc_project/State/BMCRedundancy',
+    ],
+    build_by_default: true,
+)
+
 subdir('Boot')
 subdir('Chassis')
 generated_others += custom_target(
diff --git a/xyz/openbmc_project/State/BMCRedundancy.interface.yaml b/xyz/openbmc_project/State/BMCRedundancy.interface.yaml
new file mode 100644
index 0000000..c4ff547
--- /dev/null
+++ b/xyz/openbmc_project/State/BMCRedundancy.interface.yaml
@@ -0,0 +1,8 @@
+description: >
+    An interface to describe the primary BMC within a multi-BMC environment.
+properties:
+    - name: ActivePrimaryBMC
+      type: object_path
+      description: >
+          indicates the active-primary BMC object path, looks like:
+          "/xyz/openbmc_project/inventory/system/chassis0/bmc0"