aboutsummaryrefslogtreecommitdiff
path: root/hw/phb3.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-08-09 16:38:05 +1000
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-08-11 19:54:22 +1000
commit8b6d05d9b2cd187e05ff0aa27942f07d04c8d4d6 (patch)
tree5a3dad0ac8c8fcdb0f72d9a2b82ff51af0e0fdb5 /hw/phb3.c
parentc6a6391892539450a84d3dd69f4d83ea1a1b04d6 (diff)
downloadskiboot-8b6d05d9b2cd187e05ff0aa27942f07d04c8d4d6.zip
skiboot-8b6d05d9b2cd187e05ff0aa27942f07d04c8d4d6.tar.gz
skiboot-8b6d05d9b2cd187e05ff0aa27942f07d04c8d4d6.tar.bz2
interrupts: Add new source ->attributes callback
This allows a given source to provide per-interrupt attributes such as whether it targets OPAL or Linux and it's estimated frequency. The former allows to get rid of the double set of ops used to decide which interrupts go where on some modules like the PHBs and the latter will be eventually used to implement smart caching of the source lookups. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw/phb3.c')
-rw-r--r--hw/phb3.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/hw/phb3.c b/hw/phb3.c
index 8742c7a..8d34c0f 100644
--- a/hw/phb3.c
+++ b/hw/phb3.c
@@ -1798,6 +1798,18 @@ static void phb3_err_interrupt(struct irq_source *is, uint32_t isn)
phb3_set_err_pending(p, true);
}
+static uint64_t phb3_lsi_attributes(struct irq_source *is, uint32_t isn)
+{
+#ifndef DISABLE_ERR_INTS
+ struct phb3 *p = is->data;
+ uint32_t idx = isn - p->base_lsi;
+
+ if (idx == PHB3_LSI_PCIE_INF || idx == PHB3_LSI_PCIE_ER)
+ return IRQ_ATTR_TARGET_OPAL | IRQ_ATTR_TARGET_RARE;
+#endif
+ return IRQ_ATTR_TARGET_LINUX;
+}
+
/* MSIs (OS owned) */
static const struct irq_source_ops phb3_msi_irq_ops = {
.get_xive = phb3_msi_get_xive,
@@ -1808,12 +1820,7 @@ static const struct irq_source_ops phb3_msi_irq_ops = {
static const struct irq_source_ops phb3_lsi_irq_ops = {
.get_xive = phb3_lsi_get_xive,
.set_xive = phb3_lsi_set_xive,
-};
-
-/* Error LSIs (skiboot owned) */
-static const struct irq_source_ops phb3_err_lsi_irq_ops = {
- .get_xive = phb3_lsi_get_xive,
- .set_xive = phb3_lsi_set_xive,
+ .attributes = phb3_lsi_attributes,
.interrupt = phb3_err_interrupt,
};
@@ -4447,12 +4454,8 @@ static void phb3_create(struct dt_node *np)
/* Register interrupt sources */
register_irq_source(&phb3_msi_irq_ops, p, p->base_msi,
PHB3_MSI_IRQ_COUNT);
- register_irq_source(&phb3_lsi_irq_ops, p, p->base_lsi, 4);
+ register_irq_source(&phb3_lsi_irq_ops, p, p->base_lsi, 8);
-#ifndef DISABLE_ERR_INTS
- register_irq_source(&phb3_err_lsi_irq_ops, p,
- p->base_lsi + PHB3_LSI_PCIE_INF, 2);
-#endif
/* Get the HW up and running */
phb3_init_hw(p, true);
@@ -4735,3 +4738,4 @@ void probe_phb3(void)
phb3_create(np);
}
+