schemas: legacy: extract (Up|Down)streamPort
This allows to remove some properties from 'Aggregate' schema which are
no longer needed, since there is now a more specific schema to use.
The defined schemas link to the design document [1], providing
background for easier configuration.
Tested: Schema Validator Pass
References:
[1] https://github.com/openbmc/docs/blob/master/designs/physical-topology.md
Change-Id: Iae5995f798d0cdce5dacb0bfd1ad1de6c542d2d8
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/schemas/global.json b/schemas/global.json
index c69b5a4..8504c7e 100644
--- a/schemas/global.json
+++ b/schemas/global.json
@@ -88,6 +88,12 @@
"$ref": "legacy.json#/$defs/ExternalSensor"
},
{
+ "$ref": "legacy.json#/$defs/Port"
+ },
+ {
+ "$ref": "legacy.json#/$defs/DownstreamPort"
+ },
+ {
"$ref": "virtual_sensor.json#/$defs/VirtualSensor"
},
{
diff --git a/schemas/legacy.json b/schemas/legacy.json
index cf83b31..f049a8d 100644
--- a/schemas/legacy.json
+++ b/schemas/legacy.json
@@ -477,6 +477,44 @@
"required": ["Name", "Type", "Units", "EntityId", "EntityInstance"],
"type": "object"
},
+ "Port": {
+ "description": "https://github.com/openbmc/docs/blob/master/designs/physical-topology.md",
+ "additionalProperties": false,
+ "properties": {
+ "Name": {
+ "$ref": "#/$defs/Types/Name"
+ },
+ "Type": {
+ "description": "This enum may be extended as described in the design",
+ "type": "string",
+ "enum": ["MB Upstream Port"]
+ }
+ },
+ "required": ["Name", "Type"],
+ "type": "object"
+ },
+ "DownstreamPort": {
+ "description": "https://github.com/openbmc/docs/blob/master/designs/physical-topology.md",
+ "additionalProperties": false,
+ "properties": {
+ "Name": {
+ "$ref": "#/$defs/Types/Name"
+ },
+ "ConnectsToType": {
+ "description": "Should be equal to the 'Type' property on the upstream port",
+ "$ref": "#/$defs/Types/ConnectsToType"
+ },
+ "PowerPort": {
+ "$ref": "#/$defs/Types/PowerPort"
+ },
+ "Type": {
+ "type": "string",
+ "const": "DownstreamPort"
+ }
+ },
+ "required": ["Name", "Type", "ConnectsToType"],
+ "type": "object"
+ },
"Aggregate": {
"description": "Don't add additional properties to this schema. Consult README.schema for instructions on adding new Exposes element sub-schema.",
"additionalProperties": false,
@@ -531,9 +569,6 @@
"Class": {
"$ref": "#/$defs/Types/Class"
},
- "ConnectsToType": {
- "$ref": "#/$defs/Types/ConnectsToType"
- },
"CurrScaleFactor": {
"$ref": "#/$defs/Types/CurrScaleFactor"
},
@@ -573,9 +608,6 @@
"Polling": {
"$ref": "#/$defs/Types/Polling"
},
- "PowerPort": {
- "$ref": "#/$defs/Types/PowerPort"
- },
"PowerScaleFactor": {
"$ref": "#/$defs/Types/PowerScaleFactor"
},
@@ -954,8 +986,6 @@
"UCD90160",
"UCD90320",
"EmmcDevice",
- "MB Upstream Port",
- "DownstreamPort",
"PSUPresence",
"Intel HSBP CPLD",
"IntelHsbpFruDevice",