Defect fix in logging system VPD mismatch PEL

This commit has the below fixes in ibm-read-vpd app.

1. Fixed the incorrect dbus path passed in CALLOUT_INVENTORY_PATH
when there is a system VPD mismatch between cache and hardware.

2. Fixed the incorrect PEL interface logged when there is a
system VPD mismatch between cache and hardware.

Test:
Ensured that "com.ibm.VPD.Error.SystemVPDMismatch" PEL interface
is logged and "/xyz/openbmc_project/inventory/system/chassis"
"/motherboard" inventory path is called out when there is a
system VPD mismatch.

peltool -i 0x500024AB
{
"Private Header": {
    "Section Version":          "1",
    "Sub-section type":         "0",
    "Created by":               "0x4000",
    "Created at":               "12/05/2022 05:58:47",
    "Committed at":             "12/05/2022 05:58:47",
    "Creator Subsystem":        "BMC",
    "CSSVER":                   "",
    "Platform Log Id":          "0x500024AB",
    "Entry Id":                 "0x500024AB",
    "BMC Event Log Id":         "314"
},
"User Header": {
    "Section Version":          "1",
    "Sub-section type":         "0",
    "Log Committed by":         "0x2000",
    "Subsystem":                "CEC Hardware - VPD Interface",
    "Event Scope":              "Entire Platform",
    "Event Severity":           "Predictive Error",
    "Event Type":               "Not Applicable",
    "Action Flags": [
                                "Service Action Required",
                                "Report Externally",
                                "HMC Call Home"
    ],
    "Host Transmission":        "Not Sent",
    "HMC Transmission":         "Not Sent"
},
"Primary SRC": {
    "Section Version":          "1",
    "Sub-section type":         "1",
    "Created by":               "0x4000",
    "SRC Version":              "0x02",
    "SRC Format":               "0x55",
    "Virtual Progress SRC":     "False",
    "I5/OS Service Event Bit":  "False",
    "Hypervisor Dump Initiated":"False",
    "Backplane CCIN":           "2E2D",
    "Terminate FW Error":       "False",
    "Deconfigured":             "False",
    "Guarded":                  "False",
    "Error Details": {
        "Message":              "A system VPD restoration error"
                                "occurred."
    },
    "Valid Word Count":         "0x09",
    "Reference Code":           "BD554008",
    "Hex Word 2":               "00080055",
    "Hex Word 3":               "2E2D0010",
    "Hex Word 4":               "00000000",
    "Hex Word 5":               "00000000",
    "Hex Word 6":               "00000000",
    "Hex Word 7":               "00000000",
    "Hex Word 8":               "00000000",
    "Hex Word 9":               "00000000",
    "Callout Section": {
        "Callout Count":        "2",
        "Callouts": [{
            "FRU Type":         "Normal Hardware FRU",
            "Priority":         "Mandatory, replace all with this"
                                "type as a unit",
            "Location Code":    "U78DA.ND0.WZS007H-P0",
            "Part Number":      "02WG676",
            "CCIN":             "2E2D",
            "Serial Number":    "YF33UF19Y007"
        }, {
            "FRU Type":         "Maintenance Procedure Required",
            "Priority":         "Mandatory, replace all with this"
                                "type as a unit",
            "Procedure":        "BMC0007"
        }]
    }
},
"Extended User Header": {
    "Section Version":          "1",
    "Sub-section type":         "0",
    "Created by":               "0x2000",
    "Reporting Machine Type":   "9105-22B",
    "Reporting Serial Number":  "1392BE0",
    "FW Released Ver":          "",
    "FW SubSys Version":        "fw1040.00-1.2",
    "Common Ref Time":          "00/00/0000 00:00:00",
    "Symptom Id Len":           "20",
    "Symptom Id":               "BD554008_2E2D0010"
},
"Failing MTMS": {
    "Section Version":          "1",
    "Sub-section type":         "0",
    "Created by":               "0x2000",
    "Machine Type Model":       "9105-22B",
    "Serial Number":            "1392BE0"
},
"User Data 0": {
    "Section Version": "1",
    "Sub-section type": "1",
    "Created by": "0x2000",
    "BMCLoad": "0.22 0.41 0.33",
    "BMCState": "Ready",
    "BMCUptime": "0y 0d 0h 13m 6s",
    "BootState": "Unspecified",
    "ChassisState": "Off",
    "FW Version ID": "fw1040.00-1.2-2-g1859836242-dirty",
    "HostState": "Off",
    "System IM": "50001001"
},
"User Data 1": {
    "Section Version": "1",
    "Sub-section type": "1",
    "Created by": "0x2000",
    "CALLOUT_INVENTORY_PATH": "/xyz/openbmc_project/inventory/system"
                              "/chassis/motherboard",
    "DESCRIPTION": "VPD data mismatch on cache and hardware for"
                   "record: LXR0 and keyword: LX",
    "Value on Cache: ": "0x31 0x0 0x4 0x1 0x0 0x30 0x0 0x71 ",
    "Value read from EEPROM: ": "0x64 0x65 0x4 0x1 0x0 0x30 0x0 0x71 "
}
}

Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
Change-Id: I0b94b60d03f4223e5c14162e859dd45e76a4c2fb
2 files changed
tree: 26b1215169017ed3eecba3b439f9ff5994089f60
  1. examples/
  2. ibm_vpd/
  3. subprojects/
  4. test/
  5. vpd-manager/
  6. vpd-parser/
  7. vpdecc/
  8. .clang-format
  9. .gitignore
  10. app.cpp
  11. args.cpp
  12. args.hpp
  13. common_utility.cpp
  14. common_utility.hpp
  15. const.hpp
  16. defines.hpp
  17. extra-properties-example.yaml
  18. extra-properties.mako.hpp
  19. extra-properties.py
  20. ibm_vpd_app.cpp
  21. ibm_vpd_utils.cpp
  22. ibm_vpd_utils.hpp
  23. impl.cpp
  24. impl.hpp
  25. LICENSE
  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.