| commit | c99a0b05eb0165a5d6c9c11a533a7e51c12470b3 | [log] [tgz] | 
|---|---|---|
| author | Priyanga Ramasamy <priyanga24@in.ibm.com> | Wed Jun 08 14:53:39 2022 -0500 | 
| committer | Santosh Puranik <santosh.puranik@in.ibm.com> | Fri Oct 07 12:57:53 2022 +0000 | 
| tree | ba596d0ec0f0a561f9ef9754648faa423dfe7801 | |
| parent | 2eb0176c2b20156c3054e6d3d47c9ce7021e3e2c [diff] | 
vpd-tool: Fix for Hardware write option
With this commit, vpd-tool has a fix in Hardware (-H) write
option to update only in hardware and not in cache.
This commit also has an added change. User can provide
VPD offset(--seek) value while using read from hardware and write
to hardware options. Providing offset value(--seek) is optional.
By default offset value is 0. This option is mainly usefull
when providing an EEPROM path which is not present in VPD json.
Test: Tested on everest.
CASE 1: Using Hardware write option will update only hardware and not cache.
root@ever20bmc:/tmp# ./vpd-tool -w -H -O /sys/bus/spi/drivers/at25/spi12.0/eeprom  -R VINI -K CC --seek 0x30000 -V 0x32
root@ever20bmc:/tmp# ./vpd-tool -r -H -O /sys/bus/spi/drivers/at25/spi12.0/eeprom -R VINI -K CC --seek 0x30000
{
    "/sys/bus/spi/drivers/at25/spi12.0/eeprom": {
        "CC": "2C5F"
    }
}
root@ever20bmc:/tmp# ./vpd-tool -r -O /system/chassis/motherboard/dcm0/cpu0 -R VINI -K CC
{
    "/system/chassis/motherboard/dcm0/cpu1": {
        "CC": "5C5F"
    }
}
CASE 2: Using normal write option will update both hardware and cache
root@ever20bmc:/tmp# ./vpd-tool -w -O /system/chassis/motherboard/dcm0/cpu1 -R VINI -K CC -V 0x64
root@ever20bmc:/tmp# ./vpd-tool -r -O /system/chassis/motherboard/dcm0/cpu1  -R VINI -K CC
{
    "/system/chassis/motherboard/dcm0/cpu1": {
        "CC": "dC5F"
    }
}
root@ever20bmc:/tmp# ./vpd-tool -r -H -O /sys/bus/spi/drivers/at25/spi22.0/eeprom -R VINI -K CC --seek 0x30000
{
    "/sys/bus/spi/drivers/at25/spi22.0/eeprom": {
        "CC": "dC5F"
    }
}
CASE 3: Providing wrong offset value during hardware read
root@ever20bmc:/tmp# ./vpd-tool -r -H -O /sys/bus/i2c/drivers/at24/28-0051/eeprom -R VINI -K CC --seek 19
VHDR record not found
Did you provide a valid offset? By default VPD offset is taken as 0. To input offset, use --offset. Refer vpd-tool help.
CASE 4: Providing offset value during normal read operation. As mentioned, there'll be no impact as the offset value will be
valid only while using --Hardware/-H option.
root@ever20bmc:/tmp# ./vpd-tool -r -O /system/chassis/motherboard/dcm0/cpu1  -R VINI -K CC --seek 0
{
    "/system/chassis/motherboard/dcm0/cpu1": {
        "CC": "5C5F"
    }
}
CASE 5: Providing wrong offset value during hardware write
root@ever20bmc:/tmp# ./vpd-tool -w -H -O /sys/bus/spi/drivers/at25/spi12.0/eeprom -R VINI -K CC --seek 20 -V 0x53
Could not find start tag in VPD /sys/bus/spi/drivers/at25/spi12.0/eeprom
Did you provide a valid offset? By default VPD offset is taken as 0. To input offset, use --seek. Refer vpd-tool help.
CASE 6: Providing offset value during normal write. As mentioned, there'll be no impact as the offset value will be valid
only while using --Hardware/-H option.
root@ever8bmc:/tmp# ./vpd-tool -w -O /system/chassis/motherboard/dasd_backplane/panel1 -R VMPU -K VZ -V 0x64 --seek 19
root@ever8bmc:/tmp# ./vpd-tool -r -O /system/chassis/motherboard/dasd_backplane/panel1 -R VMPU -K VZ
{
    "/system/chassis/motherboard/dasd_backplane/panel1": {
        "VZ": "d1"
    }
}
CASE 7: Reading and Writing on a EEPROM path which is not a key in JSON.
root@ever8bmc:/tmp# ./vpd-tool -w -O /sys/bus/spi/drivers/at25/spi13.0/eeprom -R VMPU -K VZ --seek 196608 -H -V 0x64
root@ever8bmc:/tmp#
root@ever8bmc:/tmp# ./vpd-tool -r -O /sys/bus/spi/drivers/at25/spi13.0/eeprom -R VMPU -K VZ --seek 196608 -H
{
    "/sys/bus/spi/drivers/at25/spi13.0/eeprom": {
        "VZ": "d1"
    }
}
Signed-off-by: Priyanga Ramasamy <priyanga24@in.ibm.com>
Change-Id: Icc94b5ee0d044271acf7b6263405fca07eb33728
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.