summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-07-16 19:10:33 +0000
committerkettenis <kettenis@openbsd.org>2020-07-16 19:10:33 +0000
commit8c64a04ec860105e01172022fe751fc4ce751db5 (patch)
treecb1bacd0bb310b1508f4f53385a8902d619a0d14
parentadd -T option to make time related system calls more prominent. (diff)
downloadwireguard-openbsd-8c64a04ec860105e01172022fe751fc4ce751db5.tar.xz
wireguard-openbsd-8c64a04ec860105e01172022fe751fc4ce751db5.zip
Reset firmware state upon reboot.
-rw-r--r--sys/arch/powerpc64/dev/xive.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/sys/arch/powerpc64/dev/xive.c b/sys/arch/powerpc64/dev/xive.c
index b789f63d70c..5d21dbfc3f5 100644
--- a/sys/arch/powerpc64/dev/xive.c
+++ b/sys/arch/powerpc64/dev/xive.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: xive.c,v 1.5 2020/06/29 20:34:19 kettenis Exp $ */
+/* $OpenBSD: xive.c,v 1.6 2020/07/16 19:10:33 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
*
@@ -138,9 +138,11 @@ xive_unmask(struct xive_softc *sc, struct intrhand *ih)
int xive_match(struct device *, void *, void *);
void xive_attach(struct device *, struct device *, void *);
+int xive_activate(struct device *, int);
struct cfattach xive_ca = {
- sizeof (struct xive_softc), xive_match, xive_attach
+ sizeof (struct xive_softc), xive_match, xive_attach, NULL,
+ xive_activate
};
struct cfdriver xive_cd = {
@@ -225,6 +227,18 @@ xive_attach(struct device *parent, struct device *self, void *aux)
xive_write_1(sc, XIVE_TM_CPPR_HV, ci->ci_cpl);
}
+int
+xive_activate(struct device *self, int act)
+{
+ switch (act) {
+ case DVACT_POWERDOWN:
+ opal_xive_reset(OPAL_XIVE_MODE_EMU);
+ break;
+ }
+
+ return 0;
+}
+
void *
xive_intr_establish(uint32_t girq, int type, int level,
int (*func)(void *), void *arg, const char *name)