summaryrefslogtreecommitdiffstats
path: root/hw/fsp/fsp.c
Commit message (Collapse)AuthorAgeFilesLines
* fsp: Don't recurse pollers in ibm_fsp_terminateStewart Smith2016-11-241-0/+31
| | | | | | | | | | | If we were to terminate in a poller, we'd call op_display() which called pollers which hit the recursive poller warning, which ended in not much fun at all. This patch will skip the running of pollers and instead run the FSP poller to set the op-panel display before attn. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* psi: Remove psi->workingBenjamin Herrenschmidt2016-08-111-2/+0
| | | | | | | I was only ever set to true Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP: Validate fsp_msg response memory allocationVasant Hegde2016-07-111-1/+7
| | | | | | | | | fsp_allocmsg() returns true even if msg->resp memory allocation fails. Validate msg->resp memory allocation as well. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Reviewed-by: Mukesh Ojha <mukesh02@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp: Add CAPP lid definition for NaplesPhilippe Bergheaud2016-04-271-0/+2
| | | | | Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp: fix spelling of "advertise" in log messageAndrew Donnellan2016-02-231-1/+1
| | | | | Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP: Give up PSI link on shutdownAnanth N Mavinakayanahalli2015-12-011-0/+22
| | | | | | | | | Since we are anyway on the way to standby and apparently the other hypervisor also does this. Tested-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP: Handle DPO initiated CEC shutdown with FSP in RRAnanth N Mavinakayanahalli2015-11-121-3/+17
| | | | | | | | | | | In a scenario where the DPO has been initiated, but the FSP then went into reset before the CEC power down came in, OPAL may not give up the link since it may never see the PSI interrupt. So, if we are in dpo_pending and an FSP reset is detected via the DISR, give up the PSI link voluntarily. Tested-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* move enum ipl_state to hw/fsp/fsp.cStewart Smith2015-09-101-0/+10
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix index of -1 into arrayStewart Smith2015-09-081-1/+3
| | | | | | | | | | In the event that we had no IO paths up, we could index -1 into the array of iopaths, no doubt causing casual amounts of fun. Although, since this is in early boot code only, the possibility of this being a problem is quite slim. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix spelling mistakesStewart Smith2015-08-261-1/+1
| | | | | | See https://github.com/lucasdemarchi/codespel Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* errorlog: Deprecate elog callback parameterSamuel Mendoza-Jonas2015-07-311-1/+1
| | | | | | | | | | There are now no users of the call_out parameter and future users should use the log_append_msg() and log_append_data() functions, so remove all references to call_out. Signed-off-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix potential NULL pointer dereferenceAnanth N Mavinakayanahalli2015-06-191-0/+2
| | | | | | | Safety check... Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Preload VPD LID and set up fsp_lid_load() for async queued loadingStewart Smith2015-05-071-3/+13
| | | | | | | | This means VPD LID is already loaded before we start preloading kernel and initramfs LIDs, thus ensuring VPD doesn't have to wait for them to finish being read from FSP. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP LID loading: always remove from lid_loaded listStewart Smith2015-05-071-4/+2
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Fix FSP resource/LID loading for preloading LIDs.Stewart Smith2015-05-071-5/+9
| | | | 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: Fix an issue where partial LID load causes opal to hang.Mahesh Salgaonkar2015-03-311-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | commit c789772 introduced an asynchronous mechanism to load LID resource for FSP systems. But after this change some of the FSP based system failed to load/boot petitboot kernel. While fetching LID resource in multiple chunks, we depend on return status from FSP whether there is more data available to fetch or not. As per FSP mailbox documentation, fetch cmd returns status=2 which means, there is more data pending, and status=0 means we have reached end-of-file. But in reality FSP don't behave as per the document. It looks like we always get status=0 irrespective of whether end of file is reached or not. The old implementation (fsp_sync_msg) used to rely on (wlen < chunk) check to decide whether we reached end of file or not. Ideally, FSP folks should be fix their code as per documentation. But until they do, adding the old check back here again. Without this patch some system won't be able to boot into petitboot kernel. Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Asynchronous LID/Resource loading for FSP systemsStewart Smith2015-03-241-104/+274
| | | | | | | | | | | | | | | This moves away from using fsp_sync_msg in fsp_fetch_data and instead using the platform hooks for start_preload_resource() to actually queue up a load and having the plumbing for checking if a resource is loaded yet. This gets rid of the "pollers called with locks held" warning we got heaps of previously. You can now boot some FSP systems without getting this warning at all. This also sets the stage for starting load of LIDs much earlier to when they're needed, improving boot time. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Change load_resource() API to be all about preloading.Stewart Smith2015-03-231-7/+7
| | | | | | | | | No functional changes in what happens, just have two calls, one for queueing preload the other for waiting until it has loaded. future patches will introduce platform specific queueing. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp: Fix FSP irq initialization on PSIHBCR for resetsAnanth N Mavinakayanahalli2015-03-171-1/+3
| | | | | | | | During Reset/Reload, we currently enable FSP interrupts on PSIHBCR even before the DISR handshake is complete. Fix that. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* sparse: fix fsp_fillmsg definitionCédric Le Goater2015-02-261-1/+1
| | | | | | | | hw/fsp/fsp.c:920:13: warning: function 'fsp_fillmsg' with external linkage has definition Signed-off-by: Cédric Le Goater <clg@fr.ibm.com> Acked-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* capi: Add CAPI microcode read to load_resource()Michael Neuling2015-02-231-0/+9
| | | | | | | | | | | | | Add ability to read CAPI microcode to load_resource() implementations. We use the cfam chipid as the subid. FSP load_resource() contains a map of cfam chipid to lid numbers. PNOR load_resource() doesn't change, but requires a properly formatted partition with EC values in the TOC matching the appropriate cfam chipid. Signed-off-by: Michael Neuling <mikey@neuling.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp: Audit callers of opal_run_pollersBenjamin Herrenschmidt2015-02-181-5/+15
| | | | | | | Use cpu_relax() and don't call it with a lock held Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core: Add subid to load_resource()Michael Neuling2015-02-171-13/+26
| | | | | | | | | | | | | | | This adds a subid to load_resource() so that sub-partitions can be accessed inside a PNOR partition. These sub-partitions follow the format used by the hostboot SBE image. The subid will match on the EC field of the SBE table of contents. If it's found, only that sub-partition is returned to the caller. Current partitions (kernel and ramfs) don't support sub-partitions. If caller tries to access a sub-partition within these, we fail the call. Signed-off-by: Michael Neuling <mikey@neuling.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>
* FSP: Reset the response outstanding bitmap on reset startAnanth N Mavinakayanahalli2014-12-101-2/+6
| | | | | | | | | | | | | | | Once we have the FSP in reset, we don't expect it to respond to any outstanding mbox commands for which we are expecting one. Reset the bitmap to reflect the same. While there, remove the stale comment about timeout resets. We use the fsp_cmdclass->timeout as a constant for all classes and a value 0 indicates an invalid class entry in the discontiguous fsp_cmdclass[]. The bitmap is what gates whether we process outstanding messages in the class. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* FSP: Fix unused result warnings in fsp driverAnanth N Mavinakayanahalli2014-12-101-9/+60
| | | | | | | | Fix Wunused-result Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Make fsp_freemsg() behave if passed a NULL pointerStewart Smith2014-12-091-1/+1
| | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* fsp: Avoid NULL dereference in case of invalid class_resp bitsBenjamin Herrenschmidt2014-12-091-8/+19
| | | | | | | | | | | | | | When handling timeouts, we appear to do an occasional NULL dereference in fsp_timeout_poll() due to fsp_cmdclass_resp_bitmask being out of sync (bit set but class queue empty). The cause for the discrepancy will be sorted out separately but the code should be more robust. Additionally, add a lock to ensure we don't race on the timer calculations otherwise we might get spurrious dual detection of the timeout. Fixes SW288484 Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* elog: Clean up error logging headersAlistair Popple2014-12-021-1/+1
| | | | | | | | | | | | | | | Commit cf6f4e8912d29fb89ce85c84834607065ad595a5 introduced a platform independent frontend for error logging. However it failed to move the generic parts of the fsp-elog.h header into the platform independent one, instead relying on the fact that up until now fsp-elog.h was included whenever a function needed to log errors. This patch moves the platform independent defines into the frontend header file (errorlog.h) and removes the include of the platform specific header in generic code paths. Signed-off-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* tce: Use TCE macrosNeelesh Gupta2014-12-021-14/+14
| | | | | | | | | Use available TCE mask and size macros to make the code readable and easy to maintain. Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Reviewed-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge branch 'update-2.1.1.1'Stewart Smith2014-11-261-1/+1
|\
| * FSP: Validate fsp_msg in fsp_queue_msgVasant Hegde2014-11-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | There are many places where we just pass fsp_msg without validating whether message allocation succeded or not (like fsp_queue_msg(fsp_mkmsg(...))). If message allocation fails then we endup crashing OPAL. This patch validates fsp_msg before using. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | fsp: Allow loading initramfs resourcesJeremy Kerr2014-10-301-0/+4
| | | | | | | | | | | | | | We have the new 80f00102.lid name for this. Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | platform: add a platform hook for loading external resourcesJeremy Kerr2014-10-301-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, in core/init.c we do a fsp-specific load procedure to grab the kernel image. We'd like to do two things: allow other types of resources, and have paths for non-FSP platforms to perform loads. This change adds a platform-specific load_resource hook, and moves the currently loading code to fsp_load_resource. To allow other resource types, we add an identifier to indicate the type of resouce to load. Signed-off-by: Jeremy Kerr <jeremy.kerr@au.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Perhaps we shouldn't prerror() about the presence of an FSP. perhaps.Stewart Smith2014-10-151-1/+2
| | | | | | | | Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | Make FSP a lot less verbose by setting log priorityStewart Smith2014-10-151-54/+63
| | | | | | | | | | | | Some things are errors, informative or just debug/trace. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | FSP buffer allocation messages can be PR_DEBUG.Stewart Smith2014-10-151-4/+4
| | | | | | | | | | | | Very unlikely to ever actually fail. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* | use prlog(PR_INSANE in hw/fsp/fsp.c in place of DBG ifdefStewart Smith2014-10-081-8/+6
|/ | | | | | | This means that when log level of PR_INSANE is enabled, you will get traces of messages to/from FSP. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* dpo: Move the FSP async messagae handling into a separate fileAnshuman Khandual2014-08-131-47/+0
| | | | | | | | | This patch moves the DPO message handling from FSP core code into a separate file to make it more cleaner and to add OPAL interfaces in the subsequent patch. It does not change anything functionally. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* lock: Fix races when setting in_con_lockBenjamin Herrenschmidt2014-08-081-0/+8
| | | | | | | | | | | When setting the flag in a lock that indicates that it's on the console path, we need to take and release that lock to ensure that any other processor that might have taken it before the flag was set has released it, otherwise the lock might still be held without the console count properly incremented, which can cause it to go negative or cause the deadlock that we mean to avoid by that to still occur. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* FSP: Make mbx error messages more verboseAnanth N Mavinakayanahalli2014-08-081-5/+6
| | | | | | | | ... helps figure out what the cause of the failure was. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Acked-by: Stewart Smith <stewart@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* epow: Enable Environment and Power Warning support in FSP machinesAnshuman Khandual2014-07-301-5/+0
| | | | | | | | | | | | | | | | | | | | | | EPOW informs about the environmental and power situation regarding the system, so thet corrective action can be taken if required. Sapphire interacts in two distinct ways with respect to EPOW events with FSP. FSP sends notification regarding changes in system-panel status (classified as normal ,extended_1, extended_2 depending on information contained). These intimations carry details regarding the prevailing EPOW situation which triggered the notification in the first place. Sapphire can also query about these system-panel status synchronously with FSP, independent of these explicit notifications. This patch enables processing of these explicit FSP notifications related to EPOW events and map them to generic OPAL EPOW events which in turn get communicated to the host above. Host communication has been implemented with OPAL message event interface with OPAL_MSG_EPOW class messages. Host gets notified about the presence of valid EPOW status in the system and subsequently calls for the complete EPOW system status through an exclussive OPAL calls with the token OPAL_GET_EPOW_STATUS. This delivers the entire array of system EPOW status which can then be processed in the host kernel to be forwarded up the stack. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* DPO: Add support for Delayed Power Off sequence on FSP machinesAnshuman Khandual2014-07-251-0/+48
| | | | | | | | | | | | | | | | This enabled DPO sequence handling in Sapphire. Delayed power off notification comes from FSP when the user requests for it through either ASM interface or system front operation panel. After receiving a valid DPO init message from the FSP, Sapphire intimates the host through an OPAL message and then sends an acknowledgement message to the FSP for the last DPO. The host is required to shutdown all the guests, user space programs and then shutdown itself. The shutdown sequence of the host will eventually make the opal call OPAL_CEC_POWER_DOWN receiving which the Sapphire will send a shutdown command to the FSP. Sapphire has got 45 minutes from the time for the initial DPO message to this shutdown command to FSP failing which the FSP will assume that the DPO sequence was successfull both in Sapphire and host, hence force shutdown the system. Signed-off-by: Anshuman Khandual <khandual@linux.vnet.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* FSP: Trigger HIR on more DISR indicationsAnanth N Mavinakayanahalli2014-07-251-4/+10
| | | | | | | | | | | | Per the Reboot and Reset/Reload HLDD, the following indicators in DISR warrant a HIR triggered recovery (in addition to unit check which we already handle): a. Runtime terminated b. Flash terminated Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* FSP: Reset DISR's RR complete for 'protocol' completionAnanth N Mavinakayanahalli2014-07-251-0/+3
| | | | | | | | | Apparently, once the FSP R/R completion is indicated by the R/R complete in DISR, we should clear the same bit to indicate a R/R completion protocol handshake. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* FSP/PSI: Drive FSP reset on HIRAnanth N Mavinakayanahalli2014-07-251-10/+4
| | | | | | | | Currently, we drive the link down when doing a host initated reset. We should ideally reset the FSP and let it bring the link down. Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* FSP: Rework the R/R state machineAnanth N Mavinakayanahalli2014-07-251-13/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a. Do not trigger PSI link down on DISR's RR bit set. b. Do trigger HIR if DISR's Unit Check bit is set. c. On fsp_mbx_err, trigger a HIR (very rare occurance). d. Use fsp_start_rr() when the DISR's RR bit is seen so all mbox activity is stopped when the FSP indicates an RR start. We do not bring the link down voluntarily on DISR's RR begin, pending a PSI interrupt, which actually triggers the link down. Per Dean Sanner, this is the right protocol to follow. The assumption is that a DISR RR bit set would cause a PSI interrupt 'soon'. One TODO is to figure out if this interrupt never arrives. The PSI interrupt does come through albeit after a short while: SURV: [ 1dc662ef7f] Sending the hearbeat command to FSP SURV: Received heartbeat acknowledge from FSP FSP #0: DISR stat change = 0x000000a1 FSP #0: FSP in Reset. Waiting for PSI interrupt FSPCON: Closed consoles on account of FSP reset/reload SURV: Disabling surveillance FSP: Closing NVRAM on account of FSP Reset FSP #0: HDES stat change = 0xffffffff PSI[0x000]: PSI mgmnt interrupt CR=0xfcf0d100c0000000 PSI: PSI Reported Error PSI: PSI Link Inactive Transition PSI: SEMR set to fff0fff00000 PSI[0x000]: Disabling link! PSI: PSIHB_CR (error bits) set to 68f0510040000000 PSI: starting link polling PSI: Spurious interrupt, attempting clear PSI[0x001]: Poll CR=0x00f0100000000000 PSI[0x000]: Poll CR=0x68f0100040000000 PSI[0x001]: Poll CR=0x00f0100000000000 PSI[0x000]: Poll CR=0x68f0100040000000 ... And we recover: PSI[0x000]: Poll CR=0x68f0100040000000 PSI[0x001]: Poll CR=0xccf0300000000000 PSI[0x001]: Found active link! PSI: stopping link polling FSP: Connected to FSP-A FSP #0: DISR stat change = 0x000000a9 FSP #0: DISR stat change = 0x00000281 FSP #0: Detected R&R complete, acking FSP #0: HDES stat change = 0x00000000 FSP #0: DISR stat change = 0x00000081 FSP: FSP assuming new role FSP: SP says Reset/Reload complete Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* FSP/PSI: Start/stop PSI link polling in psi.cAnanth N Mavinakayanahalli2014-07-251-6/+0
| | | | | | | Currently this is done in the FSP code... Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
* FSP: Fix hdes trackingAnanth N Mavinakayanahalli2014-07-251-1/+1
| | | | | | | Fix HDES state change tracking Signed-off-by: Ananth N Mavinakayanahalli <ananth@in.ibm.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
OpenPOWER on IntegriCloud