summaryrefslogtreecommitdiffstats
path: root/hdata/test
Commit message (Collapse)AuthorAgeFilesLines
* hdata/iohub: Look for IOVPD on P9Oliver O'Halloran2019-03-282-1/+7
| | | | | | | | | | | P8 and P9 use the same IO VPD setup, so we need to load the IOHUB VPD on P9 systems too. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [stewart: fixup op920 hdat_to_dt dts expected result, remove incorrect comment, skip IOVPD loading on non-FSP.] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* hdata_to_dt: fail "gracefully" on fatal op_display()Stewart Smith2019-03-202-1/+11
| | | | Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* hdata/test: Add OP920 HDAT test dataOliver O'Halloran2019-02-203-0/+4904
| | | | | | | | It's probably about time we did that. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [stewart: add in dts result] Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* hdata/test: Fix up linux,sml-base propertyOliver O'Halloran2019-02-201-0/+15
| | | | | | | | | | The linux,sml-base property stores a raw pointer into the HDAT area. When running the hdat parser tester the load address of the HDAT will change each time the tool is run so we need to sanatise the property to get consistent output. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* Add PVR_TYPE_P9PReza Arbab2019-02-101-0/+6
| | | | | | | Enable a new PVR to get us running on another p9 variant. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* hdata/test: workaround dtc bugsStewart Smith2018-11-262-4/+17
| | | | | | | | | | | | | | In dtc v1.4.5 to at least v1.4.7 there have been a few bugs introduced that change the layout of what's produced in the dts. In order to be immune from them, we should use the (provided) dtdiff utility, but we also need to run the dts we're diffing against through a dtb cycle in order to ensure we get the same format as what the hdat_to_dt to dts conversion will. This fixes a bunch of unit test failures on the version of dtc shipped with recent Linux distros such as Fedora 29. Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* Fixup unit tests for cpu_queue_job() in mem_region.cStewart Smith2018-07-182-2/+9
| | | | | Fixes: 06808a037d44231ba36e814ff1dbf66bc8b707da Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* cpu: add cpu_queue_job_on_node()Nicholas Piggin2018-07-152-0/+56
| | | | | | | | | | Add a job scheduling API which will run the job on the requested chip_id (or return failure). Includes test harness fixes from Stewart. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* vpd: Sanitize VPD dataVasant Hegde2018-06-272-2/+2
| | | | | | | | | | | | | 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/tests/stubs.c: fix GCC8 warningStewart Smith2018-05-291-2/+2
| | | | | | | | | | hdata/test/stubs.c:112:11: error: ‘lock_caller’ alias between functions of incompatible types ‘void(void)’ and ‘_Bool(void)’ [-Werror=attribute-alias] NOOP_STUB(lock_caller); ^~~~~~~~~~~ We fix it by giving the correct prototype to our stub Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* hdat_to_dt: hash_prop the same on all platformsStewart Smith2018-04-301-1/+1
| | | | Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* hdata: Fix DIMM size propertyVasant Hegde2018-04-232-6/+6
| | | | | | | | | | | Today we parse vpd blob to get DIMM size information. This is limited to FSP based system. HDAT provides DIMM size value. Lets use that to populate device tree. So that we can get size information on BMC based system as well. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> CC: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* hdata/spira: parse vpd to add part-number and serial-number to xscom@ nodeStewart Smith2018-04-112-0/+12
| | | | | | | | | Expected by FWTS and associates our processor with the part/serial number, which is obviously a good thing for one's own sanity. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
* hdata/vpd: Fix DTC warningsOliver O'Halloran2018-01-142-0/+202
| | | | | | | | | 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>
* lock: Add additional lock auditing codeBenjamin Herrenschmidt2017-12-201-1/+1
| | | | | | | | | | | | | | | | | Keep track of lock owner name and replace lock_depth counter with a per-cpu list of locks held by the cpu. This allows us to print the actual locks held in case we hit the (in)famous message about opal_pollers being run with a lock held. It also allows us to warn (and drop them) if locks are still held when returning to the OS or completing a scheduled job. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Reviewed-by: Nicholas Piggin <npiggin@gmail.com> [stewart: fix unit tests] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/tpmrel.c: add firmware event log info to the tpm nodeClaudio Carvalho2017-12-181-0/+1
| | | | | | | | | | | | | This parses the firmware event log information from the secureboot_tpm_info HDAT structure and add it to the tpm device tree node. There can be multiple secureboot_tpm_info entries with each entry corresponding to a master processor that has a tpm device, however, multiple tpm is not supported. Signed-off-by: Claudio Carvalho <cclaudio@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Add memory hierarchy under xscom nodeVasant Hegde2017-12-182-15/+15
| | | | | | | | | | | | | | | We have memory to chip mapping but doesn't have complete memory hierarchy. This patch adds memory hierarchy under xscom node. This is specific to P9 system as these hierarchy may change between processor generation. It uses memory controller ID details and populates nodes like: xscom@<addr>/mcbist@<mcbist_id>/mcs@<mcs_id>/mca@<mca_id>/dimm@<resource_id> Also this patch adds few properties under dimm node. Finally make sure xscom nodes created before calling memory_parse(). Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* make check: Make valgrind optionalMichael Ellerman2017-12-181-1/+1
| | | | | | | | | | To (slightly) lower the barrier for contributions, we can make valgrind optional with just a small amount of plumbing. This allows make check to run successfully without valgrind. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Add location code property to xscom nodeVasant Hegde2017-12-132-0/+6
| | | | | | | | This patch adds chip location code property to xscom node. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/vpd: Rework vpd node creation logicVasant Hegde2017-10-162-295/+283
| | | | | | | | | | | | | | | | | | | | | | | 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>
* core: POWER9 implement OPAL_SIGNAL_SYSTEM_RESETNicholas Piggin2017-09-201-0/+15
| | | | | | | | | | | | | | This implements OPAL_SIGNAL_SYSTEM_RESET, using scom registers to quiesce the target thread and raise a system reset exception on it. It has been tested on DD2 with stop0 ESL=0 and ESL=1 shallow power saving modes. DD1 is not implemented because it is sufficiently different as to make support difficult. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> [stewart@linux.vnet.ibm.com: fixup hdat_to_dt test] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: fix parsing of P8 hdatStewart Smith2017-09-181-1/+1
| | | | | | | Also fixes hdat_to_dt test cases. Fixes: ad484081ef8a51811e7902aec436fa8f1ca9604a Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata_to_dt: free device tree on error pathStewart Smith2017-08-241-0/+1
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata_to_dt: use a realistic PVR and chip revisionStewart Smith2017-08-113-42/+53
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata_to_dt: Add PVR overrides to the usage textOliver O'Halloran2017-06-191-1/+8
| | | | | | | Save us a few headaches in the future. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: Move enable_mambo_console() into chip initialisationMichael Ellerman2017-06-151-0/+1
| | | | | | | | | | | | | | Rather than having a wart in main_cpu_entry() that initialises the mambo console, we can move it into init_chips() which is where we discover that we're on mambo. This also means we don't need to check the quirk again, and has the added bonus that an assert in chip initialisation (which follows immediately) will actually produce output. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> [stewart@linux.vnet.ibm.com: fix make check by adding no-op stub] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/test: Add memory reservations to hdata_to_dtOliver O'Halloran2017-06-062-6/+24
| | | | | | | | | | | | | | Currently memory reservations are parsed, but since they are not processed until mem_region_init() they don't appear in the output device tree blob. Several bugs have been found with memory reservations so we want them to be part of the test output. Add them and clean up several usages of printf() since we want only the dtb to appear in standard out. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Reserve Trace AreasOliver O'Halloran2017-05-261-0/+1
| | | | | | | | | When hostboot is configured to setup in memory tracing it will reserve some memory for use by the hardware tracing facility. We need to mark these areas as off limits to the operating system and firmware. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mem_region: Add HW-only memory resevationsOliver O'Halloran2017-05-261-0/+1
| | | | | | | | | | | | Add a new type of memory reservation that indicates a memory region is only used by hardware and should not be touched by software. This is needed for the in-memory tracing buffers. These reservations have the "no-map" property which indicates that the host kernel should not setup any virtual address mappings that cover this range, unless of course a device driver does so explicitly. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mem_region: rename HW_RESERVE to FW_RESERVEOliver O'Halloran2017-05-261-2/+1
| | | | | | | | | | | Currently all existing reservations are made by hostboot itself or on behalf of some other part of system firmware (e.g. the OCCs). We want to add a "true" hardware reservation type that should not be touched by the host OS. To prepare for that this patch renames the existing reservation type to refect it's actual usage. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata_to_dt: Output up to PR_DEBUGOliver O'Halloran2017-05-161-4/+4
| | | | | | | | | | | | | A lot of stuff that is useful for debugging and general sanity checking of the HDAT parser is only printed at PR_DEBUG. Bump up the log level for hdata_to_dt so that more of this is output by default. The actual test cases only look at the DTS output so there's no harm in being verbose. Clean up the space indentation while we're here. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Add no-op stub functionsOliver O'Halloran2017-05-161-2/+8
| | | | | | | These are useful for side-stepping various HW specific functions. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* test/hdata_to_dt: fix build breakage caused by phys_map_getStewart Smith2017-05-101-0/+3
| | | | | Fixes: 5f67c1e253788691d376e4e639d4a6e7785efa55 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/test: Fix proc_gen when testingOliver O'Halloran2017-05-103-62/+70
| | | | | | | | | In the hdata_to_dt test application the PVR override flags do not correctly set proc_gen. This causes some butchering of the compatible strings and some XSCOM addresses. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: parse processor attached i2c devicesOliver O'Halloran2017-04-071-0/+1
| | | | | | | | Adds basic parsing for i2c devices that are attached to the processor I2C interfaces. This is mainly VPD SEEPROMs. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Add model-name property for OpenPower systemVasant Hegde2017-04-052-2/+2
| | | | | | | 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-052-8/+8
| | | | | | | | | | | 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>
* hdata/test: Updates to the dts for new VPD propertiesAnanth N Mavinakayanahalli2017-03-312-0/+96
| | | | | | | Update the tests for the new VPD properties. Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: print backtraces on HDAT errorsOliver O'Halloran2017-03-301-0/+1
| | | | | | | | | | Currently these aren't sufficently obnoxious, so make them more so. HDAT parse errors usually mean we won't be able to generate enough of a device-tree to boot so we want to make this much more obvious. Suggested-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Parse BMC nodes much earlierOliver O'Halloran2017-03-071-0/+1
| | | | | | | | | | This moves the parsing of the BMC and LPC details to the start of the HDAT parsing. This allows us to enable the Skiboot log console earlier so we can get debug output while parsing the rest of the HDAT. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Acked-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata_to_dt: Specify PVR on command lineStewart Smith2017-02-164-97/+110
| | | | | | | | | Current tests cases are just P8E chips, so specify that. An exercise for the reader is to grab POWER7 and POWER9 dumps. [Minor fixups for the blob patch - Oliver] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/test: Remove old testcase outputOliver O'Halloran2017-02-162-2885/+0
| | | | | | | Gets rid of the non-dts test cases. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata_to_dt: Only output dtbStewart Smith2017-02-163-39/+21
| | | | | | | | | | | convert test cases to diff DTS rather than DTB. This means we also have to build dtc on CentOS 7 to be able to run the test suite. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> [oohall@gmail.com moved the test cases into seperate patches] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/test: Add DTS output for the test casesOliver O'Halloran2017-02-162-0/+3189
| | | | | | | Add the DTS version of the output files. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata/test: strip blobs from the DT outputOliver O'Halloran2017-02-163-10294/+64
| | | | | | | | | | | | | | | | | Adds a post-processing step the hdata_to_dt test program that replaces large "blobs" in the device tree with a <0xcafebeef, length, checksum> u32 tuple. The actual contents of these blobs are mostly irrelevant. We only care that they are a) present in the device tree and b) aren't silently corrupted by the HDAT parser. Outputting a checksum instead of the full blob is sufficent for testing the parser. This reduces the size of the test case output considerably so hopefully we stop crashing everyone's mail client whenever the tests are changed. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Add FDT output to hdata_to_dtOliver O'Halloran2017-02-062-4/+94
| | | | | | | | | Adds a new -d <filename> command line option to the hdata_to_dt utility to output a FDT blob. This lets us output the output DT in standard form that can be handled by the usual tools such as dtc. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdata: Fix ibm,pa-features for all CPU typesBenjamin Herrenschmidt2017-02-021-0/+3
| | | | | | | | | Hopefully the values are all right ;-) A future TODO is to use some nice macro to make it clearer who is what. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: fake PVR_VERS_MAJ, use size_t] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: Grab vendor information from HDAT when availableVasant Hegde2017-01-162-2/+2
| | | | | | | | | | | | | 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: Rework service procesor information parsingOliver O'Halloran2017-01-162-2/+2
| | | | | | | | | | With OpenPower machines using HDAT on P9 the SPINFO structures have been amended to support BMCs in addition to the FSP. This patch reworks the existing parsing to prepare for adding BMC support. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [stewart@linux.vnet.ibm.com: s/UNK/UNKNOWN/ suggested by Vasant] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hdat: stop using proc_int_line in favor of pirOliver O'Halloran2017-01-152-26/+26
| | | | | | | | | | This field has been deprecated in the P9 HDAT format. Due to how XICS works proc_int_line has always been equal to the pir field of the same structure. This equality has always been enforced by an assert() in skiboot on P7 and P8 so it's safe to just look at the pir field instead. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud