Coder Social home page Coder Social logo

i2c_over_ipmi's Introduction

Set of utilities to work with the devices under I2C busses of the BMC controller from the main CPU:

CPU <---------> BMC ----- I2C0
    inband ipmi      |
    (KCS/BT/...)     ---- I2C1
                     |
                     ...
                     |
                     ---- I2C7

The repository includes these utilities:

  • i2cdump_over_ipmi
  • i2cget_over_ipmi
  • i2cset_over_ipmi

They naming mimics standard utilities from the i2c-tools package.

The communication is based on the IPMI command Master Write-Read:

ipmi1.png

Its description can be found in the IPMI specification:

ipmi2.png

Off course this means that for this program the BIOS<-->BMC communication should be working (for example via KCS interface) and the BMC controller should implement this IPMI operation in its IPMI stack.

phosphor-ipmi-host application from the OpenBMC project implements this command, but you need to provide a proper whitelist file master_write_read_white_list.json or disable whitelist functionality:

https://github.com/openbmc/phosphor-host-ipmid/blob/master/apphandler.cpp

    // Note: For security reason, this command will be registered only when
    // there are proper I2C Master write read whitelist
    if (populateI2CMasterWRWhitelist())
    {
        // Note: For security reasons, registering master write read as admin
        // privilege command, even though IPMI 2.0 specification allows it as
        // operator privilege.
        ipmi::registerHandler(ipmi::prioOpenBmcBase, ipmi::netFnApp,
                              ipmi::app::cmdMasterWriteRead,
                              ipmi::Privilege::Admin, ipmiMasterWriteRead);
    }

Also keep in mind that IPMI specification uses only 3 bits in command for I2C bus encoding. This means that it is not possible to access I2C busses with a bus number higher than 7 (i2c-7).

There is a solution that can be used to use bus numbers higher than 7. This goes beyond the IPMI standard, so it probably wouldn't make it upstream in OpenBMC. But you can use this extension in your designs:

47821: Master Write-Read: Extend bus ID. | https://gerrit.openbmc-project.xyz/c/openbmc/phosphor-host-ipmid/+/47821

In this case 7 higher bits in the first byte of Master Write-Read IPMI command are used to encode I2C bus. Therefore you can encode I2C busses 0..127. This is more than enough for typical design.

In case you are using this custom extension recompile programs with the EXTENDED_BUS_ID define:

make clean
make CFLAGS=-DEXTENDED_BUS_ID

i2c_over_ipmi's People

Contributors

kostr avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.