summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/arch/macppc/dev/if_wi_obio.c5
-rw-r--r--sys/arch/macppc/dev/ki2c.c5
-rw-r--r--sys/arch/macppc/dev/macgpio.c6
-rw-r--r--sys/arch/macppc/dev/mediabay.c5
-rw-r--r--sys/arch/macppc/dev/mesh.c5
-rw-r--r--sys/arch/macppc/dev/openpic.c21
-rw-r--r--sys/arch/macppc/dev/wdc_obio.c7
-rw-r--r--sys/arch/macppc/dev/zs.c5
-rw-r--r--sys/arch/macppc/pci/macobio.c6
9 files changed, 40 insertions, 25 deletions
diff --git a/sys/arch/macppc/dev/if_wi_obio.c b/sys/arch/macppc/dev/if_wi_obio.c
index 75c78c72957..3663d52b169 100644
--- a/sys/arch/macppc/dev/if_wi_obio.c
+++ b/sys/arch/macppc/dev/if_wi_obio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_wi_obio.c,v 1.14 2005/10/31 05:37:13 jsg Exp $ */
+/* $OpenBSD: if_wi_obio.c,v 1.15 2006/06/19 22:42:33 miod Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
@@ -98,7 +98,8 @@ wi_obio_match(parent, match, aux)
{
struct confargs *ca = aux;
- if (strcmp(ca->ca_name, "radio") == 0)
+ if (strcmp(ca->ca_name, "radio") == 0 &&
+ ca->ca_nintr >= 4 && ca->ca_nreg >= 8)
return (1);
return (0);
}
diff --git a/sys/arch/macppc/dev/ki2c.c b/sys/arch/macppc/dev/ki2c.c
index f42eac8cf15..51dbe47338d 100644
--- a/sys/arch/macppc/dev/ki2c.c
+++ b/sys/arch/macppc/dev/ki2c.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ki2c.c,v 1.12 2006/01/01 20:52:25 deraadt Exp $ */
+/* $OpenBSD: ki2c.c,v 1.13 2006/06/19 22:42:33 miod Exp $ */
/* $NetBSD: ki2c.c,v 1.1 2003/12/27 02:19:34 grant Exp $ */
/*-
@@ -75,7 +75,8 @@ ki2c_match(struct device *parent, void *match, void *aux)
{
struct confargs *ca = aux;
- if (strcmp(ca->ca_name, "i2c") == 0)
+ if (strcmp(ca->ca_name, "i2c") == 0 &&
+ ca->ca_nreg >= 4)
return (1);
return (0);
diff --git a/sys/arch/macppc/dev/macgpio.c b/sys/arch/macppc/dev/macgpio.c
index 09c6cb08e81..b8124fee280 100644
--- a/sys/arch/macppc/dev/macgpio.c
+++ b/sys/arch/macppc/dev/macgpio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macgpio.c,v 1.4 2006/02/14 23:05:28 kettenis Exp $ */
+/* $OpenBSD: macgpio.c,v 1.5 2006/06/19 22:42:33 miod Exp $ */
/* $NetBSD: gpio.c,v 1.2 2001/02/27 05:16:33 matt Exp $ */
/*-
@@ -79,7 +79,7 @@ macgpio_match(struct device *parent, void *cf, void *aux)
if (strcmp(ca->ca_name, "gpio") != 0)
return 0;
- if (ca->ca_nreg == 0)
+ if (ca->ca_nreg < 8)
return 0;
return 1;
@@ -147,7 +147,7 @@ macgpio_gpio_match(struct device *parent, void *cf, void *aux)
if (strcmp(ca->ca_name, "extint-gpio1") != 0)
return 0;
- if (ca->ca_nintr < 0)
+ if (ca->ca_nintr < 4)
return 0;
return 1;
diff --git a/sys/arch/macppc/dev/mediabay.c b/sys/arch/macppc/dev/mediabay.c
index b4ec6a0d5f6..9eb596113e2 100644
--- a/sys/arch/macppc/dev/mediabay.c
+++ b/sys/arch/macppc/dev/mediabay.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mediabay.c,v 1.2 2004/06/14 00:32:31 deraadt Exp $ */
+/* $OpenBSD: mediabay.c,v 1.3 2006/06/19 22:42:33 miod Exp $ */
/* $NetBSD: mediabay.c,v 1.9 2003/07/15 02:43:29 lukem Exp $ */
/*-
@@ -95,7 +95,8 @@ mediabay_match(parent, v, aux)
{
struct confargs *ca = aux;
- if (strcmp(ca->ca_name, "media-bay") == 0)
+ if (strcmp(ca->ca_name, "media-bay") == 0 &&
+ ca->ca_nintr >= 4 && ca->ca_nreg >= 8)
return 1;
return 0;
diff --git a/sys/arch/macppc/dev/mesh.c b/sys/arch/macppc/dev/mesh.c
index 9406e926532..44c9d48b4d2 100644
--- a/sys/arch/macppc/dev/mesh.c
+++ b/sys/arch/macppc/dev/mesh.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mesh.c,v 1.9 2004/12/25 23:02:24 miod Exp $ */
+/* $OpenBSD: mesh.c,v 1.10 2006/06/19 22:42:33 miod Exp $ */
/* $NetBSD: mesh.c,v 1.1 1999/02/19 13:06:03 tsubai Exp $ */
/*-
@@ -214,7 +214,8 @@ mesh_match(parent, cf, aux)
struct confargs *ca = aux;
printf("MESH_MATCH called ,ca->ca_name= %s\n",ca->ca_name);
- if (strcmp(ca->ca_name, "mesh") != 0)
+ if (strcmp(ca->ca_name, "mesh") != 0 ||
+ ca->ca_nintr < 4 || ca->ca_nreg < 16)
return 0;
return 1;
diff --git a/sys/arch/macppc/dev/openpic.c b/sys/arch/macppc/dev/openpic.c
index 23371f48008..fbac0e07a9d 100644
--- a/sys/arch/macppc/dev/openpic.c
+++ b/sys/arch/macppc/dev/openpic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: openpic.c,v 1.34 2006/03/12 02:49:50 brad Exp $ */
+/* $OpenBSD: openpic.c,v 1.35 2006/06/19 22:42:33 miod Exp $ */
/*-
* Copyright (c) 1995 Per Fogelstrom
@@ -117,13 +117,18 @@ openpic_match(struct device *parent, void *cf, void *aux)
== sizeof(pirq))
return 0; /* XXX */
- if (strcmp(ca->ca_name, "interrupt-controller") == 0 ||
- strcmp(ca->ca_name, "mpic") == 0) {
- OF_getprop(ca->ca_node, "device_type", type, sizeof(type));
- if (strcmp(type, "open-pic") == 0)
- return 1;
- }
- return 0;
+ if (strcmp(ca->ca_name, "interrupt-controller") != 0 &&
+ strcmp(ca->ca_name, "mpic") != 0)
+ return 0;
+
+ OF_getprop(ca->ca_node, "device_type", type, sizeof(type));
+ if (strcmp(type, "open-pic") != 0)
+ return 0;
+
+ if (ca->ca_nreg < 8)
+ return 0;
+
+ return 1;
}
typedef void (void_f) (void);
diff --git a/sys/arch/macppc/dev/wdc_obio.c b/sys/arch/macppc/dev/wdc_obio.c
index 7f8c2b74c55..1ca92630e98 100644
--- a/sys/arch/macppc/dev/wdc_obio.c
+++ b/sys/arch/macppc/dev/wdc_obio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: wdc_obio.c,v 1.25 2006/02/10 21:45:41 kettenis Exp $ */
+/* $OpenBSD: wdc_obio.c,v 1.26 2006/06/19 22:42:33 miod Exp $ */
/* $NetBSD: wdc_obio.c,v 1.15 2001/07/25 20:26:33 bouyer Exp $ */
/*-
@@ -115,6 +115,9 @@ wdc_obio_probe(struct device *parent, void *match, void *aux)
struct confargs *ca = aux;
char compat[32];
+ if (ca->ca_nreg < 8)
+ return 0;
+
/* XXX should not use name */
if (strcmp(ca->ca_name, "ATA") == 0 ||
strncmp(ca->ca_name, "ata", 3) == 0 ||
@@ -140,7 +143,7 @@ wdc_obio_attach(struct device *parent, struct device *self, void *aux)
bus_addr_t cmdbase;
sc->sc_use_dma = 0;
- if (ca->ca_nreg >= 16 || ca->ca_nintr == -1)
+ if (ca->ca_nreg >= 16)
sc->sc_use_dma = 1; /* Enable dma */
sc->sc_dmat = ca->ca_dmat;
diff --git a/sys/arch/macppc/dev/zs.c b/sys/arch/macppc/dev/zs.c
index 111dc6afaa2..35289f89299 100644
--- a/sys/arch/macppc/dev/zs.c
+++ b/sys/arch/macppc/dev/zs.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zs.c,v 1.12 2006/01/09 20:57:00 miod Exp $ */
+/* $OpenBSD: zs.c,v 1.13 2006/06/19 22:42:33 miod Exp $ */
/* $NetBSD: zs.c,v 1.17 2001/06/19 13:42:15 wiz Exp $ */
/*
@@ -193,6 +193,9 @@ zsc_match(struct device *parent, void *match, void *aux)
if (strcmp(ca->ca_name, "escc") != 0)
return 0;
+ if (ca->ca_nreg < 8)
+ return 0;
+
if (cf->cf_unit > 1)
return 0;
diff --git a/sys/arch/macppc/pci/macobio.c b/sys/arch/macppc/pci/macobio.c
index 6d7c6b56ff1..b73d41cb901 100644
--- a/sys/arch/macppc/pci/macobio.c
+++ b/sys/arch/macppc/pci/macobio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: macobio.c,v 1.16 2006/02/14 23:05:28 kettenis Exp $ */
+/* $OpenBSD: macobio.c,v 1.17 2006/06/19 22:42:35 miod Exp $ */
/* $NetBSD: obio.c,v 1.6 1999/05/01 10:36:08 tsubai Exp $ */
/*-
@@ -182,8 +182,8 @@ macobio_attach(struct device *parent, struct device *self, void *aux)
ca.ca_nreg = 0;
ca.ca_nintr = 0;
- ca.ca_reg = 0;
- ca.ca_intr = 0;
+ ca.ca_reg = NULL;
+ ca.ca_intr = NULL;
config_found(self, &ca, macobio_print);
}