==============================
IPMB Driver for a Satellite MC
==============================

The Intelligent Platform Management Bus or IPMB, is an
I2C bus that provides a standardized interconnection between
different boards within a chassis. This interconnection is
between the baseboard management (BMC) and chassis electronics.
IPMB is also associated with the messaging protocol through the
IPMB bus.

The devices using the IPMB are usually management
controllers that perform management functions such as servicing
the front panel interface, monitoring the baseboard,
hot-swapping disk drivers in the system chassis, etc...

When an IPMB is implemented in the system, the BMC serves as
a controller to give system software access to the IPMB. The BMC
sends IPMI requests to a device (usually a Satellite Management
Controller or Satellite MC) via IPMB and the device
sends a response back to the BMC.

For more information on IPMB and the format of an IPMB message,
refer to the IPMB and IPMI specifications.

IPMB in BlueField systems
-------------------------

On the BlueWhale, we support 2 IPMB transaction modes:

1) IPMB requests from the BMC to the BlueField (this is enabled by
   default at boot time).
   In this mode, the ipmb_dev_int driver needs to be loaded on the BF,
   while the ipmb_host driver needs to be loaded on the BMC.
2) IPMB requests from the BF to the BMC (this mode can be enabled
   via the load_bf2bmc_ipmb.sh script).
   In this mode, the ipmb_host driver needs to be loaded on the BF,
   while the ipmb_dev_int needs to be loaded on the BMC.

ipmb_dev_int - This is the driver needed to
receive IPMB messages from a BMC and send a response back.
This driver works with the I2C driver and a userspace
program such as OpenIPMI:

    1) It is an I2C slave backend driver. So, it defines a callback
       function to set the BF as an I2C slave.
       This callback function handles the received IPMI requests.

    2) It defines the read and write functions to enable a user
       space program (such as OpenIPMI) to communicate with the kernel.

ipmb_host - This is the driver needed on the BF to send IPMB
messages to the BMC on the IPMB bus. This driver
works with the I2C driver and will load successfully only
if it executes a successful handshake with the BMC.


Load the ipmb_dev_int driver
----------------------------

This is loaded by default at boot time on the BF.
The slave address at which the ipmb_dev_int driver is registered
can be changed in the /usr/bin/set_emu_param.sh script.
By default, the 7 bit slave address is set to 0x11 as follows:

echo ipmb-dev 0x1011 > /sys/bus/i2c/devices/i2c-2/new_device

This will create the device file /dev/ipmb-2, which can be accessed
by OpenIPMI. The device needs to be instantiated before running
OpenIPMI.


Load the ipmb_host driver
-------------------------

This driver is also loaded by default at boot time.
The following drivers are needed before loading ipmb_host:

1) load the ipmi_msghandler module
2) load the ipmi_devintf module
3) load the ipmb_host module that works on top of the 2
   above modules. Without these 3 modules, linux will not
   be able to create the /dev/ipmi0 device file that's is
   used by the ipmitool program to issue commands.

   To load the ipmb_host driver, you need to pass a slave_add
   argument to the insmod command as follows:

   insmod <ipmb_host module path> slave_add=0x10

   slave_add is the address of the BMC.

   To instantiate the device at 7-bit address 0x30 on bus 2:

   echo ipmb-host 0x1030 > /sys/bus/i2c/devices/i2c-2/new_device

   Note that "1" in 0x1030, is just setting the I2C_CLIENT_SLAVE
   flag. Refer to 'Documentation/i2c/instantiating-devices' for
   further info.
