aboutsummaryrefslogtreecommitdiffstats
path: root/roms/skiboot/doc/opal-api/opal-pci-set-power-state-121.rst
diff options
context:
space:
mode:
authorAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
committerAngelos Mouzakitis <a.mouzakitis@virtualopensystems.com>2023-10-10 14:33:42 +0000
commitaf1a266670d040d2f4083ff309d732d648afba2a (patch)
tree2fc46203448ddcc6f81546d379abfaeb323575e9 /roms/skiboot/doc/opal-api/opal-pci-set-power-state-121.rst
parente02cda008591317b1625707ff8e115a4841aa889 (diff)
Add submodule dependency filesHEADmaster
Change-Id: Iaf8d18082d3991dec7c0ebbea540f092188eb4ec
Diffstat (limited to 'roms/skiboot/doc/opal-api/opal-pci-set-power-state-121.rst')
-rw-r--r--roms/skiboot/doc/opal-api/opal-pci-set-power-state-121.rst57
1 files changed, 57 insertions, 0 deletions
diff --git a/roms/skiboot/doc/opal-api/opal-pci-set-power-state-121.rst b/roms/skiboot/doc/opal-api/opal-pci-set-power-state-121.rst
new file mode 100644
index 000000000..0209efb79
--- /dev/null
+++ b/roms/skiboot/doc/opal-api/opal-pci-set-power-state-121.rst
@@ -0,0 +1,57 @@
+.. _OPAL_PCI_SET_POWER_STATE:
+
+OPAL_PCI_SET_POWER_STATE
+========================
+
+.. code-block:: c
+
+ #define OPAL_PCI_SET_POWER_STATE 121
+
+ int64_t opal_pci_set_power_state(uint64_t async_token, uint64_t id, uint64_t data);
+
+Set PCI slot power state
+
+Parameters
+----------
+
+``uint64_t async_token``
+ Token of asynchronous message to be sent
+ on completion of OPAL_PCI_SLOT_POWER_{OFF, ON}. It is
+ ignored when @data is OPAL_PCI_SLOT_{OFFLINE, ONLINE}.
+
+``uint64_t id``
+ PCI slot ID
+
+``uint64_t data``
+ memory buffer pointer for the power state which
+ can be one of OPAL_PCI_SLOT_POWER_{OFF, ON, OFFLINE, ONLINE}.
+
+Calling
+-------
+
+Set PCI slot's power state. The power state is stored in buffer pointed
+by @data. The typical use is to hot add or remove adapters behind the
+indicated PCI slot (by @id) in PCI hotplug path.
+
+User will receive an asychronous message after calling the API. The message
+contains the API completion status: event (Power off or on), device node's
+phandle identifying the PCI slot, errcode (e.g. :ref:`OPAL_SUCCESS`). The API returns
+:ref:`OPAL_ASYNC_COMPLETION` for the case.
+
+The states OPAL_PCI_SLOT_OFFLINE and OPAL_PCI_SLOT_ONLINE are used for removing
+or adding devices behind the slot. The device nodes in the device tree are
+removed or added accordingly, without actually changing the slot's power state.
+The API call will return OPAL_SUCCESS immediately and no further asynchronous
+message will be sent.
+
+Return Codes
+------------
+
+:ref:`OPAL_SUCCESS`
+ PCI hotplug on the slot is completed successfully
+:ref:`OPAL_ASYNC_COMPLETION`
+ PCI hotplug needs further message to confirm
+:ref:`OPAL_PARAMETER`
+ The indicated PCI slot isn't found
+:ref:`OPAL_UNSUPPORTED`
+ Setting power state not supported on the PCI slot