aboutsummaryrefslogtreecommitdiff
path: root/hw/psi.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-08-09 16:38:14 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-08-11 19:54:22 +1000
commitd0a3ec6aea455d8b564f62679ff6f69f91ea7896 (patch)
treee1420cf1654e1dfd60ebc5dd8712a6f6f740933d /hw/psi.c
parentc8fc681aa2ed5dc5584518d213eeecb2eef7b22c (diff)
downloadskiboot-d0a3ec6aea455d8b564f62679ff6f69f91ea7896.zip
skiboot-d0a3ec6aea455d8b564f62679ff6f69f91ea7896.tar.gz
skiboot-d0a3ec6aea455d8b564f62679ff6f69f91ea7896.tar.bz2
psi: On p9, create an interrupt-map for routing PSI interrupts
This will provide the global IRQ numbers for all 16 PSI inputs (though we don't really care about 0 here). We can then express them in the device-tree as relative to the PSI bridge. Among others, that allows us to express the external interrupt and the LPC interrupt using a fixed numbering scheme. The example device-tree is updated to route them all to the LPC0 input which corresponds to what the LPC code does at the moment. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/psi.c')
-rw-r--r--hw/psi.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/psi.c b/hw/psi.c
index 465b74e..900886a 100644
--- a/hw/psi.c
+++ b/hw/psi.c
@@ -848,6 +848,20 @@ static void psi_activate_phb(struct psi *psi)
#endif
}
+static void psi_create_p9_int_map(struct psi *psi, struct dt_node *np)
+{
+ uint32_t map[P9_PSI_NUM_IRQS][4];
+ int i;
+
+ for (i = 0; i < P9_PSI_NUM_IRQS; i++) {
+ map[i][0] = i;
+ map[i][1] = get_ics_phandle();
+ map[i][2] = psi->interrupt + i;
+ map[i][3] = 1;
+ }
+ dt_add_property(np, "interrupt-map", map, sizeof(map));
+}
+
static void psi_create_mm_dtnode(struct psi *psi)
{
struct dt_node *np;
@@ -871,6 +885,7 @@ static void psi_create_mm_dtnode(struct psi *psi)
case proc_gen_p9:
dt_add_property_strings(np, "compatible", "ibm,psi",
"ibm,power9-psi");
+ psi_create_p9_int_map(psi, np);
break;
default:
dt_add_property_strings(np, "compatible", "ibm,psi");