blob: 0e78432910d50e3591059cffa8f4f3e02a3cc1d8 [file] [log] [blame]
Lei YU415b9642017-02-09 11:37:26 +08001#pragma once
2
Lei YUad143542017-07-25 14:27:07 +08003#include <xyz/openbmc_project/Time/Owner/server.hpp>
4#include <xyz/openbmc_project/Time/Synchronization/server.hpp>
5
Lei YU415b9642017-02-09 11:37:26 +08006namespace phosphor
7{
8namespace time
9{
Gunnar Millsab4cc6a2018-09-14 14:42:39 -050010/** @brief Alias to time sync mode class */
11using ModeSetting =
12 sdbusplus::xyz::openbmc_project::Time::server::Synchronization;
Lei YU415b9642017-02-09 11:37:26 +080013
Gunnar Millsab4cc6a2018-09-14 14:42:39 -050014/** @brief Alias to time owner class */
15using OwnerSetting = sdbusplus::xyz::openbmc_project::Time::server::Owner;
Lei YUad143542017-07-25 14:27:07 +080016
Gunnar Millsab4cc6a2018-09-14 14:42:39 -050017/** @brief Supported time sync modes
18 * NTP Time sourced by Network Time Server
19 * Manual User of the system need to set the time
20 */
21using Mode = ModeSetting::Method;
Lei YUad143542017-07-25 14:27:07 +080022
Gunnar Millsab4cc6a2018-09-14 14:42:39 -050023/** @brief Supported time owners
24 * BMC Time source may be NTP or Manual but it has to be set natively
25 * on the BMC. Meaning, host can not set the time. What it also
26 * means is that when BMC gets IPMI_SET_SEL_TIME, then its ignored.
27 * similarly, when BMC gets IPMI_GET_SEL_TIME, then the BMC's time
28 * is returned.
29 *
30 * Host Its only IPMI_SEL_SEL_TIME that will set the time on BMC.
31 * Meaning, IPMI_GET_SEL_TIME and request to get BMC time will
32 * result in same value.
33 *
34 * Split Both BMC and Host will maintain their individual clocks but then
35 * the time information is stored in BMC. BMC can have either NTP
36 * or Manual as it's source of time and will set the time directly
37 * on the BMC. When IPMI_SET_SEL_TIME is received, then the delta
38 * between that and BMC's time is calculated and is stored.
39 * When BMC reads the time, the current time is returned.
40 * When IPMI_GET_SEL_TIME is received, BMC's time is retrieved and
41 * then the delta offset is factored in prior to returning.
42 *
43 * Both: BMC's time is set with whoever that sets the time. Similarly,
44 * BMC's time is returned to whoever that asks the time.
45 */
46using Owner = OwnerSetting::Owners;
47} // namespace time
48} // namespace phosphor