summaryrefslogtreecommitdiffstats
path: root/core/opal.c
Commit message (Collapse)AuthorAgeFilesLines
* Big log level reduction...Benjamin Herrenschmidt2017-06-261-2/+2
| | | | | | | | | | | | | 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>
* FSP: Notify FSP of Platform Log ID after Host Initiated Reset ReloadStewart Smith2017-05-101-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Trigging a Host Initiated Reset (when the host detects the FSP has gone out to lunch and should be rebooted), would cause "Unknown Command" messages to appear in the OPAL log. This patch implements those messages How to trigger FSP RR(HIR): $ putmemproc 300000f8 0x00000000deadbeef s1 k0:n0:s0:p00 ecmd_ppc putmemproc 300000f8 0x00000000deadbeef Log showing unknown command: / # cat /sys/firmware/opal/msglog | grep -i ,3 [ 110.232114723,3] FSP: fsp_trigger_reset() entry [ 188.431793837,3] FSP #0: Link down, starting R&R [ 464.109239162,3] FSP #0: Got XUP with no pending message ! [ 466.340598554,3] FSP-DPO: Unknown command 0xce0900 [ 466.340600126,3] FSP: Unhandled message ce0900 The message we need to handle is "Get PLID after host initiated FipS reset/reload". When the FSP comes back from HIR, it asks "hey, so, which error log explains why you rebooted me?". So, we tell it. Reported-by: Pridhiviraj Paidipeddi <ppaidipe@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/init: Use '_' as separator in names of "exports" propertiesMichael Ellerman2017-04-051-2/+7
| | | | | | | | | | | | | | | | The names of the properties under /ibm,opal/firmware/exports are used directly by Linux to create files in sysfs. To remain consistent with the existing naming of OPAL sysfs files, use '_' as the separator. In particular for the symbol map which is already exported separately, it's cleaner for the two files to have the same name, eg: /sys/firmware/opal/exports/symbol_map /sys/firmware/opal/symbol_map Fixes: 9ffbfe269ec6 ("core/init: Add hdat-map property to OPAL node") Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/init: Add hdat-map property to OPAL nodeMatt Brown2017-03-241-0/+29
| | | | | | | | | | Exports the HDAT heap to the OS. This allows the OS to view the HDAT heap directly. This allows us to view the HDAT area without having to use getmemproc. Signed-off-by: Matt Brown <matthew.brown.dev@gmail.com> Reviewed-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/opal: check ibm,opal existsOliver O'Halloran2017-02-171-5/+1
| | | | | | | | | | | The ibm,opal node is normally created by Skiboot either in the HDAT parser or after the input FDT has been unflattened. However, in order to supply the /ibm,opal/power-mgt/enabled-stop-states property FDT we to tolerate /ibm,opal/ existing in the input tree. 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>
* Initial support for the ELFv2 ABINicholas Piggin2017-02-061-5/+3
| | | | | | | | | | | | Provide an experimental option to compile using ELFv2 ABI even on big endian builds. ELFv2 + BE is not officially supported by the toolchain, but it works quite well. It may be useful as a small step toward a little-endian build. This saves about 200kB of text/data. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* tree-wide: use dt_add_property_u64s() where we canOliver O'Halloran2016-12-211-3/+1
| | | | | | | | | | | | 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>
* Limit number of "Poller recursion detected" errors to displayStewart Smith2016-11-241-1/+5
| | | | | | | | | | | | In some error conditions, we could spiral out of control on this and spend all of our time printing the exact same backtrace. Limit it to 16 times, because 16 is a nice number. Cc: stable 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.vnet.ibm.com>
* core: Create event node to enable irqchipSam Mendoza-Jonas2016-09-221-0/+7
| | | | | | | | | This allows devices such as IPMI and serial consoles to use dynamic irq numbers and have separate irq numbers in Linux. Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com> Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Use additional checks in skiboot for pointersBalbir Singh2016-08-171-0/+4
| | | | | | | | | | | The checks validate pointers sent in using opal_addr_valid() in opal_call API's provided via the console, cpu, fdt, flash, i2c, interrupts, nvram, opal-msg, opal, opal-pci, xscom and cec modules Signed-off-by: Balbir Singh <bsingharora@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* device-tree: Only advertise ibm, opal-v3 (not v2) on POWER9 and aboveStewart Smith2016-07-201-2/+7
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/opal.c: Add FWTS annotations for pollers and missing OPAL_CHECK_TOKENStewart Smith2016-06-271-2/+30
| | | | | | | | | | | | | | | For the missing OPAL_CHECK_TOKEN call, it means we catch kernel bugs in the firmware test suite, which I guess is a valid thing to do, if slightly odd. Unfortunately, kernels for POWER8 systems shipped with this (totally harmless) bug, so it's possible that if FWTS is run on older POWER8 PowerNV kernels, this warning will be hit. On POWER9 and above though, this warning should never be hit. The annotations for pollers should also never be hit, although I'm not convinced we don't have a spot or two in OPAL where this could still be the case (specifically, under certain error conditions). Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add fwts annotations for critical errorsStewart Smith2016-06-201-0/+5
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix sparse warnings in opal_trace_entry()Stewart Smith2015-11-091-5/+6
| | | | | | | | | Need to flip things appropriately for endian annotations No actual functional changes since skiboot is still BE, but we're a bit more explicit about the fact the ABI is BE. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fixup sparse endian annotations for opal events and masksStewart Smith2015-11-091-2/+2
| | | | | | This fixes many spurious sparse warnings Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* slw: Move add_cpu_idle_state_properties() to add_opal_node()Shilpasri G Bhat2015-10-301-0/+1
| | | | | | | | | | | | | 05f52a8dd7c7e402896e049fd24f83d56b70aff4 core: Setup the OPAL DT node before platform probe add_cpu_idle_state_properties() was made local to slw.c in the above commit which caused p7 systems to not populate the nap idle state in DT. So moving add_cpu_idle_state_properties() to add_opal_node to fix this bug. Reported-by: Aneesh Kumar K.V <aneesh.kumar@linux.vnet.ibm.com> Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Remove FIXME for using atomics for opal_pending_eventsStewart Smith2015-09-101-1/+0
| | | | | | | The locking code is obviously correct and it's never shown up in a profile - so it's likely fine for a while yet. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* remove FIXME from opal_trace_entryStewart Smith2015-09-101-1/+0
| | | | | | | | We unlikely need this as ASM until somebody finds it to be a problem. So removing the FIXME so that it doesn't show up when grepping for FIXMEs. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fix potential integer overflow for giant cpu_max_pirStewart Smith2015-07-081-1/+1
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* OPAL: Validate before creating opal device tree nodeVasant Hegde2015-05-071-1/+5
| | | | | | | | | | | | | | On FSP based machine, attention LED location code is passed to OPAL via HDAT. We want to populate this information in device tree under led node, so that LED driver can use this information. Presently we are creating '/ibm,opal' node after parsing hdata information. This patch validates '/ibm,opal' node before creating. So on FSP based machine we can create this node in hdata itself without breaking. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Remove redundant includes of opal-api.hMichael Ellerman2015-04-011-1/+0
| | | | | | | | Now that opal.h includes opal-api.h, there are a bunch of files that include both but don't need to. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* OPAL: Detect recursive poller entry from same CPUVasant Hegde2015-03-191-0/+11
| | | | | | | Detect recursive opal poller call from same CPU. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Limit number of warnings of pollers run with lock heldStewart Smith2015-02-181-1/+6
| | | | | | | | Otherwise we pretty much spin in printing backtraces on some machines. A limit of 64 per boot is likely to give us enough bugs to fix. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Warn when pollers are called with a lock heldBenjamin Herrenschmidt2015-02-181-0/+5
| | | | | | | So we can start fixing those cases Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Move skiboot internal things from opal.h to opal-api.hStewart Smith2015-02-061-0/+1
| | | | | | | | | | This is probably not the best collection of things in the world, but it means that opal.h is much closer to being directly usable by an OS. This triggers a bunch of #include fixes throughout the tree. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* opal: Don't put the symbol map whole into a propertyBenjamin Herrenschmidt2014-12-051-3/+5
| | | | | | | | | | The huge property trips a bug in some versions of kexec, and it generally makes looking at the device-tree more painful than it has to be. Instead, let's just pass the address & size and we'll add a debugfs file on the Linux side to recover them. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge remote-tracking branch 'ltcgit/master'Benjamin Herrenschmidt2014-11-221-1/+1
|\
| * Implement skiboot versioningStewart Smith2014-11-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We grab a version from git tags (or SKIBOOT_VERSION environment variable), optionally tack on EXTRA_VERSION (if from git) as well as add things to the git version number if we're ahead of the most recent tag or the tree is dirty. Also fix-up makefiles so that we don't have to rebuild version.c every time you run make. fsp attn area needed updating as we can have >40 character version strings. We also export the version string via device tree rather than just the gitid. For buildroot builds, setting SKIBOOT_VERSION environment variable to the tag you grab will do the correct thing. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Add symbolic backtraces and expose skiboot map to LinuxBenjamin Herrenschmidt2014-11-181-0/+2
| | | | | | | | | | | | | | We use a double link technique, doing a first pass with a .o containing a dummy symbol map, then re-linking with a new .o Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* | Stack checking extensionsBenjamin Herrenschmidt2014-11-171-0/+3
|/ | | | | | | | | | | | This patch adds: - Normal builds are done with -fstack-protector (we want to investigate using -fstack-protector-strong on gcc4.9 but for now we just use that - Build with STACK_CHECK=1 will use -fstack-protector-all and -pg and will check the stack in mcount Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* timer: Only check "poll" timers on actual poll, not any interruptBenjamin Herrenschmidt2014-11-121-1/+1
| | | | | | | | Due to the lack of SLW timed interrupt support, we take the opportunity to check out timers on any incoming interrupt. However we really don't want to do that for the background pollers. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* timer: Add scheduled timer facilityBenjamin Herrenschmidt2014-11-071-0/+4
| | | | | | | For now running off the event pollers, that will improve once we get delayed interrupts from the SLW Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* opal: Add facility for dynamic event bitsJeremy Kerr2014-10-301-1/+39
| | | | | | | | We steal opal_update_pending_evt's lock for protecting the allocated dynamic event mask. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* irq/occ/opal: Add self-sent dummy interruptBenjamin Herrenschmidt2014-10-241-3/+18
| | | | | | | | | | | | | This makes OPAL use the OCC interrupt facility to send itself an interrupt whenever the OPAL event bit is set as a result of an OPAL call that wasn't itself opal_handle_interrupt() or opal_handle_hmi() (both of which we know the OS will already deal with appropriately). This ensures that OPAL event changes are notified to Linux via its interrupt path which is necessary for it to properly broadcast the state change to its various clients. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* opal_del_caller shouldn't be called: up severity level, change message.Stewart Smith2014-10-151-1/+2
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Make assert(false) for calling attn be a PR_EMERG level errorStewart Smith2014-10-151-1/+1
| | | | | | | When we do something so severe we're asserting... we want that to be in the log! Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: Setup the OPAL DT node before platform probeBenjamin Herrenschmidt2014-09-011-1/+0
| | | | | | | | | The platform probe code might want to add things to it. While at it, make add_cpu_idle_state_properties() local to slw.c and call it from slw_init() instead of from add_opal_node(). Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* opal: poller re-entrancy try #3Benjamin Herrenschmidt2014-07-131-31/+14
| | | | | | | | | | | So my great attempt at avoiding all re-entencies fails due to HBRT... at least until we have some kind of way to thread things, it will have to re-enter so let's bite the bullet, make the poller list walking lockless (we'll handle removal when we have to, ie, not yet) and slightly extend the coverage of the PSI lock while at it. All the other pollers already have their own locks anyway so we are actually removing some overhead. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* opal: Add a debug helper to check for poller recursionBenjamin Herrenschmidt2014-07-081-1/+21
| | | | | | And check & warn inside opal_run_pollers() as well Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* opal: Replace fsp_poll() with a full run of all OPAL pollersBenjamin Herrenschmidt2014-07-081-10/+15
| | | | | | | | | Otherwise we don't handle surveillance and PSI link monitoring This should fix cases of surveillance timeouts during things like code update such as BZ109939 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* Initial commit of Open Source releaseBenjamin Herrenschmidt2014-07-021-0/+308
Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
OpenPOWER on IntegriCloud