aboutsummaryrefslogtreecommitdiff
path: root/hw/prd.c
AgeCommit message (Collapse)AuthorFilesLines
2017-06-08SBE: Add passthrough command supportVasant Hegde1-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>
2017-06-06prd: Implement firmware side of opaque PRD channelJeremy Kerr1-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>
2017-05-26mem_region: rename HW_RESERVE to FW_RESERVEOliver O'Halloran1-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>
2017-04-28prd: clean up prd messagingOliver O'Halloran1-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>
2017-04-28prd: Fix PRD scoms for P9Ananth N Mavinakayanahalli1-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>
2017-01-05treewide: squash sparse static warningsAndrew Donnellan1-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>
2016-09-26occ/prd/opal-prd: Queue OCC_RESET event message to host in OpenPOWERShilpasri G Bhat1-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>
2015-09-01Rename send_pending_events() to send_next_pending_event()Stewart Smith1-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>
2015-09-01Fix scan-build warning of value stored to event is never usedStewart Smith1-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>
2015-06-19hw/prd: Fix handling of invlid message typesJeremy Kerr1-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>
2015-05-21prd: Don't expose full opal_prd_msg to kernelJeremy Kerr1-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>
2015-05-21hw/prd: Expose prd ranges via device treeJeremy Kerr1-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>
2015-05-01prd: Only alter host presentation bits of IPOLL maskJeremy Kerr1-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>
2015-04-01Remove redundant includes of opal-api.hMichael Ellerman1-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>
2015-03-04hw/prd: Add firmware PRD handling subsystemJeremy Kerr1-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>