1 #pragma once
2 
3 #include <xyz/openbmc_project/Time/Owner/server.hpp>
4 #include <xyz/openbmc_project/Time/Synchronization/server.hpp>
5 
6 namespace phosphor
7 {
8 namespace time
9 {
10     /** @brief Alias to time sync mode class */
11     using ModeSetting =
12         sdbusplus::xyz::openbmc_project::Time::server::Synchronization;
13 
14     /** @brief Alias to time owner class */
15     using OwnerSetting = sdbusplus::xyz::openbmc_project::Time::server::Owner;
16 
17     /** @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      */
21     using Mode = ModeSetting::Method;
22 
23     /** @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      */
46     using Owner = OwnerSetting::Owners;
47 }
48 }
49 
50