From 716c89ccb2c93b3fef0ffd59791c39fd9ab394d9 Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 28 Jul 1997 18:07:03 +0000 Subject: [PATCH] Include locators.h for the definition MAINBUSCF_BASE_DEFAULT. In the probe routines check the mainbus attach args mb_iobase field to verify that the iobase did not default as an iobase address needs to be specifically specified. --- sys/arch/arm32/dev/com.c | 8 ++++++-- sys/arch/arm32/dev/kbd.c | 10 ++++++++-- sys/arch/arm32/dev/lpt.c | 8 +++++++- sys/arch/arm32/dev/pms.c | 11 +++++++++-- sys/arch/arm32/dev/qms.c | 9 +++++++-- sys/arch/arm32/mainbus/beep.c | 9 +++++++-- sys/arch/arm32/mainbus/com.c | 8 ++++++-- sys/arch/arm32/mainbus/fd.c | 6 +++++- sys/arch/arm32/mainbus/if_es.c | 8 +++++++- sys/arch/arm32/mainbus/kbd.c | 10 ++++++++-- sys/arch/arm32/mainbus/lpt.c | 8 +++++++- sys/arch/arm32/mainbus/pms.c | 11 +++++++++-- sys/arch/arm32/mainbus/qmouse.c | 9 +++++++-- sys/arch/arm32/rc7500/if_es.c | 8 +++++++- sys/arch/arm32/vidc/beep.c | 9 +++++++-- 15 files changed, 107 insertions(+), 25 deletions(-) diff --git a/sys/arch/arm32/dev/com.c b/sys/arch/arm32/dev/com.c index d8631eaeece6..19947e8d0b03 100644 --- a/sys/arch/arm32/dev/com.c +++ b/sys/arch/arm32/dev/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.16 1997/01/26 02:16:44 mark Exp $ */ +/* $NetBSD: com.c,v 1.17 1997/07/28 18:07:06 mark Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996 @@ -70,7 +70,7 @@ #define com_lcr com_cfcr #include "com.h" - +#include "locators.h" #define COM_IBUFSIZE (2 * 512) #define COM_IHIGHWATER ((3 * COM_IBUFSIZE) / 4) @@ -305,6 +305,10 @@ comprobe(parent, match, aux) int rv = 1; struct mainbus_attach_args *mb = aux; + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + iot = mb->mb_iot; iobase = mb->mb_iobase; diff --git a/sys/arch/arm32/dev/kbd.c b/sys/arch/arm32/dev/kbd.c index e7e2d70e9368..de511dafa5a3 100644 --- a/sys/arch/arm32/dev/kbd.c +++ b/sys/arch/arm32/dev/kbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: kbd.c,v 1.17 1997/03/26 22:42:31 gwr Exp $ */ +/* $NetBSD: kbd.c,v 1.18 1997/07/28 18:07:16 mark Exp $ */ /* * Copyright (c) 1994 Mark Brinicombe. @@ -67,9 +67,10 @@ #include #include #include + #include "vt.h" #include "kbd.h" - +#include "locators.h" /* Define the key_struct structure */ @@ -664,8 +665,13 @@ kbdprobe(parent, match, aux) void *match; void *aux; { + struct mainbus_attach_args *mb = aux; int id; + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + /* Make sure we have an IOMD we understand */ id = IOMD_ID; diff --git a/sys/arch/arm32/dev/lpt.c b/sys/arch/arm32/dev/lpt.c index 9da6f0274e14..2cc6cdaeb5f9 100644 --- a/sys/arch/arm32/dev/lpt.c +++ b/sys/arch/arm32/dev/lpt.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpt.c,v 1.14 1997/01/13 00:46:51 mark Exp $ */ +/* $NetBSD: lpt.c,v 1.15 1997/07/28 18:07:19 mark Exp $ */ /* * Copyright (c) 1993, 1994 Charles Hannum. @@ -71,6 +71,8 @@ #include #include +#include "locators.h" + #define TIMEOUT hz*16 /* wait up to 16 seconds for a ready */ #define STEP hz/4 @@ -213,6 +215,10 @@ lptprobe(parent, match, aux) #define ABORT goto out #endif + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + iot = mb->mb_iot; base = mb->mb_iobase; if (bus_space_map(iot, base, LPT_NPORTS, 0, &ioh)) diff --git a/sys/arch/arm32/dev/pms.c b/sys/arch/arm32/dev/pms.c index b5e20755b2d9..d04c7067e4af 100644 --- a/sys/arch/arm32/dev/pms.c +++ b/sys/arch/arm32/dev/pms.c @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.10 1997/01/28 04:55:17 mark Exp $ */ +/* $NetBSD: pms.c,v 1.11 1997/07/28 18:07:22 mark Exp $ */ /*- * Copyright (c) 1996 D.C. Tsen @@ -67,6 +67,8 @@ #include #include +#include "locators.h" + /* mouse commands */ #define PMS_SET_SCALE11 0xe6 /* set scaling 1:1 */ #define PMS_SET_SCALE21 0xe7 /* set scaling 2:1 */ @@ -184,7 +186,12 @@ pmsprobe(parent, match, aux) struct device *parent; void *match, *aux; { - /*struct mainbus_attach_args *mb = aux;*/ + struct mainbus_attach_args *mb = aux; + + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + return(pmsinit()); } diff --git a/sys/arch/arm32/dev/qms.c b/sys/arch/arm32/dev/qms.c index 20f0de169f6a..15777cf353f3 100644 --- a/sys/arch/arm32/dev/qms.c +++ b/sys/arch/arm32/dev/qms.c @@ -1,4 +1,4 @@ -/* $NetBSD: qms.c,v 1.13 1997/01/28 04:55:18 mark Exp $ */ +/* $NetBSD: qms.c,v 1.14 1997/07/28 18:07:24 mark Exp $ */ /* * Copyright (c) Scott Stevens 1995 All rights reserved @@ -61,6 +61,7 @@ #include #include "quadmouse.h" +#include "locators.h" #define TIMER1_COUNT 40000 /* 50Hz */ @@ -105,9 +106,13 @@ quadmouseprobe(parent, match, aux) void *match; void *aux; { -/* struct mainbus_attach_args *mb = aux;*/ + struct mainbus_attach_args *mb = aux; int id; + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + /* Make sure we have an IOMD we understand */ id = IOMD_ID; diff --git a/sys/arch/arm32/mainbus/beep.c b/sys/arch/arm32/mainbus/beep.c index a26817e4789b..45bbee77eef3 100644 --- a/sys/arch/arm32/mainbus/beep.c +++ b/sys/arch/arm32/mainbus/beep.c @@ -1,4 +1,4 @@ -/* $NetBSD: beep.c,v 1.9 1997/01/28 04:55:15 mark Exp $ */ +/* $NetBSD: beep.c,v 1.10 1997/07/28 18:07:03 mark Exp $ */ /* * Copyright (c) 1995 Mark Brinicombe @@ -70,6 +70,7 @@ #endif #include "beep.h" +#include "locators.h" struct beep_softc { struct device sc_device; @@ -109,9 +110,13 @@ beepprobe(parent, match, aux) void *match; void *aux; { -/* struct mainbus_attach_args *mb = aux;*/ + struct mainbus_attach_args *mb = aux; int id; + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + /* Make sure we have an IOMD we understand */ id = IOMD_ID; diff --git a/sys/arch/arm32/mainbus/com.c b/sys/arch/arm32/mainbus/com.c index d8631eaeece6..19947e8d0b03 100644 --- a/sys/arch/arm32/mainbus/com.c +++ b/sys/arch/arm32/mainbus/com.c @@ -1,4 +1,4 @@ -/* $NetBSD: com.c,v 1.16 1997/01/26 02:16:44 mark Exp $ */ +/* $NetBSD: com.c,v 1.17 1997/07/28 18:07:06 mark Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996 @@ -70,7 +70,7 @@ #define com_lcr com_cfcr #include "com.h" - +#include "locators.h" #define COM_IBUFSIZE (2 * 512) #define COM_IHIGHWATER ((3 * COM_IBUFSIZE) / 4) @@ -305,6 +305,10 @@ comprobe(parent, match, aux) int rv = 1; struct mainbus_attach_args *mb = aux; + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + iot = mb->mb_iot; iobase = mb->mb_iobase; diff --git a/sys/arch/arm32/mainbus/fd.c b/sys/arch/arm32/mainbus/fd.c index 7e77c06f3ac2..caf45fb94b9b 100644 --- a/sys/arch/arm32/mainbus/fd.c +++ b/sys/arch/arm32/mainbus/fd.c @@ -1,4 +1,4 @@ -/* $NetBSD: fd.c,v 1.19 1997/07/17 01:48:35 jtk Exp $ */ +/* $NetBSD: fd.c,v 1.20 1997/07/28 18:07:10 mark Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996 @@ -265,6 +265,10 @@ fdcprobe(parent, match, aux) bus_space_handle_t ioh; int rv; + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + iot = mb->mb_iot; rv = 0; diff --git a/sys/arch/arm32/mainbus/if_es.c b/sys/arch/arm32/mainbus/if_es.c index 30e10fc57321..48ec30b90412 100644 --- a/sys/arch/arm32/mainbus/if_es.c +++ b/sys/arch/arm32/mainbus/if_es.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_es.c,v 1.7 1997/03/15 18:09:32 is Exp $ */ +/* $NetBSD: if_es.c,v 1.8 1997/07/28 18:07:13 mark Exp $ */ /* * Copyright (c) 1996, Danny C Tsen. @@ -76,6 +76,8 @@ #include #include +#include "locators.h" + #define SWAP(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff)) /* @@ -140,6 +142,10 @@ esprobe(parent, match, aux) struct device *parent; void *match, *aux; { + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + /* * This is a driver for the ethernet controller on the RC7500 motherboard. * It would be nice to be able to probe rather that using conditional diff --git a/sys/arch/arm32/mainbus/kbd.c b/sys/arch/arm32/mainbus/kbd.c index e7e2d70e9368..de511dafa5a3 100644 --- a/sys/arch/arm32/mainbus/kbd.c +++ b/sys/arch/arm32/mainbus/kbd.c @@ -1,4 +1,4 @@ -/* $NetBSD: kbd.c,v 1.17 1997/03/26 22:42:31 gwr Exp $ */ +/* $NetBSD: kbd.c,v 1.18 1997/07/28 18:07:16 mark Exp $ */ /* * Copyright (c) 1994 Mark Brinicombe. @@ -67,9 +67,10 @@ #include #include #include + #include "vt.h" #include "kbd.h" - +#include "locators.h" /* Define the key_struct structure */ @@ -664,8 +665,13 @@ kbdprobe(parent, match, aux) void *match; void *aux; { + struct mainbus_attach_args *mb = aux; int id; + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + /* Make sure we have an IOMD we understand */ id = IOMD_ID; diff --git a/sys/arch/arm32/mainbus/lpt.c b/sys/arch/arm32/mainbus/lpt.c index 9da6f0274e14..2cc6cdaeb5f9 100644 --- a/sys/arch/arm32/mainbus/lpt.c +++ b/sys/arch/arm32/mainbus/lpt.c @@ -1,4 +1,4 @@ -/* $NetBSD: lpt.c,v 1.14 1997/01/13 00:46:51 mark Exp $ */ +/* $NetBSD: lpt.c,v 1.15 1997/07/28 18:07:19 mark Exp $ */ /* * Copyright (c) 1993, 1994 Charles Hannum. @@ -71,6 +71,8 @@ #include #include +#include "locators.h" + #define TIMEOUT hz*16 /* wait up to 16 seconds for a ready */ #define STEP hz/4 @@ -213,6 +215,10 @@ lptprobe(parent, match, aux) #define ABORT goto out #endif + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + iot = mb->mb_iot; base = mb->mb_iobase; if (bus_space_map(iot, base, LPT_NPORTS, 0, &ioh)) diff --git a/sys/arch/arm32/mainbus/pms.c b/sys/arch/arm32/mainbus/pms.c index b5e20755b2d9..d04c7067e4af 100644 --- a/sys/arch/arm32/mainbus/pms.c +++ b/sys/arch/arm32/mainbus/pms.c @@ -1,4 +1,4 @@ -/* $NetBSD: pms.c,v 1.10 1997/01/28 04:55:17 mark Exp $ */ +/* $NetBSD: pms.c,v 1.11 1997/07/28 18:07:22 mark Exp $ */ /*- * Copyright (c) 1996 D.C. Tsen @@ -67,6 +67,8 @@ #include #include +#include "locators.h" + /* mouse commands */ #define PMS_SET_SCALE11 0xe6 /* set scaling 1:1 */ #define PMS_SET_SCALE21 0xe7 /* set scaling 2:1 */ @@ -184,7 +186,12 @@ pmsprobe(parent, match, aux) struct device *parent; void *match, *aux; { - /*struct mainbus_attach_args *mb = aux;*/ + struct mainbus_attach_args *mb = aux; + + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + return(pmsinit()); } diff --git a/sys/arch/arm32/mainbus/qmouse.c b/sys/arch/arm32/mainbus/qmouse.c index f545f2f2563c..4bbd6f254095 100644 --- a/sys/arch/arm32/mainbus/qmouse.c +++ b/sys/arch/arm32/mainbus/qmouse.c @@ -1,4 +1,4 @@ -/* $NetBSD: qmouse.c,v 1.13 1997/01/28 04:55:18 mark Exp $ */ +/* $NetBSD: qmouse.c,v 1.14 1997/07/28 18:07:24 mark Exp $ */ /* * Copyright (c) Scott Stevens 1995 All rights reserved @@ -61,6 +61,7 @@ #include #include "quadmouse.h" +#include "locators.h" #define TIMER1_COUNT 40000 /* 50Hz */ @@ -105,9 +106,13 @@ quadmouseprobe(parent, match, aux) void *match; void *aux; { -/* struct mainbus_attach_args *mb = aux;*/ + struct mainbus_attach_args *mb = aux; int id; + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + /* Make sure we have an IOMD we understand */ id = IOMD_ID; diff --git a/sys/arch/arm32/rc7500/if_es.c b/sys/arch/arm32/rc7500/if_es.c index 30e10fc57321..48ec30b90412 100644 --- a/sys/arch/arm32/rc7500/if_es.c +++ b/sys/arch/arm32/rc7500/if_es.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_es.c,v 1.7 1997/03/15 18:09:32 is Exp $ */ +/* $NetBSD: if_es.c,v 1.8 1997/07/28 18:07:13 mark Exp $ */ /* * Copyright (c) 1996, Danny C Tsen. @@ -76,6 +76,8 @@ #include #include +#include "locators.h" + #define SWAP(x) (((x & 0xff) << 8) | ((x >> 8) & 0xff)) /* @@ -140,6 +142,10 @@ esprobe(parent, match, aux) struct device *parent; void *match, *aux; { + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + /* * This is a driver for the ethernet controller on the RC7500 motherboard. * It would be nice to be able to probe rather that using conditional diff --git a/sys/arch/arm32/vidc/beep.c b/sys/arch/arm32/vidc/beep.c index a26817e4789b..45bbee77eef3 100644 --- a/sys/arch/arm32/vidc/beep.c +++ b/sys/arch/arm32/vidc/beep.c @@ -1,4 +1,4 @@ -/* $NetBSD: beep.c,v 1.9 1997/01/28 04:55:15 mark Exp $ */ +/* $NetBSD: beep.c,v 1.10 1997/07/28 18:07:03 mark Exp $ */ /* * Copyright (c) 1995 Mark Brinicombe @@ -70,6 +70,7 @@ #endif #include "beep.h" +#include "locators.h" struct beep_softc { struct device sc_device; @@ -109,9 +110,13 @@ beepprobe(parent, match, aux) void *match; void *aux; { -/* struct mainbus_attach_args *mb = aux;*/ + struct mainbus_attach_args *mb = aux; int id; + /* We need a base address */ + if (mb->mb_iobase == MAINBUSCF_BASE_DEFAULT) + return(0); + /* Make sure we have an IOMD we understand */ id = IOMD_ID;