summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorJonathan Gray <jsg@cvs.openbsd.org>2015-05-20 00:14:57 +0000
committerJonathan Gray <jsg@cvs.openbsd.org>2015-05-20 00:14:57 +0000
commit6ac17d698e9f2555d6a749c220845b8f7efc534f (patch)
treef2878769f10d63efcc7c6668cc77d4442c38b343 /sys
parent4c7b8e46dd62891a15569e870093e0333bb3a057 (diff)
add per soc match functions instead of using armv7_match
Diffstat (limited to 'sys')
-rw-r--r--sys/arch/armv7/exynos/exynos.c33
-rw-r--r--sys/arch/armv7/imx/imx.c13
-rw-r--r--sys/arch/armv7/omap/omap.c17
-rw-r--r--sys/arch/armv7/sunxi/sunxi.c15
4 files changed, 47 insertions, 31 deletions
diff --git a/sys/arch/armv7/exynos/exynos.c b/sys/arch/armv7/exynos/exynos.c
index 8b2e79849cd..f2dcf8c4762 100644
--- a/sys/arch/armv7/exynos/exynos.c
+++ b/sys/arch/armv7/exynos/exynos.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: exynos.c,v 1.3 2015/05/19 03:30:54 jsg Exp $ */
+/* $OpenBSD: exynos.c,v 1.4 2015/05/20 00:14:55 jsg Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
@@ -24,24 +24,8 @@
#include <armv7/armv7/armv7var.h>
-static int
-exynos_match(struct device *parent, void *cfdata, void *aux)
-{
- /* If we're running with fdt, do not attach. */
- /* XXX: Find a better way. */
- if (fdt_next_node(0))
- return (0);
-
- switch (board_id)
- {
- case BOARD_ID_EXYNOS5_CHROMEBOOK:
- return (1);
- }
-
- return (0);
-}
-
-void exynos5_init();
+int exynos_match(struct device *, void *, void *);
+void exynos5_init();
struct cfattach exynos_ca = {
sizeof(struct armv7_softc), exynos_match, armv7_attach, NULL,
@@ -120,3 +104,14 @@ exynos_board_name(void)
}
return (NULL);
}
+
+int
+exynos_match(struct device *parent, void *cfdata, void *aux)
+{
+ /* If we're running with fdt, do not attach. */
+ /* XXX: Find a better way. */
+ if (fdt_next_node(0))
+ return (0);
+
+ return (imx_board_devs() != NULL);
+}
diff --git a/sys/arch/armv7/imx/imx.c b/sys/arch/armv7/imx/imx.c
index c75c956c028..6610e7fb66a 100644
--- a/sys/arch/armv7/imx/imx.c
+++ b/sys/arch/armv7/imx/imx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: imx.c,v 1.7 2015/05/19 03:30:54 jsg Exp $ */
+/* $OpenBSD: imx.c,v 1.8 2015/05/20 00:14:55 jsg Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
* Copyright (c) 2012-2013 Patrick Wildt <patrick@blueri.se>
@@ -23,10 +23,11 @@
#include <armv7/armv7/armv7var.h>
-void imx6_init();
+int imx_match(struct device *, void *, void *);
+void imx6_init();
struct cfattach imx_ca = {
- sizeof(struct armv7_softc), armv7_match, armv7_attach, NULL,
+ sizeof(struct armv7_softc), imx_match, armv7_attach, NULL,
config_activate_children
};
@@ -298,3 +299,9 @@ imx_board_name(void)
}
return (NULL);
}
+
+int
+imx_match(struct device *parent, void *cfdata, void *aux)
+{
+ return (imx_board_devs() != NULL);
+}
diff --git a/sys/arch/armv7/omap/omap.c b/sys/arch/armv7/omap/omap.c
index 02b9a71d1a3..fc033935942 100644
--- a/sys/arch/armv7/omap/omap.c
+++ b/sys/arch/armv7/omap/omap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: omap.c,v 1.6 2015/05/19 03:30:54 jsg Exp $ */
+/* $OpenBSD: omap.c,v 1.7 2015/05/20 00:14:56 jsg Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
*
@@ -22,12 +22,13 @@
#include <armv7/armv7/armv7var.h>
-void omap3_init();
-void omap4_init();
-void am335x_init();
+int omap_match(struct device *, void *, void *);
+void omap3_init();
+void omap4_init();
+void am335x_init();
struct cfattach omap_ca = {
- sizeof(struct armv7_softc), armv7_match, armv7_attach
+ sizeof(struct armv7_softc), omap_match, armv7_attach
};
struct cfdriver omap_cd = {
@@ -172,3 +173,9 @@ omap_board_name(void)
}
return (NULL);
}
+
+int
+omap_match(struct device *parent, void *cfdata, void *aux)
+{
+ return (omap_board_devs() != NULL);
+}
diff --git a/sys/arch/armv7/sunxi/sunxi.c b/sys/arch/armv7/sunxi/sunxi.c
index 504214461f4..accd475a085 100644
--- a/sys/arch/armv7/sunxi/sunxi.c
+++ b/sys/arch/armv7/sunxi/sunxi.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sunxi.c,v 1.5 2015/05/19 03:30:54 jsg Exp $ */
+/* $OpenBSD: sunxi.c,v 1.6 2015/05/20 00:14:56 jsg Exp $ */
/*
* Copyright (c) 2005,2008 Dale Rahn <drahn@openbsd.com>
*
@@ -24,11 +24,12 @@
#include <armv7/armv7/armv7var.h>
#include <armv7/sunxi/sunxireg.h>
-void sxia1x_init();
-void sxia20_init();
+int sunxi_match(struct device *, void *, void *);
+void sxia1x_init();
+void sxia20_init();
struct cfattach sunxi_ca = {
- sizeof(struct armv7_softc), armv7_match, armv7_attach
+ sizeof(struct armv7_softc), sunxi_match, armv7_attach
};
struct cfdriver sunxi_cd = {
@@ -155,3 +156,9 @@ sunxi_board_name(void)
}
return (NULL);
}
+
+int
+sunxi_match(struct device *parent, void *cfdata, void *aux)
+{
+ return (sunxi_board_devs() != NULL);
+}