aboutsummaryrefslogtreecommitdiff
path: root/hdata/spira.c
AgeCommit message (Collapse)AuthorFilesLines
2017-09-15hdata: Parse extra NVLink infoOliver O'Halloran1-1/+29
Add parsing for the link speed information and the OCC GPU presence flags. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-15hdata: Parse NVLink informationOliver O'Halloran1-0/+168
Add the per-chip structures that descibe how the A-Bus/NVLink/OpenCAPI phy is configured. This generates the npu@xyz nodes for each chip on systems that support it. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-09-15hdata: Add xscom_to_pcrd()Oliver O'Halloran1-0/+39
Iterating the SPPCRD structures (per chip data) is a fairly common operation in the HDAT parser. Iterating the tuples directly is somewhat irritating since we need to check for disabled chips, etc on every pass. A better way to handle this is to iterate throught he xscom nodes (generated from the SPPCRD data) and map from the xscom node to the originating structure. This patch adds a function to do that. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-22opal: Extract sw checkstop fir address from HDAT.Mahesh Salgaonkar1-1/+24
Extract sw checkstop fir address info from HDAT and populate device tree node ibm,sw-checkstop-fir. This patch is required for OPAL_CEC_REBOOT2 OPAL call to work as expected on p9. With this patch a device property 'ibm,sw-checkstop-fir' is now properly populated: # lsprop ibm,sw-checkstop-fir ibm,sw-checkstop-fir 05012000 0000001f Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Tested-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-22HDAT/device-tree: only add lid-type on pre-POWER9 systemsStewart Smith1-2/+4
Largely a relic of back when we had multiple entry points into OPAL depending on which mechanism on an FSP we were using to get loaded, this isn't needed on modern P9 as we only have one entry point (we don't do the PHYP LID hack). Fixes: https://github.com/open-power/skiboot/issues/82 Reported-by: Pavaman Subramaniyam <pavsubra@linux.vnet.ibm.com> Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-10hdata/spira: POWER9 NX isn't software compatible with P7/P8 NX, don't claim soStewart Smith1-8/+10
Fixes: 2512953c7c6dc3b479d159d9bce8206219951164 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-01nx: Add device tree node for Power9Sukadev Bhattiprolu1-0/+3
Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-08-01vas: Create xscom DT node in hdataSukadev Bhattiprolu1-0/+15
Create the VAS xscom node in hdata and use that when initializing VAS. Suggested-by: Ben Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Sukadev Bhattiprolu <sukadev@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-07-13HDAT: Add IPMI sensor data under /bmc nodeVasant Hegde1-0/+1
Add IPMI sensor data under /bmc node. CC: Joel Stanley <joel@jms.id.au> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Joel Stanley <joel@jms.id.au> Tested-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-06-26Big log level reduction...Benjamin Herrenschmidt1-1/+1
90% of what we print isn't useful to a normal user. This dramatically reduces the amount of messages printed by OPAL in normal circumstances. We still need to add a way to bump the log level at boot based on a BMC scratch register or some HDAT 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>
2017-05-03hdata: indicate when booted with elevated risk levelOliver O'Halloran1-0/+5
When the system is IPLed with an elevated risk level Hostboot will set a flag in the IPL parameters structure. Parse and export this in the device tree at: /ipl-params/sys-params/elevated-risk-level Cc: Adrian Barrera <abarrera@us.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-05-01hdata/spira.c: Add device-tree bindings for nest mmuAlistair Popple1-0/+17
The nest mmu will only get initialised by opal_nmmu_set_ptcr() if the appropriate device-tree entries exist. Add them during hdata parsing. Signed-off-by: Alistair Popple <alistair@popple.id.au> Acked-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-1/+3
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-03-07hdat: Parse BMC nodes much earlierOliver O'Halloran1-2/+5
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-06hdat: Don't display "IPLPARAMS: No serial ports" on OPPBenjamin Herrenschmidt1-4/+2
The IPLPARAMs lacking serial ports isn't an error. Since it never happened on FSP machine and it's not used on BMC ones there is no need to print a message at all Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-16Fixup duplicate p9 entries in spira/xscomStewart Smith1-4/+0
Fixes: 0d81bda68f2b7adcecf268522ab9149b91115739 Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-16hdat: Fix XSCOM nodes for P9Benjamin Herrenschmidt1-1/+19
The address mapping for multiple chips is different Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-16hdat: Remove deprecated 'ibm, mem-interleave-scope' from DTVasant Hegde1-1/+3
Memory interleaving scope under PCIA strcture is deprecated on P9. Also I don't see anyone in OPAL/kernel using this property. Hence remove this property from P9 DT. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-16hdat: Grab vendor information from HDAT when availableVasant Hegde1-0/+10
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>
2017-01-16hdat: parse and export STOP levelsOliver O'Halloran1-0/+59
ISAv3 added the STOP instruction to act as a front end to the various power saving modes. The exact function of the stop instruction is implementation dependent and the firmware must advertise which "stop levels" are supported. This patch adds the required HDAT parsing and exports the "ibm,enabled-stop-levels" devicetree node for use inside of skiboot. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-15hdat: create XIVE nodes under each xscom nodeOliver O'Halloran1-0/+14
Adds the XIVE node under each chip's XSCOM controller node. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-15hdat: Add P9 compatible propertyVasant Hegde1-0/+7
Add p9 compatible property for various nodes. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [oohall@gmail.com: remove ibm,power9-nx compat] Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2017-01-15hdat: Add new fields to IPL params structureVasant Hegde1-23/+40
Add new fields to sys params structure and update sys family for p9. In P9 the compatible string is supplied by hostboot through the HDAT. This patch add support for using these strings to set the compatible property in the device tree rather than using the machine ID number scheme traditionally used in the HDAT. [removed ibm,firenze from, add some prints - Oliver] Signed-off-by: Oliver O'Halloran <oohall@gmail.com> [Folded Oliver's changes to original patch - Vasant] Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> [stewart@linux.vnet.ibm.com: fixup test case] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-21tree-wide: use dt_add_property_u64s() where we canOliver O'Halloran1-4/+2
A few places (mostly old code) were using: add_property_cells(hi32(number), lo32(number)); This patch converts them to use the helper rather than doing it manually. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-21hdat: Add PSI HB xscom detailsVasant Hegde1-0/+5
Add PSI HB XSCOM address. SCOM address and length is taken from p9 example dts (doc/device-tree/examples/power9-phb4.dts). Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> CC: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-21hdat: Add processor version check for hs service ntupleVasant Hegde1-0/+4
Host services ntuple is deprecated on P9. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-12-20hdat: add_iplparams_serial - Validate HDIF_get_iarray_size() return valueVasant Hegde1-1/+1
Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-09-27HDAT: Fix typo in nest-frequency propertyVasant Hegde1-1/+1
nest-frquency -> nest-frequency Fixes: 5cda6f6d (platforms/firenze: Fix I2C clock source frequency) CC: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-09-27core/init: create the dt root in main_cpu_entryOliver O'Halloran1-2/+0
This is created seperately when parsing the hdat and when expanding the DT. There is no real reason for this and it makes more sense to create it in the main init path. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-09-27core/init: remove master_cpu parameterOliver O'Halloran1-9/+6
master_cpu is used to determine the ChipTOD master if no ChipTOD information is available in the HDAT. However, it is set to zero at every skiboot entry point (fdt_entry, the 0x180 FSP entry and opal_boot_trampoline) and is otherwise unused. This patch removes this passing around and uses the boot CPU PIR to find the ChipTOD master rather than zero. Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-07-28hdat/vpd: Add chip-id property to processor chip node under vpdVasant Hegde1-4/+11
We have core information under /cpus node and processor chip VPD data (like SN, LN, etc) under /vpd directory. Presently we don't have any property to relate cores and chip information. This patch adds chip-id information for processor chip nodes under vpd. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-05-18hdata: Make hdata_to_dt more suitable for fuzzingStewart Smith1-2/+5
We make parse_hdat() return success/failure rather than assert. This allows the hdata_to_dt binary to gracefully error out rather than assert, which is useful when throwing it at a fuzzer. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-04-01hdata: Enable SPIRA-HVasant Hegde1-0/+48
Update the SPIRA-H pointer in the NACA so that the FSP can build and pass the SPIRA-S structure to OPAL instead of the legacy SPIRA. Older systems (which does not support SPIRA-H) ignores SPIRA-H pointer and continue to pass legacy SPIRA. "spira" is a global structure and referred everywhere inside hdata dir. Once we enable SPIRA-H we get data in SPIRA-S area, not in legacy spira. Hence fixup spira structure, so that we don't break building device tree. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-04-01hdata: Initialize SPIRA-H structureVasant Hegde1-0/+46
Previous patch reduced reserved space in spira structure. Now its safe to reduce the memory for spira section from 2K to 1K. Create separate memory section with 1K size for SPIRA-H. Also initialize SPIRA-H. FSP makes use of this information to pass various boot time data (like SPIRA-S, etc) to host. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2016-03-08platforms/firenze: Fix I2C clock source frequencyGavin Shan1-0/+19
The I2C master clock source frequency is hardcoded to wrong value. The correct frequency should be the nest clock frequency divided by 16 as Ben said. This fixes I2C master source frequency with the help of additional properties "nest-frequency" and "bus-frequency" to root and xscom device node separately. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: fixup hdata test for added property] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-11-10sparse: fix beint32_t degrades to int wantings in hdata/spira.cStewart Smith1-2/+2
hdata/spira.c:757:14: warning: restricted beint32_t degrades to integer hdata/spira.c:773:14: warning: restricted beint32_t degrades to integer Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07hdata/vpd: Add compatible propertyVasant Hegde1-0/+1
That way user space tools can identify the change in VPD layout etc. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07FSP/hdata: Populate System Attention Indicator location codeVasant Hegde1-0/+3
On FSP based machine, FSP controls System Attention Indicator. This indicator detail (location code) is passed to OPAL via HDAT. OPAL can get/set this indicator via normal MBOX command. This patch takes care of parsing SLCA entry and populating device tree with SAI location code. Device Tree: We create '/ibm,opal/led' node which contains all location code LED information. 'led-types' property under each node tells LED type. For SAI indicator 'led-types' property will be 'attention'. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07hdata: Detect LED mode and populate device treeVasant Hegde1-0/+12
FSP based machine supports two different LED modes: - Light Path : Both identify and fault LEDs are supported - Guiding Light: Only identify LEDs are supported And this information is passed to OPAL via HDAT. Lets parse this and populate the device tree. Later LED driver uses this information to populate indivisual LED node. Device Tree property: /ibm,opal/led/led-mode : lightpath/guidinglight Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2015-05-07hdata: Create LED nodeVasant Hegde1-0/+20
Unfortunately we do not have single place to get all LED related information (Some of the information is passed via HDAT and rest via MBOX command). Lets create led node before parsing HDAT and use this node to populate all LED related information. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-11-18Remove useless global include memory.hBenjamin Herrenschmidt1-1/+0
It only exposed one function that is local to the hdat stuff Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-10-15Increase verbosity of CHIPTOD to PR_DEBUGStewart Smith1-3/+3
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Reduce severity of XSCOM detection log message to PR_INFOStewart Smith1-1/+1
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Only print SPIRA discovered serial port info at PR_INFO priorityStewart Smith1-3/+3
It's certainly not an error that we have a serial port, and not essential to display during boot. Odds are, you already know about the serial port. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-10-15Reduce the amount of text 'parsing hdat' uses.Stewart Smith1-9/+3
We can, by default, deal with just two lines rather than 5 of ASCII art Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
2014-08-15hdata/test: Fix broken testsJoel Stanley1-0/+4
Commit e810dcbc (ATTN: Set up attention area to handle attention) broke tests, as the familiy of CPU_TO_BEXX macros are not compile time constant. hdata/test/../spira.c:60:4: error: initializer element is not constant .addr = CPU_TO_BE64((unsigned long)&(cpu_ctl_spat_area) + SKIBOOT_BASE) There is no test coverage of this code, so for now we can comment out these areas in order to allow the tests to pass. Signed-off-by: Joel Stanley <joel@jms.id.au> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-08-01ATTN: Set up attention area to handle attentionAruna Balakrishnaiah1-0/+36
At present CPU control area ntuple in SPIRA structure is NULL. ATTN component in Service Processor side checks for this field and if its empty, it logs hardcoded SRC (0xBB821410) and generates SYSDUMP. So we have 1 SRC for all failure (assert call) from OPAL side. This makes difficult to debug the issue. Service processor provides attention area interface (FIPS PHyp Attentions spec), so that we can pass SRC and user data (error message) to service processor. This will helps us identify different failures in OPAL. This patch enables attention area and provides interface (update_sp_attn_area()) to add src and user data (error message) through assert macro. Attention SRC format: 1st byte - Opal src type 2-4 bytes - Holds the address of the assert function call Signed-off-by: Aruna Balakrishnaiah <aruna@linux.vnet.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-31MDST: Rename function name and variable orderVasant Hegde1-2/+2
- Better function naming - Better macro naming - Re-ordered function variables - calculate max_mdst_entry after allocating memory for mdst table. No change in functionality. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
2014-07-02Initial commit of Open Source releaseBenjamin Herrenschmidt1-0/+965
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>