xref: /openbmc/google-ipmi-sys/README.md (revision 8cfa4c4400201459690c2ec6537df0f9c197f730)
1### Sys Commands (0x32)
2
3There are and will be a variety of sys specific commands.
4
5#### Cablecheck - SubCommand 0x00
6
7The cablecheck command checks whether the BMC is seeing traffic between itself
8and the host's NIC.  Sys specifies which if_name is expected to be connected.
9The BMC presently only checks traffic on the interface specified.  There are
10now ethernet statistics available over IPMI, which can be checked directly in
11lieu of this.
12
13Request
14
15|Byte(s) |Value  |Data
16|--------|-------|----
17|0x00|0x00|Subcommand
18|0x01|If_name length|Where you expect the cable, eth0 or eth1, etc
19|0x02 ... |The name|The string, not null-terminated
20
21Response
22
23|Byte(s) |Value  |Data
24|--------|-------|----
25|0x00|0x00|Subcommand
26|0x01|0x00/0x01|0 for false, 1 for true
27
28#### CpldVersion - SubCommand 0x01
29
30Any CPLD on the system that can only be read directly via the BMC can have its
31version exported to Sys via the cpld version command.
32
33Request
34
35|Byte(s) |Value  |Data
36|--------|-------|----
37|0x00|0x01|Subcommand
38|0x01|CPLD ID|A one-byte identifier for the CPLD file to read, unsigned byte.
39
40
41Response
42
43|Byte(s) |Value  |Data
44|--------|-------|----
45|0x00|0x01|Subcommand
46|0x01|Major|Major version
47|0x02|Minor|Minor Version
48|0x03|Sub 1|Third version number
49|0x04|Sub 2|Fourth version number
50
51**Per the above, if the version number doesn't fit in a byte it'll be cast to
52size.**
53
54#### GetNcsiEthDevice - SubCommand 0x02
55
56The BMC itself must have hard-coded into the image, which ethernet device is
57connected to the host NIC.  This is true also in the mapping of ethernet device
58to channel number.  The channel number is used to configure the ethernet device
59over IPMI, instead of the interface name.  This is because we leverage the
60current IPMI command set to read and write the networking configuration.  Sys
61can be programmed already to have this information in the board protobuf,
62however, this information -- can be read from the BMC over IPMI.
63
64Request
65
66|Byte(s) |Value  |Data
67|--------|-------|----
68|0x00|0x02|Subcommand
69
70Response
71
72|Byte(s) |Value  |Data
73|--------|-------|----
74|0x00|0x02|Subcommand
75|0x01|Channel number|The IPMI channel number for use with the network configuration commands (such as reading the MAC or IP address of the BMC).
76|0x02|if_name length|The length of the if_name in bytes.
77|0x03... |if_name|The interface name, not null-terminated
78
79#### DelayedHardReset - SubCommand 0x03
80
81Sys needs to be able to tell the BMC to reset the host but given a delay in
82seconds.
83
84Request
85
86|Byte(s) |Value  |Data
87|--------|-------|----
88|0x00|0x03|Subcommand
89|0x01..0x04| |Seconds to delay (uint32)
90
91Response
92
93|Byte(s) |Value  |Data
94|--------|-------|----
95|0x00|0x03|Subcommand
96
97### GetPCIeSlotsCount - SubCommand 0x04
98
99Sys can get the total number of PCIe slots from BMC using this command. When
100BMC receives this command, BMC can enumerate over all the PCIe slots and create
101a hashmap with all the available PCIe slot name - I2C bus number mappings. BMC
102can then send the total number of PCIe slots as part of this command response.
103
104Request
105
106|Byte(s) |Value  |Data
107|--------|-------|----
108|0x00|0x04|Subcommand
109
110
111Response
112
113|Byte(s) |Value  |Data
114|--------|-------|----
115|0x00|0x04|Subcommand
116|0x01|Total number of PCIe slots|Total number of PCIe slots
117
118### GetPCIeSlotI2cBusMapping - SubCommand 0x05
119
120If Sys gets N total slots as part of the above command, then Sys can send this
121command N times with Entry IDs ranging from 0 to N - 1. Say, Sys sends this
122command with Entry ID as 1, BMC can go and fetch the first PCIe slot name - I2C
123bus number mapping from the hashmap created above and then send the PCIe slot
124name and I2C bus number as part of the command response.
125
126Request
127
128|Byte(s) |Value  |Data
129|--------|-------|----
130|0x00|0x05|Subcommand
131|0x01|Entry ID|Entry ID ranging from 0 to N - 1
132
133
134Response
135
136|Byte(s) |Value  |Data
137|--------|-------|----
138|0x00|0x05|Subcommand
139|0x01|I2C bus number|The I2C bus number which is input to the above PCIe slot
140|0x02|PCIe slot name length|The PCIe slot name length
141|0x03...|PCIe slot name|The PCIe slot name without null terminator
142
143### GetEntityName - SubCommand 0x06
144
145Gsys can get the "Entity ID:Entity Instance" to Entity name mapping from BMC
146using this command. When BMC receives this command, BMC can check the related
147JSON file and then send the name for that particular entity as this command
148response.
149
150Request
151
152|Byte(s) |Value |Data
153|--------|------|----
154|0x00|0x06|Subcommand
155|0x01|Entity ID|Entity ID
156|0x02|Entity Instance|Entity Instance
157
158Response
159
160|Byte(s) |Value |Data
161|--------|------|----
162|0x00|0x06|Subcommand
163|0x01|Entity name length (say N)|Entity name length
164|0x02...0x02 + N - 1|Entity name|Entity name without null terminator
165
166### GetMachineName - SubCommand 0x07
167
168The BMC parses /etc/os-release for the OPENBMC_TARGET_MACHINE field and returns
169its value.
170
171Request
172
173|Byte(s) |Value |Data
174|--------|------|----
175|0x00|0x06|Subcommand
176
177Response
178
179|Byte(s) |Value |Data
180|--------|------|----
181|0x00|0x06|Subcommand
182|0x01|Model name length (say N)|Model name length
183|0x02...0x02 + N - 1|Model name|Model name without null terminator
184
185### HardResetOnShutdown - SubCommand 0x08
186
187Tells the BMC to powercycle the next time the host shuts down.
188
189Request
190
191|Byte(s) |Value |Data
192|--------|------|----
193|0x00|0x08|Subcommand
194
195Response
196
197|Byte(s) |Value |Data
198|--------|------|----
199|0x00|0x08|Subcommand
200
201
202### GetFlashSize - SubCommand 0x09
203
204Request the physical size of the BMC flash.
205
206Request
207
208|Byte(s) |Value |Data
209|--------|------|----
210|0x00|0x09|Subcommand
211
212Response
213
214|Byte(s) |Value |Data
215|--------|------|----
216|0x00|0x09|Subcommand
217|0x01...0x04|Flash size|Flash size
218
219### HostPowerOff - SubCommand 0x0A
220Sys command needs to be able to let the BMC knows host attempt S5 shutdown,
221it need power-off the Host gracefully and disable the watchdog with given time
222delay.
223
224Request
225
226|Byte(s) |Value  |Data
227|--------|-------|----
228|0x00|0x0A|Subcommand
229|0x01..0x04| |Seconds to delay (uint32)
230
231Response
232
233|Byte(s) |Value  |Data
234|--------|-------|----
235|0x00|0x0A|Subcommand
236