Populate unique PrettyName for IO-SCM systems

IO-SCM is a DCM with one of the chips being just IO-Good, that is one of
the chips does not have any good computing cores. But those chips can be
useful for other purposes like connecting PCIE devices. So we still use
those cpu chips without trashing.

So to uniquely identify an IO-Good chip, this commit populates a unique
PrettyName for such cpus so that the redfish client can easily
distinguish between chips with good computing cores and an IO-Good chip.

Test:
Tested on io-SCM system.

Case 1: CPU which is not an IO.

=====> root@rain71bmc:/tmp# ./ibm-read-vpd --file /sys/bus/spi/drivers/at25/spi12.0/eeprom

=====> root@rain71bmc:/tmp# busctl introspect xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/dcm0/cpu0
NAME                                                  TYPE      SIGNATURE RESULT/VALUE                             FLAGS
com.ibm.ipzvpd.CP00                                   interface -         -                                        -
.AW                                                   property  ay        4 0 0 0 0                                emits-change writable
.D4                                                   property  ay        4 0 0 0 0                                emits-change writable
.D5                                                   property  ay        4 0 0 0 0                                emits-change writable
.MK                                                   property  ay        7 1 0 0 0 0 0 0                          emits-change writable
.PD_G                                                 property  ay        7168 23 82 83 5 9 0 20 0 0 1 3 73 2 255… emits-change writable
......

xyz.openbmc_project.Inventory.Item                    interface -         -                                        -
.Present                                              property  b         true                                     emits-change writable
.PrettyName                                           property  s         "PROCESSOR MODULE"                       emits-change writable
xyz.openbmc_project.Inventory.Item.Cpu                interface -         -                                        -
.Characteristics                                      property  as        0                                        emits-change writable
.CoreCount                                            property  q         10                                       emits-change writable

....

=====> curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/system/Processors/dcm0-cpu0
{
  "@odata.id": "/redfish/v1/Systems/system/Processors/dcm0-cpu0",
  "@odata.type": "#Processor.v1_12_0.Processor",
  "Id": "dcm0-cpu0",
  "Location": {
    "PartLocation": {
      "ServiceLabel": "U78DA.ND0.WZS0042-P0-C15"
    }
  },
  "LocationIndicatorActive": false,
  "Manufacturer": "",
  "MaxSpeedMHz": 0,
  "Model": "5C74",
  "Name": "PROCESSOR MODULE",
  "PartNumber": "03JM528",
  "ProcessorId": {
    "EffectiveFamily": ""
  },
  "ProcessorType": "CPU",
  "SerialNumber": "YA3936127705",
  "Socket": "",
  "SparePartNumber": "F210110",
  "Status": {
    "Health": "OK",
    "State": "Enabled"
  },
  "SubProcessors": {
    "@odata.id": "/redfish/v1/Systems/system/Processors/dcm0-cpu0/SubProcessors"
  },
  "TotalCores": 10,
  "TotalThreads": 0
}

Case 2: CPU which is an IO only chip.

=====> root@rain71bmc:/tmp# ./ibm-read-vpd --file /sys/bus/spi/drivers/at25/spi22.0/eeprom

=====> root@rain71bmc:/tmp# busctl introspect xyz.openbmc_project.Inventory.Manager /xyz/openbmc_project/inventory/system/chassis/motherboard/dcm0/cpu1
NAME                                                  TYPE      SIGNATURE RESULT/VALUE                             FLAGS
com.ibm.ipzvpd.CP00                                   interface -         -                                        -
.AW                                                   property  ay        4 0 0 0 0                                emits-change writable
.D4                                                   property  ay        4 0 0 0 0                                emits-change writable
.D5                                                   property  ay        4 0 0 0 0                                emits-change writable
.MK                                                   property  ay        7 1 0 0 0 0 0 0                          emits-change writable
.PD_G                                                 property  ay        7168 23

.......

xyz.openbmc_project.Inventory.Item                    interface -         -                                        -
.Present                                              property  b         true                                     emits-change writable
.PrettyName                                           property  s         "IO"                                     emits-change writable
xyz.openbmc_project.Inventory.Item.Cpu                interface -         -                                        -
.Characteristics                                      property  as        0

...

=====> curl -k -H "X-Auth-Token: $bmc_token" -X GET https://${bmc}/redfish/v1/Systems/system/Processors/dcm0-cpu1
{
  "@odata.id": "/redfish/v1/Systems/system/Processors/dcm0-cpu1",
  "@odata.type": "#Processor.v1_12_0.Processor",
  "Id": "dcm0-cpu1",
  "Location": {
    "PartLocation": {
      "ServiceLabel": "U78DA.ND0.WZS0042-P0-C15"
    }
  },
  "LocationIndicatorActive": false,
  "Manufacturer": "",
  "MaxSpeedMHz": 0,
  "Model": "5C74",
  "Name": "IO",
  "PartNumber": "03JM528",
  "ProcessorId": {
    "EffectiveFamily": ""
  },
  "ProcessorType": "CPU",
  "SerialNumber": "YA3936127705",
  "Socket": "",
  "SparePartNumber": "F210110",
  "Status": {
    "Health": "OK",
    "State": "Enabled"
  },
  "SubProcessors": {
    "@odata.id": "/redfish/v1/Systems/system/Processors/dcm0-cpu1/SubProcessors"
  },
  "TotalCores": 0,
  "TotalThreads": 0
}
==========

Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
Change-Id: I39917557b50074650fe381f161e101640f7d870c
1 file changed
tree: 2958a3280d859eae8ac9523deee8cbec99014b6c
  1. examples/
  2. subprojects/
  3. test/
  4. vpd-manager/
  5. vpd-parser/
  6. vpdecc/
  7. .clang-format
  8. .gitignore
  9. app.cpp
  10. args.cpp
  11. args.hpp
  12. common_utility.cpp
  13. common_utility.hpp
  14. const.hpp
  15. defines.hpp
  16. extra-properties-example.yaml
  17. extra-properties.mako.hpp
  18. extra-properties.py
  19. ibm_vpd_app.cpp
  20. ibm_vpd_utils.cpp
  21. ibm_vpd_utils.hpp
  22. impl.cpp
  23. impl.hpp
  24. LICENSE
  25. MAINTAINERS
  26. meson.build
  27. meson_options.txt
  28. OWNERS
  29. README.md
  30. store.hpp
  31. types.hpp
  32. utilInterface.hpp
  33. vpd_exceptions.hpp
  34. vpd_tool.cpp
  35. vpd_tool_impl.cpp
  36. vpd_tool_impl.hpp
  37. write.cpp
  38. write.hpp
  39. writefru.mako.hpp
  40. writefru.py
  41. writefru.yaml
README.md

Overview

This repository hosts code for OpenPower and IBM IPZ format VPD parsers. Both OpenPower VPD and IPZ VPD formats are structured binaries that consist of records and keywords. A record is a collection of multiple keywords. More information about the format can be found here.

The repository consists of two distinct applications, which are:

OpenPower VPD Parser

This is a build-time YAML driven application that parses the OpenPower VPD format and uses the YAML configuration (see extra-properties-example.yaml and writefru.yaml) to determine:

  • The supported records and keywords.
  • How VPD data is translated into D-Bus interfaces and properties.

The application instance must be passed in the file path to the VPD (this can, for example, be a sysfs path exposed by the EEPROM device driver) and also the D-Bus object path(s) that EEPROM data needs to be published under.

IBM VPD Parser

This parser is can be built by passing in the --enable-ibm-parser configure option. This parser differs from the OpenPower VPD parser in the following ways:

  • It parses all the records and keywords from the VPD, including large keywords (Keywords that begin with a # and are > 255 bytes in length).
  • It relies on a runtime JSON configuration (see examples/inventory.json) to determine the D-Bus object path(s) that hold interfaces and properties representing the VPD for a given VPD file path.

Making the application runtime JSON driven allows us to support multiple systems (with different FRU configurations) to be supported in a single code image as well as making the application more flexible for future improvements.

TODOs and Future Improvements

  1. The long-term goal is to completely do away with the build time YAML driven configurations and instead reconcile the OpenPower VPD parser and the IBM VPD parser applications into a single runtime JSON driven application.
  2. Add details to the README on how to configure and build the application.
  3. More JSON documentation.
  4. Support for more IBM VPD formats.
  5. VPD Write and tool documentation.