blob: 790162ad84b30fbc476ced4784e1b05679867eec [file] [log] [blame]
AppaRao Pulie63eeda2019-07-05 16:25:38 +05301/*
2// Copyright (c) 2019 Intel Corporation
3//
4// Licensed under the Apache License, Version 2.0 (the "License");
5// you may not use this file except in compliance with the License.
6// You may obtain a copy of the License at
7//
8// http://www.apache.org/licenses/LICENSE-2.0
9//
10// Unless required by applicable law or agreed to in writing, software
11// distributed under the License is distributed on an "AS IS" BASIS,
12// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13// See the License for the specific language governing permissions and
14// limitations under the License.
15*/
16
AppaRao Puli67d184c2020-05-29 00:48:33 +053017#include "pfr.hpp"
18#include "pfr_mgr.hpp"
19
AppaRao Puli88aa33b2019-07-18 23:49:55 +053020#include <systemd/sd-journal.h>
21
AppaRao Puli46cead92019-07-22 16:50:09 +053022#include <boost/asio.hpp>
AppaRao Pulie63eeda2019-07-05 16:25:38 +053023
AppaRao Pulidcf13122020-05-28 01:21:39 +053024namespace pfr
25{
AppaRao Puli88aa33b2019-07-18 23:49:55 +053026// Caches the last Recovery/Panic Count to
27// identify any new Recovery/panic actions.
28/* TODO: When BMC Reset's, these values will be lost
29 * Persist this info using settingsd */
30static uint8_t lastRecoveryCount = 0;
31static uint8_t lastPanicCount = 0;
32static uint8_t lastMajorErr = 0;
33static uint8_t lastMinorErr = 0;
34
35static bool stateTimerRunning = false;
AppaRao Puli46cead92019-07-22 16:50:09 +053036bool finishedSettingChkPoint = false;
37static constexpr uint8_t bmcBootFinishedChkPoint = 0x09;
38
AppaRao Puli88aa33b2019-07-18 23:49:55 +053039std::unique_ptr<boost::asio::steady_timer> stateTimer = nullptr;
AppaRao Puli46cead92019-07-22 16:50:09 +053040std::unique_ptr<boost::asio::steady_timer> initTimer = nullptr;
AppaRao Puli88aa33b2019-07-18 23:49:55 +053041
AppaRao Pulidcf13122020-05-28 01:21:39 +053042std::vector<std::unique_ptr<PfrVersion>> pfrVersionObjects;
43std::unique_ptr<PfrConfig> pfrConfigObject;
AppaRao Pulie4e95652019-07-19 16:52:01 +053044
AppaRao Pulie4e95652019-07-19 16:52:01 +053045// List holds <ObjPath> <ImageType> <VersionPurpose>
46static std::vector<std::tuple<std::string, ImageType, std::string>>
47 verComponentList = {
48 std::make_tuple("bmc_active", ImageType::bmcActive, versionPurposeBMC),
49 std::make_tuple("bmc_recovery", ImageType::bmcRecovery,
50 versionPurposeBMC),
51 std::make_tuple("bios_active", ImageType::biosActive,
52 versionPurposeHost),
53 std::make_tuple("bios_recovery", ImageType::biosRecovery,
54 versionPurposeHost),
Vikram Bodireddy3c6c8c32019-12-05 11:06:15 +053055 std::make_tuple("cpld_active", ImageType::cpldActive,
56 versionPurposeOther),
57 std::make_tuple("cpld_recovery", ImageType::cpldRecovery,
58 versionPurposeOther),
59};
AppaRao Pulie4e95652019-07-19 16:52:01 +053060
AppaRao Pulie90f1282019-11-05 01:07:05 +053061// Recovery reason map.
62// {<CPLD association>,{<Redfish MessageID>, <Recovery Reason>}}
63static const boost::container::flat_map<uint8_t,
64 std::pair<std::string, std::string>>
65 recoveryReasonMap = {
66 {0x01,
67 {"BIOSFirmwareRecoveryReason",
Chalapathi3fb544b2020-02-14 15:43:49 +000068 "BIOS active image authentication failure"}},
AppaRao Pulie90f1282019-11-05 01:07:05 +053069 {0x02,
70 {"BIOSFirmwareRecoveryReason",
Chalapathi3fb544b2020-02-14 15:43:49 +000071 "BIOS recovery image authentication failure"}},
AppaRao Pulie90f1282019-11-05 01:07:05 +053072 {0x03, {"MEFirmwareRecoveryReason", "ME launch failure"}},
73 {0x04, {"BIOSFirmwareRecoveryReason", "ACM launch failure"}},
74 {0x05, {"BIOSFirmwareRecoveryReason", "IBB launch failure"}},
75 {0x06, {"BIOSFirmwareRecoveryReason", "OBB launch failure"}},
76 {0x07,
77 {"BMCFirmwareRecoveryReason",
78 "BMC active image authentication failure"}},
79 {0x08,
80 {"BMCFirmwareRecoveryReason",
81 "BMC recovery image authentication failure"}},
82 {0x09, {"BMCFirmwareRecoveryReason", "BMC launch failure"}},
83 {0x0A, {"CPLDFirmwareRecoveryReason", "CPLD watchdog expired"}}};
AppaRao Puli88aa33b2019-07-18 23:49:55 +053084
AppaRao Pulie90f1282019-11-05 01:07:05 +053085// Panic Reason map.
86// {<CPLD association>, {<Redfish MessageID>, <Panic reason> })
87static const boost::container::flat_map<uint8_t,
88 std::pair<std::string, std::string>>
89 panicReasonMap = {
Chalapathi3fb544b2020-02-14 15:43:49 +000090 {0x01, {"BIOSFirmwarePanicReason", "BIOS update intent"}},
91 {0x02, {"BMCFirmwarePanicReason", "BMC update intent"}},
92 {0x03, {"BMCFirmwarePanicReason", "BMC reset detected"}},
93 {0x04, {"BMCFirmwarePanicReason", "BMC watchdog expired"}},
94 {0x05, {"MEFirmwarePanicReason", "ME watchdog expired"}},
95 {0x06, {"BIOSFirmwarePanicReason", "ACM watchdog expired"}},
96 {0x07, {"BIOSFirmwarePanicReason", "IBB watchdog expired"}},
97 {0x08, {"BIOSFirmwarePanicReason", "OBB watchdog expired"}},
AppaRao Pulie90f1282019-11-05 01:07:05 +053098 {0x09,
99 {"BIOSFirmwarePanicReason",
Chalapathi3fb544b2020-02-14 15:43:49 +0000100 "ACM or IBB or OBB authentication failure"}}};
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530101
AppaRao Puli24766942019-11-13 19:27:08 +0530102// Firmware resiliency major map.
103// {<CPLD association>, {<Redfish MessageID>, <Error reason> })
104static const boost::container::flat_map<uint8_t,
105 std::pair<std::string, std::string>>
106 majorErrorCodeMap = {
107 {0x01,
108 {"BMCFirmwareResiliencyError", "BMC image authentication failed"}},
109 {0x02,
110 {"BIOSFirmwareResiliencyError", "BIOS image authentication failed"}},
Chalapathi3fb544b2020-02-14 15:43:49 +0000111 {0x03, {"BIOSFirmwareResiliencyError", "Update from BIOS failed"}},
112 {0x04, {"BMCFirmwareResiliencyError", "Update from BMC failed"}}};
AppaRao Puli24766942019-11-13 19:27:08 +0530113
AppaRao Pulie4e95652019-07-19 16:52:01 +0530114static void updateDbusPropertiesCache()
115{
116 for (const auto& pfrVerObj : pfrVersionObjects)
117 {
118 pfrVerObj->updateVersion();
119 }
120
121 // Update provisoningStatus properties
122 pfrConfigObject->updateProvisioningStatus();
123
124 phosphor::logging::log<phosphor::logging::level::INFO>(
125 "PFR Manager service cache data updated.");
126}
127
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530128static void logLastRecoveryEvent()
129{
130 uint8_t reason = 0;
AppaRao Pulidcf13122020-05-28 01:21:39 +0530131 if (0 != readCpldReg(ActionType::recoveryReason, reason))
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530132 {
133 return;
134 }
135
AppaRao Pulie90f1282019-11-05 01:07:05 +0530136 auto it = recoveryReasonMap.find(reason);
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530137 if (it == recoveryReasonMap.end())
138 {
139 // No matching found. So just return without logging event.
140 return;
141 }
AppaRao Pulie90f1282019-11-05 01:07:05 +0530142 std::string msgId = "OpenBMC.0.1." + it->second.first;
143 sd_journal_send("MESSAGE=%s", "Platform firmware recovery occurred.",
144 "PRIORITY=%i", LOG_WARNING, "REDFISH_MESSAGE_ID=%s",
145 msgId.c_str(), "REDFISH_MESSAGE_ARGS=%s",
146 it->second.second.c_str(), NULL);
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530147}
148
149static void logLastPanicEvent()
150{
151 uint8_t reason = 0;
AppaRao Pulidcf13122020-05-28 01:21:39 +0530152 if (0 != readCpldReg(ActionType::panicReason, reason))
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530153 {
154 return;
155 }
156
AppaRao Pulie90f1282019-11-05 01:07:05 +0530157 auto it = panicReasonMap.find(reason);
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530158 if (it == panicReasonMap.end())
159 {
160 // No matching found. So just return without logging event.
161 return;
162 }
163
AppaRao Pulie90f1282019-11-05 01:07:05 +0530164 std::string msgId = "OpenBMC.0.1." + it->second.first;
165 sd_journal_send("MESSAGE=%s", "Platform firmware panic occurred.",
166 "PRIORITY=%i", LOG_WARNING, "REDFISH_MESSAGE_ID=%s",
167 msgId.c_str(), "REDFISH_MESSAGE_ARGS=%s",
168 it->second.second.c_str(), NULL);
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530169}
170
AppaRao Puli24766942019-11-13 19:27:08 +0530171static void logResiliencyErrorEvent(const uint8_t majorErrorCode,
172 const uint8_t minorErrorCode)
173{
174 auto it = majorErrorCodeMap.find(majorErrorCode);
175 if (it == majorErrorCodeMap.end())
176 {
177 // No matching found. So just return without logging event.
178 return;
179 }
180
181 std::string errorStr =
182 it->second.second + "(MinorCode:0x" + toHexString(minorErrorCode) + ")";
183 std::string msgId = "OpenBMC.0.1." + it->second.first;
184 sd_journal_send(
185 "MESSAGE=%s", "Platform firmware resiliency error occurred.",
186 "PRIORITY=%i", LOG_ERR, "REDFISH_MESSAGE_ID=%s", msgId.c_str(),
187 "REDFISH_MESSAGE_ARGS=%s", errorStr.c_str(), NULL);
188}
189
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530190static void checkAndLogEvents()
191{
192 uint8_t currPanicCount = 0;
AppaRao Pulidcf13122020-05-28 01:21:39 +0530193 if (0 == readCpldReg(ActionType::panicCount, currPanicCount))
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530194 {
195 if (lastPanicCount != currPanicCount)
196 {
197 // Update cached data and log redfish event by reading reason.
198 lastPanicCount = currPanicCount;
199 logLastPanicEvent();
200 }
201 }
202
203 uint8_t currRecoveryCount = 0;
AppaRao Pulidcf13122020-05-28 01:21:39 +0530204 if (0 == readCpldReg(ActionType::recoveryCount, currRecoveryCount))
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530205 {
206 if (lastRecoveryCount != currRecoveryCount)
207 {
208 // Update cached data and log redfish event by reading reason.
209 lastRecoveryCount = currRecoveryCount;
210 logLastRecoveryEvent();
211 }
212 }
213
214 uint8_t majorErr = 0;
215 uint8_t minorErr = 0;
AppaRao Pulidcf13122020-05-28 01:21:39 +0530216 if ((0 == readCpldReg(ActionType::majorError, majorErr)) &&
217 (0 == readCpldReg(ActionType::minorError, minorErr)))
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530218 {
219 if ((lastMajorErr != majorErr) || (lastMinorErr != minorErr))
220 {
221 lastMajorErr = majorErr;
222 lastMinorErr = minorErr;
223
AppaRao Puli24766942019-11-13 19:27:08 +0530224 logResiliencyErrorEvent(majorErr, minorErr);
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530225 }
226 }
227}
228
229static void monitorPlatformStateChange(
230 sdbusplus::asio::object_server& server,
231 std::shared_ptr<sdbusplus::asio::connection>& conn)
232{
233 constexpr size_t pollTimeout = 10; // seconds
234 stateTimer->expires_after(std::chrono::seconds(pollTimeout));
235 stateTimer->async_wait(
236 [&server, &conn](const boost::system::error_code& ec) {
237 if (ec == boost::asio::error::operation_aborted)
238 {
239 // Timer reset.
240 return;
241 }
242 if (ec)
243 {
244 // Platform State Monitor - Timer cancelled.
245 return;
246 }
247 checkAndLogEvents();
248 monitorPlatformStateChange(server, conn);
249 });
250}
251
AppaRao Puli46cead92019-07-22 16:50:09 +0530252void checkAndSetCheckpoint(sdbusplus::asio::object_server& server,
253 std::shared_ptr<sdbusplus::asio::connection>& conn)
254{
255 // Check whether systemd completed all the loading.
256 conn->async_method_call(
257 [&server, &conn](boost::system::error_code ec,
258 const std::variant<uint64_t>& value) {
AppaRao Pulib7e172c2019-12-13 14:46:25 +0530259 if (!ec)
AppaRao Puli46cead92019-07-22 16:50:09 +0530260 {
AppaRao Pulib7e172c2019-12-13 14:46:25 +0530261 if (std::get<uint64_t>(value))
AppaRao Puli46cead92019-07-22 16:50:09 +0530262 {
AppaRao Pulib7e172c2019-12-13 14:46:25 +0530263 phosphor::logging::log<phosphor::logging::level::INFO>(
264 "PFR: BMC boot completed. Setting checkpoint 9.");
265 if (!finishedSettingChkPoint)
266 {
267 finishedSettingChkPoint = true;
AppaRao Pulidcf13122020-05-28 01:21:39 +0530268 setBMCBootCheckpoint(bmcBootFinishedChkPoint);
AppaRao Pulib7e172c2019-12-13 14:46:25 +0530269 }
270 return;
AppaRao Puli46cead92019-07-22 16:50:09 +0530271 }
272 }
273 else
274 {
AppaRao Pulib7e172c2019-12-13 14:46:25 +0530275 // Failed to get data from systemd. System might not
276 // be ready yet. Attempt again for data.
277 phosphor::logging::log<phosphor::logging::level::ERR>(
278 "PFR: aync call failed to get FinishTimestamp.",
279 phosphor::logging::entry("MSG=%s", ec.message().c_str()));
AppaRao Puli46cead92019-07-22 16:50:09 +0530280 }
AppaRao Pulib7e172c2019-12-13 14:46:25 +0530281 // FIX-ME: Latest up-stream sync caused issue in receiving
282 // StartupFinished signal. Unable to get StartupFinished signal
283 // from systemd1 hence using poll method too, to trigger it
284 // properly.
285 constexpr size_t pollTimeout = 10; // seconds
286 initTimer->expires_after(std::chrono::seconds(pollTimeout));
287 initTimer->async_wait([&server,
288 &conn](const boost::system::error_code& ec) {
289 if (ec == boost::asio::error::operation_aborted)
290 {
291 // Timer reset.
292 phosphor::logging::log<phosphor::logging::level::INFO>(
293 "PFR: Set boot Checkpoint - Timer aborted or stopped.");
294 return;
295 }
296 if (ec)
297 {
298 phosphor::logging::log<phosphor::logging::level::ERR>(
299 "PFR: Set boot Checkpoint - async wait error.");
300 return;
301 }
302 checkAndSetCheckpoint(server, conn);
303 });
AppaRao Puli46cead92019-07-22 16:50:09 +0530304 },
305 "org.freedesktop.systemd1", "/org/freedesktop/systemd1",
306 "org.freedesktop.DBus.Properties", "Get",
307 "org.freedesktop.systemd1.Manager", "FinishTimestamp");
308}
309
AppaRao Pulia9bf9712020-01-12 05:45:48 +0530310void monitorSignals(sdbusplus::asio::object_server& server,
311 std::shared_ptr<sdbusplus::asio::connection>& conn)
AppaRao Pulie63eeda2019-07-05 16:25:38 +0530312{
AppaRao Puli46cead92019-07-22 16:50:09 +0530313 // Monitor Boot finished signal and set the checkpoint 9 to
314 // notify CPLD about BMC boot finish.
315 auto bootFinishedSignal = std::make_unique<sdbusplus::bus::match::match>(
316 static_cast<sdbusplus::bus::bus&>(*conn),
317 "type='signal',"
318 "member='StartupFinished',path='/org/freedesktop/systemd1',"
319 "interface='org.freedesktop.systemd1.Manager'",
320 [&server, &conn](sdbusplus::message::message& msg) {
321 if (!finishedSettingChkPoint)
322 {
AppaRao Pulib7e172c2019-12-13 14:46:25 +0530323 phosphor::logging::log<phosphor::logging::level::INFO>(
324 "PFR: BMC boot completed(StartupFinished). Setting "
325 "checkpoint 9.");
AppaRao Puli46cead92019-07-22 16:50:09 +0530326 finishedSettingChkPoint = true;
AppaRao Pulidcf13122020-05-28 01:21:39 +0530327 setBMCBootCheckpoint(bmcBootFinishedChkPoint);
AppaRao Puli46cead92019-07-22 16:50:09 +0530328 }
329 });
330 checkAndSetCheckpoint(server, conn);
331
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530332 // Capture the Chassis state and Start the monitor timer
333 // if state changed to 'On'. Run timer until OS boot.
334 // Stop timer if state changed to 'Off'.
335 static auto matchChassisState = sdbusplus::bus::match::match(
336 static_cast<sdbusplus::bus::bus&>(*conn),
337 "type='signal',member='PropertiesChanged', "
338 "interface='org.freedesktop.DBus.Properties', "
339 "sender='xyz.openbmc_project.State.Chassis', "
340 "arg0namespace='xyz.openbmc_project.State.Chassis'",
341 [&server, &conn](sdbusplus::message::message& message) {
342 std::string intfName;
343 std::map<std::string, std::variant<std::string>> properties;
344 message.read(intfName, properties);
345
346 const auto it = properties.find("CurrentPowerState");
347 if (it != properties.end())
348 {
349 const std::string* state =
350 std::get_if<std::string>(&it->second);
351 if (state != nullptr)
352 {
353 if ((*state ==
354 "xyz.openbmc_project.State.Chassis.PowerState.On") &&
355 (!stateTimerRunning))
356 {
357 stateTimerRunning = true;
358 monitorPlatformStateChange(server, conn);
359 }
360 else if ((*state == "xyz.openbmc_project.State.Chassis."
361 "PowerState.Off") &&
362 (stateTimerRunning))
363 {
364 stateTimer->cancel();
365 checkAndLogEvents();
366 stateTimerRunning = false;
367 }
368 }
AppaRao Pulie4e95652019-07-19 16:52:01 +0530369
370 // Update the D-Bus properties when chassis state changes.
371 updateDbusPropertiesCache();
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530372 }
373 });
374
375 // Capture the Host state and Start the monitor timer
376 // if state changed to 'Running'. Run timer until OS boot.
377 // Stop timer if state changed to 'Off'.
378 static auto matchHostState = sdbusplus::bus::match::match(
379 static_cast<sdbusplus::bus::bus&>(*conn),
380 "type='signal',member='PropertiesChanged', "
381 "interface='org.freedesktop.DBus.Properties', "
382 "sender='xyz.openbmc_project.State.Chassis', "
383 "arg0namespace='xyz.openbmc_project.State.Host'",
384 [&server, &conn](sdbusplus::message::message& message) {
385 std::string intfName;
386 std::map<std::string, std::variant<std::string>> properties;
387 message.read(intfName, properties);
388
389 const auto it = properties.find("CurrentHostState");
390 if (it != properties.end())
391 {
392 const std::string* state =
393 std::get_if<std::string>(&it->second);
394 if (state != nullptr)
395 {
396 if ((*state ==
397 "xyz.openbmc_project.State.Host.HostState.Running") &&
398 (!stateTimerRunning))
399 {
400 stateTimerRunning = true;
401 monitorPlatformStateChange(server, conn);
402 }
403 else if (((*state == "xyz.openbmc_project.State.Host."
404 "HostState.Off") ||
405 (*state == "xyz.openbmc_project.State.Host."
406 "HostState.Quiesced")) &&
407 (stateTimerRunning))
408 {
409 stateTimer->cancel();
410 checkAndLogEvents();
411 stateTimerRunning = false;
412 }
413 }
AppaRao Pulie4e95652019-07-19 16:52:01 +0530414
415 // Update the D-Bus properties when host state changes.
416 updateDbusPropertiesCache();
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530417 }
418 });
419
420 // Capture the OS state change and stop monitor timer
421 // if OS boots completly or becomes Inactive.
422 // start timer in other cases to mnitor states.
423 static auto matchOsState = sdbusplus::bus::match::match(
424 static_cast<sdbusplus::bus::bus&>(*conn),
425 "type='signal',member='PropertiesChanged', "
426 "interface='org.freedesktop.DBus.Properties', "
427 "sender='xyz.openbmc_project.State.Chassis', "
428 "arg0namespace='xyz.openbmc_project.State.OperatingSystem.Status'",
429 [&server, &conn](sdbusplus::message::message& message) {
430 std::string intfName;
431 std::map<std::string, std::variant<std::string>> properties;
432 message.read(intfName, properties);
433
434 const auto it = properties.find("OperatingSystemState");
435 if (it != properties.end())
436 {
437 const std::string* state =
438 std::get_if<std::string>(&it->second);
439 if (state != nullptr)
440 {
441 if (((*state == "BootComplete") ||
442 (*state == "Inactive")) &&
443 (stateTimerRunning))
444 {
445 stateTimer->cancel();
446 checkAndLogEvents();
447 stateTimerRunning = false;
448 }
449 else if (!stateTimerRunning)
450 {
451 stateTimerRunning = true;
452 monitorPlatformStateChange(server, conn);
453 }
454 }
455 }
456 });
457
458 // First time, check and log events if any.
459 checkAndLogEvents();
AppaRao Pulia9bf9712020-01-12 05:45:48 +0530460}
AppaRao Puli88aa33b2019-07-18 23:49:55 +0530461
AppaRao Pulidcf13122020-05-28 01:21:39 +0530462} // namespace pfr
463
AppaRao Pulia9bf9712020-01-12 05:45:48 +0530464int main()
465{
466 // setup connection to dbus
467 boost::asio::io_service io;
468 auto conn = std::make_shared<sdbusplus::asio::connection>(io);
AppaRao Pulidcf13122020-05-28 01:21:39 +0530469 pfr::stateTimer = std::make_unique<boost::asio::steady_timer>(io);
470 pfr::initTimer = std::make_unique<boost::asio::steady_timer>(io);
AppaRao Pulia9bf9712020-01-12 05:45:48 +0530471 auto server = sdbusplus::asio::object_server(conn, true);
AppaRao Pulidcf13122020-05-28 01:21:39 +0530472 pfr::monitorSignals(server, conn);
AppaRao Pulia9bf9712020-01-12 05:45:48 +0530473
474 auto rootInterface = server.add_interface("/xyz/openbmc_project/pfr", "");
475 rootInterface->initialize();
476 server.add_manager("/xyz/openbmc_project/pfr");
477
478 // Create PFR attributes object and interface
AppaRao Pulidcf13122020-05-28 01:21:39 +0530479 pfr::pfrConfigObject = std::make_unique<pfr::PfrConfig>(server, conn);
AppaRao Pulia9bf9712020-01-12 05:45:48 +0530480
481 // Create Software objects using Versions interface
AppaRao Pulidcf13122020-05-28 01:21:39 +0530482 for (const auto& entry : pfr::verComponentList)
AppaRao Pulia9bf9712020-01-12 05:45:48 +0530483 {
AppaRao Pulidcf13122020-05-28 01:21:39 +0530484 pfr::pfrVersionObjects.emplace_back(std::make_unique<pfr::PfrVersion>(
AppaRao Pulia9bf9712020-01-12 05:45:48 +0530485 server, conn, std::get<0>(entry), std::get<1>(entry),
486 std::get<2>(entry)));
487 }
488
489 conn->request_name("xyz.openbmc_project.PFR.Manager");
AppaRao Pulie63eeda2019-07-05 16:25:38 +0530490 phosphor::logging::log<phosphor::logging::level::INFO>(
491 "Intel PFR service started successfully");
AppaRao Pulie63eeda2019-07-05 16:25:38 +0530492 io.run();
493
494 return 0;
495}