Sketch of OpenBMC OEM message formats

This document describes OEM Requests to be supported using the OpenBMC OEM Number.

What's in the box?

  • Briefly recap OEM Extension layout as described in IPMI Specification.
  • Enumerate Command codes allocated for use with the OpenBMC OEM Number.
  • For each such code, describe the associated messages, including representation, function, meaning, limits, and so on.

OEM Extensions, Block Transfer Transport Example.

This table and the next briefly recap OEM Extension messages as described in the IPMI Specification. To keep it both simple and concrete, only BT Tansport is described. Please consult that specification for the full story.

OEM Request

Per section 11.1 of IPMI Spec

BytesBitsSpec IDValueDescription
0Length*-Number of bytes to follow in this request
12:7NetFn0x2EOEM Request
10:1LUN-Allow any LUN
2Seq*-Per section 11.3 of IPMI Spec
3Cmd-Table 3 - OpenBMC Cmd Codes
4 ~ 6OEN49871OEM Enterprise Number
2 ~ n+6Data-n data bytes, encoding depends on Cmd

Notes:

  • Length and Seq are specific to BT transport - other transports may not have them.

  • Serialize numbers larger than 1 byte LSB first - e.g., represent OEM Enterprise Number 49871 as {0xcf, 0xc2, 0x00}

OEM Response

Per section 11.2 of IPMI Spec

BytesBitsSpec IDValueDescription
0Length*-Number of bytes to follow in this response
12:7NetFn0x2FOEM Response
10:1LUN-LUN of request to which this is a response
2Seq*-Seq of request to which this is a response
3Cmd-Cmd code of request to which this is a response
4CC-Completion code, Section 5.2 of IPMI Spec v2.0
5 ~ 7OEN49871OEM Enterprise Number
8 ~ n+7Data-n data bytes, encoding depends on Cmd

OpenBMC OEM Cmd Codes

/*
 * This is the OpenBMC IANA OEM Number
 */
constexpr OemNumber obmcOemNumber = 49871;

These are the Command codes allocated for use with the OpenBMC OEM Number.

CmdIdentifierDescription
0-Reserved
1gpioCmdGPIO Access
2i2cCmdI2C Device Access
3flashCmdFlash Device Access
4fanManualCmdManual Fan Controls
5 ~ 255-Unallocated

I2C Device Access (Command 2)

The next subsections describe command and response messages supporting the I2C Device Access extension OpenBMC OEM extension (command code 2).

I2C Request Message - Overall

BytesBitsIdentifierDescription
0busLogical I2C bus.
1xferFlagsFlags for all steps.
7I2cFlagUsePec1 => use PEC - see note.
6:0Reserved(0)
2 ~ n-1Step sequence - see next.

Notes

  • Total length of step sequence must exactly fill request.

  • Intent is to handle Linux Kernel SMBus Protocol, with com generalized to m byte sequence - e.g., at24c64 uses 2 address bytes, and n bytes of received data, rather than specific operations for various sizes.

  • Goal is to support SMBus v2 32-byte data block length limit; but easily supports new 4 and 8 byte transfers added for SMBus v3.

  • PEC refers to SMBus Packet Error Check.

  • SMBus address resolution, alerts, and non-standard protocols not supported. So for example, there is no way to insert a stop command within a transfer.

  • Depending on options, i2cdetect uses either quick write or 1 byte read; default is 1-byte read for eeprom/spd memory ranges, else quick write.

I2C Request Message - Step Properties

BytesBitsIdentifierDescription
0devAndDir
7:1dev7-bit I2C device address.
0isRead1 = read, 0 = write.
1stepFlags
7i2cFlagRecvLen1 if block read, else regular; see table.
6i2cFlagNoStart1 to suppress I2C start.
5:0Reserved(0)
2pCount parameter; see table
3:m+2wrPayloadNonempty iff p supplies nonzero m; see table.
Allowed step property combinations
is_readRecvLenpSizeDescription
0003Quick write 0; same as write m=0 bytes.
00mm+3Consume and write next m bytes.
01-3Reserved.
1003Quick write 1; same as read n=0 bytes.
10n3Read n bytes.
11-3Read count from device.

Notes

  • All other combinations are reserved.

  • RecvLen corresponds to Linux I2C_M_RECV_LEN message flags bit

  • Transfers include byte count in SMBUS block modes, and PEC byte when selected. Allows for use with SMBUS compatibility layer.

  • In case of write steps, wrPayload may include:

    • register address byte or bytes;
    • count byte if implementing SMBUS block or call operation;
    • up to 32 bytes of logical payload; and
    • PEC byte.

I2C Response Message

BytesIdentifierSizeDescription
0:n-1rd_data0 ~ 34byte sequence read

Notes

  • Maximum logical payload is 32.

  • In the unlikely event a transfer specifies multiple read steps, all bytes read are simply concatenated in the order read.

  • However, maximum reply limit is sized for the largest single read.

  • RecvLen case w/ PEC can return up to 34 bytes: count + payload + PEC