aboutsummaryrefslogtreecommitdiff
path: root/hdata/test
AgeCommit message (Collapse)AuthorFilesLines
2019-07-26hw/phys-map: Add pvr argument to phys_map_init()Reza Arbab1-1/+1
When new chip types are added, phys_map_init() will need to know which memory map it should use. Instead of directly checking PVR, make it an argument to the function, so that 'make hw-check' can test all the maps. Signed-off-by: Reza Arbab <arbab@linux.ibm.com> Acked-by: Michael Neuling <mikey@neuling.org> Reviewed-by: Andrew Donnellan <ajd@linux.ibm.com> Acked-by: Stewart Smith <stewart@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-07-26SPDX-ify all skiboot codeStewart Smith4-30/+13
Use Software Package Data Exchange (SPDX) to indicate license for each file that is unique to skiboot. At the same time, ensure the (C) who and years are correct. See https://spdx.org/ Signed-off-by: Stewart Smith <stewart@linux.ibm.com> [oliver: Added a few missing files] Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-07-19sparse: hdata/spira sw_xstop_fir_bitpos is uint8_t, has no endianStewart Smith1-1/+1
hdata/spira.c:625:33: warning: incorrect type in argument 1 (different base types) hdata/spira.c:625:33: expected restricted beint32_t [usertype] be_val hdata/spira.c:625:33: got unsigned char [usertype] fir_bit hdata/spira.c:625:33: warning: incorrect type in argument 1 (different base types) hdata/spira.c:625:33: expected restricted beint32_t [usertype] be_val hdata/spira.c:625:33: got unsigned char [usertype] fir_bit Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-07-19sparse: hdata/fsp: u8 doesn't have endianStewart Smith1-1/+1
hdata/fsp.c:271:9: warning: incorrect type in argument 1 (different base types) hdata/fsp.c:271:9: expected restricted beint32_t [usertype] be_val hdata/fsp.c:271:9: got unsigned char const [usertype] uart_int_number hdata/fsp.c:271:9: warning: incorrect type in argument 1 (different base types) hdata/fsp.c:271:9: expected restricted beint32_t [usertype] be_val hdata/fsp.c:271:9: got unsigned char const [usertype] uart_int_number Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
2019-06-04Remove POWER7 and POWER7+ supportStewart Smith1-11/+2
It's been a good long while since either OPAL POWER7 user touched a machine, and even longer since they'd have been okay using an old version rather than tracking master. There's also been no testing of OPAL on POWER7 systems for an awfully long time, so it's pretty safe to assume that it's very much bitrotted. It also saves a whole 14kb of xz compressed payload space. Signed-off-by: Stewart Smith <stewart@linux.ibm.com> Enthusiasticly-Acked-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-03-28hdata/iohub: Look for IOVPD on P9Oliver O'Halloran2-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>
2019-03-20hdata_to_dt: fail "gracefully" on fatal op_display()Stewart Smith2-1/+11
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2019-02-20hdata/test: Add OP920 HDAT test dataOliver O'Halloran3-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>
2019-02-20hdata/test: Fix up linux,sml-base propertyOliver O'Halloran1-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>
2019-02-10Add PVR_TYPE_P9PReza Arbab1-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>
2018-11-26hdata/test: workaround dtc bugsStewart Smith2-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>
2018-07-18Fixup unit tests for cpu_queue_job() in mem_region.cStewart Smith2-2/+9
Fixes: 06808a037d44231ba36e814ff1dbf66bc8b707da Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-07-15cpu: add cpu_queue_job_on_node()Nicholas Piggin2-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>
2018-06-27vpd: Sanitize VPD dataVasant Hegde2-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>
2018-05-29hdata/tests/stubs.c: fix GCC8 warningStewart Smith1-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>
2018-04-30hdat_to_dt: hash_prop the same on all platformsStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.ibm.com>
2018-04-23hdata: Fix DIMM size propertyVasant Hegde2-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>
2018-04-11hdata/spira: parse vpd to add part-number and serial-number to xscom@ nodeStewart Smith2-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>
2018-01-14hdata/vpd: Fix DTC warningsOliver O'Halloran2-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>
2017-12-20lock: Add additional lock auditing codeBenjamin Herrenschmidt1-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>
2017-12-18hdata/tpmrel.c: add firmware event log info to the tpm nodeClaudio Carvalho1-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>
2017-12-18hdata: Add memory hierarchy under xscom nodeVasant Hegde2-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>
2017-12-18make check: Make valgrind optionalMichael Ellerman1-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>
2017-12-13hdata: Add location code property to xscom nodeVasant Hegde2-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>
2017-10-16hdata/vpd: Rework vpd node creation logicVasant Hegde2-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>
2017-09-20core: POWER9 implement OPAL_SIGNAL_SYSTEM_RESETNicholas Piggin1-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>
2017-09-18hdat: fix parsing of P8 hdatStewart Smith1-1/+1
Also fixes hdat_to_dt test cases. Fixes: ad484081ef8a51811e7902aec436fa8f1ca9604a Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-24hdata_to_dt: free device tree on error pathStewart Smith1-0/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-11hdata_to_dt: use a realistic PVR and chip revisionStewart Smith3-42/+53
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-19hdata_to_dt: Add PVR overrides to the usage textOliver O'Halloran1-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>
2017-06-15core: Move enable_mambo_console() into chip initialisationMichael Ellerman1-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>
2017-06-06hdata/test: Add memory reservations to hdata_to_dtOliver O'Halloran2-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>
2017-05-26hdata: Reserve Trace AreasOliver O'Halloran1-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>
2017-05-26mem_region: Add HW-only memory resevationsOliver O'Halloran1-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>
2017-05-26mem_region: rename HW_RESERVE to FW_RESERVEOliver O'Halloran1-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>
2017-05-16hdata_to_dt: Output up to PR_DEBUGOliver O'Halloran1-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>
2017-05-16hdata: Add no-op stub functionsOliver O'Halloran1-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>
2017-05-10test/hdata_to_dt: fix build breakage caused by phys_map_getStewart Smith1-0/+3
Fixes: 5f67c1e253788691d376e4e639d4a6e7785efa55 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-10hdata/test: Fix proc_gen when testingOliver O'Halloran3-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>
2017-04-07hdat: parse processor attached i2c devicesOliver O'Halloran1-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>
2017-04-05hdat: Add model-name property for OpenPower systemVasant Hegde2-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>
2017-04-05hdat: Read description from ibm, vpd binary blobVasant Hegde2-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>
2017-03-31hdata/test: Updates to the dts for new VPD propertiesAnanth N Mavinakayanahalli2-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>
2017-03-30hdata: print backtraces on HDAT errorsOliver O'Halloran1-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>
2017-03-07hdat: Parse BMC nodes much earlierOliver O'Halloran1-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>
2017-02-16hdata_to_dt: Specify PVR on command lineStewart Smith4-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>
2017-02-16hdata/test: Remove old testcase outputOliver O'Halloran2-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>
2017-02-16hdata_to_dt: Only output dtbStewart Smith3-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>
2017-02-16hdata/test: Add DTS output for the test casesOliver O'Halloran2-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>
2017-02-16hdata/test: strip blobs from the DT outputOliver O'Halloran3-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>