Fix Get and Set SM PWM Signal

On systems with multiple fan controllers, Index value is only unique
within the same controller. This means that Index alone can not be used
to correctly identify a fan sensor. This commit fixes this defect by
specifically searching for the "Fan_#" Entity Manager object where # is
the fan being accessed.

The commit which introduced this issue can be found here:
https://gerrit.openbmc.org/c/openbmc/intel-ipmi-oem/+/56909

This commit also replaces phosphor-logging log with lg2.

Testing:
1. System with multiple fan controllers that have duplicated index
    property:
busctl introspect xyz.openbmc_project.EntityManager
    /xyz/openbmc_project/inventory/system/board/XXXXXXXX/Fan_7
xyz.openbmc_project.Configuration.I2CFan           interface
.Address                                           property  t
    47
.BindConnector                                     property  s
    "System Fan connector 7"
.Bus                                               property  t
    6
.Index                                             property  t
    0
busctl introspect xyz.openbmc_project.EntityManager
    /xyz/openbmc_project/inventory/system/board/XXXXXXXX/Fan_1
xyz.openbmc_project.Configuration.I2CFan           interface
.Address                                           property  t
    44
.BindConnector                                     property  s
    System Fan connector 1"
.Bus                                               property  t
    6
.Index                                             property  t
    0

Without fix:
ipmitool raw 0x30 0x14 0x0d 0 0x00
 3c
ipmitool raw 0x30 0x14 0x0d 6 0x00
 Unable to send RAW command (channel=0x0 netfn=0x30 lun=0x0 cmd=0x14
    rsp=0xcc): Invalid data field in request.

With fix:
ipmitool raw 0x30 0x14 0x0d 0 0x00
 3c
ipmitool raw 0x30 0x14 0x0d 6 0x00
 3c
ipmitool raw 0x30 0x15 0x05 0 0x1 0x40
ipmitool raw 0x30 0x15 0x05 6 0x1 0x46
ipmitool raw 0x30 0x14 0x0d 0 0x00
 40
ipmitool raw 0x30 0x14 0x0d 6 0x00
 46

2. System with one pwm port controlling two fans:
busctl introspect xyz.openbmc_project.EntityManager
    /xyz/openbmc_project/inventory/system/board/XXXXXXXX/Fan_1
xyz.openbmc_project.Configuration.I2CFan.Connector interface
.Name                                              property  s
    "System Fan connector 1" emits-change
.Pwm                                               property  t
    0                        emits-change
.PwmName                                           property  s
    "Pwm_1_2"                emits-change
busctl introspect xyz.openbmc_project.EntityManager
    /xyz/openbmc_project/inventory/system/board/XXXXXXXX/Fan_2
xyz.openbmc_project.Configuration.I2CFan.Connector interface
.Name                                              property  s
    "System Fan connector 2" emits-change
.Pwm                                               property  t
    0                        emits-change
.PwmName                                           property  s
    "Pwm_1_2"                emits-change

ipmitool raw 0x30 0x14 0x0d 0 0x00
 3c
ipmitool raw 0x31 0x14 0x0d 1 0x00
 3c
ipmitool raw 0x30 0x15 0x05 0 0x1 0x40
ipmitool raw 0x30 0x14 0x0d 0 0x00
 40
ipmitool raw 0x31 0x14 0x0d 1 0x00
 40

Signed-off-by: Alex Schendel <alex.schendel@intel.com>
Change-Id: I8e2323c4572ed21c4e2f58d282574e65270bf60c
1 file changed
tree: b438d71ffc166d689d9c1ac47889396cca25b3e5
  1. cmake/
  2. docs/
  3. include/
  4. non-yocto/
  5. src/
  6. tests/
  7. .clang-format
  8. .gitignore
  9. cmake-format.json
  10. CMakeLists.txt
  11. CMakeLists.txt.in
  12. generate-allowlist.py
  13. ipmi-allowlist.conf
  14. LICENSE
  15. OWNERS
  16. README.md
README.md

Intel IPMI OEM support library

This component is intended to provide Intel-specific IPMI[3] command handlers for OpenBMC. These handlers are intended to integrate BMC with servers based on Intel architecture.

Overview

intel-ipmi-oem serves as an extension[1] to OpenBMC IPMI daemon[2]. It is compiled as a shared library and intended to both:

  • override existing implementation of standard IPMI commands to comply with Intel-specific solutions,
  • provide implementation for non-standard OEM extensions.

Capabilities

Related features provided by the library are grouped in separate source files. Main extensions to vanilla OpenBMC IPMI stack are the following:

  • Acquiring SMBIOS data over IPMI
  • Commands for better integration with Intel hardware
  • Firmware update extensions
  • Extended parsing of IPMI Platform Events[4]

References

  1. OpenBMC IPMI Architecture
  2. Phosphor IPMI Host
  3. IPMI Specification v2.0
  4. Intel Platform Events parsing