summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorpatrick <patrick@openbsd.org>2016-05-02 15:27:24 +0000
committerpatrick <patrick@openbsd.org>2016-05-02 15:27:24 +0000
commit4eab9aace75acb1f8dff1f9929778a730813350d (patch)
tree5978aeeee926367ad3103de9eb2e06ad6d119209
parentWhen writing master.password entries, use %lld for time_t and cast (diff)
downloadwireguard-openbsd-4eab9aace75acb1f8dff1f9929778a730813350d.tar.xz
wireguard-openbsd-4eab9aace75acb1f8dff1f9929778a730813350d.zip
Add check to armv7 platform bus match code, so that those busses only
attach if we are running in legacy mode. ok jsg@
-rw-r--r--sys/arch/armv7/exynos/exynos.c18
-rw-r--r--sys/arch/armv7/imx/imx.c12
-rw-r--r--sys/arch/armv7/omap/omap.c12
-rw-r--r--sys/arch/armv7/sunxi/sunxi.c12
-rw-r--r--sys/arch/armv7/vexpress/vexpress.c12
5 files changed, 53 insertions, 13 deletions
diff --git a/sys/arch/armv7/exynos/exynos.c b/sys/arch/armv7/exynos/exynos.c
index 16b7a1e060a..dfa86147fcf 100644
--- a/sys/arch/armv7/exynos/exynos.c
+++ b/sys/arch/armv7/exynos/exynos.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exynos.c,v 1.10 2016/04/24 00:57:23 patrick Exp $ */
+/* $OpenBSD: exynos.c,v 1.11 2016/05/02 15:27:24 patrick Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
@@ -20,10 +20,8 @@
#include <sys/systm.h>
#include <machine/bus.h>
-#if NFDT > 0
-#include <machine/fdt.h>
-#endif
+#include <arm/mainbus/mainbus.h>
#include <armv7/armv7/armv7var.h>
int exynos_match(struct device *, void *, void *);
@@ -171,12 +169,14 @@ exynos_board_name(void)
int
exynos_match(struct device *parent, void *cfdata, void *aux)
{
-#if NFDT > 0
- /* If we're running with fdt, do not attach. */
- /* XXX: Find a better way. */
- if (fdt_next_node(0))
+ union mainbus_attach_args *ma = (union mainbus_attach_args *)aux;
+ struct cfdata *cf = (struct cfdata *)cfdata;
+
+ if (ma->ma_name == NULL)
+ return (0);
+
+ if (strcmp(cf->cf_driver->cd_name, ma->ma_name) != 0)
return (0);
-#endif
return (exynos_board_devs() != NULL);
}
diff --git a/sys/arch/armv7/imx/imx.c b/sys/arch/armv7/imx/imx.c
index 0471a215af2..dfc6ef33023 100644
--- a/sys/arch/armv7/imx/imx.c
+++ b/sys/arch/armv7/imx/imx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imx.c,v 1.9 2016/02/02 03:31:22 jsg Exp $ */
+/* $OpenBSD: imx.c,v 1.10 2016/05/02 15:27:24 patrick Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
@@ -21,6 +21,7 @@
#include <machine/bus.h>
+#include <arm/mainbus/mainbus.h>
#include <armv7/armv7/armv7var.h>
int imx_match(struct device *, void *, void *);
@@ -301,5 +302,14 @@ imx_board_name(void)
int
imx_match(struct device *parent, void *cfdata, void *aux)
{
+ union mainbus_attach_args *ma = (union mainbus_attach_args *)aux;
+ struct cfdata *cf = (struct cfdata *)cfdata;
+
+ if (ma->ma_name == NULL)
+ return (0);
+
+ if (strcmp(cf->cf_driver->cd_name, ma->ma_name) != 0)
+ return (0);
+
return (imx_board_devs() != NULL);
}
diff --git a/sys/arch/armv7/omap/omap.c b/sys/arch/armv7/omap/omap.c
index 837ebefa057..9cb946dfba1 100644
--- a/sys/arch/armv7/omap/omap.c
+++ b/sys/arch/armv7/omap/omap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omap.c,v 1.8 2016/02/02 03:31:22 jsg Exp $ */
+/* $OpenBSD: omap.c,v 1.9 2016/05/02 15:27:24 patrick Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
*
@@ -20,6 +20,7 @@
#include <machine/bus.h>
+#include <arm/mainbus/mainbus.h>
#include <armv7/armv7/armv7var.h>
int omap_match(struct device *, void *, void *);
@@ -175,5 +176,14 @@ omap_board_name(void)
int
omap_match(struct device *parent, void *cfdata, void *aux)
{
+ union mainbus_attach_args *ma = (union mainbus_attach_args *)aux;
+ struct cfdata *cf = (struct cfdata *)cfdata;
+
+ if (ma->ma_name == NULL)
+ return (0);
+
+ if (strcmp(cf->cf_driver->cd_name, ma->ma_name) != 0)
+ return (0);
+
return (omap_board_devs() != NULL);
}
diff --git a/sys/arch/armv7/sunxi/sunxi.c b/sys/arch/armv7/sunxi/sunxi.c
index dac03489532..2ed498d8881 100644
--- a/sys/arch/armv7/sunxi/sunxi.c
+++ b/sys/arch/armv7/sunxi/sunxi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunxi.c,v 1.8 2016/02/02 03:31:22 jsg Exp $ */
+/* $OpenBSD: sunxi.c,v 1.9 2016/05/02 15:27:24 patrick Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
*
@@ -21,6 +21,7 @@
#include <machine/bus.h>
#include <arm/armv7/armv7var.h>
+#include <arm/mainbus/mainbus.h>
#include <armv7/armv7/armv7var.h>
#include <armv7/sunxi/sunxireg.h>
@@ -155,5 +156,14 @@ sunxi_board_name(void)
int
sunxi_match(struct device *parent, void *cfdata, void *aux)
{
+ union mainbus_attach_args *ma = (union mainbus_attach_args *)aux;
+ struct cfdata *cf = (struct cfdata *)cfdata;
+
+ if (ma->ma_name == NULL)
+ return (0);
+
+ if (strcmp(cf->cf_driver->cd_name, ma->ma_name) != 0)
+ return (0);
+
return (sunxi_board_devs() != NULL);
}
diff --git a/sys/arch/armv7/vexpress/vexpress.c b/sys/arch/armv7/vexpress/vexpress.c
index fcf33f814d4..8a994e1d536 100644
--- a/sys/arch/armv7/vexpress/vexpress.c
+++ b/sys/arch/armv7/vexpress/vexpress.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vexpress.c,v 1.3 2016/02/02 03:31:22 jsg Exp $ */
+/* $OpenBSD: vexpress.c,v 1.4 2016/05/02 15:27:24 patrick Exp $ */
/*
* Copyright (c) 2015 Jonathan Gray <jsg@openbsd.org>
@@ -22,6 +22,7 @@
#include <machine/bus.h>
#include <arm/cpufunc.h>
+#include <arm/mainbus/mainbus.h>
#include <armv7/armv7/armv7var.h>
int vexpress_match(struct device *, void *, void *);
@@ -105,5 +106,14 @@ vexpress_board_name(void)
int
vexpress_match(struct device *parent, void *cfdata, void *aux)
{
+ union mainbus_attach_args *ma = (union mainbus_attach_args *)aux;
+ struct cfdata *cf = (struct cfdata *)cfdata;
+
+ if (ma->ma_name == NULL)
+ return (0);
+
+ if (strcmp(cf->cf_driver->cd_name, ma->ma_name) != 0)
+ return (0);
+
return (vexpress_board_devs() != NULL);
}