1# OpenBMC MRW Requirements
2
3This document describes the data requirements that OpenBMC has on the machine
4readable workbook XML generated by [Serverwiz2](https://www.github.com/open-power/serverwiz).
5The requirements in this document are broken up by the OpenBMC functions that
6use them.
7
8If a particular OpenBMC implementation doesn't use a certain function,
9then that MRW data isn't required.
10
11## System Inventory
12
13The system inventory can be generated from the MRW XML.  The inventory
14typically contains all FRUs (field replaceable units), along with a few
15non-FRU entities, like the BMC chip and processor cores.
16
17To specify a target in the MRW should be in the inventory:
18
19* Set the FRU\_NAME attribute of that target.
20
21**Note**: The BMC and cores will be automatically added without the need to
22set FRU\_NAME.
23
24
25## BMC Device Tree
26
27The BMC device tree can be generated from the MRW XML.  For the full device
28tree to be generated, all of the corresponding devices and connections must
29be modeled in the MRW XML.  For a system built with parts that already have
30existing XML representations, there are only a few attributes that need to
31be set.  If a new part is being modeled, initial values for some attributes
32may need to be determined, depending on the part.
33
34The following sections list the system dependent information that the device
35tree generator requires.  The majority of the information it requires is
36static data that is either already built into the XML representations of
37the existing parts or pulled in from an include file.
38
39
40### System Level Attributes
41
42##### SYSTEM\_NAME
43The name of the system as the firmware would know it.
44
45##### MANUFACTURER
46The system manufacturer.
47
48
49### BMC Chip
50All of the BMC chip attributes that are needed for the device tree are
51pre-built into the XML representation and don't need to be updated when
52the device is placed into a system in Serverwiz.
53
54> Note:  The AST2500 is currently the only BMC XML model that contains all
55of the necessary device tree attributes.
56
57
58### SPI Flashes
59> Coming soon after new device driver released.
60
61
62### Ethernet MAC Units
63To enable a BMC MAC module, its ethernet master unit in the MRW must be
64connected to an ethernet slave unit.  Additionally, the following
65attributes may need to be set.
66
67##### NCSI\_MODE
68This attribute in the ethernet master unit can be set to 1 if the link uses
69NCSI.  The default is 0.
70
71##### USE\_HW\_CHECKSUM
72This attribute in the ethernet master unit can be set to 1 if the MAC has
73hardware checksum enabled, or 0 if not enabled.  The default is 1.
74
75
76### UARTS
77UARTs are enabled by connecting the appropriate UART master units in the
78BMC part to their corresponding uart slave units.  No additional attributes
79are required.
80
81
82### LEDs
83LEDS will be listed in the device tree when LED parts in the MRW are wired to
84their GPIO master endpoints.  The instance name in the MRW is the name of
85its node in the device tree.
86
87##### ON\_STATE
88Set to the logic value required to activate the LED - either 0 or 1.  The
89default is 0.
90
91
92### I2C
93I2C devices are enabled by connecting the I2C master units in the BMC to
94the I2C slave units on the devices.
95
96##### I2C\_ADDRESS
97The 8 bit hexadecimal I2C address should be set in the slave unit of the
98end device.
99
100##### BMC\_DT\_COMPATIBLE
101When creating a new XML device model, this attribute should be used to
102specify which device driver the kernel will use to access the device.
103For example, `ti,423` or `bosch,bmp280`.  For existing parts,  this should
104already be set.
105
106##### BMC\_DT\_ATTR\_NAMES
107This attribute is also only required when creating a new XML representation
108of an I2C device.  It specifies which other attributes of the device should be
109listed as properties in the device tree, as required by the device driver
110for that device. It can contain up to 4 pairs of names, the first name in the
111pair is the attribute name in the XML to read, and the second name in the
112pair is the name of the property to call it in the device tree.  For example,
113`ATTR_WRITE_PAGE_SIZE, pagesize` indicates that the value of the
114`ATTR_WRITE_PAGE_SIZE` attribute should be stored in a property called
115`pagesize` in the device tree.
116
117