commit | 3803131f1d4da9e6f41d53a5a6e655e41c34776d | [log] [tgz] |
---|---|---|
author | Priyanga Ramasamy <priyanga24@in.ibm.com> | Thu Oct 07 16:39:13 2021 -0500 |
committer | Santosh Puranik <santosh.puranik@in.ibm.com> | Thu Jun 02 16:58:39 2022 +0000 |
tree | 8e9981789f3d674add3940691f59b15e9a55ec2a | |
parent | 28079c8bd9b98ab7d9ba61f774145924524e0c9d [diff] |
Vpd-tool:Read keyword from hardware Vpd-tool adds an option to read any keyword directly from hardware with the help of -H option. This commit has the front-end portion which gets the user option and calls the back end code which is present in Impl class in this commit https://gerrit.openbmc.org/c/openbmc/openpower-vpd-parser/+/47666 . Test: Tested on rainier. 1. root@rain111bmc:/tmp# ./vpd-tool -r -O /sys/bus/spi/drivers/at25/spi12.0/eeprom -R CP00 -K PG -H { "/sys/bus/spi/drivers/at25/spi12.0/eeprom": { "PG": "0x01e03fffe051ffe37fffe53fffffffffffffffffffffffffffe00c1fe00c1fffffffffffffe21dffe21dffffffffffffffe79fffe39fffe79fffe79fffffffffffffffffffffffffffffffffffffffe3bdffe3bdffe3bdffffffffe3bdffe3bdffe7f9ffe1987fe0001fe7f9ffe7f9ffe0001fe6619fe0001fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" } } root@rain111bmc:/tmp# ./vpd-tool -r -O /system/chassis/motherboard/dcm0/cpu0 -R CP00 -K PG { "/system/chassis/motherboard/dcm0/cpu0": { "PG": "0x01e03fffe051ffe37fffe53fffffffffffffffffffffffffffe00c1fe00c1fffffffffffffe21dffe21dffffffffffffffe79fffe39fffe79fffe79fffffffffffffffffffffffffffffffffffffffe3bdffe3bdffe3bdffffffffe3bdffe3bdffe7f9ffe1987fe0001fe7f9ffe7f9ffe0001fe6619fe0001fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff" } } 2. root@rain111bmc:/tmp# ./vpd-tool -r -H -O /sys/bus/spi/drivers/at25/spi12.0/eeprom -R VINI -K SN { "/sys/bus/spi/drivers/at25/spi12.0/eeprom": { "SN": "YA3936110110" } } root@rain111bmc:/tmp# ./vpd-tool -r -O /system/chassis/motherboard/dcm0/cpu0 -R VINI -K SN { "/system/chassis/motherboard/dcm0/cpu0": { "SN": "YA3936110110" } } 3. root@rain111bmc:/tmp# ./vpd-tool -r -H -O /sys/bus/i2c/drivers/at24/8-0050/eeprom -R VSYS -K BR { "/sys/bus/i2c/drivers/at24/8-0050/eeprom": { "BR": "S0" } } 4. root@rain111bmc:/tmp# ./vpd-tool -r -H -O /sys/bus/i2c/drivers/at24/8-0050/eeprom -R VINI -K SN { "/sys/bus/i2c/drivers/at24/8-0050/eeprom": { "SN": "Y131UF07302S" } } 5. root@perfrain86bmctest:/tmp# ./vpd-tool -r -H -O /sys/bus/i2c/drivers/at24/7-0050/eeprom -R VR10 -K BD The given keyword BD is not present in the given record VR10 in the given vpd path /sys/bus/i2c/drivers/at24/7-0050/eeprom 6. root@perfrain86bmctest:/tmp# ./vpd-tool -r -H -O /sys/bus/i2c/drivers/at24/7-0050/eeprom -R CP00 -K SN The given record CP00 is not present in the given vpd path /sys/bus/i2c/drivers/at24/7-0050/eeprom 7. root@perfrain86bmctest:/tmp# ./vpd-tool -r -H -O /sys/bus/i2c/drivers/at24/7-0050/eeprom -R VR10 -K DC { "/sys/bus/i2c/drivers/at24/7-0050/eeprom": { "DC": "BD 201908260800" } } Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com> Change-Id: I37f85fe22a2c98704bbc8f6090f0d83084d4c6f8
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:
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 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.
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:
#
and are > 255 bytes in length).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.