aboutsummaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-11-14 13:06:14 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-11-15 15:06:02 +1100
commitbd4eaedc2dda6e7b365eb5e104c07c5d114528e6 (patch)
tree6f2b4faa02d5d3b483de26b796f026368412bb95 /hw
parent5ca6fcd9103008472dcb04e87a469e11b4443124 (diff)
downloadskiboot-bd4eaedc2dda6e7b365eb5e104c07c5d114528e6.zip
skiboot-bd4eaedc2dda6e7b365eb5e104c07c5d114528e6.tar.gz
skiboot-bd4eaedc2dda6e7b365eb5e104c07c5d114528e6.tar.bz2
xive: Add helper to retrieve an IPI trigger port
To be used by such things as VAS Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xive.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/hw/xive.c b/hw/xive.c
index 1237cd9..a9150ed 100644
--- a/hw/xive.c
+++ b/hw/xive.c
@@ -1295,6 +1295,25 @@ uint32_t xive_alloc_ipi_irqs(uint32_t chip_id, uint32_t count, uint32_t align)
return base;
}
+void *xive_get_trigger_port(uint32_t girq)
+{
+ struct xive *x;
+ uint32_t idx;
+
+ /* Find XIVE on which the IVE resides */
+ x = xive_from_isn(girq);
+ if (!x)
+ return NULL;
+
+ /* Make sure it's an IPI on that chip */
+ if (girq < x->int_base ||
+ girq >= x->int_ipi_top)
+ return NULL;
+
+ idx = girq - x->int_base;
+ return x->esb_mmio + idx * 0x20000;
+}
+
uint64_t xive_get_notify_port(uint32_t chip_id, uint32_t ent)
{
struct proc_chip *chip = get_chip(chip_id);