summaryrefslogtreecommitdiffstats
path: root/hw/prd.c
Commit message (Collapse)AuthorAgeFilesLines
* prd: Log unsupported message typeVasant Hegde2017-12-141-0/+4
| | | | | | | | | | | | Useful for debugging. Sample output: [29155.157050283,7] PRD: Unsupported prd message type : 0xc CC: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* opal-prd: occ: Add support for runtime OCC load/start in ZZShilpasri G Bhat2017-12-141-0/+17
| | | | | | | | | | | | | This patch adds support to handle OCC load/start event from FSP/PRD. During IPL we send a success directly to FSP without invoking any HBRT load routines on recieving OCC load mbox message from FSP. At runtime we forward this event to host opal-prd. This patch provides support for invoking OCC load/start HBRT routines like load_pm_complex() and start_pm_complex() from opal-prd. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* opal-prd: Add support for runtime OCC reset in ZZShilpasri G Bhat2017-12-141-0/+21
| | | | | | | | | | This patch handles OCC_RESET runtime events in host opal-prd and also provides support for calling 'hostinterface->wakeup()' which is required for doing the reset operation. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* prd: Enable error logging via firmware_request interfaceVasant Hegde2017-12-141-0/+13
| | | | | | | | | | | In P9 HBRT sends error logs to FSP via firmware_request interface. This patch adds support to parse error log and send it to FSP. CC: Jeremy Kerr <jk@ozlabs.org> CC: Daniel M Crowell <dcrowell@us.ibm.com> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* SBE: Add passthrough command supportVasant Hegde2017-06-081-0/+13
| | | | | | | | | | | | SBE sends passthrough command. We have to capture this interrupt and send event to HBRT via opal-prd (user space daemon). This patch adds minimal SBE code to capture SBE interrupt and send event to opal-prd. Next patch will add opal-prd (user space) support. CC: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* prd: Implement firmware side of opaque PRD channelJeremy Kerr2017-06-061-12/+76
| | | | | | | | | | | | | | This change introduces the firmware side of the opaque HBRT <--> OPAL message channel. We define a base message format to be shared with HBRT (in include/prd-fw-msg.h), and allow firmware requests and responses to be sent over this channel. We don't currently have any notifications defined, so have nothing to do for firmware_notify() at this stage. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> CC: Daniel M Crowell <dcrowell@us.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* mem_region: rename HW_RESERVE to FW_RESERVEOliver O'Halloran2017-05-261-1/+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>
* prd: clean up prd messagingOliver O'Halloran2017-04-281-31/+15
| | | | | | | | | | Skiboot should only send PRD messages to the host kernel if the platform has enabled opal-prd. This is done via overwriting a function pointer when the PRD is enabled, but this can be replaced with a simple if check. Cc: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* prd: Fix PRD scoms for P9Ananth N Mavinakayanahalli2017-04-281-16/+45
| | | | | | | | | | The IPOLL register addresses have changed from P8. Also indicate what the specific register bits are for in the #defines. Signed-off-by: Ananth N Mavinakayanahalli <ananth@linux.vnet.ibm.com> [Moved inline into prd_init and added a default case -oliver] Signed-off-by: Oliver O'Halloran <oohall@gmail.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* treewide: squash sparse static warningsAndrew Donnellan2017-01-051-1/+1
| | | | | | | | | | Add static to various declarations that can use it, as found by sparse. It turns out that one of these (fsp_pcie_inv_lock in platform/ibm-fsp/firenze.c) is actually unused, so remove it. Signed-off-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* occ/prd/opal-prd: Queue OCC_RESET event message to host in OpenPOWERShilpasri G Bhat2016-09-261-0/+4
| | | | | | | | | | | | | | | | | During an OCC reset cycle the system is forced to Psafe pstate. When OCC becomes active, the system has to be restored to its last pstate as requested by host. So host needs to be notified of OCC_RESET event or else system will continue to remian in Psafe state until host requests a new pstate after the OCC reset cycle. This patch defines 'OPAL_PRD_MSG_TYPE_OCC_RESET_NOTIFY' to notify OPAL when opal-prd issues OCC reset. OPAL will queue OCC_RESET message to host when it receives opal_prd_msg of type '*_OCC_RESET_NOTIFY'. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Rename send_pending_events() to send_next_pending_event()Stewart Smith2015-09-011-5/+5
| | | | | | | It only sends one event, so this name is more accurate. Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org>
* Fix scan-build warning of value stored to event is never usedStewart Smith2015-09-011-6/+0
| | | | | | | | | | | | | | | | | | In send_pending_events() we set event to the type of event received yet did nothing with it. This seems to be a left over bit of code, as what does happen is on consuming the message (prd_msg_consumed) we'll clear the event bit and then send the next event: 120 if (event) 121 events[proc] &= ~event; 122 prd_msg_inuse = false; 123 send_pending_events(); 124 unlock(&events_lock); Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org>
* hw/prd: Fix handling of invlid message typesJeremy Kerr2015-06-191-2/+4
| | | | | | | | | | | | | | If we get a prd_message_consumed callback from the opal_msg interface, and it has an invalid message type, then we'll end up returning with the events_lock held. This really shouldn't happen (as we have handlers for all message types that we queue), but we should still handle this gracefully. This change fixes the error path to log and error and send any further queued messages. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* prd: Don't expose full opal_prd_msg to kernelJeremy Kerr2015-05-211-8/+16
| | | | | | | | | | | | | The kernel is only accessing part of struct opal_prd_msg, and doesn't need to know about the rest. This change moves the "internal" parts of opal_prd_msg to a separate header. In order for the kernel to pass full messages between userspace and firmware, it needs the total size of the struct. We put this in the header for the kernel to access. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hw/prd: Expose prd ranges via device treeJeremy Kerr2015-05-211-0/+30
| | | | | | | | | | | | | | | Currently, the prd reserved ranges are present in the reserved-ranges nodes in the device tree. While this works, it's difficult to filter the actual PRD ranges from general reserved memory. This change links the prd ranges into the /reserved-memory nodes, by adding ibm,prd-label properties to those used for PRD. This change adds a prd node to the ibm,opal node too, to giver kernel & userspace information about the prd infrastructure provided by OPAL. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* prd: Only alter host presentation bits of IPOLL maskJeremy Kerr2015-05-011-4/+6
| | | | | | | | | | | We'll need to leave the FSI presentation bits clear, to allow OCCs to handle the checkstop interrupt. This modifies the PRD code to only touch the host presentation bits, both on init, and in response to incoming PRD actions. Signed-off-by: Jeremy Kerr <jk@ozlabs.org> 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>
* hw/prd: Add firmware PRD handling subsystemJeremy Kerr2015-03-041-0/+360
This change adds Processor Recovery Diagnostics (PRD) code to skiboot firmware. This allows certain hardware RAS events to be handled by a userspace application. The core of the PRD code is a messaging interface to the kernel (and onwards to userspace). PRD events are logged with the prd.c code, and sent to the kernel as opal_msg messages. For responses to these messages, the kernel will reply using a new OPAL call, opal_prd_msg. Only one message is outstanding at a time; we collect events from hardware interrupts (hooked up by subsequent patches), and set per-processor event bits. Once an event has been consumed by the kernel, we clear that event from out pending set, and send any further pending events. Certain events (hardware attentions from the psi layer) need to be masked at interrupt time. For these, we have an acknowledgement facility to clear the mask once the userspace PRD application has cleared the source of the error. Includes multiple contributions from: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Neelesh Gupta <neelegup@linux.vnet.ibm.com> Signed-off-by: Vaidyanathan Srinivasan <svaidy@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
OpenPOWER on IntegriCloud