Interfaces for IPZ VPD

This commit adds interface YAMLs to provide
access to IPZ VPD (an IBM VPD format).

The interfaces are contained within the
com.ibm.ipzvpd namespace.

The commit also adds a configure option to
enable compiling these interfaces (--enable-ibm-dbus-interfaces)

Signed-off-by: Santosh Puranik <santosh.puranik@in.ibm.com>
Change-Id: I4832bc6b6f1e9f7e4235757d69f018b17cb896b1
diff --git a/README.md b/README.md
index a1ffe27..2c2f726 100644
--- a/README.md
+++ b/README.md
@@ -7,3 +7,8 @@
 ```
 --enable-openpower-dbus-interfaces
 ```
+Enable IBM D-Bus interfaces with:
+```
+--enable-ibm-dbus-interfaces
+```
+
diff --git a/com/ibm/ipzvpd/DINF.interface.yaml b/com/ibm/ipzvpd/DINF.interface.yaml
new file mode 100644
index 0000000..619ae15
--- /dev/null
+++ b/com/ibm/ipzvpd/DINF.interface.yaml
@@ -0,0 +1,16 @@
+description: >
+    Implement to represent the DINF record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: RI
+      type: array[byte]
+      description: >
+          RI keyword. Power resource ID.
+    - name: FL
+      type: array[byte]
+      description: >
+          FL keyword. The FRU label.
+
diff --git a/com/ibm/ipzvpd/LXR0.interface.yaml b/com/ibm/ipzvpd/LXR0.interface.yaml
new file mode 100644
index 0000000..d1409ec
--- /dev/null
+++ b/com/ibm/ipzvpd/LXR0.interface.yaml
@@ -0,0 +1,16 @@
+description: >
+    Implement to represent the LXR0 record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: VZ
+      type: array[byte]
+      description: >
+          VZ keyword. The record version.
+    - name: LX
+      type: array[byte]
+      description: >
+          LX keyword. The load ID data.
+
diff --git a/com/ibm/ipzvpd/MER0.interface.yaml b/com/ibm/ipzvpd/MER0.interface.yaml
new file mode 100644
index 0000000..67d3797
--- /dev/null
+++ b/com/ibm/ipzvpd/MER0.interface.yaml
@@ -0,0 +1,13 @@
+description: >
+    Implement to represent the MER0 record (contains manufacturing repair data)
+    in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: PD_I
+      type: array[byte]
+      description: >
+          The "#I" keyword. Contains the repair data.
+
diff --git a/com/ibm/ipzvpd/README.md b/com/ibm/ipzvpd/README.md
new file mode 100644
index 0000000..842c61f
--- /dev/null
+++ b/com/ibm/ipzvpd/README.md
@@ -0,0 +1,20 @@
+# IPZ VPD D-Bus Interfaces
+IPZ is a VPD (Vital Product Data) format used in IBM Power systems.
+The format consists of keywords that are stored as key-value
+pairs (Keyword name and its value). Keywords are grouped into records,
+usually with similar function grouped into a single record.
+
+The [OpenPower VPD] [1] format is quite similar to the IPZ format
+and describes the record-keyword structure.
+
+Also refer to the [VPD Collection design document] [2] that describes how the
+VPD collection application on the BMC will parse and publish the VPD data for
+IBM Power systems on D-Bus.
+
+The D-Bus interfaces defined here describe how IPZ VPD will be made available on
+D-Bus. Each YAML here represents a record in the IPZ VPD and keywords that
+belong to that record are represented as properties under that interface.
+The type of every property shall be a byte array.
+
+[1]:https://www-355.ibm.com/systems/power/openpower/posting.xhtml?postingId=1D060729AC96891885257E1B0053BC95
+[2]:https://github.com/openbmc/docs/blob/master/designs/vpd-collection.md
diff --git a/com/ibm/ipzvpd/UTIL.interface.yaml b/com/ibm/ipzvpd/UTIL.interface.yaml
new file mode 100644
index 0000000..31b655d
--- /dev/null
+++ b/com/ibm/ipzvpd/UTIL.interface.yaml
@@ -0,0 +1,89 @@
+description: >
+    Implement to represent the UTIL record in IPZ VPD. The properties within
+    contain various legacy utility data.
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: D0
+      type: array[byte]
+      description: >
+          D0 keyword.
+    - name: D1
+      type: array[byte]
+      description: >
+          D1 keyword.
+    - name: D2
+      type: array[byte]
+      description: >
+          D2 keyword.
+    - name: D3
+      type: array[byte]
+      description: >
+          D3 keyword.
+    - name: D4
+      type: array[byte]
+      description: >
+          D4 keyword.
+    - name: D5
+      type: array[byte]
+      description: >
+          D5 keyword.
+    - name: D6
+      type: array[byte]
+      description: >
+          D6 keyword.
+    - name: D7
+      type: array[byte]
+      description: >
+          D7 keyword.
+    - name: D8
+      type: array[byte]
+      description: >
+          D8 keyword.
+    - name: D9
+      type: array[byte]
+      description: >
+          D9 keyword.
+    - name: F0
+      type: array[byte]
+      description: >
+          F0 keyword.
+    - name: F1
+      type: array[byte]
+      description: >
+          F1 keyword.
+    - name: F2
+      type: array[byte]
+      description: >
+          F2 keyword.
+    - name: F3
+      type: array[byte]
+      description: >
+          F3 keyword.
+    - name: F4
+      type: array[byte]
+      description: >
+          F4 keyword.
+    - name: F5
+      type: array[byte]
+      description: >
+          F5 keyword.
+    - name: F6
+      type: array[byte]
+      description: >
+          F6 keyword.
+    - name: F7
+      type: array[byte]
+      description: >
+          F7 keyword.
+    - name: F8
+      type: array[byte]
+      description: >
+          F8 keyword.
+    - name: F9
+      type: array[byte]
+      description: >
+          F9 keyword.
+
diff --git a/com/ibm/ipzvpd/VCEN.interface.yaml b/com/ibm/ipzvpd/VCEN.interface.yaml
new file mode 100644
index 0000000..9a412c2
--- /dev/null
+++ b/com/ibm/ipzvpd/VCEN.interface.yaml
@@ -0,0 +1,32 @@
+description: >
+    Implement to represent the VCEN record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: DR
+      type: array[byte]
+      description: >
+          Descrition of the record.
+    - name: SE
+      type: array[byte]
+      description: >
+          SE keyword.
+    - name: TM
+      type: array[byte]
+      description: >
+          System eclosure type and model.
+    - name: FC
+      type: array[byte]
+      description: >
+          System enclosure feature code.
+    - name: RG
+      type: array[byte]
+      description: >
+          RG keyword. Field core override information.
+    - name: RB
+      type: array[byte]
+      description: >
+          RB keyword. Brand specific data.
+
diff --git a/com/ibm/ipzvpd/VCFG.interface.yaml b/com/ibm/ipzvpd/VCFG.interface.yaml
new file mode 100644
index 0000000..5021fe6
--- /dev/null
+++ b/com/ibm/ipzvpd/VCFG.interface.yaml
@@ -0,0 +1,20 @@
+description: >
+    Implement to represent the VCFG record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: VZ
+      type: array[byte]
+      description: >
+          VZ keyword. The record version.
+    - name: Z0
+      type: array[byte]
+      description: >
+          First base MAC address.
+    - name: Z1
+      type: array[byte]
+      description: >
+          Second base MAC address.
+
diff --git a/com/ibm/ipzvpd/VEIR.interface.yaml b/com/ibm/ipzvpd/VEIR.interface.yaml
new file mode 100644
index 0000000..115ccdd
--- /dev/null
+++ b/com/ibm/ipzvpd/VEIR.interface.yaml
@@ -0,0 +1,13 @@
+description: >
+    Implement to represent the VEIR record (contains elastic interface repair
+    data) in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: PD_I
+      type: array[byte]
+      description: >
+          The "#I" keyword. Contains the repair data.
+
diff --git a/com/ibm/ipzvpd/VER0.interface.yaml b/com/ibm/ipzvpd/VER0.interface.yaml
new file mode 100644
index 0000000..d5869e9
--- /dev/null
+++ b/com/ibm/ipzvpd/VER0.interface.yaml
@@ -0,0 +1,13 @@
+description: >
+    Implement to represent the VER0 record (contains vendor repair data)
+    in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: PD_I
+      type: array[byte]
+      description: >
+          The "#I" keyword. Contains the repair data.
+
diff --git a/com/ibm/ipzvpd/VINI.interface.yaml b/com/ibm/ipzvpd/VINI.interface.yaml
new file mode 100644
index 0000000..fddc0dc
--- /dev/null
+++ b/com/ibm/ipzvpd/VINI.interface.yaml
@@ -0,0 +1,72 @@
+description: >
+    Implement to represent the VINI record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: DR
+      type: array[byte]
+      description: >
+          Descrition of the record.
+    - name: CE
+      type: array[byte]
+      description: >
+          CE keyword. The CCIN extension.
+    - name: VZ
+      type: array[byte]
+      description: >
+          VZ keyword. The record version.
+    - name: FN
+      type: array[byte]
+      description: >
+          FRU number.
+    - name: PN
+      type: array[byte]
+      description: >
+          Part number.
+    - name: SN
+      type: array[byte]
+      description: >
+          Serial number.
+    - name: CC
+      type: array[byte]
+      description: >
+          FRU CCIN.
+    - name: HE
+      type: array[byte]
+      description: >
+          HE keyword. The hardware EC level.
+    - name: CT
+      type: array[byte]
+      description: >
+          CT keyword. The card type.
+    - name: HW
+      type: array[byte]
+      description: >
+          HW keyword. Represents the HW version.
+    - name: B3
+      type: array[byte]
+      description: >
+          B3 keyword. Contains hardware characteristics.
+    - name: B4
+      type: array[byte]
+      description: >
+          B4 keyword. Manufacturing FRU control information.
+    - name: B7
+      type: array[byte]
+      description: >
+          B7 keyword. Manufacturing test data.
+    - name: HX
+      type: array[byte]
+      description: >
+          HX keyword. Slot bifurcation information for PCIe FRUs.
+    - name: FG
+      type: array[byte]
+      description: >
+          FG keyword. Card related data.
+    - name: TS
+      type: array[byte]
+      description: >
+          TS keyword. Technology source.
+
diff --git a/com/ibm/ipzvpd/VMPU.interface.yaml b/com/ibm/ipzvpd/VMPU.interface.yaml
new file mode 100644
index 0000000..fb14fd0
--- /dev/null
+++ b/com/ibm/ipzvpd/VMPU.interface.yaml
@@ -0,0 +1,24 @@
+description: >
+    Implement to represent the VMPU record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: VZ
+      type: array[byte]
+      description: >
+          VZ keyword. The record version.
+    - name: SO
+      type: array[byte]
+      description: >
+          Series usage.
+    - name: DI
+      type: array[byte]
+      description: >
+          DI keyword. Data identifier.
+    - name: IN
+      type: array[byte]
+      description: >
+          IN Keyword. Multi purpose usage data.
+
diff --git a/com/ibm/ipzvpd/VMSC.interface.yaml b/com/ibm/ipzvpd/VMSC.interface.yaml
new file mode 100644
index 0000000..04865f9
--- /dev/null
+++ b/com/ibm/ipzvpd/VMSC.interface.yaml
@@ -0,0 +1,12 @@
+description: >
+    Implement to represent the VMSC record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: IN
+      type: array[byte]
+      description: >
+          IN keyword. Multi purpose usage data.
+
diff --git a/com/ibm/ipzvpd/VPRI.interface.yaml b/com/ibm/ipzvpd/VPRI.interface.yaml
new file mode 100644
index 0000000..21fbfc6
--- /dev/null
+++ b/com/ibm/ipzvpd/VPRI.interface.yaml
@@ -0,0 +1,20 @@
+description: >
+    Implement to represent the VPRI record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: VD
+      type: array[byte]
+      description: >
+          VD keyword. The record version.
+    - name: CR
+      type: array[byte]
+      description: >
+          CR keyword. Calibration data.
+    - name: PD_D
+      type: array[byte]
+      description: >
+          '#D' keyword. Card specific data.
+
diff --git a/com/ibm/ipzvpd/VR10.interface.yaml b/com/ibm/ipzvpd/VR10.interface.yaml
new file mode 100644
index 0000000..fdde378
--- /dev/null
+++ b/com/ibm/ipzvpd/VR10.interface.yaml
@@ -0,0 +1,24 @@
+description: >
+    Implement to represent the VR10 record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: DR
+      type: array[byte]
+      description: >
+          Descrition of the record.
+    - name: DC
+      type: array[byte]
+      description: >
+          Date Code.
+    - name: FL
+      type: array[byte]
+      description: >
+          FRU label.
+    - name: WA
+      type: array[byte]
+      description: >
+          WA keyword.
+
diff --git a/com/ibm/ipzvpd/VRTN.interface.yaml b/com/ibm/ipzvpd/VRTN.interface.yaml
new file mode 100644
index 0000000..005e224
--- /dev/null
+++ b/com/ibm/ipzvpd/VRTN.interface.yaml
@@ -0,0 +1,20 @@
+description: >
+    Implement to represent the VRTN record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: SO
+      type: array[byte]
+      description: >
+          SO keyword. Contains the brand information.
+    - name: IN
+      type: array[byte]
+      description: >
+          IN keyword. Multi purpose data.
+    - name: I2
+      type: array[byte]
+      description: >
+          I2 keyword. Multi purpose data.
+
diff --git a/com/ibm/ipzvpd/VSBP.interface.yaml b/com/ibm/ipzvpd/VSBP.interface.yaml
new file mode 100644
index 0000000..c7487ca
--- /dev/null
+++ b/com/ibm/ipzvpd/VSBP.interface.yaml
@@ -0,0 +1,20 @@
+description: >
+    Implement to represent the VSBP record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: DR
+      type: array[byte]
+      description: >
+          Descrition of the record.
+    - name: PA
+      type: array[byte]
+      description: >
+          Is op-panel installed.
+    - name: IM
+      type: array[byte]
+      description: >
+          A unique keyword to identify the system.
+
diff --git a/com/ibm/ipzvpd/VSRC.interface.yaml b/com/ibm/ipzvpd/VSRC.interface.yaml
new file mode 100644
index 0000000..cb0d46b
--- /dev/null
+++ b/com/ibm/ipzvpd/VSRC.interface.yaml
@@ -0,0 +1,16 @@
+description: >
+    Implement to represent the VSRC record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: DR
+      type: array[byte]
+      description: >
+          DR keyword. FRU description.
+    - name: IN
+      type: array[byte]
+      description: >
+          IN keyword. FRU plug history data.
+
diff --git a/com/ibm/ipzvpd/VSYS.interface.yaml b/com/ibm/ipzvpd/VSYS.interface.yaml
new file mode 100644
index 0000000..83b22ff
--- /dev/null
+++ b/com/ibm/ipzvpd/VSYS.interface.yaml
@@ -0,0 +1,64 @@
+description: >
+    Implement to represent the VINI record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: DR
+      type: array[byte]
+      description: >
+          Descrition of the record.
+    - name: BR
+      type: array[byte]
+      description: >
+          The system brand.
+    - name: SE
+      type: array[byte]
+      description: >
+          System serial number - ipSeries.
+    - name: SG
+      type: array[byte]
+      description: >
+          System serial number - storage.
+    - name: TM
+      type: array[byte]
+      description: >
+          Machine type model - ipSeries.
+    - name: TN
+      type: array[byte]
+      description: >
+          Machine type model - storage.
+    - name: MN
+      type: array[byte]
+      description: >
+          Manufacturing ID.
+    - name: ID
+      type: array[byte]
+      description: >
+          Two character system ID.
+    - name: SU
+      type: array[byte]
+      description: >
+          System unique ID.
+    - name: NN
+      type: array[byte]
+      description: >
+          World wide node name.
+    - name: RG
+      type: array[byte]
+      description: >
+          Field core override.
+    - name: RB
+      type: array[byte]
+      description: >
+          RB keyword.
+    - name: WN
+      type: array[byte]
+      description: >
+          WWPN root.
+    - name: FV
+      type: array[byte]
+      description: >
+          Firmware version.
+
diff --git a/com/ibm/ipzvpd/VW10.interface.yaml b/com/ibm/ipzvpd/VW10.interface.yaml
new file mode 100644
index 0000000..fe165ac
--- /dev/null
+++ b/com/ibm/ipzvpd/VW10.interface.yaml
@@ -0,0 +1,16 @@
+description: >
+    Implement to represent the VW10 record in IPZ VPD
+properties:
+    - name: RT
+      type: array[byte]
+      description: >
+          RT keyword. Contains the record name.
+    - name: DR
+      type: array[byte]
+      description: >
+          Descrition of the record.
+    - name: GD
+      type: array[byte]
+      description: >
+          Gard data.
+
diff --git a/configure.ac b/configure.ac
index a2bfc73..bb6c8e4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,6 +29,13 @@
        YAML_DIRS="$YAML_DIRS org/open_power"
 ])
 
+AC_ARG_ENABLE([ibm_dbus_interfaces],
+    AS_HELP_STRING([--enable-ibm-dbus-interfaces], [Enable the IBM D-Bus interfaces]))
+
+AS_IF([test "x$enable_ibm_dbus_interfaces" == "xyes"], [
+       YAML_DIRS="$YAML_DIRS com/ibm"
+])
+
 AM_CONDITIONAL([WANT_LIBPHOSPHOR_DBUS], [test "x$enable_libphosphor_dbus" != "xno"])
 
 AS_IF([test "x$enable_libphosphor_dbus" != "xno"], [