aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorPhilippe Bergheaud <felix@linux.vnet.ibm.com>2018-02-21 13:31:18 +0100
committerStewart Smith <stewart@linux.vnet.ibm.com>2018-03-01 20:36:53 -0600
commit0f3584d846629d5bc1832a1dc4663a1befe8c4b0 (patch)
treed595bffde3a36b08568ac08885e6236839269333 /include
parenta8cfb0906643a7b074a5822bb312bf7481625905 (diff)
downloadskiboot-0f3584d846629d5bc1832a1dc4663a1befe8c4b0.zip
skiboot-0f3584d846629d5bc1832a1dc4663a1befe8c4b0.tar.gz
skiboot-0f3584d846629d5bc1832a1dc4663a1befe8c4b0.tar.bz2
phb4: set PBCQ Tunnel BAR for tunneled operations
P9 supports PCI tunneled operations (atomics and as_notify) that are initiated by devices. A subset of the tunneled operations require a response, that must be sent back from the host to the device. For example, an atomic compare and swap will return the compare status, as swap will only performed in case of success. Similarly, as_notify reports if the target thread has been woken up or not, because the operation may fail. To enable tunneled operations, a device driver must tell the host where it expects tunneled operation responses, by setting the PBCQ Tunnel BAR Response register with a specific value within the range of its BARs. This register is currently initialized by enable_capi_mode(). But, as tunneled operations may also operate in PCI mode, a new API is required to set the PBCQ Tunnel BAR Response register, without switching to CAPI mode. This patch provides two new OPAL calls to get/set the PBCQ Tunnel BAR Response register. Note: as there is only one PBCQ Tunnel BAR register, shared between all the devices connected to the same PHB, only one of these devices will be able to use tunneled operations, at any time. Signed-off-by: Philippe Bergheaud <felix@linux.vnet.ibm.com> Reviewed-by: Frederic Barrat <fbarrat@linux.vnet.ibm.com> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'include')
-rw-r--r--include/opal-api.h4
-rw-r--r--include/pci.h4
2 files changed, 7 insertions, 1 deletions
diff --git a/include/opal-api.h b/include/opal-api.h
index 57434d7..34a2d08 100644
--- a/include/opal-api.h
+++ b/include/opal-api.h
@@ -220,7 +220,9 @@
#define OPAL_NPU_TL_SET 161
#define OPAL_SENSOR_READ_U64 162
#define OPAL_SENSOR_GROUP_ENABLE 163
-#define OPAL_LAST 163
+#define OPAL_PCI_GET_PBCQ_TUNNEL_BAR 164
+#define OPAL_PCI_SET_PBCQ_TUNNEL_BAR 165
+#define OPAL_LAST 165
#define QUIESCE_HOLD 1 /* Spin all calls at entry */
#define QUIESCE_REJECT 2 /* Fail all calls with OPAL_BUSY */
diff --git a/include/pci.h b/include/pci.h
index 17b5c96..0c2858c 100644
--- a/include/pci.h
+++ b/include/pci.h
@@ -333,6 +333,10 @@ struct phb_ops {
/* PCI peer-to-peer setup */
void (*set_p2p)(struct phb *phb, uint64_t mode, uint64_t flags,
uint16_t pe_number);
+
+ /* Get/set PBCQ Tunnel BAR register */
+ void (*get_tunnel_bar)(struct phb *phb, uint64_t *addr);
+ int64_t (*set_tunnel_bar)(struct phb *phb, uint64_t addr);
};
enum phb_type {