Add opal_msg_type OPAL_MSG_HOTPLUG
diff mbox series

Message ID 1547701504-84382-1-git-send-email-mine260309@gmail.com
State Under Review
Headers show
Series
  • Add opal_msg_type OPAL_MSG_HOTPLUG
Related show

Checks

Context Check Description
snowpatch_ozlabs/snowpatch_job_snowpatch-skiboot success Test snowpatch/job/snowpatch-skiboot on branch master
snowpatch_ozlabs/apply_patch success master/apply_patch Successfully applied

Commit Message

Lei YU Jan. 17, 2019, 5:05 a.m. UTC
This message is used to notify kernel about an PCIe hotplug event occurs
on slots connected directly to CPU.

Updated doc/pci-slot.rst to describe the details of the usage of this
event.

Signed-off-by: Lei YU <mine260309@gmail.com>
---
 doc/pci-slot.rst   | 12 ++++++++++++
 include/opal-api.h |  1 +
 2 files changed, 13 insertions(+)

Patch
diff mbox series

diff --git a/doc/pci-slot.rst b/doc/pci-slot.rst
index fd3fd7d..7790175 100644
--- a/doc/pci-slot.rst
+++ b/doc/pci-slot.rst
@@ -66,6 +66,7 @@  Property                    Definition
 ibm,reset-by-firmware       Boolean indicating whether the slot reset should be done in firmware
 ibm,slot-pluggable          Boolean indicating whether the slot is pluggable
 ibm,slot-surprise-pluggable Boolean indicating whether the slot supports surprise hotplug
+ibm,slot-use-hotplug-event  Boolean indicating whether the slot shall use opal message to handle hotplug
 ibm,slot-broken-pdc         Boolean indicating whether PDC (Presence Detection Change) is broken
 ibm,slot-power-ctl          Boolean indicating whether the slot has power control
 ibm,slot-wired-lanes        The number of hardware lanes that are wired
@@ -105,6 +106,17 @@  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.
 
+In case of a slot directly connected to CPU instead of PCIe switch, there is no
+hotplug interrupt generated by switch. The property "ibm,slot-use-hotplug-event"
+is added to support this case. Typically a GPIO interrupt is generated from the
+peripheral device and sent to CPU. Skiboot then handles the interrupt, retrieves
+the hotplug status, and then sends an opal message to kernel with parameters of
+   * An integer indicating the slot id
+   * A boolean indicating if the device is plugged out or in
+
+Example:
+    opal_queue_msg(OPAL_MSG_HOTPLUG, NULL, NULL, <slot_id>, <0|1>);
+
 PCI Slot on Apollo and Firenze
 ------------------------------
 
diff --git a/include/opal-api.h b/include/opal-api.h
index 5f397c8..a262054 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -547,6 +547,7 @@  enum opal_msg_type {
 	OPAL_MSG_DPO		= 5,
 	OPAL_MSG_PRD		= 6,
 	OPAL_MSG_OCC		= 7,
+	OPAL_MSG_HOTPLUG	= 8,    /* params[0] = slot id, param[1] = 0 out, 1 in */
 	OPAL_MSG_TYPE_MAX,
 };