DD2:  Enable Dimms

This commit checks for the chip version , if it is DD2 or higher then bind the device driver
for all the Dimms(supported in vpd json)

Test-
Tested on HW with DD2 processor.
rain135bmc
root@rain135bmc:/sys/bus/i2c/drivers/at24# ls
0-0051   10-0050  6-0053   7-0050   8-0050   8-0051   9-0050   bind     uevent   unbind

===================after execution============================================================

root@rain135bmc:/sys/bus/i2c/drivers/at24# ls
0-0051    111-0050  311-0050  6-0053    8-0050    9-0050    uevent
10-0050   202-0050  402-0050  7-0050    8-0051    bind      unbind

root@rain135bmc:/sys/bus/i2c/devices# ls
0-0020   11-0051  4-0049   5-0051   7-0040   8-0011   9-004d   i2c-110  i2c-14   i2c-203  i2c-300  i2c-4    i2c-417
0-0051   13-0050  4-004a   6-0048   7-0048   8-0032   9-0050   i2c-111  i2c-15   i2c-210  i2c-301  i2c-402  i2c-5
10-004c  14-0050  4-0050   6-004a   7-0050   8-0048   i2c-0    i2c-112  i2c-16   i2c-211  i2c-310  i2c-403  i2c-6
10-004d  15-0050  4-0051   6-004b   7-0051   8-004a   i2c-1    i2c-113  i2c-17   i2c-214  i2c-311  i2c-410  i2c-7
10-0050  3-0061   4-0052   6-0050   7-0052   8-0050   i2c-10   i2c-114  i2c-18   i2c-215  i2c-312  i2c-411  i2c-8
11-0048  3-0068   5-0048   6-0051   7-0061   8-0051   i2c-100  i2c-115  i2c-19   i2c-216  i2c-313  i2c-414  i2c-9
11-0049  3-0069   5-0049   6-0052   7-0076   8-0061   i2c-101  i2c-12   i2c-2    i2c-217  i2c-314  i2c-415
11-0050  4-0048   5-0050   6-0053   7-1062   9-004c   i2c-11   i2c-13   i2c-202  i2c-3    i2c-315  i2c-416
root@rain135bmc:/sys/bus/i2c/devices#

===================Executing patch============================================================

root@rain135bmc:/tmp# ./ibm-read-vpd -f /sys/bus/spi/drivers/at25/spi12.0/eeprom

===================after execution============================================================

root@rain71bmc:/sys/bus/i2c/devices# ls
0-0020    111-0050  214-0050  313-0050  411-0050  6-0050    8-0011    i2c-10    i2c-14    i2c-215   i2c-4     i2c-8
0-0051    112-0050  215-0050  314-0050  414-0050  6-0051    8-0032    i2c-100   i2c-15    i2c-216   i2c-402   i2c-9
10-004c   113-0050  216-0050  315-0050  415-0050  6-0052    8-0048    i2c-101   i2c-16    i2c-217   i2c-403
10-004d   114-0050  217-0050  4-0048    416-0050  6-0053    8-004a    i2c-11    i2c-17    i2c-3     i2c-410
10-0050   115-0050  3-0061    4-0049    417-0050  7-0040    8-0050    i2c-110   i2c-18    i2c-300   i2c-411
100-0050  13-0050   3-0068    4-004a    5-0048    7-0048    8-0051    i2c-111   i2c-19    i2c-301   i2c-414
101-0050  14-0050   3-0069    4-0050    5-0049    7-0050    8-0061    i2c-112   i2c-2     i2c-310   i2c-415
11-0048   15-0050   300-0050  4-0051    5-0050    7-0051    9-004c    i2c-113   i2c-202   i2c-311   i2c-416
11-0049   202-0050  301-0050  4-0052    5-0051    7-0052    9-004d    i2c-114   i2c-203   i2c-312   i2c-417
11-0050   203-0050  310-0050  402-0050  6-0048    7-0061    9-0050    i2c-115   i2c-210   i2c-313   i2c-5
11-0051   210-0050  311-0050  403-0050  6-004a    7-0076    i2c-0     i2c-12    i2c-211   i2c-314   i2c-6
110-0050  211-0050  312-0050  410-0050  6-004b    7-1062    i2c-1     i2c-13    i2c-214   i2c-315   i2c-7
root@rain135bmc:/sys/bus/i2c/devices#
Also, vpd got collected for all these Dimms-

root@rain135c:/tmp# busctl introspect  xyz.openbmc_project.Inventory.Manager  /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm22| grep -e MemorySizeInKB -e  Present -e PrettyName -e Model  -e PartNumber  -e SerialNumber
.Model                                                property  s         "327A"                                   emits-change writable
.PartNumber                                           property  s         "78P6574"                                emits-change writable
.SerialNumber                                         property  s         "YH30MS04N004"                           emits-change writable
.SparePartNumber                                      property  s         ""                                       emits-change writable
.SubModel                                             property  s         ""                                       emits-change writable
.Present                                              property  b         true                                     emits-change writable
.PrettyName                                           property  s         "Memory DIMM"                            emits-change writable
.MemorySizeInKB                                       property  u         33554432                                 emits-change writable

root@rain135c:/tmp# busctl introspect  xyz.openbmc_project.Inventory.Manager  /xyz/openbmc_project/inventory/system/chassis/motherboard/dimm31| grep -e MemorySizeInKB -e  Present -e PrettyName -e Model  -e PartNumber  -e SerialNumber
.Model                                                property  s         "327A"                                   emits-change writable
.PartNumber                                           property  s         "78P6574"                                emits-change writable
.SerialNumber                                         property  s         "YH301T9CH022"                           emits-change writable
.SparePartNumber                                      property  s         ""                                       emits-change writable
.SubModel                                             property  s         ""                                       emits-change writable
.Present                                              property  b         true                                     emits-change writable
.PrettyName                                           property  s         "Memory DIMM"                            emits-change writable
.MemorySizeInKB                                       property  u         33554432                                 emits-change writable
root@rain135c:/tmp#

Change-Id: Iab1b099fe0352c08327e70aa8c2e33fc213cc40f
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
3 files changed
tree: 7734a364666b1b63ef8a0d4db46594f1972c7312
  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. README.md
  29. store.hpp
  30. types.hpp
  31. utilInterface.hpp
  32. vpd_exceptions.hpp
  33. vpd_tool.cpp
  34. vpd_tool_impl.cpp
  35. vpd_tool_impl.hpp
  36. write.cpp
  37. write.hpp
  38. writefru.mako.hpp
  39. writefru.py
  40. 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.