Skip to content

Commit 2593070

Browse files
committed
ipmi: Add SMBus interface driver (SSIF)
This patch adds the SMBus interface to the IPMI driver. Signed-off-by: Corey Minyard <[email protected]> Documentation/IPMI.txt | 32 drivers/char/ipmi/Kconfig | 11 drivers/char/ipmi/Makefile | 1 drivers/char/ipmi/ipmi_smb.c | 1737 +++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 1769 insertions(+), 12 deletions(-)
1 parent 99ab32f commit 2593070

File tree

4 files changed

+1950
-3
lines changed

4 files changed

+1950
-3
lines changed

Documentation/IPMI.txt

Lines changed: 71 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,13 @@ The driver interface depends on your hardware. If your system
4242
properly provides the SMBIOS info for IPMI, the driver will detect it
4343
and just work. If you have a board with a standard interface (These
4444
will generally be either "KCS", "SMIC", or "BT", consult your hardware
45-
manual), choose the 'IPMI SI handler' option.
45+
manual), choose the 'IPMI SI handler' option. A driver also exists
46+
for direct I2C access to the IPMI management controller. Some boards
47+
support this, but it is unknown if it will work on every board. For
48+
this, choose 'IPMI SMBus handler', but be ready to try to do some
49+
figuring to see if it will work on your system if the SMBIOS/APCI
50+
information is wrong or not present. It is fairly safe to have both
51+
these enabled and let the drivers auto-detect what is present.
4652

4753
You should generally enable ACPI on your system, as systems with IPMI
4854
can have ACPI tables describing them.
@@ -52,7 +58,8 @@ their job correctly, the IPMI controller should be automatically
5258
detected (via ACPI or SMBIOS tables) and should just work. Sadly,
5359
many boards do not have this information. The driver attempts
5460
standard defaults, but they may not work. If you fall into this
55-
situation, you need to read the section below named 'The SI Driver'.
61+
situation, you need to read the section below named 'The SI Driver' or
62+
"The SMBus Driver" on how to hand-configure your system.
5663

5764
IPMI defines a standard watchdog timer. You can enable this with the
5865
'IPMI Watchdog Timer' config option. If you compile the driver into
@@ -97,7 +104,12 @@ driver, each open file for this device ties in to the message handler
97104
as an IPMI user.
98105

99106
ipmi_si - A driver for various system interfaces. This supports KCS,
100-
SMIC, and BT interfaces.
107+
SMIC, and BT interfaces. Unless you have an SMBus interface or your
108+
own custom interface, you probably need to use this.
109+
110+
ipmi_ssif - A driver for accessing BMCs on the SMBus. It uses the
111+
I2C kernel driver's SMBus interfaces to send and receive IPMI messages
112+
over the SMBus.
101113

102114
ipmi_watchdog - IPMI requires systems to have a very capable watchdog
103115
timer. This driver implements the standard Linux watchdog timer
@@ -476,6 +488,62 @@ for specifying an interface. Note that when removing an interface,
476488
only the first three parameters (si type, address type, and address)
477489
are used for the comparison. Any options are ignored for removing.
478490

491+
The SMBus Driver (SSIF)
492+
-----------------------
493+
494+
The SMBus driver allows up to 4 SMBus devices to be configured in the
495+
system. By default, the driver will only register with something it
496+
finds in DMI or ACPI tables. You can change this
497+
at module load time (for a module) with:
498+
499+
modprobe ipmi_ssif.o
500+
addr=<i2caddr1>[,<i2caddr2>[,...]]
501+
adapter=<adapter1>[,<adapter2>[...]]
502+
dbg=<flags1>,<flags2>...
503+
slave_addrs=<addr1>,<addr2>,...
504+
[dbg_probe=1]
505+
506+
The addresses are normal I2C addresses. The adapter is the string
507+
name of the adapter, as shown in /sys/class/i2c-adapter/i2c-<n>/name.
508+
It is *NOT* i2c-<n> itself.
509+
510+
The debug flags are bit flags for each BMC found, they are:
511+
IPMI messages: 1, driver state: 2, timing: 4, I2C probe: 8
512+
513+
Setting dbg_probe to 1 will enable debugging of the probing and
514+
detection process for BMCs on the SMBusses.
515+
516+
The slave_addrs specifies the IPMI address of the local BMC. This is
517+
usually 0x20 and the driver defaults to that, but in case it's not, it
518+
can be specified when the driver starts up.
519+
520+
Discovering the IPMI compliant BMC on the SMBus can cause devices on
521+
the I2C bus to fail. The SMBus driver writes a "Get Device ID" IPMI
522+
message as a block write to the I2C bus and waits for a response.
523+
This action can be detrimental to some I2C devices. It is highly
524+
recommended that the known I2C address be given to the SMBus driver in
525+
the smb_addr parameter unless you have DMI or ACPI data to tell the
526+
driver what to use.
527+
528+
When compiled into the kernel, the addresses can be specified on the
529+
kernel command line as:
530+
531+
ipmb_ssif.addr=<i2caddr1>[,<i2caddr2>[...]]
532+
ipmi_ssif.adapter=<adapter1>[,<adapter2>[...]]
533+
ipmi_ssif.dbg=<flags1>[,<flags2>[...]]
534+
ipmi_ssif.dbg_probe=1
535+
ipmi_ssif.slave_addrs=<addr1>[,<addr2>[...]]
536+
537+
These are the same options as on the module command line.
538+
539+
The I2C driver does not support non-blocking access or polling, so
540+
this driver cannod to IPMI panic events, extend the watchdog at panic
541+
time, or other panic-related IPMI functions without special kernel
542+
patches and driver modifications. You can get those at the openipmi
543+
web page.
544+
545+
The driver supports a hot add and remove of interfaces through the I2C
546+
sysfs interface.
479547

480548
Other Pieces
481549
------------

drivers/char/ipmi/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,14 @@ config IPMI_SI_PROBE_DEFAULTS
6262
only be available on older systems if the "ipmi_si_intf.trydefaults=1"
6363
boot argument is passed.
6464

65+
config IPMI_SSIF
66+
tristate 'IPMI SMBus handler (SSIF)'
67+
select I2C
68+
help
69+
Provides a driver for a SMBus interface to a BMC, meaning that you
70+
have a driver that must be accessed over an I2C bus instead of a
71+
standard interface. This module requires I2C support.
72+
6573
config IPMI_WATCHDOG
6674
tristate 'IPMI Watchdog Timer'
6775
help

drivers/char/ipmi/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,5 +7,6 @@ ipmi_si-y := ipmi_si_intf.o ipmi_kcs_sm.o ipmi_smic_sm.o ipmi_bt_sm.o
77
obj-$(CONFIG_IPMI_HANDLER) += ipmi_msghandler.o
88
obj-$(CONFIG_IPMI_DEVICE_INTERFACE) += ipmi_devintf.o
99
obj-$(CONFIG_IPMI_SI) += ipmi_si.o
10+
obj-$(CONFIG_IPMI_SSIF) += ipmi_ssif.o
1011
obj-$(CONFIG_IPMI_WATCHDOG) += ipmi_watchdog.o
1112
obj-$(CONFIG_IPMI_POWEROFF) += ipmi_poweroff.o

0 commit comments

Comments
 (0)