diff options
author | 2016-03-19 17:17:06 +0000 | |
---|---|---|
committer | 2016-03-19 17:17:06 +0000 | |
commit | 60af79c0fb2913d22401f407b6f76e23223c058b (patch) | |
tree | ccf79c8efde5cf68b13181265b607c731a5905c0 | |
parent | Turn off the close-on-exec bit with fcntl() instead of ioctl(). (diff) | |
download | wireguard-openbsd-60af79c0fb2913d22401f407b6f76e23223c058b.tar.xz wireguard-openbsd-60af79c0fb2913d22401f407b6f76e23223c058b.zip |
Attach dwctwo(4) only on Octeon models that have a DWC2 controller.
OK uebayasi@
-rw-r--r-- | sys/arch/octeon/dev/octdwctwo.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/arch/octeon/dev/octdwctwo.c b/sys/arch/octeon/dev/octdwctwo.c index 995a783ae39..b732b121ec6 100644 --- a/sys/arch/octeon/dev/octdwctwo.c +++ b/sys/arch/octeon/dev/octdwctwo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: octdwctwo.c,v 1.9 2015/09/01 14:45:24 visa Exp $ */ +/* $OpenBSD: octdwctwo.c,v 1.10 2016/03/19 17:17:06 visa Exp $ */ /* * Copyright (c) 2015 Masao Uebayashi <uebayasi@tombiinc.com> @@ -24,6 +24,7 @@ #include <machine/bus.h> #include <machine/octeonreg.h> #include <machine/octeonvar.h> +#include <machine/octeon_model.h> #include <octeon/dev/iobusvar.h> #include <octeon/dev/octhcireg.h> @@ -123,7 +124,17 @@ bus_space_t octdwctwo_tag = { int octdwctwo_match(struct device *parent, void *match, void *aux) { - return (1); + int id; + + id = octeon_get_chipid(); + switch (octeon_model_family(id)) { + case OCTEON_MODEL_FAMILY_CN30XX: + case OCTEON_MODEL_FAMILY_CN31XX: + case OCTEON_MODEL_FAMILY_CN50XX: + return (1); + default: + return (0); + } } void |