summaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-12-22 14:16:46 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2017-01-05 15:41:01 +1100
commitf3e34ce176bc543f9a719ccbeaf7ef082592acc8 (patch)
treedeac8f8f70b53d4146353a6f7ce88068231c00a8 /core
parent0bc9d38dd6f5ad9a144a9e7657f9d0c32eaf0281 (diff)
downloadtalos-skiboot-f3e34ce176bc543f9a719ccbeaf7ef082592acc8.tar.gz
talos-skiboot-f3e34ce176bc543f9a719ccbeaf7ef082592acc8.zip
interrupts: Add optional name for OPAL interrupts
This adds the infrastructure for an interrupt source to provide a name for an interrupt directed toward OPAL. Those names will be put into an "opal-interrupts-names" property which is a standard DT string list corresponding 1:1 with the "opal-interrupts" property. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'core')
-rw-r--r--core/interrupts.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/core/interrupts.c b/core/interrupts.c
index 6c00138d..c01a430f 100644
--- a/core/interrupts.c
+++ b/core/interrupts.c
@@ -198,8 +198,9 @@ uint32_t get_ics_phandle(void)
void add_opal_interrupts(void)
{
struct irq_source *is;
- unsigned int i, count = 0;
+ unsigned int i, ns, tns = 0, count = 0;
uint32_t *irqs = NULL, isn;
+ char *names = NULL;
lock(&irq_lock);
list_for_each(&irq_sources, is, link) {
@@ -211,8 +212,21 @@ void add_opal_interrupts(void)
continue;
for (isn = is->start; isn < is->end; isn++) {
uint64_t attr = is->ops->attributes(is, isn);
+ char *name;
+
if (attr & IRQ_ATTR_TARGET_LINUX)
continue;
+ name = is->ops->name ? is->ops->name(is, isn) : NULL;
+ ns = name ? strlen(name) : 0;
+ printf("irq %x name: %s (%d/%d)\n",
+ isn, name ? name : "<null>", ns, tns);
+ names = realloc(names, tns + ns + 1);
+ if (name) {
+ strcpy(names + tns, name);
+ tns += (ns + 1);
+ free(name);
+ } else
+ names[tns++] = 0;
i = count++;
irqs = realloc(irqs, 4 * count);
irqs[i] = isn;
@@ -227,6 +241,7 @@ void add_opal_interrupts(void)
* handling in Linux can cause problems.
*/
dt_add_property(opal_node, "opal-interrupts", irqs, count * 4);
+ dt_add_property(opal_node, "opal-interrupts-names", names, tns);
free(irqs);
}
OpenPOWER on IntegriCloud