aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGavin Shan <gwshan@linux.vnet.ibm.com>2016-06-10 15:03:51 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-06-14 16:00:17 +1000
commit7a3e2c4ee3aa0c2abf2a11b75c971f13f6db7664 (patch)
tree692541e398525d8989606a62ad3c1e88d9fb7115 /include
parent358b4d654f100cfdfcba939cae012099a851b3bc (diff)
downloadskiboot-7a3e2c4ee3aa0c2abf2a11b75c971f13f6db7664.zip
skiboot-7a3e2c4ee3aa0c2abf2a11b75c971f13f6db7664.tar.gz
skiboot-7a3e2c4ee3aa0c2abf2a11b75c971f13f6db7664.tar.bz2
core/opal: Support PCI slot and new APIs
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>
Diffstat (limited to 'include')
-rw-r--r--include/opal-api.h9
-rw-r--r--include/pci.h72
2 files changed, 7 insertions, 74 deletions
diff --git a/include/opal-api.h b/include/opal-api.h
index b4d96b8..69d9ce3 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -164,7 +164,10 @@
#define OPAL_CEC_REBOOT2 116
#define OPAL_CONSOLE_FLUSH 117
#define OPAL_GET_DEVICE_TREE 118
-#define OPAL_LAST 118
+#define OPAL_PCI_GET_PRESENCE_STATE 119
+#define OPAL_PCI_GET_POWER_STATE 120
+#define OPAL_PCI_SET_POWER_STATE 121
+#define OPAL_LAST 121
/* Device tree flags */
@@ -383,7 +386,9 @@ enum OpalPciSlotPresence {
enum OpalPciSlotPower {
OPAL_PCI_SLOT_POWER_OFF = 0,
- OPAL_PCI_SLOT_POWER_ON = 1
+ OPAL_PCI_SLOT_POWER_ON = 1,
+ OPAL_PCI_SLOT_OFFLINE = 2,
+ OPAL_PCI_SLOT_ONLINE = 3
};
enum OpalSlotLedType {
diff --git a/include/pci.h b/include/pci.h
index ce46889..83c9683 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -294,78 +294,6 @@ struct phb_ops {
*/
int64_t (*pci_msi_eoi)(struct phb *phb, uint32_t hwirq);
- /*
- * Slot control
- */
-
- /* presence_detect - Check for a present device
- *
- * Immediate return of:
- *
- * OPAL_SHPC_DEV_NOT_PRESENT = 0,
- * OPAL_SHPC_DEV_PRESENT = 1
- *
- * or a negative OPAL error code
- */
- int64_t (*presence_detect)(struct phb *phb);
-
- /* link_state - Check link state
- *
- * Immediate return of:
- *
- * OPAL_SHPC_LINK_DOWN = 0,
- * OPAL_SHPC_LINK_UP_x1 = 1,
- * OPAL_SHPC_LINK_UP_x2 = 2,
- * OPAL_SHPC_LINK_UP_x4 = 4,
- * OPAL_SHPC_LINK_UP_x8 = 8,
- * OPAL_SHPC_LINK_UP_x16 = 16,
- * OPAL_SHPC_LINK_UP_x32 = 32
- *
- * or a negative OPAL error code
- */
- int64_t (*link_state)(struct phb *phb);
-
- /* power_state - Check slot power state
- *
- * Immediate return of:
- *
- * OPAL_SLOT_POWER_OFF = 0,
- * OPAL_SLOT_POWER_ON = 1,
- *
- * or a negative OPAL error code
- */
- int64_t (*power_state)(struct phb *phb);
-
- /* slot_power_off - Start slot power off sequence
- *
- * Asynchronous function, returns a positive delay
- * or a negative error code
- */
- int64_t (*slot_power_off)(struct phb *phb);
-
- /* slot_power_on - Start slot power on sequence
- *
- * Asynchronous function, returns a positive delay
- * or a negative error code.
- */
- int64_t (*slot_power_on)(struct phb *phb);
-
- /* PHB power off and on after complete init */
- int64_t (*complete_reset)(struct phb *phb, uint8_t assert);
-
- /* hot_reset - Hot Reset sequence */
- int64_t (*hot_reset)(struct phb *phb);
-
- /* Fundamental reset */
- int64_t (*fundamental_reset)(struct phb *phb);
-
- /* poll - Poll and advance asynchronous operations
- *
- * Returns a positive delay, 0 for success or a
- * negative OPAL error code
- */
- int64_t (*poll)(struct phb *phb);
-
/* Put phb in capi mode or pcie mode */
int64_t (*set_capi_mode)(struct phb *phb, uint64_t mode, uint64_t pe_number);