summaryrefslogtreecommitdiff
path: root/settings/include/defaults.hpp
blob: c83e608d6924ad6e3cef063d799e0a3a20184d73 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
/*
// Copyright (c) 2019 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 "interface.hpp"

using Association = std::tuple<std::string, std::string, std::string>;

// this file is vendor specific, other vendors should replace this file using a
// bbappend

inline void loadSettings(sdbusplus::asio::object_server &objectServer,
                         std::vector<SettingsInterface> &settings)
{

    SettingsInterface *setting = nullptr;
    setting = &settings.emplace_back(
        objectServer,
        "/xyz/openbmc_project/control/minimum_ship_level_required",
        "xyz.openbmc_project.Control.MinimumShipLevel");

    setting->addProperty("MinimumShipLevelRequired", true);

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/auto_reboot",
        "xyz.openbmc_project.Control.Boot.RebootPolicy");

    setting->addProperty("AutoReboot", false);

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/control/host0/boot",
                                     "xyz.openbmc_project.Control.Boot.Source");

    setting->addProperty(
        "BootSource",
        "xyz.openbmc_project.Control.Boot.Source.Sources.Default");

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/control/host0/boot",
                                     "xyz.openbmc_project.Control.Boot.Mode");

    setting->addProperty("BootMode",
                         "xyz.openbmc_project.Control.Boot.Mode.Modes.Regular");

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/boot/one_time",
        "xyz.openbmc_project.Control.Boot.Source");

    setting->addProperty(
        "BootSource",
        "xyz.openbmc_project.Control.Boot.Source.Sources.Default");

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/boot/one_time",
        "xyz.openbmc_project.Control.Boot.Mode");

    setting->addProperty("BootMode",
                         "xyz.openbmc_project.Control.Boot.Mode.Modes.Regular");

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/boot/one_time",
        "xyz.openbmc_project.Object.Enable");

    setting->addProperty("Enabled", true);

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/power_cap",
        "xyz.openbmc_project.Control.Power.Cap");

    setting->addProperty("PowerCap", static_cast<uint32_t>(0));
    setting->addProperty("PowerCapEnable", false);

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/power_restore_policy",
        "xyz.openbmc_project.Control.Power.RestorePolicy");

    setting->addProperty(
        "PowerRestorePolicy",
        "xyz.openbmc_project.Control.Power.RestorePolicy.Policy.AlwaysOff");

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/power_restore_delay",
        "xyz.openbmc_project.Control.Power.RestoreDelay");

    setting->addProperty("PowerRestoreDelay", static_cast<uint16_t>(0));

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/acpi_power_state",
        "xyz.openbmc_project.Control.Power.ACPIPowerState");

    setting->addProperty(
        "SysACPIStatus",
        "xyz.openbmc_project.Control.Power.ACPIPowerState.ACPI.Unknown");
    setting->addProperty(
        "DevACPIStatus",
        "xyz.openbmc_project.Control.Power.ACPIPowerState.ACPI.Unknown");

    setting =
        &settings.emplace_back(objectServer, "/xyz/openbmc_project/time/owner",
                               "xyz.openbmc_project.Time.Owner");

    setting->addProperty("TimeOwner",
                         "xyz.openbmc_project.Time.Owner.Owners.BMC");

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/time/sync_method",
        "xyz.openbmc_project.Time.Synchronization");

    setting->addProperty("TimeSyncMethod",
                         "xyz.openbmc_project.Time.Synchronization.Method.NTP");

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/network/host0/intf",
                                     "xyz.openbmc_project.Network.MACAddress");

    setting->addProperty("MACAddress", "00:00:00:00:00:00");

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/network/host0/intf/addr",
        "xyz.openbmc_project.Network.IP");

    setting->addProperty("Address", "0.0.0.0");
    setting->addProperty("PrefixLength", static_cast<uint8_t>(0));
    setting->addProperty("Origin",
                         "xyz.openbmc_project.Network.IP.AddressOrigin.Static");
    setting->addProperty("Gateway", "0.0.0.0");
    setting->addProperty("Type",
                         "xyz.openbmc_project.Network.IP.Protocol.IPv4");

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/TPMEnable",
        "xyz.openbmc_project.Control.TPM.Policy");

    setting->addProperty("TPMEnable", false);

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/power_supply_redundancy",
        "xyz.openbmc_project.Control.PowerSupplyRedundancy");

    setting->addProperty("PowerSupplyRedundancyEnabled", true);
    setting->addProperty(
        "ColdRedundancyStatus",
        "xyz.openbmc_project.Control.PowerSupplyRedundancy.Status.completed");
    setting->addProperty("ColdRedundancyEnabled", true);
    setting->addProperty("RotationEnabled", true);
    setting->addProperty(
        "RotationAlgorithm",
        "xyz.openbmc_project.Control.PowerSupplyRedundancy.Algo.bmcSpecific");
    setting->addProperty("RotationRankOrder", std::vector<uint8_t>{0});
    setting->addProperty("PeriodOfRotation", static_cast<uint32_t>(120));

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/turbo_allowed",
        "xyz.openbmc_project.Control.Host.TurboAllowed");

    setting->addProperty("TurboAllowed", true);

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/systemGUID",
        "xyz.openbmc_project.Common.UUID");

    setting->addProperty("UUID", "00000000-0000-0000-0000-000000000000");

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/software/bios",
                                     "xyz.openbmc_project.Software.Version");
    setting->addProperty("Version", "NA");
    setting->addProperty(
        "Purpose", "xyz.openbmc_project.Software.Version.VersionPurpose.Host");

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/software/bios",
                                     "xyz.openbmc_project.Software.Activation");
    setting->addProperty(
        "Activation",
        "xyz.openbmc_project.Software.Activation.Activations.Active");

    std::vector<Association> associations;
    associations.push_back(Association("functional", "software_version",
                                       "/xyz/openbmc_project/software/bios"));

    setting =
        &settings.emplace_back(objectServer, "/xyz/openbmc_project/software",
                               "xyz.openbmc_project.Association.Definitions");
    setting->interface->register_property("Associations", associations);

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/processor_error_config",
        "xyz.openbmc_project.Control.Processor.ErrConfig");

    setting->addProperty("ResetOnCATERR", false);
    setting->addProperty("ResetOnERR2", false);
    setting->addProperty("ErrorCountCPU1", static_cast<uint8_t>(0));
    setting->addProperty("ErrorCountCPU2", static_cast<uint8_t>(0));
    setting->addProperty("ErrorCountCPU3", static_cast<uint8_t>(0));
    setting->addProperty("ErrorCountCPU4", static_cast<uint8_t>(0));
    setting->addProperty("CrashdumpCount", static_cast<uint8_t>(0));

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/bmc_reset_disables",
        "xyz.openbmc_project.Control.ResetDisables");

    setting->addProperty("ResetOnSMI", false);

    setting = &settings.emplace_back(
        objectServer, "/com/intel/control/ocotshutdown_policy_config",
        "com.intel.Control.OCOTShutdownPolicy");

    setting->addProperty(
        "OCOTPolicy",
        "com.intel.Control.OCOTShutdownPolicy.Policy.NoShutdownOnOCOT");

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/Chassis/Control/NMISource",
        "xyz.openbmc_project.Chassis.Control.NMISource");

    setting->addProperty(
        "BMCSource",
        "xyz.openbmc_project.Chassis.Control.NMISource.BMCSourceSignal.None");

    setting->addProperty("Enabled", false);

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/state/chassis0",
                                     "xyz.openbmc_project.State.PowerOnHours");

    setting->addProperty("POHCounter", static_cast<uint32_t>(0));

    setting = &settings.emplace_back(
        objectServer,
        "/xyz/openbmc_project/control/chassis_capabilities_config",
        "xyz.openbmc_project.Control.ChassisCapabilities");

    setting->addProperty("CapabilitiesFlags", static_cast<uint8_t>(7));
    setting->addProperty("ChassisIntrusionEnabled", true);
    setting->addProperty("ChassisFrontPanelLockoutEnabled", true);
    setting->addProperty("ChassisNMIEnabled", true);
    setting->addProperty("ChassisPowerInterlockEnabled", false);
    setting->addProperty("FRUDeviceAddress", static_cast<uint8_t>(32));
    setting->addProperty("SDRDeviceAddress", static_cast<uint8_t>(32));
    setting->addProperty("SELDeviceAddress", static_cast<uint8_t>(32));
    setting->addProperty("SMDeviceAddress", static_cast<uint8_t>(32));
    setting->addProperty("BridgeDeviceAddress", static_cast<uint8_t>(32));

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/thermal_mode",
        "xyz.openbmc_project.Control.ThermalMode");

    setting->addProperty("Current", "Performance");
    setting->addProperty("Supported",
                         std::vector<std::string>{"Acoustic", "Performance"});

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/control/cfm_limit",
                                     "xyz.openbmc_project.Control.CFMLimit");

    setting->addProperty("Limit", static_cast<double>(0));

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/ipmi/sol/eth0",
                                     "xyz.openbmc_project.Ipmi.SOL");

    setting->addProperty("Progress", static_cast<uint8_t>(0), false);
    setting->addProperty("Enable", false);
    setting->addProperty("ForceEncryption", true);
    setting->addProperty("ForceAuthentication", true);
    setting->addProperty("Privilege", static_cast<uint8_t>(4));
    setting->addProperty("AccumulateIntervalMS", static_cast<uint8_t>(100));
    setting->addProperty("Threshold", static_cast<uint8_t>(96));
    setting->addProperty("RetryCount", static_cast<uint8_t>(6));
    setting->addProperty("RetryIntervalMS", static_cast<uint8_t>(20));

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/ipmi/sol/eth1",
                                     "xyz.openbmc_project.Ipmi.SOL");

    setting->addProperty("Progress", static_cast<uint8_t>(0), false);
    setting->addProperty("Enable", false);
    setting->addProperty("ForceEncryption", true);
    setting->addProperty("ForceAuthentication", true);
    setting->addProperty("Privilege", static_cast<uint8_t>(4));
    setting->addProperty("AccumulateIntervalMS", static_cast<uint8_t>(100));
    setting->addProperty("Threshold", static_cast<uint8_t>(96));
    setting->addProperty("RetryCount", static_cast<uint8_t>(6));
    setting->addProperty("RetryIntervalMS", static_cast<uint8_t>(20));

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/ipmi/sol/eth2",
                                     "xyz.openbmc_project.Ipmi.SOL");

    setting->addProperty("Progress", static_cast<uint8_t>(0), false);
    setting->addProperty("Enable", false);
    setting->addProperty("ForceEncryption", true);
    setting->addProperty("ForceAuthentication", true);
    setting->addProperty("Privilege", static_cast<uint8_t>(4));
    setting->addProperty("AccumulateIntervalMS", static_cast<uint8_t>(100));
    setting->addProperty("Threshold", static_cast<uint8_t>(96));
    setting->addProperty("RetryCount", static_cast<uint8_t>(6));
    setting->addProperty("RetryIntervalMS", static_cast<uint8_t>(20));

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/control/host0/ac_boot",
        "xyz.openbmc_project.Common.ACBoot");

    setting->addProperty("ACBoot", "Unknown", false);

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/Inventory/Item/Dimm",
        "xyz.openbmc_project.Inventory.Item.Dimm.Offset");

    setting->addProperty("DimmOffset", std::vector<uint8_t>{});

    setting = &settings.emplace_back(
        objectServer, "/xyz/openbmc_project/logging/rest_api_logs",
        "xyz.openbmc_project.Object.Enable");

    setting->addProperty("Enabled", true);

    setting = &settings.emplace_back(objectServer,
                                     "/xyz/openbmc_project/software/apply_time",
                                     "xyz.openbmc_project.Software.ApplyTime");

    setting->addProperty(
        "RequestedApplyTime",
        "xyz.openbmc_project.Software.ApplyTime.RequestedApplyTimes.Immediate");

    for (SettingsInterface &s : settings)
    {
        s.initialize();
    }
}