host: define new interface for checking condition

With the introduction of the PLDM protocol as a mechanism to communicate
with the host firmware, a more specific mechanism is needed for BMC
software to check if the host is running. Utilizing the generic
Execute() method is confusing, especially considering that all of the
Command types may not be supported by all protocols.

The plan is to deprecate the Control.Host, Execute() with the HeartBeat
command type, in place of this new interface and property. Both IPMI
and PLDM will implement this method and BMC software can query mapper
for implementers on their specific systems.

Signed-off-by: Andrew Geissler <geissonator@yahoo.com>
Change-Id: I102b07a0c795e6af3be48fedee9a31ae816dba11
diff --git a/gen/xyz/openbmc_project/Condition/Host/meson.build b/gen/xyz/openbmc_project/Condition/Host/meson.build
new file mode 100644
index 0000000..8523523
--- /dev/null
+++ b/gen/xyz/openbmc_project/Condition/Host/meson.build
@@ -0,0 +1,14 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+    'xyz/openbmc_project/Condition/Host__cpp'.underscorify(),
+    input: [ meson.project_source_root() / 'xyz/openbmc_project/Condition/Host.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.project_source_root(),
+        'xyz/openbmc_project/Condition/Host',
+    ],
+)
+
diff --git a/gen/xyz/openbmc_project/Condition/HostFirmware/meson.build b/gen/xyz/openbmc_project/Condition/HostFirmware/meson.build
new file mode 100644
index 0000000..4aba803
--- /dev/null
+++ b/gen/xyz/openbmc_project/Condition/HostFirmware/meson.build
@@ -0,0 +1,14 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+    'xyz/openbmc_project/Condition/HostFirmware__cpp'.underscorify(),
+    input: [ meson.project_source_root() / 'xyz/openbmc_project/Condition/HostFirmware.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.project_source_root(),
+        'xyz/openbmc_project/Condition/HostFirmware',
+    ],
+)
+
diff --git a/gen/xyz/openbmc_project/Condition/meson.build b/gen/xyz/openbmc_project/Condition/meson.build
new file mode 100644
index 0000000..c0f1bad
--- /dev/null
+++ b/gen/xyz/openbmc_project/Condition/meson.build
@@ -0,0 +1,16 @@
+# Generated file; do not modify.
+subdir('HostFirmware')
+generated_others += custom_target(
+    'xyz/openbmc_project/Condition/HostFirmware__markdown'.underscorify(),
+    input: [ meson.project_source_root() / 'xyz/openbmc_project/Condition/HostFirmware.interface.yaml',  ],
+    output: [ 'HostFirmware.md' ],
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'markdown',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.project_source_root(),
+        'xyz/openbmc_project/Condition/HostFirmware',
+    ],
+    build_by_default: true,
+)
+
diff --git a/gen/xyz/openbmc_project/meson.build b/gen/xyz/openbmc_project/meson.build
index 55ffcf7..b94dfc1 100644
--- a/gen/xyz/openbmc_project/meson.build
+++ b/gen/xyz/openbmc_project/meson.build
@@ -48,6 +48,7 @@
     build_by_default: true,
 )
 
+subdir('Condition')
 subdir('Control')
 subdir('Dump')
 subdir('Inventory')
diff --git a/xyz/openbmc_project/Condition/HostFirmware.interface.yaml b/xyz/openbmc_project/Condition/HostFirmware.interface.yaml
new file mode 100644
index 0000000..3ee8190
--- /dev/null
+++ b/xyz/openbmc_project/Condition/HostFirmware.interface.yaml
@@ -0,0 +1,27 @@
+description: >
+    Implement to provide information on the condition of the host firmware.
+    The expectation is the implementer of this interface utilize their host
+    protocol (IPMI, PLDM, ...) to check the state of the host firmware running
+    on the system.
+
+properties:
+    - name: CurrentFirmwareCondition
+      type: enum[self.FirmwareCondition]
+      default: 'Unknown'
+      description: >
+          The current condition of the host
+
+enumerations:
+    - name: FirmwareCondition
+      description: >
+        The current condition of the host firmware
+      values:
+        - name: 'Unknown'
+          description: >
+            The condition of the host firmware is unknown
+        - name: 'Off'
+          description: >
+            Host firmware is not responsive to communication
+        - name: 'Running'
+          description: >
+            Host firmware is running and responsive to communication
diff --git a/xyz/openbmc_project/Control/Host.interface.yaml b/xyz/openbmc_project/Control/Host.interface.yaml
index 52abf5f..afe9bad 100644
--- a/xyz/openbmc_project/Control/Host.interface.yaml
+++ b/xyz/openbmc_project/Control/Host.interface.yaml
@@ -38,6 +38,8 @@
             command has been sent to the host.
         - name: Heartbeat
           description: >
+            Note: This is in the process of being deprecated in favor of the
+            new xyz.openbmc_project.Condition.HostFirmware interface.
             Used to determine if the host is running and functional.  This
             command will return once the command has been sent to the host.
             The response to the attention and the reading of the command