summaryrefslogtreecommitdiffstats
path: root/hw/lpc-mbox.c
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2017-04-21 08:59:50 +1000
committerMichael Neuling <mikey@neuling.org>2017-04-21 11:37:30 +1000
commit50e1921f98e4b1b15a748fa7dbc01a71a11b61c4 (patch)
treebe7f4e0e2d2a9101805650e63acd808ad0ce67b7 /hw/lpc-mbox.c
parent2889f18cef25f13587bc6982003af0ce42e0d3a5 (diff)
downloadblackbird-skiboot-50e1921f98e4b1b15a748fa7dbc01a71a11b61c4.tar.gz
blackbird-skiboot-50e1921f98e4b1b15a748fa7dbc01a71a11b61c4.zip
mbox: Sanitize interrupts registers
If some status interrupts are left unmasked by a previous firmware run (either HostBoot or some other version of skiboot), we fail to clear them and end up with a runaway SerIRQ. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Michael Neuling <mikey@neuling.org>
Diffstat (limited to 'hw/lpc-mbox.c')
-rw-r--r--hw/lpc-mbox.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/hw/lpc-mbox.c b/hw/lpc-mbox.c
index fd107fbb..21e6eee0 100644
--- a/hw/lpc-mbox.c
+++ b/hw/lpc-mbox.c
@@ -200,11 +200,18 @@ static struct lpc_client mbox_lpc_client = {
static bool mbox_init_hw(void)
{
- /*
- * Turns out there isn't anything to do.
- * It might be a good idea to santise the registers though.
- * TODO
+ /* Disable all status interrupts except attentions */
+ bmc_mbox_outb(0x00, MBOX_HOST_INT_EN_0);
+ bmc_mbox_outb(MBOX_STATUS_ATTN, MBOX_HOST_INT_EN_1);
+
+ /* Cleanup host interrupt and status */
+ bmc_mbox_outb(MBOX_CTRL_INT_STATUS, MBOX_HOST_CTRL);
+
+ /* Disable host control interrupt for now (will be
+ * re-enabled when needed). Clear BMC interrupts
*/
+ bmc_mbox_outb(MBOX_CTRL_INT_MASK, MBOX_BMC_CTRL);
+
return true;
}
OpenPOWER on IntegriCloud