summaryrefslogtreecommitdiffstats
path: root/hdata/vpd.c
Commit message (Collapse)AuthorAgeFilesLines
* vpd: Add vendor property to processor nodeVasant Hegde2018-06-271-0/+15
| | | | | | | | | Processor FRU vpd doesn't contain vendor detail. We have to parse module VPD to get vendor detail. Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* vpd: Sanitize VPD dataVasant Hegde2018-06-271-22/+49
| | | | | | | | | | | | | On OpenPower system, VPD keyword size tells us the maximum size of the data. But they fill trailing end with space (0x20) instead of NULL. Also spec doesn't stop user to have space (0x20) within actual data. This patch discards trailing spaces before populating device tree. Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [stewart: fixup make check] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* hdata/vpd: Add vendor propertyVasant Hegde2018-01-301-0/+5
| | | | | | | | ibm,vpd blob contains VN field. Use that to populate vendor property for various FRU's. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Remove possible dereference after null check (CID 207468)Cyril Bur2018-01-301-1/+1
| | | | | | | | | | | The next_extry label doesn't do anything other than perform an addition which requires a dereference of the NULL entry variable, just continue the loop instead. Fixes: 77190aa7 (hdata/vpd: Rework vpd node creation logic) Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Fix DTC warningsOliver O'Halloran2018-01-141-0/+5
| | | | | | | | | All the nodes under the vpd heirachy have a unit address (their SLCA index) but no reg properties. Add them and their size/address cells to squash the warnings. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: add support for parsing CPU VRML recordsRobert Lippert2017-11-191-0/+24
| | | | | | | | | Allows skiboot to parse out the processor part/serial numbers on OpenPOWER P9 machines. Change-Id: Ie22a3c50d32f480671334b4b6c820476e29301c9 Signed-off-by: Robert Lippert <rlippert@google.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Improve vpd node find logicVasant Hegde2017-10-161-14/+2
| | | | | | | | | Use dt_find_by_name_addr() instead of dt_find_by_name(). That way we can avoid unnecessary memory allocation/cleanup. CC: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Rework vpd node creation logicVasant Hegde2017-10-161-94/+78
| | | | | | | | | | | | | | | | | | | | | | | Presently we traverse SLCA structure to create various FRU nodes under /vpd node. We assumed that children are always contiguous. It happened to be contiguous in P8 and worked fine, but failed in P9 system. So it ended up populating duplicate node under wrong parent. Also failed to populate some of the nodes. Unfortunately there is no way to reach all the children of a given parent from parent node :-( Hence we have to rework vpd creation logic. This patch goes through all the SLCA entries serially and creates vpd node. Assumptions: - SLCA index is always serial (0..n) - When we traverse serially parent entry comes before child - Redundant resources are always consecutive - Populate node if SLCA has 'installed' and 'VPD collected' bit set CC: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Make vpd data parsing function globalVasant Hegde2017-09-041-5/+9
| | | | | | | | | | Move VPD parsing code to separate function (vpd_data_parse()) and make it as global. So that we can call this function from other files. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Fix vpd parseVasant Hegde2017-09-041-6/+3
| | | | | | | | | | | | | | | | We detect vpd data format in vpd_parse() and set "op_platform" variable. dt_add_vpd_node() depends on op_platform to select parser type. There are places where we call dt_add_vpd_node() even before calling vpd_parse(). And in such cases it will not parse vpd data properly. This patch fixes above issue. Fixes: 694546c1 (hdata/vpd: Parse the OpenPOWER OPFR record) CC: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Acked-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Fix possible NULL dereference (CID 144258)Cyril Bur2017-08-151-3/+1
| | | | | | | | | Only use devicetree model if there was one. Fixes: CID 144258 Signed-off-by: Cyril Bur <cyril.bur@au1.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Don't dereference possible NULL model_nameStewart Smith2017-07-041-4/+4
| | | | | | | | | | It's legitimate to just add model-name to the device tree if we have one, which is what the hdata logic tries to do, but subtley fails in one of the code paths. Found by static analysis Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat/vpd: Don't warn and don't create a dummy "model-name"Benjamin Herrenschmidt2017-06-261-3/+0
| | | | | | | | | | If the model property doesn't contain a known model number that we can translate into a name, assume it's already a name, stop warning and don't create an extraneous property. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Use dt_add_property_nstr instead of duplicating codeVasant Hegde2017-04-051-9/+3
| | | | | Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Add model-name property for OpenPower systemVasant Hegde2017-04-051-4/+10
| | | | | | | Lets add model-name property for OpenPower system as well. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Read description from ibm, vpd binary blobVasant Hegde2017-04-051-4/+10
| | | | | | | | | | | In P8, for few FRU's we hardcoded description table (I don't call the reason behind this). Hence on newers system, for most devices description propetry under /vpd contains "Unknown". Hence lets read description from vpd blob. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Populate model property with 'Unknown' in error pathVasant Hegde2017-04-051-0/+5
| | | | | | | | | Linux kernel refers to model and sytem-id properties. Also some of the user space tools refers these properties. Hence in error path fill model/system-id property with "Unknown". Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Parse the OpenPOWER OPFR recordAnanth N Mavinakayanahalli2017-03-311-1/+44
| | | | | | | | | | | | Parse the OpenPOWER FRU VPD (OPFR) record on OpenPOWER instead of the VINI records. TODO: Add the dts and updates for make check for P9 OPFR systems once the HDAT in those are complete. Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Parse additional VINI recordsAnanth N Mavinakayanahalli2017-03-311-56/+43
| | | | | | | | | | | These records provide hardware version details, CCIN extension information, card type details and hardware characteristics of the FRU While there, use the helper to add individual records. Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Reorganize VPD codeAnanth N Mavinakayanahalli2017-03-311-5/+8
| | | | | | | | | | | | To make it convenient to add OpenPOWER platform support. No change in functionality. This series has been tested on a Witherspoon. The HDAT has the corresponding properties, but is not populated with the right values (serial number, etc). Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Reorganize vpd name mappingAnanth N Mavinakayanahalli2017-02-171-287/+140
| | | | | | | | | to use a more graceful structured representation. Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Reviewed-by: Oliver O'Halloran <oohall@gmail.com> [stewart@linux.vnet.ibm.com: preserve PR_WARNING on Unknown] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Rework parsing of system VPD for Open PowerBenjamin Herrenschmidt2017-02-061-49/+62
| | | | | | | Handle the OSYS record on OPP machines in stead of VSYS Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Grab system model name from HDAT when availableVasant Hegde2017-01-161-8/+34
| | | | | | | | | | | | | Latest spec added system model information to IPL PARAMS ntuple. Grab this information when available instead of using hardcoded table (machine_table). Its better to parse all IPL params in one place. But on P8 we depend on model information ..which we get from sysvpd_parse(). Hence for now I've added code inside sysvpd_parse(). Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Grab vendor information from HDAT when availableVasant Hegde2017-01-161-1/+0
| | | | | | | | | | | | | Latest spec added vendor information to IPL PARAMS ntuple. Grab this information when available instead of hardcoding vendor name. Also move vendor property code from vpd.c to iplparms parsing function in spira.c. Suggested-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: handle ISDIMM SPD blobsOliver O'Halloran2017-01-161-1/+2
| | | | | | | | | | | | | | | | Previously the HDAT format was only ever used with IBM hardware so it would store vital product data (VPD) blobs in the IBM ASCII Keyword VPD format. With P9 HDAT is used on OpenPower machines which use Industry Standard DIMMs that provide their product data through a "Serial Present Detect" EEPROM mounted on the DIMM. The SPD blob has a different format and is exported in the device-tree under the "spd" property rather than the "ibm,vpd" property. This patch adds support for recognising these blobs and placing them in the appropriate DT property. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Enable -Werror for -WformatStewart Smith2015-11-161-1/+2
| | | | | | | We create our own inttypes.h to get the correct printf formatting for 64bit numbers. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* sparse: fix conversion of hdat slca_indexStewart Smith2015-11-091-1/+1
| | | | | | | | | | No code changes as skiboot is BE. hdata/vpd.c:559:38: warning: incorrect type in argument 1 (different base types) hdata/vpd.c:559:38: expected unsigned short [unsigned] [usertype] slca_index hdata/vpd.c:559:38: got restricted beint16_t const [usertype] slca_index Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Improve error loggingVasant Hegde2015-05-071-3/+16
| | | | | | | | | | | | Populate CCIN description and model-name property as "Unknown" if its not available (say new system model, etc). That way device tree will be consistent. Also improve error logging. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* vpd: Use slca parent-child relationship to create vpd treeNeelesh Gupta2015-02-111-142/+75
| | | | | | | | | | | | SLCA entries available through hdat have parent-child relationship of various FRUs of the system, the patch makes use of this data to create VPD nodes in hierarchial fashion. This is further useful for the user space tools like 'lshw'/'lsvpd' to plug-in the support easily on POWER. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Initial commit of Open Source releaseBenjamin Herrenschmidt2014-07-021-0/+851
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
OpenPOWER on IntegriCloud