cpuinfoapp: Add SST discovery feature

Retrieve Intel Speed Select Technology (SST) configuration values for
all CPUs via PECI (OS-PCode mailbox). Each CPU may have up to three
Performance Profiles (PP), each with accompanying Base Frequency (BF)
information.

Discovery is started immediately, but if no CPUs are found or any
unexpected PECI error is encountered, discovery is aborted and scheduled
for periodic retries until complete.

The profile data is published on D-Bus using two predefined interfaces:
 - xyz.openbmc_project.Control.Processor.CurrentOperationConfig, which
   is implemented on each "cpu" object in the inventory, and contains
   mutable properties for OOB configuration (modifiying properties not
   supported yet).
 - xyz.openbmc_project.Inventory.Item.Cpu.OperationConfig, which is
   implemented on separate "config" objects and contains the readonly
   properties for each performance profile.

Tested:
 - Profiled performance of PECI operations via code instrumentation
   (takes ~2 min per CPU on ast2500 during BMC boot, ~2 sec during BMC idle).
 - Validated Redfish output against Linux driver using included python
   tool.
 - Injected PECI failures in code to test error handling, and tested
   with Linux OS idling on host to make sure WOP is working.

Change-Id: I0d8ae79655dfd2880cf3bae6abe600597740df7c
Signed-off-by: Jonathan Doman <jonathan.doman@intel.com>
diff --git a/include/cpuinfo.hpp b/include/cpuinfo.hpp
index 796ed4c..5267c00 100644
--- a/include/cpuinfo.hpp
+++ b/include/cpuinfo.hpp
@@ -26,6 +26,8 @@
 static constexpr char const* cpuInfoObject = "xyz.openbmc_project.CPUInfo";
 static constexpr char const* cpuInfoPath = "/xyz/openbmc_project/CPUInfo";
 static constexpr char const* cpuInfoInterface = "xyz.openbmc_project.CPUInfo";
+static constexpr const char* cpuPath =
+    "/xyz/openbmc_project/inventory/system/chassis/motherboard/cpu";
 
 static constexpr const int peciCheckInterval = 10;
 
diff --git a/include/speed_select.hpp b/include/speed_select.hpp
new file mode 100644
index 0000000..aaa8b70
--- /dev/null
+++ b/include/speed_select.hpp
@@ -0,0 +1,40 @@
+// Copyright (c) 2020 Intel Corporation
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+//      http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#pragma once
+
+#include <boost/asio/io_context.hpp>
+#include <sdbusplus/asio/connection.hpp>
+
+namespace cpu_info
+{
+namespace sst
+{
+
+/**
+ * Retrieve all SST configuration info for all discoverable CPUs, and publish
+ * the info on new D-Bus objects on the given bus connection.
+ *
+ * This function may block until all discovery is completed (many seconds), or
+ * it may schedule the work to be done at a later time (on the given ASIO
+ * context) if CPUs are not currently available, and may also schedule periodic
+ * work to be done after initial discovery is completed.
+ *
+ * @param[in,out]   ioc     ASIO IO context/service
+ * @param[in,out]   conn    D-Bus ASIO connection.
+ */
+void init(boost::asio::io_context& ioc,
+          const std::shared_ptr<sdbusplus::asio::connection>& conn);
+
+} // namespace sst
+} // namespace cpu_info