topology: remove legacy config mechanism

Remove legacy schemas for topology and migrate any configurations which
were using them.

- remove legacy mechanism from schema
- remove legacy mechanism from docs
- migrate upstream configs

Legacy mechanism is still present in code to decouple the upstream
migration from downstream migration.

Tested: on ampere's platforms [1]

References:
[1] https://gerrit.openbmc.org/c/openbmc/entity-manager/+/83565/comments/3e4a544b_21e57d15

Change-Id: Ia04753a3e7804372252bb9f3c8498ae5951a1297
Signed-off-by: Alexander Hansen <alexander.hansen@9elements.com>
diff --git a/configurations/ampere/mtjade.json b/configurations/ampere/mtjade.json
index ef1bcc7..7737880 100644
--- a/configurations/ampere/mtjade.json
+++ b/configurations/ampere/mtjade.json
@@ -1053,10 +1053,6 @@
                 "Type": "EEPROM"
             },
             {
-                "Name": "MB Upstream Port",
-                "Type": "MB Upstream Port"
-            },
-            {
                 "Name": "S0_DIMMG0_Temp",
                 "Sensors": [
                     "S0_DIMM_CH0_Temp",
@@ -1347,6 +1343,16 @@
                 "Type": "NVME1000"
             },
             {
+                "Name": "ContainPort",
+                "PortType": "containing",
+                "Type": "Port"
+            },
+            {
+                "Name": "PowerPort",
+                "PortType": "powered_by",
+                "Type": "Port"
+            },
+            {
                 "Address": "0x28",
                 "Bus": 3,
                 "Name": "TS1_Temp",
@@ -1939,10 +1945,14 @@
     {
         "Exposes": [
             {
-                "ConnectsToType": "MB Upstream Port",
-                "Name": "PowerSupply$ADDRESS % 80 Downstream Port",
-                "PowerPort": true,
-                "Type": "DownstreamPort"
+                "Name": "PowerPort",
+                "PortType": "powering",
+                "Type": "Port"
+            },
+            {
+                "Name": "ContainPort",
+                "PortType": "contained_by",
+                "Type": "Port"
             }
         ],
         "Name": "PowerSupply$ADDRESS % 80",
diff --git a/configurations/ampere/mtjefferson_mb.json b/configurations/ampere/mtjefferson_mb.json
index b06f0eb..ab2f0a1 100644
--- a/configurations/ampere/mtjefferson_mb.json
+++ b/configurations/ampere/mtjefferson_mb.json
@@ -1236,10 +1236,6 @@
                 "Type": "I2CFan"
             },
             {
-                "Name": "MB Upstream Port",
-                "Type": "MB Upstream Port"
-            },
-            {
                 "EntityId": 4,
                 "EntityInstance": 1,
                 "MaxValue": 127,
@@ -1497,6 +1493,16 @@
                 "UpdateThermalsTimeMS": 6000
             },
             {
+                "Name": "ContainPort",
+                "PortType": "containing",
+                "Type": "Port"
+            },
+            {
+                "Name": "PowerPort",
+                "PortType": "powered_by",
+                "Type": "Port"
+            },
+            {
                 "Class": "temp",
                 "Inputs": [
                     "S0_SOC_Pkg_Temp"
@@ -2227,10 +2233,14 @@
     {
         "Exposes": [
             {
-                "ConnectsToType": "MB Upstream Port",
-                "Name": "PowerSupply$ADDRESS % 80 Downstream Port",
-                "PowerPort": true,
-                "Type": "DownstreamPort"
+                "Name": "ContainPort",
+                "PortType": "contained_by",
+                "Type": "Port"
+            },
+            {
+                "Name": "PowerPort",
+                "PortType": "powering",
+                "Type": "Port"
             }
         ],
         "Name": "PowerSupply$ADDRESS % 80",
diff --git a/configurations/ampere/mtmitchell_mb.json b/configurations/ampere/mtmitchell_mb.json
index 69a303b..263c31e 100644
--- a/configurations/ampere/mtmitchell_mb.json
+++ b/configurations/ampere/mtmitchell_mb.json
@@ -2050,10 +2050,6 @@
                 "Type": "I2CFan"
             },
             {
-                "Name": "MB Upstream Port",
-                "Type": "MB Upstream Port"
-            },
-            {
                 "Name": "NVMeM2_MaxTemp",
                 "Sensors": [
                     "m2nvme0",
@@ -2119,6 +2115,16 @@
                 "Type": "NVME1000"
             },
             {
+                "Name": "ContainPort",
+                "PortType": "containing",
+                "Type": "Port"
+            },
+            {
+                "Name": "PowerPort",
+                "PortType": "powered_by",
+                "Type": "Port"
+            },
+            {
                 "Address": "0x48",
                 "Bus": 8,
                 "Name": "InletTemp",
@@ -2284,10 +2290,14 @@
     {
         "Exposes": [
             {
-                "ConnectsToType": "MB Upstream Port",
-                "Name": "PowerSupply$ADDRESS % 80 Downstream Port",
-                "PowerPort": true,
-                "Type": "DownstreamPort"
+                "Name": "PowerPort",
+                "PortType": "powering",
+                "Type": "Port"
+            },
+            {
+                "Name": "ContainPort",
+                "PortType": "contained_by",
+                "Type": "Port"
             }
         ],
         "Name": "PowerSupply$ADDRESS % 80",
diff --git a/docs/associations.md b/docs/associations.md
index 05127cc..d28a7e4 100644
--- a/docs/associations.md
+++ b/docs/associations.md
@@ -1,6 +1,7 @@
 # Associations
 
 Entity Manager will create [associations][1] between entities in certain cases.
+The associations are needed as part of [2].
 
 ## Configuring Associations between Entities
 
@@ -106,93 +107,6 @@
 probing/probed_by association property in the inventory item of the
 configuration.
 
-## Deprecated configuration style
-
-The configuration style described below is deprecated and superseded.
-
-## `contained_by`, `containing`
-
-Entity Manager can model the [physical topology][2] of how entities plug into
-each other when upstream and downstream ports are added as `Exposes` elements.
-It will then create the 'upstream containing downstream' and 'downstream
-contained_by upstream' associations for the connected entities.
-
-For example, taken from the referenced physical topology design:
-
-superchassis.json:
-
-```json
-{
-  "Exposes": [
-    {
-      "Name": "MyPort",
-      "Type": "BackplanePort"
-    }
-  ],
-  "Name": "Superchassis"
-}
-```
-
-subchassis.json:
-
-```json
-{
-  "Exposes": [
-    {
-      "ConnectsToType": "BackplanePort",
-      "Name": "MyDownstreamPort",
-      "Type": "DownstreamPort"
-    }
-  ],
-  "Name": "Subchassis"
-}
-```
-
-Entity Manager will create the 'Superchassis containing Subchassis' and
-'Subchassis contained_by Superchassis` associations, putting the associations
-definition interface on the downstream entity.
-
-## `powered_by`, `powering`
-
-In addition to the `containing` associations, entity-manager will add
-`powering`/`powered_by` associations between a power supply and its parent when
-its downstream port is marked as a `PowerPort`.
-
-The below example shows two PSU ports on the motherboard, where the `Type`
-fields for those ports match up with the `ConnectsToType` field from the PSUs.
-
-motherboard.json:
-
-```json
-{
-  "Exposes": [
-    {
-      "Name": "PSU 1 Port",
-      "Type": "PSU 1 Port"
-    },
-    {
-      "Name": "PSU 2 Port",
-      "Type": "PSU 2 Port"
-    }
-  ]
-}
-```
-
-psu.json:
-
-```json
-{
-  "Exposes": [
-    {
-      "ConnectsToType": "PSU$ADDRESS % 4 + 1 Port",
-      "Name": "PSU Port",
-      "Type": "DownstreamPort",
-      "PowerPort": true
-    }
-  ]
-}
-```
-
 [1]:
   https://github.com/openbmc/docs/blob/master/architecture/object-mapper.md#associations
 [2]: https://github.com/openbmc/docs/blob/master/designs/physical-topology.md
diff --git a/schemas/exposes_record.json b/schemas/exposes_record.json
index 36dae8c..bc62621 100644
--- a/schemas/exposes_record.json
+++ b/schemas/exposes_record.json
@@ -91,12 +91,6 @@
                     "$ref": "topology.json#/$defs/Port"
                 },
                 {
-                    "$ref": "topology.json#/$defs/LegacyPort"
-                },
-                {
-                    "$ref": "topology.json#/$defs/LegacyDownstreamPort"
-                },
-                {
                     "$ref": "legacy.json#/$defs/PSUPresence"
                 },
                 {
diff --git a/schemas/topology.json b/schemas/topology.json
index 66c9d59..67d67e1 100644
--- a/schemas/topology.json
+++ b/schemas/topology.json
@@ -28,45 +28,6 @@
             "required": ["Name", "PortType", "Type"],
             "type": "object"
         },
-        "LegacyPort": {
-            "description": "deprecated schema. 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", "BackplanePort"]
-                }
-            },
-            "required": ["Name", "Type"],
-            "type": "object"
-        },
-        "LegacyDownstreamPort": {
-            "description": "deprecated schema. 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",
-                    "type": "string",
-                    "enum": ["MB Upstream Port", "BackplanePort"]
-                },
-                "PowerPort": {
-                    "type": "boolean"
-                },
-                "Type": {
-                    "type": "string",
-                    "const": "DownstreamPort"
-                }
-            },
-            "required": ["Name", "Type", "ConnectsToType"],
-            "type": "object"
-        },
         "Types": {
             "Name": {
                 "type": "string"