aboutsummaryrefslogtreecommitdiff
path: root/hw/psi.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2016-11-14 13:06:01 +1100
committerStewart Smith <stewart@linux.vnet.ibm.com>2016-11-15 15:05:59 +1100
commit747771ddfa422d0bcbd21fa39e11430bbbcefdd3 (patch)
tree23d4f475c1fb304ca8ebd2c156eb630ef7ce3b11 /hw/psi.c
parent7a6298eaf7ce282890bfa9e630d82a1edb3daf12 (diff)
downloadskiboot-747771ddfa422d0bcbd21fa39e11430bbbcefdd3.zip
skiboot-747771ddfa422d0bcbd21fa39e11430bbbcefdd3.tar.gz
skiboot-747771ddfa422d0bcbd21fa39e11430bbbcefdd3.tar.bz2
psi: Add DT option to disable LPC interrupts
Some sim models have the LPC interrupts stuck asserted on secondary chips so we add a device-tree option that makes us set the policy for these to "Linux" instead of "OPAL". Since they aren't referenced in the device-tree this will de-facto prevent them from being enabled 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.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/hw/psi.c b/hw/psi.c
index 17e83a5..503e1ce 100644
--- a/hw/psi.c
+++ b/hw/psi.c
@@ -521,6 +521,9 @@ static uint64_t psi_p8_irq_attributes(struct irq_source *is, uint32_t isn)
uint32_t idx = isn - psi->interrupt;
uint64_t attr;
+ if (psi->no_lpc_irqs && idx == P8_IRQ_PSI_LPC)
+ return IRQ_ATTR_TARGET_LINUX;
+
if (idx == P8_IRQ_PSI_EXTERNAL &&
psi_ext_irq_policy == EXTERNAL_IRQ_POLICY_LINUX)
return IRQ_ATTR_TARGET_LINUX;
@@ -586,8 +589,23 @@ static void psihb_p9_interrupt(struct irq_source *is, uint32_t isn)
}
static uint64_t psi_p9_irq_attributes(struct irq_source *is __unused,
- uint32_t isn __unused)
+ uint32_t isn)
{
+ struct psi *psi = is->data;
+ unsigned int idx = isn & 0xf;
+
+ /* If LPC interrupts are disabled, route them to Linux
+ * (who will not request them since they aren't referenced
+ * in the device tree)
+ */
+ if (psi->no_lpc_irqs &&
+ (idx == P9_PSI_IRQ_LPC_SIRQ0 ||
+ idx == P9_PSI_IRQ_LPC_SIRQ1 ||
+ idx == P9_PSI_IRQ_LPC_SIRQ2 ||
+ idx == P9_PSI_IRQ_LPC_SIRQ3 ||
+ idx == P9_PSI_IRQ_LPCHC))
+ return IRQ_ATTR_TARGET_LINUX;
+
/* XXX For now, all go to OPAL, this will change */
return IRQ_ATTR_TARGET_OPAL | IRQ_ATTR_TARGET_FREQUENT;
}
@@ -1002,6 +1020,9 @@ static bool psi_init_psihb(struct dt_node *psihb)
}
chip->psi = psi;
+ if (dt_has_node_property(psihb, "no-lpc-interrupts", NULL))
+ psi->no_lpc_irqs = true;
+
psi_activate_phb(psi);
psi_init_interrupts(psi);
psi_create_mm_dtnode(psi);