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### BMC SPI Flashes 59The device tree can support either 1 or 2 BMC SPI flash chips. This is 60accomplished by connecting instances of the `BMC_FLASH` part to the 61spi-master-unit on the BMC that has its `SPI_FUNCTION` attribute set to 62`BMC_CODE`. If there are multiple chips, they are both connected to the 63same unit. 64 65 66### Ethernet MAC Units 67To enable a BMC MAC module, its ethernet master unit in the MRW must be 68connected to an ethernet slave unit. Additionally, the following 69attributes may need to be set. 70 71##### NCSI\_MODE 72This attribute in the ethernet master unit can be set to 1 if the link uses 73NCSI. The default is 0. 74 75##### USE\_HW\_CHECKSUM 76This attribute in the ethernet master unit can be set to 1 if the MAC has 77hardware checksum enabled, or 0 if not enabled. The default is 1. 78 79 80### UARTS 81UARTs are enabled by connecting the appropriate UART master units in the 82BMC part to their corresponding uart slave units. No additional attributes 83are required. 84 85 86### LEDs 87LEDS will be listed in the device tree when LED parts in the MRW are wired to 88their GPIO master endpoints. The instance name in the MRW is the name of 89its node in the device tree. 90 91##### ON\_STATE 92Set to the logic value required to activate the LED - either 0 or 1. The 93default is 0. 94 95 96### I2C 97I2C devices are enabled by connecting the I2C master units in the BMC to 98the I2C slave units on the devices. 99 100##### I2C\_ADDRESS 101The 8 bit hexadecimal I2C address should be set in the slave unit of the 102end device. 103 104##### BMC\_DT\_COMPATIBLE 105When creating a new XML device model, this attribute should be used to 106specify which device driver the kernel will use to access the device. 107For example, `ti,423` or `bosch,bmp280`. For existing parts, this should 108already be set. 109 110##### BMC\_DT\_ATTR\_NAMES 111This attribute is also only required when creating a new XML representation 112of an I2C device. It specifies which other attributes of the device should be 113listed as properties in the device tree, as required by the device driver 114for that device. It can contain up to 4 pairs of names, the first name in the 115pair is the attribute name in the XML to read, and the second name in the 116pair is the name of the property to call it in the device tree. For example, 117`ATTR_WRITE_PAGE_SIZE, pagesize` indicates that the value of the 118`ATTR_WRITE_PAGE_SIZE` attribute should be stored in a property called 119`pagesize` in the device tree. 120 121