xref: /openbmc/pldm/docs/bios_implementation.md (revision 571d7d44635580ee7bb29e84ee3114c472d3fc61)
1# BIOS Support
2
3Redfish supports the BIOS Attribute Registry, which provides users with a list
4of BIOS attributes supported in the BIOS configuration. To incorporate BIOS
5attribute registry support in openBMC, BmcWeb is designed to read data from the
6Base BIOS Table. PLDM populates the Base BIOS Table for the BIOS Config Manager
7based on BIOS JSON files. BIOS functionality is integrated into PLDM according
8to the guidelines in the
9[PLDM BIOS Specification](https://www.dmtf.org/sites/default/files/standards/documents/DSP0247_1.0.0.pdf).
10BIOS attributes, also referred to as BIOS parameters or configuration settings,
11are structured within JSON files. Each attribute is defined by its name, type,
12and type-specific metadata. PLDM parses
13[BIOS JSON file](https://github.com/openbmc/pldm/tree/master/oem/ibm/configurations/bios/com.ibm.Hardware.Chassis.Model.Rainier2U)
14and creates the
15[Base BIOS Table](https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/BIOSConfig/Manager.interface.yaml#L62)
16hosted by [BIOS Config Manager](https://github.com/openbmc/bios-settings-mgr).
17The design is documented in
18[DesignDoc](https://github.com/openbmc/docs/blob/master/designs/remote-bios-configuration.md).
19Redfish supports
20[BIOS Attribute registry](https://redfish.dmtf.org/schemas/v1/AttributeRegistry.v1_3_8.json),
21which provides users with the list of BIOS attributes supported in the BIOS
22configuration. The BIOS Attribute registry data is supposed to be derived from
23[Base BIOS Table](https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/BIOSConfig/Manager.interface.yaml#L62).
24PLDM populates the Base BIOS Table for BIOS Config Manager based on BIOS Json
25files.
26
27After the JSON files are parsed, pldm would also create the string table,
28attribute table, and attribute value table as per Section7 in
29[PLDM BIOS Specification](https://www.dmtf.org/sites/default/files/standards/documents/DSP0247_1.0.0.pdf).
30Those BIOS tables are exchanged with remote PLDM terminus using the
31`GetBiosTable` command as defined in DSP0247_1.0.0.pdf Section 8.1. All the
32`bios attribute json files are kept under OEM`
33[Path](https://github.com/openbmc/pldm/tree/master/oem). BIOS json configuration
34is provided in bios_attr.json file which contains attributes of type enum,
35integer and string.
36
37Integer Attribute details as documented at Table9 of
38[PLDM BIOS Specification](https://www.dmtf.org/sites/default/files/standards/documents/DSP0247_1.0.0.pdf):
39
40```json
41{
42  "entries": [
43    {
44      "attribute_type": "integer",
45      "attribute_name": "Attribute Name",
46      "lower_bound": "The lower bound on the integer value",
47      "upper_bound": "The upper bound on the integer value",
48      "scalar_increment": "The scalar value that is used for the increments to this integer ",
49      "default_value": "The default value of the integer",
50      "help_text": "Help text about attribute usage",
51      "display_name": "Attribute Display Name",
52      "read_only": "Read only Attribute"
53    }
54  ]
55}
56```
57
58Enum Attribute details as documented at Table6 of
59[PLDM BIOS Specification](https://www.dmtf.org/sites/default/files/standards/documents/DSP0247_1.0.0.pdf):
60
61```json
62{
63  "entries": [
64    {
65      "attribute_type": "enum",
66      "attribute_name": "Attribute Name",
67      "possible_values": [
68        "An array of character strings of variable to indicate the possible values of the BIOS attribute"
69      ],
70      "default_values": "Default value",
71      "help_text": "Help text about attribute usage",
72      "display_name": "Display Name",
73      "read_only": "Read only Attribute"
74    }
75  ]
76}
77```
78
79String Attribute details as documented at Table7 of
80[PLDM BIOS Specification](https://www.dmtf.org/sites/default/files/standards/documents/DSP0247_1.0.0.pdf):
81
82```json
83{
84  "entries": [
85    {
86      "attribute_type": "string",
87      "attribute_name": "Attribute Name",
88      "string_type": "It specifies the character encoding format, which can be ASCII, Hex, UTF-8, UTF-16LE, or UTF-16BE. Currently, only ASCII is supported",
89      "minimum_string_length": "The minimum length of the string in bytes",
90      "maximum_string_length": "The maximum length of the string in bytes",
91      "default_string": "The default string itself",
92      "help_text": "Help text about attribute usage",
93      "display_name": "Attribute Display Name",
94      "read_only": "Read only Attribute"
95    }
96  ]
97}
98```
99
100As PLDM BIOS Attributes may differ across platforms and systems, supporting
101system-specific BIOS attributes is crucial. To achieve this, BIOS JSON files are
102organized under folders named after the system type. System type information is
103retrieved from the Entity Manager service, which hosts the
104[Compatible Interface](https://github.com/openbmc/phosphor-dbus-interfaces/blob/master/yaml/xyz/openbmc_project/Inventory/Decorator/Compatible.interface.yaml).
105
106This interface dynamically populates the Names property with system type
107information. However, determining the system type in the application space may
108take some time since the compatible interface and the Names property are
109dynamically created by the Entity Manager. Consequently, BIOS tables are lazily
110constructed upon receiving the system type.
111
112To enable system-specific BIOS attribute support within PLDM, the meson option
113`system-specific-bios-json` can be utilized. With `system-specific-bios-json`
114option `enabled` BIOS JSON files specific to the system type are fetched during
115runtime.
116