support multiple device trees in the same BMC image

This commit checks for current system type and if it is changed from last boot,
it loads new/appropriate device tree and reboot the system.

Tested-
=========================================
Test Case 1: first boot when env not defined

triggerred system vpd collection-
DBG: systemType is: 50001000
DBG: newDeviceTree: fw_dt2
U-Boot environment is not set. Updating...
DBG: rebooting...
root@rainier:/tmp# Connection to rain4bmc closed by remote host.
Connection to rain4bmc closed.
========================================
Test case 2-
triggerred system vpd collection-
DBG: systemType is: 50001001
DBG: newDeviceTree: fw_dt1
U-Boot environment is not updated. Updating...
DBG: rebooting...
root@rainier:/tmp# Connection to rain4bmc closed by remote host.
Connection to rain4bmc closed.

alpana07> ssh -k root@rain4bmc
root@rain4bmc's password:
printenv
...
bootside=b
devTree=fw_dt1
root@rainier:~#
=========================================
Test case 3-
triggerred system vpd collection again-
DBG: systemType is: 50001001
DBG: newDeviceTree: fw_dt1
U-Boot environment is Updated.

root@rainier:~# fw_printenv
...
bootside=b
devTree=fw_dt1
=========================================

Change-Id: I28bce8ced4a970e1818b4f4f613bd062647a4d3a
Signed-off-by: Alpana Kumari <alpankum@in.ibm.com>
3 files changed
tree: 3c5fc5798cb4327a5ed9bcd56380457d2e51383d
  1. examples/
  2. test/
  3. vpd-manager/
  4. vpd-parser/
  5. vpdecc/
  6. .clang-format
  7. .gitignore
  8. app.cpp
  9. args.cpp
  10. args.hpp
  11. const.hpp
  12. defines.hpp
  13. extra-properties-example.yaml
  14. extra-properties.mako.hpp
  15. extra-properties.py
  16. ibm_vpd_app.cpp
  17. impl.cpp
  18. impl.hpp
  19. LICENSE
  20. MAINTAINERS
  21. meson.build
  22. meson_options.txt
  23. README.md
  24. store.hpp
  25. types.hpp
  26. utilInterface.hpp
  27. utils.cpp
  28. utils.hpp
  29. vpd_tool.cpp
  30. vpd_tool_impl.cpp
  31. vpd_tool_impl.hpp
  32. write.cpp
  33. write.hpp
  34. writefru.mako.hpp
  35. writefru.py
  36. 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.