schemas: Introduce xyz.openbmc_project.Configuration.CPLD

This change introduces a schema for CPLD configuration objects.

The upcoming CPLD firmware manager in `phosphor-bmc-code-mgmt` will use
these objects to enable firmware inventory and updating for CPLDs.

CPLDs are generally exposed to BMCs as i2c devices. The type of
CPLD determines the exact protocol for interaction with its firmware
management functions.


The update procedure for some CPLDs requires setting output GPIOs as
well: such designs are not accounted for in this change, but this schema
can be extended to include optional GPIO configuration information in
the future, or a separate schema for GPIOs associated with CPLDs can be
created (e.g., `xyz.openbmc_project.Configuration.CPLD.GPIO`).

Change-Id: I86f6dfed424cd35253245c6e52bd601a98ead28e
Signed-off-by: Peter Delevoryas <peter@pjd.dev>
diff --git a/schemas/cpld.json b/schemas/cpld.json
new file mode 100644
index 0000000..f33c22b
--- /dev/null
+++ b/schemas/cpld.json
@@ -0,0 +1,34 @@
+{
+    "$schema": "http://json-schema.org/draft-07/schema#",
+    "$defs": {
+        "CPLDFirmware": {
+            "description": "The schema definition for CPLD firmware upgrade",
+            "type": "object",
+            "additionalProperties": false,
+            "properties": {
+                "Address": {
+                    "$ref": "legacy.json#/$defs/Types/Address"
+                },
+                "Bus": {
+                    "$ref": "legacy.json#/$defs/Types/Bus"
+                },
+                "FirmwareInfo": {
+                    "$ref": "firmware.json#/$defs/FirmwareInfoDef"
+                },
+                "Name": {
+                    "description": "Full name of device",
+                    "type": "string"
+                },
+                "Type": {
+                    "description": "Supported CPLD devices, <vendor name><chip family>CPLD",
+                    "enum": [
+                        "LatticeMachXO2Firmware",
+                        "LatticeMachXO3Firmware",
+                        "LatticeMachXO5Firmware"
+                    ]
+                }
+            },
+            "required": ["Address", "Bus", "FirmwareInfo", "Name", "Type"]
+        }
+    }
+}
diff --git a/schemas/exposes_record.json b/schemas/exposes_record.json
index 5c3be11..ffee2da 100644
--- a/schemas/exposes_record.json
+++ b/schemas/exposes_record.json
@@ -152,6 +152,9 @@
                 },
                 {
                     "$ref": "nvidia.json#/$defs/NvidiaMctpVdm"
+                },
+                {
+                    "$ref": "cpld.json#/$defs/CPLDFirmware"
                 }
             ]
         },