summaryrefslogtreecommitdiffstats
path: root/include/opal-api.h
Commit message (Collapse)AuthorAgeFilesLines
...
* hw/phb4: Add initial supportBenjamin Herrenschmidt2016-07-081-2/+16
| | | | | | | | | | This adds the base support for the PHB4. It currently only support the M32 window, EEH or in general error recovery aren't supported yet. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: update (C) year, fix indenting] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* XIVE: Base XIVE support for OPAL XICS emulation callsBenjamin Herrenschmidt2016-07-081-4/+4
| | | | | | | | | | | | | This provides basic initialization of the XIVE along with some OPAL calls to emulate an old-style XICS which will initially be used by Linux for backward compatibility. The current implementation is limited to one priority and doesn't expose much to Linux for future exploitation mode yet. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> [stewart@linux.vnet.ibm.com: add (C) header, fix whitespace, missing breaks] Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Reserve OPAL API numbers for XICS emulation for XIVEStewart Smith2016-07-061-1/+5
| | | | | | | | | Additionally, we put in some skeleton docs for what's coming, key points being that this is for P9 and above, relies on a device being present in the device tree and is modelled on the PAPR calls. Suggested-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* slw: Move macros associated with power-mgt nodes to opal-api.hShreyas B. Prabhu2016-06-201-2/+19
| | | | | | | | | Move macros associated with cpuidle fields of power-mgt device tree nodes to opal-api.h This patch does not change any functionality. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* slw: Add Power9 idle states to power-mgt dt nodeShreyas B. Prabhu2016-06-201-0/+10
| | | | | | | | | | | | | | | | | | | POWER ISA v3 defines a new idle processor core mechanism. In summary, a) new instruction named stop is added. This instruction replaces instructions like nap, sleep, rvwinkle. b) new per thread SPR named PSSCR is added which controls the behavior of stop instruction. This SPR subsumes PMICR. This patch adds the supported idle states to power-mgt dt node. It also introduces ibm,cpu-idle-state-psscr and ibm,cpu-idle-state-psscr-mask entries which exposes the value to be written to PSSCR to enter a given stop state. These entries replaces POWER8's counterparts ibm,cpu-idle-state-pmicr and ibm,cpu-idle-state-pmicr-mask. Signed-off-by: Shreyas B. Prabhu <shreyas@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/opal: Support PCI slot and new APIsGavin Shan2016-06-141-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | The various reset requests are completed by PHB's callbacks. All of them (except reset on IODA table or error injection) are covered by PCI slot. opal_pci_poll() faces similar situation. This reimplements opal_pci_reset() and opal_pci_poll() based on the callbacks provided by PCI slot instead of PHB. Also, couple of new APIs are introduced based on the callbacks in PCI slot as below: * opal_pci_get_presence_state(): Check if there is adapter presented behind the specified PHB or PCI slot. * opal_pci_get_power_state(): Returns power supply state (on or off) on the specified PHB or PCI slot. * opal_pci_set_power_state(): Sets power supply state (on or off) on the specified PHB or PCI slot. Besides, the state can be (offline or online) without changing the PCI slot's power state. Eventually, the definition of unused PHB's callbacks are removed. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Reviewed-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/pci: Support PCI slotGavin Shan2016-06-141-0/+10
| | | | | | | | | | | | | | | | | | | Every PCIE bridge port or PHB is expected to be bound with PCI slot , to which various PCI slot's functionalities are attached (e.g. power, link, reset). This supports PCI slot: * PCI slot is reprsented by "struct pci_slot". * "struct pci_slot_ops" represents the functions supported on the PCI slot. It's initialized by PCI slot core at the beginning and allowed to be overrided by platform partially or completely. * On PCI hot plugging event, the PCI devices behind the slot are enumarated. Device sub-tree is populated and sent to OS by OPAL message. * On PCI hot unplugging event, the PCI devices behind the slot are destroyed. Device sub-tree is removed and the slot is powered off. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* core/fdt: Introduce opal_get_device_tree()Gavin Shan2016-06-141-1/+2
| | | | | | | | | This introduces OPAL API opal_get_device_tree() to get the device sub-tree. It's going to be used in PCI hot add path. Signed-off-by: Gavin Shan <gwshan@linux.vnet.ibm.com> Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* phb3: Add support for CAPP DMA modeIan Munsie2016-06-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The XSL used in the Mellanox CX4 card uses a DMA mode of CAPI, which requires a few registers configured specially. In addition to enabling the mode, - The CAPP only owns some of the PHB read buffers, and must be configured to use the correct ones, and the self-snoop configured for the same ones. - The tve needs to be configured to allow the card to access all kernel memory as it uses DMA accesses to read the scheduled process area from the kernel, among other things. These cannot be configured unconditionally, as doing so will break existing CAPI devices that do not use DMA mode. This adds a new mode to the OPAL_PCI_SET_PHB_CAPI_MODE API to enable CAPI in DMA mode. Since the snoop on/off modes write to the capi snoop configuration register, which is configured differently in DMA mode, it uses the redundant bits from the apc master powerbus control register to determine if it should configure the register for DMA mode rather than requiring any more permutations of the mode parameter. Signed-off-by: Ian Munsie <imunsie@au1.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* opal-api: Fix typo in EPOW event handling descriptionVipin K Parashar2016-06-081-1/+1
| | | | | | | Fix typo in EPOW event handling description in include/opal-api.h. Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* hmi: Add handling for NPU checkstopsRussell Currey2016-03-311-0/+1
| | | | | | | | | | | | | | | | | | If the NPU detects an unrecoverable error, it will send a HMI. This is problematic since unhandled HMIs will checkstop the entire system, which is not the intended behaviour of a NPU failure. Instead, the NPU emulated PCI devices should be fenced as part of EEH. Add support for handling NPU HMIs. This works by finding the NPU responsible for the HMI, checking its error registers, and sending a recoverable HMI event. The NPU itself cannot actually recover, but the system should not be brought down. Fence mode is set on the NPU, such that any further operations on the NPU will trigger EEH, and it will be subsequently fenced from the system. Signed-off-by: Russell Currey <ruscur@russell.cc> Reviewed-by: Alistair Popple <alistair@popple.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Add OPAL_CONSOLE_FLUSH to the OPAL APIRussell Currey2016-01-121-1/+2
| | | | | | | | | | | | | | | | | | | | | uart consoles only flush output when polled. The Linux kernel calls these pollers frequently, except when in a panic state. As such, panic messages are not fully printed unless the system is configured to reboot after panic. This patch adds a new call to the OPAL API to flush the buffer. If the system has a uart console (i.e. BMC machines), it will incrementally flush the buffer, returning if there is more to be flushed or not. If the system has a different console, the function will have no effect. This will allow the Linux kernel to ensure that panic message have been fully printed out. The existing synchronous flushing mechanism used in OPAL's shutdown and reboot routines has been refactored into a helper that repeatedly calls the new partial flush function. Signed-off-by: Russell Currey <ruscur@russell.cc> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* opal-api: Assign numbers to OPAL_MSG macros of enum opal_msg_typeVipin K Parashar2015-09-011-8/+8
| | | | | | | | | | | | | This patch assigns numbers to OPAL_MSG macros of enum opal_msg_type to prevent accidental insertion of any new value in between and thus break OPAL API. This is also helpful while backporting mainline kernel changes to distros which run downlevel kernel and thus don't have all OPAL messages defined, avoiding unnecessary bugs due to enum values order mismatch. Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> Acked-by: Jeremy Kerr <jk@ozlabs.org> 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>
* opal-api: Add OPAL call to handle abnormal reboots.Vipin K Parashar2015-07-311-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new OPAL call OPAL_CEC_REBOOT2 which will be used to handle abnormal reboot/termination by kernel host. This call will allow host kernel to pass reboot type and additional debug data which needs to be captured/saved somewhere (for later analysis) before going down. Currently it will support two reboot types (0). normal reboot, that will behave similar to that of opal_cec_reboot() call, and (1). platform error reboot, that will trigger a system checkstop using xscom address and FIR bit information obtained via device-tree property 'ibm,sw-checkstop-fir'. For unsupported reboot type, this call will do nothing and return with OPAL_UNSUPPORTED. In future, we can overload this call to support additional reboot types. Signed-off-by: Vipin K Parashar <vipin@linux.vnet.ibm.com> Signed-off-by: Mahesh Salgaonkar <mahesh@linux.vnet.ibm.com> Reviewed-by: Samuel Mendoza-Jonas <sam.mj@au1.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* occ: Poll OCC throttle status and queue OCC events to hostShilpasri G Bhat2015-07-061-0/+25
| | | | | | | | | | | | | | | | | Add a new class of message definition OPAL_MSG_OCC to opal_message_type to notify the following OCC events to host: 1) OCC Reset 2) OCC Load 3) OCC Throttle Status Change Add an opal poller to periodically read throttle status updated by OCC for each chip and notify any change in throttle status to host. The throttle status indicates the reason why OCC may have limited the max Pstate of the chip. Signed-off-by: Shilpasri G Bhat <shilpa.bhat@linux.vnet.ibm.com> Reviewed-by: Preeti U Murthy <preeti@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Merge PRD rework from stableStewart Smith2015-05-211-3/+8
|\
| * prd: Don't expose full opal_prd_msg to kernelJeremy Kerr2015-05-211-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* | FSP/LED: Add system attention indicator supportVasant Hegde2015-05-071-1/+2
|/ | | | | | | | | | | | | | | | SAI is controlled by FSP. This patch adds support to get/set this indicator. Also update OPAL interface so that playload can read/set this indicator. During init, we read this indicator state using MBOX command. OPAL uses MBOX interface to update this SAI. FSP sends update notification whenever there is change in SAI state (except for OPAL initiates updates). We use the notification to update cached SAI state. Signed-off-by: Vasant Hegde <hegdevasant@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Move contents of opal.h to opal-api.hMichael Ellerman2015-04-011-0/+946
| | | | | | | | | | | | | | | | | | | | | Move the contents of opal.h, which is the definition of the OPAL API shared with Linux, into opal-api.h. Recreate opal.h, containing just the include of types.h as well as including opal-api.h and opal-internal.h. We can also remove the #ifdef SKIBOOT, because opal.h is no longer shared with Linux. This gets us to an opal-api.h that is purely a superset of Linux's opal-api.h, ie. the only differences are things that are new in skiboot and haven't yet been added to Linux. Finally update head.S to only include opal-api.h, which is all it needs, and avoids the need for ASSEMBLY guards in opal.h. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
* Move opal-api.h to opal-internal.hMichael Ellerman2015-04-011-84/+0
| | | | | | | | | | | | | | | | Move the content of opal-api.h, which is currently "Internal header for OPAL API related things" to opal-internal.h. Recreate opal-api.h as an empty header, until the next commit, so as not to break all the includers of it. Include opal-internal.h from opal.h, but not for assembly users as it's all C declarations. Finally we need to adjust include guard names. Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> 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/+84
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>
OpenPOWER on IntegriCloud