diff options
author | Benjamin Herrenschmidt <benh@kernel.crashing.org> | 2016-12-22 14:16:48 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-01-05 15:41:01 +1100 |
commit | 5a3e27d5f0469a5458ed771da90cc64a0a14eccb (patch) | |
tree | a6be56fd572df17b0e578b54d3967eb90be9dff8 /hw/psi.c | |
parent | fe522167376456f2ded980fb139d3c3d55a0a87e (diff) | |
download | skiboot-5a3e27d5f0469a5458ed771da90cc64a0a14eccb.zip skiboot-5a3e27d5f0469a5458ed771da90cc64a0a14eccb.tar.gz skiboot-5a3e27d5f0469a5458ed771da90cc64a0a14eccb.tar.bz2 |
psi: Add names for PSI interrupts
This adds a name callback to the PSI interrupts sources on P8 and P9
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.c | 48 |
1 files changed, 48 insertions, 0 deletions
@@ -535,11 +535,31 @@ static uint64_t psi_p8_irq_attributes(struct irq_source *is, uint32_t isn) return attr; } +static char *psi_p8_irq_name(struct irq_source *is, uint32_t isn) +{ + struct psi *psi = is->data; + uint32_t idx = isn - psi->interrupt; + + static const char *names[P8_IRQ_PSI_IRQ_COUNT] = { + "psi:fsp", + "psi:occ", + "psi:fsi", + "psi:lpchc", + "psi:local_err", + "psi:external", + }; + + if (idx >= P8_IRQ_PSI_IRQ_COUNT) + return NULL; + return strdup(names[idx]); +} + static const struct irq_source_ops psi_p8_irq_ops = { .get_xive = psi_p8_get_xive, .set_xive = psi_p8_set_xive, .interrupt = psihb_p8_interrupt, .attributes = psi_p8_irq_attributes, + .name = psi_p8_irq_name, }; static void psihb_p9_interrupt(struct irq_source *is, uint32_t isn) @@ -610,9 +630,37 @@ static uint64_t psi_p9_irq_attributes(struct irq_source *is __unused, return IRQ_ATTR_TARGET_OPAL | IRQ_ATTR_TARGET_FREQUENT; } +static char *psi_p9_irq_name(struct irq_source *is, uint32_t isn) +{ + struct psi *psi = is->data; + uint32_t idx = isn - psi->interrupt; + + static const char *names[P9_PSI_NUM_IRQS] = { + "psi:fsp", + "psi:occ", + "psi:fsi", + "psi:lpchc", + "psi:local_err", + "psi:global_err", + "psi:external", + "psi:lpc_serirq_mux0", /* Have a callback to get name ? */ + "psi:lpc_serirq_mux1", /* Have a callback to get name ? */ + "psi:lpc_serirq_mux2", /* Have a callback to get name ? */ + "psi:lpc_serirq_mux3", /* Have a callback to get name ? */ + "psi:i2c", + "psi:dio", + "psi:psu" + }; + + if (idx >= P9_PSI_NUM_IRQS) + return NULL; + return strdup(names[idx]); +} + static const struct irq_source_ops psi_p9_irq_ops = { .interrupt = psihb_p9_interrupt, .attributes = psi_p9_irq_attributes, + .name = psi_p9_irq_name, }; static void psi_tce_enable(struct psi *psi, bool enable) |