Add org/open_power D-Bus interfaces

In an effort to define all of the D-Bus interfaces in one place, this
commit adds the interfaces from the openpower-dbus-interfaces
repository.

To compile these interfaces, use the --enable-openpower-dbus-interfaces
configure flag.

Change-Id: I801cab4ac979e56d8325a42c14319a0b7cd094bb
Signed-off-by: Matt Spinler <spinler@us.ibm.com>
diff --git a/org/open_power/Common/Callout.errors.yaml b/org/open_power/Common/Callout.errors.yaml
new file mode 100644
index 0000000..dab7a3b
--- /dev/null
+++ b/org/open_power/Common/Callout.errors.yaml
@@ -0,0 +1,2 @@
+- name: Procedure
+  description: Procedure callout
diff --git a/org/open_power/Common/Callout.metadata.yaml b/org/open_power/Common/Callout.metadata.yaml
new file mode 100644
index 0000000..00e2067
--- /dev/null
+++ b/org/open_power/Common/Callout.metadata.yaml
@@ -0,0 +1,4 @@
+- name: Procedure
+  meta:
+    - str: "PROCEDURE=%u"
+      type: uint32
diff --git a/org/open_power/Control/Host.interface.yaml b/org/open_power/Control/Host.interface.yaml
new file mode 100644
index 0000000..ea5e9a1
--- /dev/null
+++ b/org/open_power/Control/Host.interface.yaml
@@ -0,0 +1,55 @@
+description: >
+    Implement to provide host interface support.
+    This will define the interfaces using which, a OpenPower
+    machine can communicate with host on agreed commands.
+
+    This is for Internal use by the Firmware only. The D-Bus object
+    is visible for the REST but it must not be used.
+
+methods:
+    - name: Execute
+      description: >
+          Execute the requested command by the caller. This command will be
+          processed in first in first out order. See the Command enum
+          description below for details on all supported commands.
+      parameters:
+          - name: command
+            type: enum[self.Command]
+            description: Requested command to execute against the host
+          - name: data
+            type: variant[byte]
+            description: Data associated with the command.
+
+signals:
+    - name: CommandComplete
+      description: >
+        Signal indicating that a command has completed
+      properties:
+        - name: command
+          type: enum[self.Command]
+          description: Executed command
+        - name: result
+          type: enum[self.Result]
+          description: Result of the command execution
+
+enumerations:
+    - name: Command
+      description: >
+        The command to execute against the host
+      values:
+        - name: OCCReset
+          description: >
+            Host firmware should reset the OCC. This is invoked by
+            OCC error monitor application on detecting the error.
+            Sensor ID of the failing OCC will be sent as data.
+            This command will return once the command has been placed
+            in command Queue.
+
+    - name: Result
+      description: >
+        The result of the command execution
+      values:
+        - name: Success
+          description: Command execution was a success
+        - name: Failure
+          description: Command execution was a failure
diff --git a/org/open_power/Control/TPM/SecurityKeys.interface.yaml b/org/open_power/Control/TPM/SecurityKeys.interface.yaml
new file mode 100644
index 0000000..89f46a4
--- /dev/null
+++ b/org/open_power/Control/TPM/SecurityKeys.interface.yaml
@@ -0,0 +1,26 @@
+description: >
+    Settings to clear or reset the security keys.
+
+properties:
+    - name: ClearHostSecurityKeys
+      type: byte
+      description: >
+          This is a bit mask used to specify clearing different security keys
+          or resetting those values back to default by the host. Setting this
+          property does not guarantee a successful operation as additional
+          conditions will be checked by the host to clear/reset the sensitive
+          data. This property will be mapped to a new IPMI sensor.
+
+          The new property is having an integer value and the default value
+          will be zero. The end operation is determined by the bit value set
+          and some of the customer use cases which maps to bit value are
+
+          Bit 0 - Clear All : Clear/reset all the sensitive data controlled by
+                  platform firmware from the system. System can generate new
+                  data to re-enable the affected functions if required
+          Bit 1 - Clear OS PK : This directs OPAL to clear the OS platform key
+          Bit 2 - Clear PEF SSO : This directs OPAL/PEF to clear the
+                  System Security Officer certificate
+          Bit 3 - Clear PowerVM System Key : This directs PowerVM to reset the
+                  system key back to the default state
+          Bit 4-6 - Reserved
diff --git a/org/open_power/Host.errors.yaml b/org/open_power/Host.errors.yaml
new file mode 100644
index 0000000..ab3df62
--- /dev/null
+++ b/org/open_power/Host.errors.yaml
@@ -0,0 +1,5 @@
+- name: Event
+  description: A host system event was received
+
+- name: MaintenanceProcedure
+  description: A host system event with a procedure callout
diff --git a/org/open_power/Host.metadata.yaml b/org/open_power/Host.metadata.yaml
new file mode 100644
index 0000000..8fd8870
--- /dev/null
+++ b/org/open_power/Host.metadata.yaml
@@ -0,0 +1,15 @@
+- name: Event
+  level: ERR
+  meta:
+    - str: "ESEL=%s"
+      type: string
+  inherits:
+    - xyz.openbmc_project.Common.Callout.Inventory
+
+- name: MaintenanceProcedure
+  level: ERR
+  meta:
+    - str: "ESEL=%s"
+      type: string
+  inherits:
+    - org.open_power.Common.Callout.Procedure
diff --git a/org/open_power/Host/Access.errors.yaml b/org/open_power/Host/Access.errors.yaml
new file mode 100644
index 0000000..08d6f4b
--- /dev/null
+++ b/org/open_power/Host/Access.errors.yaml
@@ -0,0 +1,5 @@
+- name: WriteCFAM
+  description: Failed to do a CFAM register write
+
+- name: ReadCFAM
+  description: Failed to do a CFAM register read
diff --git a/org/open_power/Host/Access.metadata.yaml b/org/open_power/Host/Access.metadata.yaml
new file mode 100644
index 0000000..f263858
--- /dev/null
+++ b/org/open_power/Host/Access.metadata.yaml
@@ -0,0 +1,13 @@
+- name: WriteCFAM
+  meta:
+    - str: "ADDRESS=0x%X"
+      type: uint32
+  inherits:
+    - xyz.openbmc_project.Common.Callout.Device
+
+- name: ReadCFAM
+  meta:
+    - str: "ADDRESS=0x%X"
+      type: uint32
+  inherits:
+    - xyz.openbmc_project.Common.Callout.Device
diff --git a/org/open_power/Inventory/Decorator/Asset.interface.yaml b/org/open_power/Inventory/Decorator/Asset.interface.yaml
new file mode 100644
index 0000000..bd8a4ee
--- /dev/null
+++ b/org/open_power/Inventory/Decorator/Asset.interface.yaml
@@ -0,0 +1,9 @@
+description: >
+    Implement to provide item physical asset attributes.
+properties:
+    - name: CCIN
+      type: string
+      description: >
+          Customer card identification number.
+
+# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
diff --git a/org/open_power/Logging/PEL.interface.yaml b/org/open_power/Logging/PEL.interface.yaml
new file mode 100644
index 0000000..d78b641
--- /dev/null
+++ b/org/open_power/Logging/PEL.interface.yaml
@@ -0,0 +1,36 @@
+description: >
+  Provides D-Bus access to OpenPower Platform Event Logs
+methods:
+  - name: GetPEL
+    description: >
+      Returns a file desciptor to a PEL.
+    parameters:
+      - name: pelID
+        type: uint32
+        description: >
+          The PEL log ID of the PEL to retrieve.
+    returns:
+      - name: data
+        type: unixfd
+        description: >
+          A file descriptor for a file that contains the PEL.
+    errors:
+       - xyz.openbmc_project.Common.Error.InternalFailure
+       - xyz.openbmc_project.Common.Error.InvalidArgument
+
+  - name: GetPELFromOBMCID
+    description: >
+      Returns PEL data based on the OpenBMC event log ID.
+    parameters:
+      - name: obmcLogID
+        type: uint32
+        description: >
+          The OpenBMC event log ID of the PEL to retrieve.
+    returns:
+      - name: data
+        type: array[byte]
+        description: >
+          The PEL data
+    errors:
+       - xyz.openbmc_project.Common.Error.InternalFailure
+       - xyz.openbmc_project.Common.Error.InvalidArgument
diff --git a/org/open_power/OCC/PassThrough.interface.yaml b/org/open_power/OCC/PassThrough.interface.yaml
new file mode 100644
index 0000000..3fc968c
--- /dev/null
+++ b/org/open_power/OCC/PassThrough.interface.yaml
@@ -0,0 +1,28 @@
+description: >
+    Implement to provide pass-through mechanism to the On Chip Controller (OCC).
+methods:
+    - name: Send
+      description: >
+          Pass through a command to the OCC.
+      parameters:
+        - name: command
+          # TODO via https://github.com/openbmc/openbmc/issues/1160. This should
+          # change to array[byte]. As of now, the REST server maps any numeric
+          # data to int32.
+          type: array[int32]
+          description: >
+              An array of integers representing the command and payload. This
+              should still be bytes worth of data (as though using array[byte]),
+              so each entry in the array should pack as many bytes as possible.
+      returns:
+        - name: response
+          # TODO via https://github.com/openbmc/openbmc/issues/1160. This should
+          # change to array[byte]. As of now, the REST server maps any numeric
+          # data to int32.
+          type: array[int32]
+          description: >
+              An array of integers representing the response. This
+              should still be bytes worth of data (as though using array[byte]),
+              so each entry in the array should pack as many bytes as possible.
+
+# vim: tabstop=8 expandtab shiftwidth=4 softtabstop=4
diff --git a/org/open_power/OCC/Status.interface.yaml b/org/open_power/OCC/Status.interface.yaml
new file mode 100644
index 0000000..ea99fa4
--- /dev/null
+++ b/org/open_power/OCC/Status.interface.yaml
@@ -0,0 +1,23 @@
+description: >
+    Implement to indicate status of the OCC.
+
+properties:
+    - name: OccActive
+      type: boolean
+      description: >
+        Indicates whether OCC is active or not
+    - name: ThrottleProcTemp
+      type: boolean
+      default: 0
+      description: >
+        Indicates processor throttling due to an over temperature condition
+    - name: ThrottleProcPower
+      type: boolean
+      default: 0
+      description: >
+        Indicates processor throttling due to reaching the power cap limit
+    - name: ThrottleMemTemp
+      type: boolean
+      default: 0
+      description: >
+        Indicates memory throttling due to an over temperature condition
diff --git a/org/open_power/Proc/FSI.errors.yaml b/org/open_power/Proc/FSI.errors.yaml
new file mode 100644
index 0000000..0332e0c
--- /dev/null
+++ b/org/open_power/Proc/FSI.errors.yaml
@@ -0,0 +1,5 @@
+- name: MasterDetectionFailure
+  description: Failed while detecting the master processor
+
+- name: SlaveDetectionFailure
+  description: Failed while detecting the slave processors
diff --git a/org/open_power/Proc/FSI.metadata.yaml b/org/open_power/Proc/FSI.metadata.yaml
new file mode 100644
index 0000000..6a202f3
--- /dev/null
+++ b/org/open_power/Proc/FSI.metadata.yaml
@@ -0,0 +1,8 @@
+- name: MasterDetectionFailure
+  inherits:
+    - xyz.openbmc_project.Common.Callout.Device
+
+- name: SlaveDetectionFailure
+  meta:
+    - str: "ERRNO=%d"
+      type: int32
diff --git a/org/open_power/Sensor/Aggregation/History/Average.interface.yaml b/org/open_power/Sensor/Aggregation/History/Average.interface.yaml
new file mode 100644
index 0000000..93795d9
--- /dev/null
+++ b/org/open_power/Sensor/Aggregation/History/Average.interface.yaml
@@ -0,0 +1,57 @@
+description: >
+    Implement to provide an object that contains a history of averages.  The
+    object this interface is placed on should provide information about the
+    duration the average is calculated over.
+
+properties:
+    - name: Scale
+      type: int64
+      description: >
+          The reading scaling factor N, where the actual reading is value * 10^N.
+          This is immutable once set.
+
+    - name: Unit
+      type: enum[self.Unit]
+      description: >
+          The unit of the reading.  Immutable once set for a sensor.
+          For objects in the temperature namespace, Unit must be "DegreesC".
+          For objects in the fan_tach namespace, Unit must be "RPMS".
+          For objects in the voltage namespace, Unit must be "Volts".
+          For objects in the altitude namespace, Unit must be "Meters".
+          For objects in the current namespace, Unit must be "Amperes".
+          For objects in the power namespace, Unit must be "Watts".
+          For objects in the energy namespace, Unit must be "Joules".
+
+    - name: Values
+      type: array[struct[uint64,int64]]
+      description: >
+          An array of timestamp, average value tuples.  The timestamp is the
+          number of milliseconds since 1970.  The entries in the array will
+          always be ordered from newest to oldest.
+
+enumerations:
+    - name: Unit
+      description: >
+        A sensor reading unit.
+      values:
+        - name: DegreesC
+          description: >
+            Temperature as degrees Celsius.
+        - name: RPMS
+          description: >
+            Frequency of rotation as revolutions per minute.
+        - name: Volts
+          description: >
+            Electromotive force as volts.
+        - name: Meters
+          description: >
+            Length as meters.
+        - name: Amperes
+          description: >
+            Electrical charge flow rate as Amperes.
+        - name: Watts
+          description: >
+            Rate of energy transfer as Watts.
+        - name: Joules
+          description: >
+            Energy transfer as Joules.
diff --git a/org/open_power/Sensor/Aggregation/History/Maximum.interface.yaml b/org/open_power/Sensor/Aggregation/History/Maximum.interface.yaml
new file mode 100644
index 0000000..e0f116a
--- /dev/null
+++ b/org/open_power/Sensor/Aggregation/History/Maximum.interface.yaml
@@ -0,0 +1,57 @@
+description: >
+    Implement to provide an object that contains a history of maximum values.
+    The values are the maximum values within a time period.  The object this
+    interface is placed on should provide information about the time period.
+
+properties:
+    - name: Scale
+      type: int64
+      description: >
+          The reading scaling factor N, where the actual reading is value * 10^N.
+          This is immutable once set.
+
+    - name: Unit
+      type: enum[self.Unit]
+      description: >
+          The unit of the reading.  Immutable once set for a sensor.
+          For objects in the temperature namespace, Unit must be "DegreesC".
+          For objects in the fan_tach namespace, Unit must be "RPMS".
+          For objects in the voltage namespace, Unit must be "Volts".
+          For objects in the altitude namespace, Unit must be "Meters".
+          For objects in the current namespace, Unit must be "Amperes".
+          For objects in the power namespace, Unit must be "Watts".
+          For objects in the energy namespace, Unit must be "Joules".
+
+    - name: Values
+      type: array[struct[uint64,int64]]
+      description: >
+          An array of timestamp, maximum value tuples.  The timestamp is the
+          number of milliseconds since 1970.  The entries in the array will
+          always be ordered from newest to oldest.
+
+enumerations:
+    - name: Unit
+      description: >
+        A sensor reading unit.
+      values:
+        - name: DegreesC
+          description: >
+            Temperature as degrees Celsius.
+        - name: RPMS
+          description: >
+            Frequency of rotation as revolutions per minute.
+        - name: Volts
+          description: >
+            Electromotive force as volts.
+        - name: Meters
+          description: >
+            Length as meters.
+        - name: Amperes
+          description: >
+            Electrical charge flow rate as Amperes.
+        - name: Watts
+          description: >
+            Rate of energy transfer as Watts.
+        - name: Joules
+          description: >
+            Energy transfer as Joules.