Inventory-item: Add PCIe Switch interface

Add association between pcie switch to pcie slots

PCIe switches enable the expansion of the system's I/O (Input/Output)
capabilities, so adding optional association between PCIe Switch and
PCIe Slots.

Change-Id: I66a26a85ef9df11fac245c60872d4daf191c2b09
Signed-off-by: Archana Kakani <archana.kakani@ibm.com>
diff --git a/gen/xyz/openbmc_project/Inventory/Item/PCIeSwitch/meson.build b/gen/xyz/openbmc_project/Inventory/Item/PCIeSwitch/meson.build
new file mode 100644
index 0000000..1c76048
--- /dev/null
+++ b/gen/xyz/openbmc_project/Inventory/Item/PCIeSwitch/meson.build
@@ -0,0 +1,15 @@
+# Generated file; do not modify.
+generated_sources += custom_target(
+    'xyz/openbmc_project/Inventory/Item/PCIeSwitch__cpp'.underscorify(),
+    input: [ '../../../../../../yaml/xyz/openbmc_project/Inventory/Item/PCIeSwitch.interface.yaml',  ],
+    output: [ 'common.hpp', 'server.cpp', 'server.hpp', 'aserver.hpp', 'client.hpp',  ],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'cpp',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../../../yaml',
+        'xyz/openbmc_project/Inventory/Item/PCIeSwitch',
+    ],
+)
+
diff --git a/gen/xyz/openbmc_project/Inventory/Item/meson.build b/gen/xyz/openbmc_project/Inventory/Item/meson.build
index b6a1f65..e78966b 100644
--- a/gen/xyz/openbmc_project/Inventory/Item/meson.build
+++ b/gen/xyz/openbmc_project/Inventory/Item/meson.build
@@ -298,6 +298,21 @@
     ],
 )
 
+subdir('PCIeSwitch')
+generated_others += custom_target(
+    'xyz/openbmc_project/Inventory/Item/PCIeSwitch__markdown'.underscorify(),
+    input: [ '../../../../../yaml/xyz/openbmc_project/Inventory/Item/PCIeSwitch.interface.yaml',  ],
+    output: [ 'PCIeSwitch.md' ],
+    depend_files: sdbusplusplus_depfiles,
+    command: [
+        sdbuspp_gen_meson_prog, '--command', 'markdown',
+        '--output', meson.current_build_dir(),
+        '--tool', sdbusplusplus_prog,
+        '--directory', meson.current_source_dir() / '../../../../../yaml',
+        'xyz/openbmc_project/Inventory/Item/PCIeSwitch',
+    ],
+)
+
 subdir('Panel')
 generated_others += custom_target(
     'xyz/openbmc_project/Inventory/Item/Panel__markdown'.underscorify(),
diff --git a/yaml/xyz/openbmc_project/Inventory/Item/PCIeSlot.interface.yaml b/yaml/xyz/openbmc_project/Inventory/Item/PCIeSlot.interface.yaml
index 0bf1ac4..4ed5a58 100644
--- a/yaml/xyz/openbmc_project/Inventory/Item/PCIeSlot.interface.yaml
+++ b/yaml/xyz/openbmc_project/Inventory/Item/PCIeSlot.interface.yaml
@@ -105,3 +105,4 @@
     reverse_name: connecting
     required_endpoint_interfaces:
         - xyz.openbmc_project.Inventory.Item.Cpu
+        - xyz.openbmc_project.Inventory.Item.PCIeSwitch
diff --git a/yaml/xyz/openbmc_project/Inventory/Item/PCIeSwitch.interface.yaml b/yaml/xyz/openbmc_project/Inventory/Item/PCIeSwitch.interface.yaml
new file mode 100644
index 0000000..c119637
--- /dev/null
+++ b/yaml/xyz/openbmc_project/Inventory/Item/PCIeSwitch.interface.yaml
@@ -0,0 +1,12 @@
+description: >
+    Implement to provide PCIe Switch attributes. PCIe switches enable the
+    expansion of the system's Input/Output capabilities.
+
+associations:
+    name: connecting
+    description: >
+        Objects that implement Switch interface can optionally implement the
+        connecting association to provide links to one or more Slots.
+    reverse_name: connected_to
+    required_endpoint_interfaces:
+        - xyz.openbmc_project.Inventory.Item.PCIeSlot
diff --git a/yaml/xyz/openbmc_project/Inventory/Item/README.md b/yaml/xyz/openbmc_project/Inventory/Item/README.md
index 674440a..8280658 100644
--- a/yaml/xyz/openbmc_project/Inventory/Item/README.md
+++ b/yaml/xyz/openbmc_project/Inventory/Item/README.md
@@ -26,5 +26,6 @@
 - PowerSupply and Item: `{powering, powered_by}`
 - FabricAdapter and Connector.Port: `{connecting, connected_to}`
 - Cpu and PCIeSlot: `{connecting, connected_to}`
+- PCIeSwitch and PCIeSlot: `{connecting, connected_to}`
 - Control.Throttle and Item: `{throttling, throttled_by}`
 - Cable and Item: `{connecting, connected_to}`