commit | 647868edf10761db109d8b51a2013ebed6f86463 | [log] [tgz] |
---|---|---|
author | PriyangaRamasamy <priyanga24@in.ibm.com> | Tue Sep 08 17:03:19 2020 +0530 |
committer | Santosh Puranik <santosh.puranik@in.ibm.com> | Mon May 10 13:49:24 2021 +0530 |
tree | b642522bae84b0b93fa9dbed1e0a10de3b2dfe4d | |
parent | f05effdb612c2ffdc625f52a28cd7ff2ea0ea401 [diff] |
Translate Udev Event path to a generic path Given Udev event generated path is translated into sys bus path - as the json will have the sys/bus path. Test: -> Translation successful for all frus including frus behind muxes. -> If the system vpd is triggered by udev event, then the execution stops as the system vpd will already be parsed via system-vpd.service. Few Reasons why we translate the path to a generic path: -> Each i2c bus is memory mapped to a certain address in ASPEED. In future if there are any architectural changes in the kernel, we need to make changes to the JSON accordingly. -> Also in future if the system runs on a different ASPEED, we need to update the JSON accordingly. -> This generic /sys/bus path represents the system wiring and doesnot rely on how the busses are memory mapped. -> Also for call out based events, generic path is expected than the udev event path. Sample Udev Event i2c path : "/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a480.i2c-bus/i2c-8/8-0050/8-00500/nvmem" Which gets translated to /sys/bus/ path as : "/sys/bus/i2c/drivers/at24/8-0050/eeprom" Sample Udev Event spi path : "/sys/devices/platform/ahb/ahb:apb/1e79b000.fsi/fsi-master/fsi0/slave@00:00/00:00:00:0a/fsi-master/fsi1/slave@03:00/01:03:00:04/spi_master/spi6/spi6.0/spi6.00/nvmem" Which gets translated to /sys/bus/ path as : "/sys/bus/spi/drivers/at25/spi6.0/eeprom" Sample Udev Event i2c path for frus behind mux : "/sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a300.i2c-bus/i2c-5/i2c-24/24-0051/24-00510/nvmem" Which gets translated to generic path as /sys/bus/i2c/drivers/at24/24-0051/eeprom Tested on simics: <the inventory json should have generic eeprom paths for all frus> root@rainier:/tmp# ./ibm-read-vpd-UG -f /sys/devices/platform/ahb/ahb:apb/1e79b000.fsi/fsi-master/fsi0/slave@00:00/00:00:00:04/spi_master/spi12/spi12.0/spi12.00/nvmem the path after translation : /sys/bus/spi/drivers/at25/spi12.0/eeprom root@rainier:/tmp# ./ibm-read-vpd-UG -f /sys/devices/platform/ahb/ahb:apb/ahb:apb:bus@1e78a000/1e78a480.i2c-bus/i2c-8/8-0051/8-00510/nvmem the path after translation : /sys/bus/i2c/drivers/at24/8-0051/eeprom root@rainier:/tmp# ./ibm-read-vpd-UG -f /sys/bus/i2c/drivers/at24/8-0051/8-00510/nvmem the path after translation : /sys/bus/i2c/drivers/at24/8-0051/eeprom Signed-off-by: PriyangaRamasamy <priyanga24@in.ibm.com> Change-Id: I6d5995a85ef15e63d2d0b6f054fb0bf14a2b756c
#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:
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.