Skip to content

Commit 51bd6f2

Browse files
asmaamellanoxcminyard
authored andcommitted
Add support for IPMB driver
Support receiving IPMB requests on a Satellite MC from the BMC. Once a response is ready, this driver will send back a response to the BMC via the IPMB channel. Signed-off-by: Asmaa Mnebhi <[email protected]> Acked-by: [email protected] Message-Id: <319690553a0da2a1e80b400941341081b383e5f1.1560192707.git.Asmaa@mellanox.com> [Move the config option to outside the ipmi msghandler, as it's not dependent on that. Fixed one small whitespace issue.] Signed-off-by: Corey Minyard <[email protected]>
1 parent 3559c32 commit 51bd6f2

File tree

4 files changed

+476
-0
lines changed

4 files changed

+476
-0
lines changed

Documentation/IPMB.txt

Lines changed: 103 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,103 @@
1+
==============================
2+
IPMB Driver for a Satellite MC
3+
==============================
4+
5+
The Intelligent Platform Management Bus or IPMB, is an
6+
I2C bus that provides a standardized interconnection between
7+
different boards within a chassis. This interconnection is
8+
between the baseboard management (BMC) and chassis electronics.
9+
IPMB is also associated with the messaging protocol through the
10+
IPMB bus.
11+
12+
The devices using the IPMB are usually management
13+
controllers that perform management functions such as servicing
14+
the front panel interface, monitoring the baseboard,
15+
hot-swapping disk drivers in the system chassis, etc...
16+
17+
When an IPMB is implemented in the system, the BMC serves as
18+
a controller to give system software access to the IPMB. The BMC
19+
sends IPMI requests to a device (usually a Satellite Management
20+
Controller or Satellite MC) via IPMB and the device
21+
sends a response back to the BMC.
22+
23+
For more information on IPMB and the format of an IPMB message,
24+
refer to the IPMB and IPMI specifications.
25+
26+
IPMB driver for Satellite MC
27+
----------------------------
28+
29+
ipmb-dev-int - This is the driver needed on a Satellite MC to
30+
receive IPMB messages from a BMC and send a response back.
31+
This driver works with the I2C driver and a userspace
32+
program such as OpenIPMI:
33+
34+
1) It is an I2C slave backend driver. So, it defines a callback
35+
function to set the Satellite MC as an I2C slave.
36+
This callback function handles the received IPMI requests.
37+
38+
2) It defines the read and write functions to enable a user
39+
space program (such as OpenIPMI) to communicate with the kernel.
40+
41+
42+
Load the IPMB driver
43+
--------------------
44+
45+
The driver needs to be loaded at boot time or manually first.
46+
First, make sure you have the following in your config file:
47+
CONFIG_IPMB_DEVICE_INTERFACE=y
48+
49+
1) If you want the driver to be loaded at boot time:
50+
51+
a) Add this entry to your ACPI table, under the appropriate SMBus:
52+
53+
Device (SMB0) // Example SMBus host controller
54+
{
55+
Name (_HID, "<Vendor-Specific HID>") // Vendor-Specific HID
56+
Name (_UID, 0) // Unique ID of particular host controller
57+
:
58+
:
59+
Device (IPMB)
60+
{
61+
Name (_HID, "IPMB0001") // IPMB device interface
62+
Name (_UID, 0) // Unique device identifier
63+
}
64+
}
65+
66+
b) Example for device tree:
67+
68+
&i2c2 {
69+
status = "okay";
70+
71+
ipmb@10 {
72+
compatible = "ipmb-dev";
73+
reg = <0x10>;
74+
};
75+
};
76+
77+
2) Manually from Linux:
78+
modprobe ipmb-dev-int
79+
80+
81+
Instantiate the device
82+
----------------------
83+
84+
After loading the driver, you can instantiate the device as
85+
described in 'Documentation/i2c/instantiating-devices'.
86+
If you have multiple BMCs, each connected to your Satellite MC via
87+
a different I2C bus, you can instantiate a device for each of
88+
those BMCs.
89+
The name of the instantiated device contains the I2C bus number
90+
associated with it as follows:
91+
92+
BMC1 ------ IPMB/I2C bus 1 ---------| /dev/ipmb-1
93+
Satellite MC
94+
BMC1 ------ IPMB/I2C bus 2 ---------| /dev/ipmb-2
95+
96+
For instance, you can instantiate the ipmb-dev-int device from
97+
user space at the 7 bit address 0x10 on bus 2:
98+
99+
# echo ipmb-dev 0x1010 > /sys/bus/i2c/devices/i2c-2/new_device
100+
101+
This will create the device file /dev/ipmb-2, which can be accessed
102+
by the user space program. The device needs to be instantiated
103+
before running the user space program.

drivers/char/ipmi/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,3 +131,11 @@ config ASPEED_BT_IPMI_BMC
131131
Provides a driver for the BT (Block Transfer) IPMI interface
132132
found on Aspeed SOCs (AST2400 and AST2500). The driver
133133
implements the BMC side of the BT interface.
134+
135+
config IPMB_DEVICE_INTERFACE
136+
tristate 'IPMB Interface handler'
137+
depends on I2C_SLAVE
138+
help
139+
Provides a driver for a device (Satellite MC) to
140+
receive requests and send responses back to the BMC via
141+
the IPMB interface. This module requires I2C support.

drivers/char/ipmi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,4 @@ obj-$(CONFIG_IPMI_KCS_BMC) += kcs_bmc.o
2626
obj-$(CONFIG_ASPEED_BT_IPMI_BMC) += bt-bmc.o
2727
obj-$(CONFIG_ASPEED_KCS_IPMI_BMC) += kcs_bmc_aspeed.o
2828
obj-$(CONFIG_NPCM7XX_KCS_IPMI_BMC) += kcs_bmc_npcm7xx.o
29+
obj-$(CONFIG_IPMB_DEVICE_INTERFACE) += ipmb_dev_int.o

0 commit comments

Comments
 (0)