summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkettenis <kettenis@openbsd.org>2020-08-23 10:11:17 +0000
committerkettenis <kettenis@openbsd.org>2020-08-23 10:11:17 +0000
commit1d508df52e11f7d1f9c663dfb0040fd04bde3077 (patch)
treecb4b21cb6e36f8b70863b98b50a4bc75977dfa17
parentAdd support for POWER8 (and maybe earlier) CPUs. Not sure if this works on (diff)
downloadwireguard-openbsd-1d508df52e11f7d1f9c663dfb0040fd04bde3077.tar.xz
wireguard-openbsd-1d508df52e11f7d1f9c663dfb0040fd04bde3077.zip
Attempt to support IODA2 bridges such as the one found on POWER8 chips.
These lack an "ibm,opal-available-m64-ranges" property, but it seems we can assume a 0-15 range. At least this is what Linux does.
-rw-r--r--sys/arch/powerpc64/dev/phb.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/arch/powerpc64/dev/phb.c b/sys/arch/powerpc64/dev/phb.c
index f12b3cd0a33..2b728c0335e 100644
--- a/sys/arch/powerpc64/dev/phb.c
+++ b/sys/arch/powerpc64/dev/phb.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: phb.c,v 1.12 2020/07/14 20:40:48 kettenis Exp $ */
+/* $OpenBSD: phb.c,v 1.13 2020/08/23 10:11:17 kettenis Exp $ */
/*
* Copyright (c) 2020 Mark Kettenis <kettenis@openbsd.org>
*
@@ -111,7 +111,8 @@ phb_match(struct device *parent, void *match, void *aux)
{
struct fdt_attach_args *faa = aux;
- return OF_is_compatible(faa->fa_node, "ibm,ioda3-phb");
+ return (OF_is_compatible(faa->fa_node, "ibm,ioda2-phb") ||
+ OF_is_compatible(faa->fa_node, "ibm,ioda3-phb"));
}
void
@@ -251,7 +252,7 @@ phb_attach(struct device *parent, struct device *self, void *aux)
/*
* Enable all the 64-bit mmio windows we found.
*/
- m64ranges[0] = 1; m64ranges[1] = 0;
+ m64ranges[0] = 0; m64ranges[1] = 16;
OF_getpropintarray(sc->sc_node, "ibm,opal-available-m64-ranges",
m64ranges, sizeof(m64ranges));
window = m64ranges[0];