Add support for getting a connected peer from IOHS or SMPGROUP
This adds getConnectedTarget support to get a connected peer
target that is across a bus from a provided IOHS or
SMPGROUP/IOLINK target
Signed-off-by: Caleb Palmer <cnpalmer@us.ibm.com>
Change-Id: I00320cf604ea21023b702fc984efd83f137ab36d
diff --git a/test/dbus-sim-only.cpp b/test/dbus-sim-only.cpp
new file mode 100644
index 0000000..09c0e65
--- /dev/null
+++ b/test/dbus-sim-only.cpp
@@ -0,0 +1,19 @@
+#include <util/dbus.hpp>
+
+namespace util
+{
+
+namespace dbus
+{
+
+MachineType getMachineType()
+{
+ // default to Rainier 2S4U
+ MachineType machineType = MachineType::Rainier_2S4U;
+
+ return machineType;
+}
+
+} // namespace dbus
+
+} // namespace util
diff --git a/test/meson.build b/test/meson.build
index 911b709..2f04365 100644
--- a/test/meson.build
+++ b/test/meson.build
@@ -94,6 +94,7 @@
'../analyzer/plugins/p10-plugins.cpp',
'../analyzer/service_data.cpp',
'../util/pdbg.cpp',
+ 'dbus-sim-only.cpp',
'pdbg-sim-only.cpp',
),
pdbg_test_dtb,
@@ -116,6 +117,7 @@
files(
tc + '.cpp',
'../util/pdbg.cpp',
+ 'dbus-sim-only.cpp',
'pdbg-sim-only.cpp',
),
pdbg_test_dtb,
@@ -143,6 +145,7 @@
'../analyzer/service_data.cpp',
'../util/data_file.cpp',
'../util/pdbg.cpp',
+ 'dbus-sim-only.cpp',
'pdbg-sim-only.cpp',
),
pdbg_test_dtb,
@@ -167,6 +170,7 @@
'../analyzer/resolution.cpp',
'../analyzer/service_data.cpp',
'../util/pdbg.cpp',
+ 'dbus-sim-only.cpp',
'pdbg-sim-only.cpp',
),
pdbg_test_dtb,
@@ -191,6 +195,7 @@
'../analyzer/plugins/p10-tod-plugins.cpp',
'../analyzer/service_data.cpp',
'../util/pdbg.cpp',
+ 'dbus-sim-only.cpp',
'pdbg-sim-only.cpp',
),
pdbg_test_dtb,
diff --git a/test/test-resolution.cpp b/test/test-resolution.cpp
index 2de693d..99f317c 100644
--- a/test/test-resolution.cpp
+++ b/test/test-resolution.cpp
@@ -14,7 +14,7 @@
// Unit paths
constexpr auto proc_str = "";
-constexpr auto iolink_str = "pib/perv24/pauc0/iohs0/smpgroup0";
+constexpr auto iolink_str = "pib/perv26/pauc1/iohs0/smpgroup0";
constexpr auto omi_str = "pib/perv12/mc0/mi0/mcc0/omi0";
constexpr auto ocmb_str = "pib/perv12/mc0/mi0/mcc0/omi0/ocmb0";
constexpr auto core_str = "pib/perv39/eq7/fc1/core1";
@@ -227,7 +227,7 @@
"EntityPath": [],
"GuardType": "GARD_Unrecoverable",
"Guarded": true,
- "LocationCode": "/proc0/pib/perv24/pauc0/iohs0/smpgroup0",
+ "LocationCode": "/proc1/pib/perv25/pauc0/iohs1/smpgroup0",
"Priority": "A"
},
{
@@ -257,8 +257,8 @@
"Callout Type": "Connected Callout",
"Guard": true,
"Priority": "medium_group_A",
- "RX Target": "/proc0/pib/perv24/pauc0/iohs0/smpgroup0",
- "TX Target": "/proc0/pib/perv24/pauc0/iohs0/smpgroup0"
+ "RX Target": "/proc0/pib/perv26/pauc1/iohs0/smpgroup0",
+ "TX Target": "/proc1/pib/perv25/pauc0/iohs1/smpgroup0"
},
{
"Bus Type": "OMI_BUS",
diff --git a/util/data/meson.build b/util/data/meson.build
new file mode 100644
index 0000000..8be4402
--- /dev/null
+++ b/util/data/meson.build
@@ -0,0 +1,9 @@
+# Install the data files
+
+data_files = files(
+ 'peer-targets-everest.json',
+ 'peer-targets-rainier-2u.json',
+ 'peer-targets-rainier-4u.json',
+)
+
+install_data( data_files, install_dir: join_paths(package_dir, 'util-data') )
diff --git a/util/data/peer-targets-everest.json b/util/data/peer-targets-everest.json
new file mode 100644
index 0000000..5e32998
--- /dev/null
+++ b/util/data/peer-targets-everest.json
@@ -0,0 +1,209 @@
+{
+ "/proc0/pib/perv24/pauc0/iohs0": "/proc7/pib/perv27/pauc1/iohs1",
+ "/proc0/pib/perv25/pauc0/iohs1": "",
+ "/proc0/pib/perv26/pauc1/iohs0": "/proc1/pib/perv25/pauc0/iohs1",
+ "/proc0/pib/perv27/pauc1/iohs1": "/proc6/pib/perv24/pauc0/iohs0",
+ "/proc0/pib/perv28/pauc2/iohs0": "",
+ "/proc0/pib/perv29/pauc2/iohs1": "/proc4/pib/perv31/pauc3/iohs1",
+ "/proc0/pib/perv30/pauc3/iohs0": "",
+ "/proc0/pib/perv31/pauc3/iohs1": "/proc2/pib/perv31/pauc3/iohs1",
+
+ "/proc1/pib/perv24/pauc0/iohs0": "",
+ "/proc1/pib/perv25/pauc0/iohs1": "/proc0/pib/perv26/pauc1/iohs0",
+ "/proc1/pib/perv26/pauc1/iohs0": "/proc6/pib/perv25/pauc0/iohs1",
+ "/proc1/pib/perv27/pauc1/iohs1": "/proc7/pib/perv24/pauc0/iohs0",
+ "/proc1/pib/perv28/pauc2/iohs0": "",
+ "/proc1/pib/perv29/pauc2/iohs1": "/proc4/pib/perv31/pauc3/iohs1",
+ "/proc1/pib/perv30/pauc3/iohs0": "/proc2/pib/perv31/pauc3/iohs1",
+ "/proc1/pib/perv31/pauc3/iohs1": "/proc3/pib/perv31/pauc3/iohs1",
+
+ "/proc2/pib/perv24/pauc0/iohs0": "",
+ "/proc2/pib/perv25/pauc0/iohs1": "/proc4/pib/perv24/pauc0/iohs0",
+ "/proc2/pib/perv26/pauc1/iohs0": "/proc3/pib/perv25/pauc0/iohs1",
+ "/proc2/pib/perv27/pauc1/iohs1": "/proc5/pib/perv26/pauc1/iohs0",
+ "/proc2/pib/perv28/pauc2/iohs0": "",
+ "/proc2/pib/perv29/pauc2/iohs1": "/proc6/pib/perv31/pauc3/iohs1",
+ "/proc2/pib/perv30/pauc3/iohs0": "",
+ "/proc2/pib/perv31/pauc3/iohs1": "/proc1/pib/perv30/pauc3/iohs0",
+
+ "/proc3/pib/perv24/pauc0/iohs0": "",
+ "/proc3/pib/perv25/pauc0/iohs1": "/proc2/pib/perv26/pauc1/iohs0",
+ "/proc3/pib/perv26/pauc1/iohs0": "/proc4/pib/perv25/pauc0/iohs1",
+ "/proc3/pib/perv27/pauc1/iohs1": "/proc5/pib/perv24/pauc0/iohs0",
+ "/proc3/pib/perv28/pauc2/iohs0": "",
+ "/proc3/pib/perv29/pauc2/iohs1": "/proc6/pib/perv31/pauc3/iohs1",
+ "/proc3/pib/perv30/pauc3/iohs0": "/proc0/pib/perv31/pauc3/iohs1",
+ "/proc3/pib/perv31/pauc3/iohs1": "/proc1/pib/perv31/pauc3/iohs1",
+
+ "/proc4/pib/perv24/pauc0/iohs0": "/proc2/pib/perv25/pauc0/iohs1",
+ "/proc4/pib/perv25/pauc0/iohs1": "/proc3/pib/perv26/pauc1/iohs0",
+ "/proc4/pib/perv26/pauc1/iohs0": "/proc5/pib/perv25/pauc0/iohs1",
+ "/proc4/pib/perv27/pauc1/iohs1": "",
+ "/proc4/pib/perv28/pauc2/iohs0": "/proc7/pib/perv29/pauc2/iohs1",
+ "/proc4/pib/perv29/pauc2/iohs1": "/proc6/pib/perv29/pauc2/iohs1",
+ "/proc4/pib/perv30/pauc3/iohs0": "",
+ "/proc4/pib/perv31/pauc3/iohs1": "/proc1/pib/perv29/pauc2/iohs1",
+
+ "/proc5/pib/perv24/pauc0/iohs0": "/proc3/pib/perv27/pauc1/iohs1",
+ "/proc5/pib/perv25/pauc0/iohs1": "/proc4/pib/perv26/pauc1/iohs0",
+ "/proc5/pib/perv26/pauc1/iohs0": "/proc2/pib/perv27/pauc1/iohs1",
+ "/proc5/pib/perv27/pauc1/iohs1": "",
+ "/proc5/pib/perv28/pauc2/iohs0": "",
+ "/proc5/pib/perv29/pauc2/iohs1": "/proc6/pib/perv28/pauc2/iohs0",
+ "/proc5/pib/perv30/pauc3/iohs0": "",
+ "/proc5/pib/perv31/pauc3/iohs1": "/proc1/pib/perv29/pauc2/iohs1",
+
+ "/proc6/pib/perv24/pauc0/iohs0": "/proc0/pib/perv27/pauc1/iohs1",
+ "/proc6/pib/perv25/pauc0/iohs1": "/proc1/pib/perv26/pauc1/iohs0",
+ "/proc6/pib/perv26/pauc1/iohs0": "/proc7/pib/perv25/pauc0/iohs1",
+ "/proc6/pib/perv27/pauc1/iohs1": "",
+ "/proc6/pib/perv28/pauc2/iohs0": "/proc5/pib/perv29/pauc2/iohs1",
+ "/proc6/pib/perv29/pauc2/iohs1": "/proc4/pib/perv29/pauc2/iohs1",
+ "/proc6/pib/perv30/pauc3/iohs0": "",
+ "/proc6/pib/perv31/pauc3/iohs1": "/proc3/pib/perv29/pauc2/iohs1",
+
+ "/proc7/pib/perv24/pauc0/iohs0": "/proc1/pib/perv27/pauc1/iohs1",
+ "/proc7/pib/perv25/pauc0/iohs1": "/proc6/pib/perv26/pauc1/iohs0",
+ "/proc7/pib/perv26/pauc1/iohs0": "",
+ "/proc7/pib/perv27/pauc1/iohs1": "/proc0/pib/perv24/pauc0/iohs0",
+ "/proc7/pib/perv28/pauc2/iohs0": "",
+ "/proc7/pib/perv29/pauc2/iohs1": "/proc5/pib/perv29/pauc2/iohs1",
+ "/proc7/pib/perv30/pauc3/iohs0": "",
+ "/proc7/pib/perv31/pauc3/iohs1": "/proc3/pib/perv29/pauc2/iohs1",
+
+ "/proc0/pib/perv24/pauc0/iohs0/smpgroup0": "/proc7/pib/perv27/pauc1/iohs1/smpgroup1",
+ "/proc0/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc0/pib/perv25/pauc0/iohs1/smpgroup0": "",
+ "/proc0/pib/perv25/pauc0/iohs1/smpgroup1": "",
+ "/proc0/pib/perv26/pauc1/iohs0/smpgroup0": "/proc1/pib/perv25/pauc0/iohs1/smpgroup0",
+ "/proc0/pib/perv26/pauc1/iohs0/smpgroup1": "/proc1/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc0/pib/perv27/pauc1/iohs1/smpgroup0": "/proc6/pib/perv24/pauc0/iohs0/smpgroup1",
+ "/proc0/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc0/pib/perv28/pauc2/iohs0/smpgroup0": "",
+ "/proc0/pib/perv28/pauc2/iohs0/smpgroup1": "",
+ "/proc0/pib/perv29/pauc2/iohs1/smpgroup0": "/proc5/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc0/pib/perv29/pauc2/iohs1/smpgroup1": "/proc4/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc0/pib/perv30/pauc3/iohs0/smpgroup0": "",
+ "/proc0/pib/perv30/pauc3/iohs0/smpgroup1": "",
+ "/proc0/pib/perv31/pauc3/iohs1/smpgroup0": "/proc3/pib/perv30/pauc3/iohs0/smpgroup1",
+ "/proc0/pib/perv31/pauc3/iohs1/smpgroup1": "/proc2/pib/perv31/pauc3/iohs1/smpgroup1",
+
+ "/proc1/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc1/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc1/pib/perv25/pauc0/iohs1/smpgroup0": "/proc0/pib/perv26/pauc1/iohs0/smpgroup0",
+ "/proc1/pib/perv25/pauc0/iohs1/smpgroup1": "/proc0/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc1/pib/perv26/pauc1/iohs0/smpgroup0": "",
+ "/proc1/pib/perv26/pauc1/iohs0/smpgroup1": "/proc6/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc1/pib/perv27/pauc1/iohs1/smpgroup0": "/proc7/pib/perv24/pauc0/iohs0/smpgroup1",
+ "/proc1/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc1/pib/perv28/pauc2/iohs0/smpgroup0": "",
+ "/proc1/pib/perv28/pauc2/iohs0/smpgroup1": "",
+ "/proc1/pib/perv29/pauc2/iohs1/smpgroup0": "/proc5/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc1/pib/perv29/pauc2/iohs1/smpgroup1": "/proc4/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc1/pib/perv30/pauc3/iohs0/smpgroup0": "",
+ "/proc1/pib/perv30/pauc3/iohs0/smpgroup1": "/proc2/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc1/pib/perv31/pauc3/iohs1/smpgroup0": "",
+ "/proc1/pib/perv31/pauc3/iohs1/smpgroup1": "/proc3/pib/perv31/pauc3/iohs1/smpgroup1",
+
+ "/proc2/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc2/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc2/pib/perv25/pauc0/iohs1/smpgroup0": "/proc4/pib/perv24/pauc0/iohs0/smpgroup1",
+ "/proc2/pib/perv25/pauc0/iohs1/smpgroup1": "",
+ "/proc2/pib/perv26/pauc1/iohs0/smpgroup0": "/proc3/pib/perv25/pauc0/iohs1/smpgroup0",
+ "/proc2/pib/perv26/pauc1/iohs0/smpgroup1": "/proc3/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc2/pib/perv27/pauc1/iohs1/smpgroup0": "/proc5/pib/perv26/pauc1/iohs0/smpgroup0",
+ "/proc2/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc2/pib/perv28/pauc2/iohs0/smpgroup0": "",
+ "/proc2/pib/perv28/pauc2/iohs0/smpgroup1": "",
+ "/proc2/pib/perv29/pauc2/iohs1/smpgroup0": "/proc7/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc2/pib/perv29/pauc2/iohs1/smpgroup1": "/proc6/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc2/pib/perv30/pauc3/iohs0/smpgroup0": "",
+ "/proc2/pib/perv30/pauc3/iohs0/smpgroup1": "",
+ "/proc2/pib/perv31/pauc3/iohs1/smpgroup0": "/proc1/pib/perv30/pauc3/iohs0/smpgroup1",
+ "/proc2/pib/perv31/pauc3/iohs1/smpgroup1": "/proc0/pib/perv31/pauc3/iohs1/smpgroup1",
+
+ "/proc3/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc3/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc3/pib/perv25/pauc0/iohs1/smpgroup0": "/proc2/pib/perv26/pauc1/iohs0/smpgroup0",
+ "/proc3/pib/perv25/pauc0/iohs1/smpgroup1": "/proc2/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc3/pib/perv26/pauc1/iohs0/smpgroup0": "",
+ "/proc3/pib/perv26/pauc1/iohs0/smpgroup1": "/proc4/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc3/pib/perv27/pauc1/iohs1/smpgroup0": "/proc5/pib/perv24/pauc0/iohs0/smpgroup1",
+ "/proc3/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc3/pib/perv28/pauc2/iohs0/smpgroup0": "",
+ "/proc3/pib/perv28/pauc2/iohs0/smpgroup1": "",
+ "/proc3/pib/perv29/pauc2/iohs1/smpgroup0": "/proc7/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc3/pib/perv29/pauc2/iohs1/smpgroup1": "/proc6/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc3/pib/perv30/pauc3/iohs0/smpgroup0": "",
+ "/proc3/pib/perv30/pauc3/iohs0/smpgroup1": "/proc0/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc3/pib/perv31/pauc3/iohs1/smpgroup0": "",
+ "/proc3/pib/perv31/pauc3/iohs1/smpgroup1": "/proc1/pib/perv31/pauc3/iohs1/smpgroup1",
+
+ "/proc4/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc4/pib/perv24/pauc0/iohs0/smpgroup1": "/proc2/pib/perv25/pauc0/iohs1/smpgroup0",
+ "/proc4/pib/perv25/pauc0/iohs1/smpgroup0": "",
+ "/proc4/pib/perv25/pauc0/iohs1/smpgroup1": "/proc3/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc4/pib/perv26/pauc1/iohs0/smpgroup0": "/proc5/pib/perv25/pauc0/iohs1/smpgroup0",
+ "/proc4/pib/perv26/pauc1/iohs0/smpgroup1": "/proc5/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc4/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc4/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc4/pib/perv28/pauc2/iohs0/smpgroup0": "/proc7/pib/perv29/pauc2/iohs1/smpgroup1",
+ "/proc4/pib/perv28/pauc2/iohs0/smpgroup1": "",
+ "/proc4/pib/perv29/pauc2/iohs1/smpgroup0": "/proc6/pib/perv29/pauc2/iohs1/smpgroup0",
+ "/proc4/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc4/pib/perv30/pauc3/iohs0/smpgroup0": "",
+ "/proc4/pib/perv30/pauc3/iohs0/smpgroup1": "",
+ "/proc4/pib/perv31/pauc3/iohs1/smpgroup0": "/proc1/pib/perv29/pauc2/iohs1/smpgroup1",
+ "/proc4/pib/perv31/pauc3/iohs1/smpgroup1": "/proc0/pib/perv29/pauc2/iohs1/smpgroup1",
+
+ "/proc5/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc5/pib/perv24/pauc0/iohs0/smpgroup1": "/proc3/pib/perv27/pauc1/iohs1/smpgroup0",
+ "/proc5/pib/perv25/pauc0/iohs1/smpgroup0": "/proc4/pib/perv26/pauc1/iohs0/smpgroup0",
+ "/proc5/pib/perv25/pauc0/iohs1/smpgroup1": "/proc4/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc5/pib/perv26/pauc1/iohs0/smpgroup0": "/proc2/pib/perv27/pauc1/iohs1/smpgroup0",
+ "/proc5/pib/perv26/pauc1/iohs0/smpgroup1": "",
+ "/proc5/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc5/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc5/pib/perv28/pauc2/iohs0/smpgroup0": "",
+ "/proc5/pib/perv28/pauc2/iohs0/smpgroup1": "",
+ "/proc5/pib/perv29/pauc2/iohs1/smpgroup0": "/proc7/pib/perv29/pauc2/iohs1/smpgroup0",
+ "/proc5/pib/perv29/pauc2/iohs1/smpgroup1": "/proc6/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc5/pib/perv30/pauc3/iohs0/smpgroup0": "",
+ "/proc5/pib/perv30/pauc3/iohs0/smpgroup1": "",
+ "/proc5/pib/perv31/pauc3/iohs1/smpgroup0": "/proc1/pib/perv29/pauc2/iohs1/smpgroup0",
+ "/proc5/pib/perv31/pauc3/iohs1/smpgroup1": "/proc0/pib/perv29/pauc2/iohs1/smpgroup0",
+
+ "/proc6/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc6/pib/perv24/pauc0/iohs0/smpgroup1": "/proc0/pib/perv27/pauc1/iohs1/smpgroup0",
+ "/proc6/pib/perv25/pauc0/iohs1/smpgroup0": "",
+ "/proc6/pib/perv25/pauc0/iohs1/smpgroup1": "/proc1/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc6/pib/perv26/pauc1/iohs0/smpgroup0": "/proc7/pib/perv25/pauc0/iohs1/smpgroup0",
+ "/proc6/pib/perv26/pauc1/iohs0/smpgroup1": "/proc7/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc6/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc6/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc6/pib/perv28/pauc2/iohs0/smpgroup0": "/proc5/pib/perv29/pauc2/iohs1/smpgroup1",
+ "/proc6/pib/perv28/pauc2/iohs0/smpgroup1": "",
+ "/proc6/pib/perv29/pauc2/iohs1/smpgroup0": "/proc4/pib/perv29/pauc2/iohs1/smpgroup0",
+ "/proc6/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc6/pib/perv30/pauc3/iohs0/smpgroup0": "",
+ "/proc6/pib/perv30/pauc3/iohs0/smpgroup1": "",
+ "/proc6/pib/perv31/pauc3/iohs1/smpgroup0": "/proc3/pib/perv29/pauc2/iohs1/smpgroup1",
+ "/proc6/pib/perv31/pauc3/iohs1/smpgroup1": "/proc2/pib/perv29/pauc2/iohs1/smpgroup1",
+
+ "/proc7/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc7/pib/perv24/pauc0/iohs0/smpgroup1": "/proc1/pib/perv27/pauc1/iohs1/smpgroup0",
+ "/proc7/pib/perv25/pauc0/iohs1/smpgroup0": "/proc6/pib/perv26/pauc1/iohs0/smpgroup0",
+ "/proc7/pib/perv25/pauc0/iohs1/smpgroup1": "/proc6/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc7/pib/perv26/pauc1/iohs0/smpgroup0": "",
+ "/proc7/pib/perv26/pauc1/iohs0/smpgroup1": "",
+ "/proc7/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc7/pib/perv27/pauc1/iohs1/smpgroup1": "/proc0/pib/perv24/pauc0/iohs0/smpgroup0",
+ "/proc7/pib/perv28/pauc2/iohs0/smpgroup0": "",
+ "/proc7/pib/perv28/pauc2/iohs0/smpgroup1": "",
+ "/proc7/pib/perv29/pauc2/iohs1/smpgroup0": "/proc5/pib/perv29/pauc2/iohs1/smpgroup0",
+ "/proc7/pib/perv29/pauc2/iohs1/smpgroup1": "/proc4/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc7/pib/perv30/pauc3/iohs0/smpgroup0": "",
+ "/proc7/pib/perv30/pauc3/iohs0/smpgroup1": "",
+ "/proc7/pib/perv31/pauc3/iohs1/smpgroup0": "/proc3/pib/perv29/pauc2/iohs1/smpgroup0",
+ "/proc7/pib/perv31/pauc3/iohs1/smpgroup1": "/proc2/pib/perv29/pauc2/iohs1/smpgroup0"
+}
diff --git a/util/data/peer-targets-rainier-2u.json b/util/data/peer-targets-rainier-2u.json
new file mode 100644
index 0000000..0ceac3e
--- /dev/null
+++ b/util/data/peer-targets-rainier-2u.json
@@ -0,0 +1,105 @@
+{
+ "/proc0/pib/perv24/pauc0/iohs0": "",
+ "/proc0/pib/perv25/pauc0/iohs1": "",
+ "/proc0/pib/perv26/pauc1/iohs0": "/proc1/pib/perv25/pauc0/iohs1",
+ "/proc0/pib/perv27/pauc1/iohs1": "",
+ "/proc0/pib/perv28/pauc2/iohs0": "/proc2/pib/perv31/pauc3/iohs1",
+ "/proc0/pib/perv29/pauc2/iohs1": "",
+ "/proc0/pib/perv30/pauc3/iohs0": "/proc1/pib/perv28/pauc2/iohs0",
+ "/proc0/pib/perv31/pauc3/iohs1": "/proc3/pib/perv30/pauc3/iohs0",
+
+ "/proc1/pib/perv24/pauc0/iohs0": "",
+ "/proc1/pib/perv25/pauc0/iohs1": "/proc0/pib/perv26/pauc1/iohs0",
+ "/proc1/pib/perv26/pauc1/iohs0": "",
+ "/proc1/pib/perv27/pauc1/iohs1": "",
+ "/proc1/pib/perv28/pauc2/iohs0": "/proc0/pib/perv30/pauc3/iohs0",
+ "/proc1/pib/perv29/pauc2/iohs1": "",
+ "/proc1/pib/perv30/pauc3/iohs0": "/proc3/pib/perv31/pauc3/iohs1",
+ "/proc1/pib/perv31/pauc3/iohs1": "/proc2/pib/perv28/pauc2/iohs0",
+
+ "/proc2/pib/perv24/pauc0/iohs0": "",
+ "/proc2/pib/perv25/pauc0/iohs1": "",
+ "/proc2/pib/perv26/pauc1/iohs0": "/proc3/pib/perv25/pauc0/iohs1",
+ "/proc2/pib/perv27/pauc1/iohs1": "",
+ "/proc2/pib/perv28/pauc2/iohs0": "/proc1/pib/perv31/pauc3/iohs1",
+ "/proc2/pib/perv29/pauc2/iohs1": "",
+ "/proc2/pib/perv30/pauc3/iohs0": "/proc3/pib/perv28/pauc2/iohs0",
+ "/proc2/pib/perv31/pauc3/iohs1": "/proc0/pib/perv28/pauc2/iohs0",
+
+ "/proc3/pib/perv24/pauc0/iohs0": "",
+ "/proc3/pib/perv25/pauc0/iohs1": "/proc2/pib/perv26/pauc1/iohs0",
+ "/proc3/pib/perv26/pauc1/iohs0": "",
+ "/proc3/pib/perv27/pauc1/iohs1": "",
+ "/proc3/pib/perv28/pauc2/iohs0": "/proc2/pib/perv30/pauc3/iohs0",
+ "/proc3/pib/perv29/pauc2/iohs1": "",
+ "/proc3/pib/perv30/pauc3/iohs0": "/proc0/pib/perv31/pauc3/iohs1",
+ "/proc3/pib/perv31/pauc3/iohs1": "/proc1/pib/perv30/pauc3/iohs0",
+
+ "/proc0/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc0/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc0/pib/perv25/pauc0/iohs1/smpgroup0": "",
+ "/proc0/pib/perv25/pauc0/iohs1/smpgroup1": "",
+ "/proc0/pib/perv26/pauc1/iohs0/smpgroup0": "/proc1/pib/perv25/pauc0/iohs1/smpgroup0",
+ "/proc0/pib/perv26/pauc1/iohs0/smpgroup1": "/proc1/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc0/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc0/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc0/pib/perv28/pauc2/iohs0/smpgroup0": "/proc2/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc0/pib/perv28/pauc2/iohs0/smpgroup1": "/proc2/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc0/pib/perv29/pauc2/iohs1/smpgroup0": "",
+ "/proc0/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc0/pib/perv30/pauc3/iohs0/smpgroup0": "/proc1/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc0/pib/perv30/pauc3/iohs0/smpgroup1": "/proc1/pib/perv28/pauc2/iohs0/smpgroup1",
+ "/proc0/pib/perv31/pauc3/iohs1/smpgroup0": "/proc3/pib/perv30/pauc3/iohs0/smpgroup0",
+ "/proc0/pib/perv31/pauc3/iohs1/smpgroup1": "/proc3/pib/perv30/pauc3/iohs0/smpgroup1",
+
+ "/proc1/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc1/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc1/pib/perv25/pauc0/iohs1/smpgroup0": "/proc0/pib/perv26/pauc1/iohs0/smpgroup0",
+ "/proc1/pib/perv25/pauc0/iohs1/smpgroup1": "/proc0/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc1/pib/perv26/pauc1/iohs0/smpgroup0": "",
+ "/proc1/pib/perv26/pauc1/iohs0/smpgroup1": "",
+ "/proc1/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc1/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc1/pib/perv28/pauc2/iohs0/smpgroup0": "/proc0/pib/perv30/pauc3/iohs0/smpgroup0",
+ "/proc1/pib/perv28/pauc2/iohs0/smpgroup1": "/proc0/pib/perv30/pauc3/iohs0/smpgroup1",
+ "/proc1/pib/perv29/pauc2/iohs1/smpgroup0": "",
+ "/proc1/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc1/pib/perv30/pauc3/iohs0/smpgroup0": "/proc3/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc1/pib/perv30/pauc3/iohs0/smpgroup1": "/proc3/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc1/pib/perv31/pauc3/iohs1/smpgroup0": "/proc2/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc1/pib/perv31/pauc3/iohs1/smpgroup1": "/proc2/pib/perv28/pauc2/iohs0/smpgroup1",
+
+ "/proc2/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc2/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc2/pib/perv25/pauc0/iohs1/smpgroup0": "",
+ "/proc2/pib/perv25/pauc0/iohs1/smpgroup1": "",
+ "/proc2/pib/perv26/pauc1/iohs0/smpgroup0": "/proc3/pib/perv25/pauc0/iohs1/smpgroup0",
+ "/proc2/pib/perv26/pauc1/iohs0/smpgroup1": "/proc3/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc2/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc2/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc2/pib/perv28/pauc2/iohs0/smpgroup0": "/proc1/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc2/pib/perv28/pauc2/iohs0/smpgroup1": "/proc1/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc2/pib/perv29/pauc2/iohs1/smpgroup0": "",
+ "/proc2/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc2/pib/perv30/pauc3/iohs0/smpgroup0": "/proc3/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc2/pib/perv30/pauc3/iohs0/smpgroup1": "/proc3/pib/perv28/pauc2/iohs0/smpgroup1",
+ "/proc2/pib/perv31/pauc3/iohs1/smpgroup0": "/proc0/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc2/pib/perv31/pauc3/iohs1/smpgroup1": "/proc0/pib/perv28/pauc2/iohs0/smpgroup1",
+
+ "/proc3/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc3/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc3/pib/perv25/pauc0/iohs1/smpgroup0": "/proc2/pib/perv26/pauc1/iohs0/smpgroup0",
+ "/proc3/pib/perv25/pauc0/iohs1/smpgroup1": "/proc2/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc3/pib/perv26/pauc1/iohs0/smpgroup0": "",
+ "/proc3/pib/perv26/pauc1/iohs0/smpgroup1": "",
+ "/proc3/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc3/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc3/pib/perv28/pauc2/iohs0/smpgroup0": "/proc2/pib/perv30/pauc3/iohs0/smpgroup0",
+ "/proc3/pib/perv28/pauc2/iohs0/smpgroup1": "/proc2/pib/perv30/pauc3/iohs0/smpgroup1",
+ "/proc3/pib/perv29/pauc2/iohs1/smpgroup0": "",
+ "/proc3/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc3/pib/perv30/pauc3/iohs0/smpgroup0": "/proc0/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc3/pib/perv30/pauc3/iohs0/smpgroup1": "/proc0/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc3/pib/perv31/pauc3/iohs1/smpgroup0": "/proc1/pib/perv30/pauc3/iohs0/smpgroup0",
+ "/proc3/pib/perv31/pauc3/iohs1/smpgroup1": "/proc1/pib/perv30/pauc3/iohs0/smpgroup1"
+}
diff --git a/util/data/peer-targets-rainier-4u.json b/util/data/peer-targets-rainier-4u.json
new file mode 100644
index 0000000..0ceac3e
--- /dev/null
+++ b/util/data/peer-targets-rainier-4u.json
@@ -0,0 +1,105 @@
+{
+ "/proc0/pib/perv24/pauc0/iohs0": "",
+ "/proc0/pib/perv25/pauc0/iohs1": "",
+ "/proc0/pib/perv26/pauc1/iohs0": "/proc1/pib/perv25/pauc0/iohs1",
+ "/proc0/pib/perv27/pauc1/iohs1": "",
+ "/proc0/pib/perv28/pauc2/iohs0": "/proc2/pib/perv31/pauc3/iohs1",
+ "/proc0/pib/perv29/pauc2/iohs1": "",
+ "/proc0/pib/perv30/pauc3/iohs0": "/proc1/pib/perv28/pauc2/iohs0",
+ "/proc0/pib/perv31/pauc3/iohs1": "/proc3/pib/perv30/pauc3/iohs0",
+
+ "/proc1/pib/perv24/pauc0/iohs0": "",
+ "/proc1/pib/perv25/pauc0/iohs1": "/proc0/pib/perv26/pauc1/iohs0",
+ "/proc1/pib/perv26/pauc1/iohs0": "",
+ "/proc1/pib/perv27/pauc1/iohs1": "",
+ "/proc1/pib/perv28/pauc2/iohs0": "/proc0/pib/perv30/pauc3/iohs0",
+ "/proc1/pib/perv29/pauc2/iohs1": "",
+ "/proc1/pib/perv30/pauc3/iohs0": "/proc3/pib/perv31/pauc3/iohs1",
+ "/proc1/pib/perv31/pauc3/iohs1": "/proc2/pib/perv28/pauc2/iohs0",
+
+ "/proc2/pib/perv24/pauc0/iohs0": "",
+ "/proc2/pib/perv25/pauc0/iohs1": "",
+ "/proc2/pib/perv26/pauc1/iohs0": "/proc3/pib/perv25/pauc0/iohs1",
+ "/proc2/pib/perv27/pauc1/iohs1": "",
+ "/proc2/pib/perv28/pauc2/iohs0": "/proc1/pib/perv31/pauc3/iohs1",
+ "/proc2/pib/perv29/pauc2/iohs1": "",
+ "/proc2/pib/perv30/pauc3/iohs0": "/proc3/pib/perv28/pauc2/iohs0",
+ "/proc2/pib/perv31/pauc3/iohs1": "/proc0/pib/perv28/pauc2/iohs0",
+
+ "/proc3/pib/perv24/pauc0/iohs0": "",
+ "/proc3/pib/perv25/pauc0/iohs1": "/proc2/pib/perv26/pauc1/iohs0",
+ "/proc3/pib/perv26/pauc1/iohs0": "",
+ "/proc3/pib/perv27/pauc1/iohs1": "",
+ "/proc3/pib/perv28/pauc2/iohs0": "/proc2/pib/perv30/pauc3/iohs0",
+ "/proc3/pib/perv29/pauc2/iohs1": "",
+ "/proc3/pib/perv30/pauc3/iohs0": "/proc0/pib/perv31/pauc3/iohs1",
+ "/proc3/pib/perv31/pauc3/iohs1": "/proc1/pib/perv30/pauc3/iohs0",
+
+ "/proc0/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc0/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc0/pib/perv25/pauc0/iohs1/smpgroup0": "",
+ "/proc0/pib/perv25/pauc0/iohs1/smpgroup1": "",
+ "/proc0/pib/perv26/pauc1/iohs0/smpgroup0": "/proc1/pib/perv25/pauc0/iohs1/smpgroup0",
+ "/proc0/pib/perv26/pauc1/iohs0/smpgroup1": "/proc1/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc0/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc0/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc0/pib/perv28/pauc2/iohs0/smpgroup0": "/proc2/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc0/pib/perv28/pauc2/iohs0/smpgroup1": "/proc2/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc0/pib/perv29/pauc2/iohs1/smpgroup0": "",
+ "/proc0/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc0/pib/perv30/pauc3/iohs0/smpgroup0": "/proc1/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc0/pib/perv30/pauc3/iohs0/smpgroup1": "/proc1/pib/perv28/pauc2/iohs0/smpgroup1",
+ "/proc0/pib/perv31/pauc3/iohs1/smpgroup0": "/proc3/pib/perv30/pauc3/iohs0/smpgroup0",
+ "/proc0/pib/perv31/pauc3/iohs1/smpgroup1": "/proc3/pib/perv30/pauc3/iohs0/smpgroup1",
+
+ "/proc1/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc1/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc1/pib/perv25/pauc0/iohs1/smpgroup0": "/proc0/pib/perv26/pauc1/iohs0/smpgroup0",
+ "/proc1/pib/perv25/pauc0/iohs1/smpgroup1": "/proc0/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc1/pib/perv26/pauc1/iohs0/smpgroup0": "",
+ "/proc1/pib/perv26/pauc1/iohs0/smpgroup1": "",
+ "/proc1/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc1/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc1/pib/perv28/pauc2/iohs0/smpgroup0": "/proc0/pib/perv30/pauc3/iohs0/smpgroup0",
+ "/proc1/pib/perv28/pauc2/iohs0/smpgroup1": "/proc0/pib/perv30/pauc3/iohs0/smpgroup1",
+ "/proc1/pib/perv29/pauc2/iohs1/smpgroup0": "",
+ "/proc1/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc1/pib/perv30/pauc3/iohs0/smpgroup0": "/proc3/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc1/pib/perv30/pauc3/iohs0/smpgroup1": "/proc3/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc1/pib/perv31/pauc3/iohs1/smpgroup0": "/proc2/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc1/pib/perv31/pauc3/iohs1/smpgroup1": "/proc2/pib/perv28/pauc2/iohs0/smpgroup1",
+
+ "/proc2/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc2/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc2/pib/perv25/pauc0/iohs1/smpgroup0": "",
+ "/proc2/pib/perv25/pauc0/iohs1/smpgroup1": "",
+ "/proc2/pib/perv26/pauc1/iohs0/smpgroup0": "/proc3/pib/perv25/pauc0/iohs1/smpgroup0",
+ "/proc2/pib/perv26/pauc1/iohs0/smpgroup1": "/proc3/pib/perv25/pauc0/iohs1/smpgroup1",
+ "/proc2/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc2/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc2/pib/perv28/pauc2/iohs0/smpgroup0": "/proc1/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc2/pib/perv28/pauc2/iohs0/smpgroup1": "/proc1/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc2/pib/perv29/pauc2/iohs1/smpgroup0": "",
+ "/proc2/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc2/pib/perv30/pauc3/iohs0/smpgroup0": "/proc3/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc2/pib/perv30/pauc3/iohs0/smpgroup1": "/proc3/pib/perv28/pauc2/iohs0/smpgroup1",
+ "/proc2/pib/perv31/pauc3/iohs1/smpgroup0": "/proc0/pib/perv28/pauc2/iohs0/smpgroup0",
+ "/proc2/pib/perv31/pauc3/iohs1/smpgroup1": "/proc0/pib/perv28/pauc2/iohs0/smpgroup1",
+
+ "/proc3/pib/perv24/pauc0/iohs0/smpgroup0": "",
+ "/proc3/pib/perv24/pauc0/iohs0/smpgroup1": "",
+ "/proc3/pib/perv25/pauc0/iohs1/smpgroup0": "/proc2/pib/perv26/pauc1/iohs0/smpgroup0",
+ "/proc3/pib/perv25/pauc0/iohs1/smpgroup1": "/proc2/pib/perv26/pauc1/iohs0/smpgroup1",
+ "/proc3/pib/perv26/pauc1/iohs0/smpgroup0": "",
+ "/proc3/pib/perv26/pauc1/iohs0/smpgroup1": "",
+ "/proc3/pib/perv27/pauc1/iohs1/smpgroup0": "",
+ "/proc3/pib/perv27/pauc1/iohs1/smpgroup1": "",
+ "/proc3/pib/perv28/pauc2/iohs0/smpgroup0": "/proc2/pib/perv30/pauc3/iohs0/smpgroup0",
+ "/proc3/pib/perv28/pauc2/iohs0/smpgroup1": "/proc2/pib/perv30/pauc3/iohs0/smpgroup1",
+ "/proc3/pib/perv29/pauc2/iohs1/smpgroup0": "",
+ "/proc3/pib/perv29/pauc2/iohs1/smpgroup1": "",
+ "/proc3/pib/perv30/pauc3/iohs0/smpgroup0": "/proc0/pib/perv31/pauc3/iohs1/smpgroup0",
+ "/proc3/pib/perv30/pauc3/iohs0/smpgroup1": "/proc0/pib/perv31/pauc3/iohs1/smpgroup1",
+ "/proc3/pib/perv31/pauc3/iohs1/smpgroup0": "/proc1/pib/perv30/pauc3/iohs0/smpgroup0",
+ "/proc3/pib/perv31/pauc3/iohs1/smpgroup1": "/proc1/pib/perv30/pauc3/iohs0/smpgroup1"
+}
diff --git a/util/dbus.cpp b/util/dbus.cpp
index ea3fdf0..8878f72 100644
--- a/util/dbus.cpp
+++ b/util/dbus.cpp
@@ -1,3 +1,5 @@
+#include <fmt/format.h>
+
#include <util/dbus.hpp>
#include <util/trace.hpp>
#include <xyz/openbmc_project/State/Boot/Progress/server.hpp>
@@ -355,6 +357,77 @@
return plid; // platform log id or 0
}
+MachineType getMachineType()
+{
+ // default to Rainier 2S4U
+ MachineType machineType = MachineType::Rainier_2S4U;
+
+ // The return value of the dbus operation is a vector of 4 uint8_ts
+ std::vector<uint8_t> ids;
+
+ constexpr auto interface = "com.ibm.ipzvpd.VSBP";
+
+ DBusService service;
+ DBusPath path;
+
+ if (0 == find(interface, path, service))
+ {
+ DBusValue value;
+
+ // Machine ID is given from the "IM" keyword
+ constexpr auto property = "IM";
+
+ if (0 == getProperty(interface, path, service, property, value))
+ {
+ // return value is a variant, ID value is a vector of 4 uint8_ts
+ ids = std::get<std::vector<uint8_t>>(value);
+
+ // Convert the returned ID value to a hex string to determine
+ // machine type. The hex values corresponding to the machine type
+ // are defined in /openbmc/openpower-vpd-parser/const.hpp
+ // RAINIER_2S4U == 0x50001000
+ // RAINIER_2S2U == 0x50001001
+ // RAINIER_1S4U == 0x50001002
+ // RAINIER_1S2U == 0x50001003
+ // EVEREST == 0x50003000
+ try
+ {
+ // Format the vector into a single hex string to compare to.
+ std::string hexId =
+ fmt::format("0x{:02x}{:02x}{:02x}{:02x}", ids.at(0),
+ ids.at(1), ids.at(2), ids.at(3));
+
+ std::map<std::string, MachineType> typeMap = {
+ {"0x50001000", MachineType::Rainier_2S4U},
+ {"0x50001001", MachineType::Rainier_2S2U},
+ {"0x50001002", MachineType::Rainier_1S4U},
+ {"0x50001003", MachineType::Rainier_1S2U},
+ {"0x50003000", MachineType::Everest},
+ };
+
+ machineType = typeMap.at(hexId);
+ }
+ catch (const std::out_of_range& e)
+ {
+ trace::err("Out of range exception caught from returned "
+ "machine ID.");
+ for (const auto& id : ids)
+ {
+ trace::err("Returned Machine ID value: 0x%x", id);
+ }
+ throw;
+ }
+ }
+ }
+ else
+ {
+ throw std::invalid_argument(
+ "Unable to find dbus service to get machine type.");
+ }
+
+ return machineType;
+}
+
} // namespace dbus
} // namespace util
diff --git a/util/dbus.hpp b/util/dbus.hpp
index fc8f11a..d8510ac 100644
--- a/util/dbus.hpp
+++ b/util/dbus.hpp
@@ -134,6 +134,23 @@
std::map<std::string, std::string>& io_additional,
const std::vector<FFDCTuple>& i_ffdc);
+/** @brief Machine ID definitions */
+enum class MachineType
+{
+ Rainier_2S4U,
+ Rainier_2S2U,
+ Rainier_1S4U,
+ Rainier_1S2U,
+ Everest,
+};
+
+/**
+ * @brief Read the System IM keyword to get the machine type
+ *
+ * @return An enum representing the machine type
+ */
+MachineType getMachineType();
+
} // namespace dbus
} // namespace util
diff --git a/util/meson.build b/util/meson.build
index e05b4f2..f562559 100644
--- a/util/meson.build
+++ b/util/meson.build
@@ -25,7 +25,9 @@
util_src,
include_directories : incdir,
dependencies : util_deps,
- cpp_args : test_arg,
+ cpp_args : [ package_args, test_arg ],
install : false,
)
+# Install the util data files
+subdir('data')
diff --git a/util/pdbg.cpp b/util/pdbg.cpp
index 10f3b73..46bb37b 100644
--- a/util/pdbg.cpp
+++ b/util/pdbg.cpp
@@ -9,15 +9,23 @@
#include <config.h>
#include <hei_main.hpp>
+#include <nlohmann/json.hpp>
+#include <util/dbus.hpp>
#include <util/pdbg.hpp>
#include <util/trace.hpp>
+#include <filesystem>
+#include <fstream>
+#include <string>
+
#ifdef CONFIG_PHAL_API
#include <attributes_info.H>
#endif
using namespace analyzer;
+namespace fs = std::filesystem;
+
namespace util
{
@@ -195,6 +203,67 @@
//------------------------------------------------------------------------------
+pdbg_target* getTargetAcrossBus(pdbg_target* i_rxTarget)
+{
+ assert(nullptr != i_rxTarget);
+
+ // Validate target type
+ auto rxType = util::pdbg::getTrgtType(i_rxTarget);
+ assert(util::pdbg::TYPE_IOLINK == rxType ||
+ util::pdbg::TYPE_IOHS == rxType);
+
+ pdbg_target* o_peerTarget;
+ fs::path filePath;
+
+ // Open the appropriate data file depending on machine type
+ util::dbus::MachineType machineType = util::dbus::getMachineType();
+ switch (machineType)
+ {
+ // Rainier 4U
+ case util::dbus::MachineType::Rainier_2S4U:
+ case util::dbus::MachineType::Rainier_1S4U:
+ filePath =
+ fs::path{PACKAGE_DIR "util-data/peer-targets-rainier-4u.json"};
+ break;
+ // Rainier 2U
+ case util::dbus::MachineType::Rainier_2S2U:
+ case util::dbus::MachineType::Rainier_1S2U:
+ filePath =
+ fs::path{PACKAGE_DIR "util-data/peer-targets-rainier-2u.json"};
+ break;
+ // Everest
+ case util::dbus::MachineType::Everest:
+ filePath =
+ fs::path{PACKAGE_DIR "util-data/peer-targets-everest.json"};
+ break;
+ default:
+ trace::err("Invalid machine type found %d",
+ static_cast<uint8_t>(machineType));
+ break;
+ }
+
+ std::ifstream file{filePath};
+ assert(file.good());
+
+ try
+ {
+ auto trgtMap = nlohmann::json::parse(file);
+ std::string rxPath = util::pdbg::getPath(i_rxTarget);
+ std::string peerPath = trgtMap.at(rxPath).get<std::string>();
+
+ o_peerTarget = util::pdbg::getTrgt(peerPath);
+ }
+ catch (...)
+ {
+ trace::err("Failed to parse file: %s", filePath.string().c_str());
+ throw;
+ }
+
+ return o_peerTarget;
+}
+
+//------------------------------------------------------------------------------
+
pdbg_target* getConnectedTarget(pdbg_target* i_rxTarget,
const callout::BusType& i_busType)
{
@@ -208,27 +277,19 @@
if (callout::BusType::SMP_BUS == i_busType &&
util::pdbg::TYPE_IOLINK == rxType)
{
- // TODO: Will need to reference some sort of data that can tell us how
- // the processors are connected in the system. For now, return the
- // RX target to avoid returning a nullptr.
- trace::inf("No support to get peer target on SMP bus");
- txTarget = i_rxTarget;
+ txTarget = getTargetAcrossBus(i_rxTarget);
}
else if (callout::BusType::SMP_BUS == i_busType &&
util::pdbg::TYPE_IOHS == rxType)
{
- // TODO: Will need to reference some sort of data that can tell us how
- // the processors are connected in the system. For now, return the
- // RX target to avoid returning a nullptr.
- trace::inf("No support to get peer target on SMP bus");
- txTarget = i_rxTarget;
+ txTarget = getTargetAcrossBus(i_rxTarget);
}
else if (callout::BusType::OMI_BUS == i_busType &&
util::pdbg::TYPE_OMI == rxType)
{
// This is a bit clunky. The pdbg APIs only give us the ability to
- // iterate over the children instead of just returning a list. So we'll
- // push all the children to a list and go from there.
+ // iterate over the children instead of just returning a list. So
+ // we'll push all the children to a list and go from there.
std::vector<pdbg_target*> childList;
pdbg_target* childTarget = nullptr;
@@ -309,9 +370,9 @@
//------------------------------------------------------------------------------
// IMPORTANT:
-// The ATTR_CHIP_ID attribute will be synced from Hostboot to the BMC at some
-// point during the IPL. It is possible that this information is needed before
-// the sync occurs, in which case the value will return 0.
+// The ATTR_CHIP_ID attribute will be synced from Hostboot to the BMC at
+// some point during the IPL. It is possible that this information is needed
+// before the sync occurs, in which case the value will return 0.
uint32_t __getChipId(pdbg_target* i_trgt)
{
uint32_t attr = 0;
@@ -320,9 +381,9 @@
}
// IMPORTANT:
-// The ATTR_EC attribute will be synced from Hostboot to the BMC at some point
-// during the IPL. It is possible that this information is needed before the
-// sync occurs, in which case the value will return 0.
+// The ATTR_EC attribute will be synced from Hostboot to the BMC at some
+// point during the IPL. It is possible that this information is needed
+// before the sync occurs, in which case the value will return 0.
uint8_t __getChipEc(pdbg_target* i_trgt)
{
uint8_t attr = 0;
@@ -338,11 +399,11 @@
if (((0 == chipId) || (0 == chipEc)) && (TYPE_PROC == getTrgtType(i_trgt)))
{
// There is a special case where the model/level attributes have not
- // been initialized in the devtree. This is possible on the epoch IPL
- // where an attention occurs before Hostboot is able to update the
- // devtree information on the BMC. It may is still possible to get this
- // information from chips with CFAM access (i.e. a processor) via the
- // CFAM chip ID register.
+ // been initialized in the devtree. This is possible on the epoch
+ // IPL where an attention occurs before Hostboot is able to update
+ // the devtree information on the BMC. It may is still possible to
+ // get this information from chips with CFAM access (i.e. a
+ // processor) via the CFAM chip ID register.
uint32_t val = 0;
if (0 == getCfam(i_trgt, 0x100a, val))
@@ -358,16 +419,16 @@
void __addChip(std::vector<libhei::Chip>& o_chips, pdbg_target* i_trgt,
libhei::ChipType_t i_type)
{
- // Trace each chip for debug. It is important to show the type just in case
- // the model/EC does not exist. See note below.
+ // Trace each chip for debug. It is important to show the type just in
+ // case the model/EC does not exist. See note below.
trace::inf("Chip found: type=0x%08" PRIx32 " chip=%s", i_type,
getPath(i_trgt));
if (0 == i_type)
{
- // This is a special case. See the details in __getChipIdEC(). There is
- // nothing more we can do with this chip since we don't know what it is.
- // So ignore the chip for now.
+ // This is a special case. See the details in __getChipIdEC(). There
+ // is nothing more we can do with this chip since we don't know what
+ // it is. So ignore the chip for now.
}
else
{
@@ -385,8 +446,8 @@
{
// We cannot use the proc target to determine if the chip is active.
// There is some design limitation in pdbg that requires the proc
- // targets to always be active. Instead, we must get the associated pib
- // target and check if it is active.
+ // targets to always be active. Instead, we must get the associated
+ // pib target and check if it is active.
// Active processors only.
if (PDBG_TARGET_ENABLED != pdbg_target_probe(getPibTrgt(procTrgt)))
@@ -434,7 +495,8 @@
pdbg_target* getPrimaryProcessor()
{
- // TODO: For at least P10, the primary processor (the one connected directly
+ // TODO: For at least P10, the primary processor (the one connected
+ // directly
// to the BMC), will always be PROC 0. We will need to update this
// later if we ever support an alternate primary processor.
return getTrgt("/proc0");
@@ -519,10 +581,10 @@
ATTR_PHYS_BIN_PATH_Type value;
if (DT_GET_PROP(ATTR_PHYS_BIN_PATH, target, value))
{
- // The attrirbute for this target does not exist. Get the immediate
- // parent in the devtree path and try again. Note that if there is
- // no parent target, nullptr will be returned and that will be
- // checked above.
+ // The attrirbute for this target does not exist. Get the
+ // immediate parent in the devtree path and try again. Note that
+ // if there is no parent target, nullptr will be returned and
+ // that will be checked above.
return getPhysBinPath(pdbg_target_parent(nullptr, target));
}