From c111c7c7453256ff1a0124c8e5c4f2cdc4235b98 Mon Sep 17 00:00:00 2001 From: Joerg Wunsch Date: Sat, 14 Dec 1996 18:07:17 +0000 Subject: [PATCH] Add a small hack to UserConfig that allows to override the number of EISA slots to probe. This is mainly intended to allow installing the system on an HP Netserver with an on-board AIC7xxx EISA SCSI controller, that is sitting on EISA slot # 11. Documentation updates explaining this hack will follow shortly. Note that this can go away again as soon as the EISA device probing is more intelligent about the address space clash with the PCI address space. 2.2 candidate. Not objected by: freebsd-core :) --- sys/dev/eisa/eisaconf.c | 7 +++++-- sys/i386/eisa/eisaconf.c | 7 +++++-- sys/i386/i386/userconfig.c | 26 ++++++++++++++++++++++++-- 3 files changed, 34 insertions(+), 6 deletions(-) diff --git a/sys/dev/eisa/eisaconf.c b/sys/dev/eisa/eisaconf.c index 762633bf3ef..eeef75831bd 100644 --- a/sys/dev/eisa/eisaconf.c +++ b/sys/dev/eisa/eisaconf.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: eisaconf.c,v 1.22 1996/09/06 23:06:57 phk Exp $ + * $Id: eisaconf.c,v 1.23 1996/09/08 10:43:42 phk Exp $ */ #include #include @@ -95,6 +95,9 @@ static struct { int column; /* How much we have output so far. */ #define MAX_COL 80 } reg_state; + +/* XXX Global variable, so UserConfig can change it. */ +int num_eisa_slots = EISA_SLOTS; /* ** probe for EISA devices @@ -113,7 +116,7 @@ eisa_configure() e_drvp = (struct eisa_driver**)eisadriver_set.ls_items; - for (slot = 0; slot < EISA_SLOTS; eisaBase+=0x1000, slot++) { + for (slot = 0; slot < num_eisa_slots; eisaBase+=0x1000, slot++) { int id_size = sizeof(eisa_id); eisa_id = 0; for( i = 0; i < id_size; i++ ) { diff --git a/sys/i386/eisa/eisaconf.c b/sys/i386/eisa/eisaconf.c index 762633bf3ef..eeef75831bd 100644 --- a/sys/i386/eisa/eisaconf.c +++ b/sys/i386/eisa/eisaconf.c @@ -28,7 +28,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: eisaconf.c,v 1.22 1996/09/06 23:06:57 phk Exp $ + * $Id: eisaconf.c,v 1.23 1996/09/08 10:43:42 phk Exp $ */ #include #include @@ -95,6 +95,9 @@ static struct { int column; /* How much we have output so far. */ #define MAX_COL 80 } reg_state; + +/* XXX Global variable, so UserConfig can change it. */ +int num_eisa_slots = EISA_SLOTS; /* ** probe for EISA devices @@ -113,7 +116,7 @@ eisa_configure() e_drvp = (struct eisa_driver**)eisadriver_set.ls_items; - for (slot = 0; slot < EISA_SLOTS; eisaBase+=0x1000, slot++) { + for (slot = 0; slot < num_eisa_slots; eisaBase+=0x1000, slot++) { int id_size = sizeof(eisa_id); eisa_id = 0; for( i = 0; i < id_size; i++ ) { diff --git a/sys/i386/i386/userconfig.c b/sys/i386/i386/userconfig.c index 8b875e7b3c0..1e671c9c0d0 100644 --- a/sys/i386/i386/userconfig.c +++ b/sys/i386/i386/userconfig.c @@ -46,7 +46,7 @@ ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF ** THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ** - ** $Id: userconfig.c,v 1.70 1996/11/27 22:53:10 phk Exp $ + ** $Id: userconfig.c,v 1.71 1996/12/09 05:13:19 msmith Exp $ **/ /** @@ -2220,7 +2220,7 @@ visuserconfig(void) * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: userconfig.c,v 1.70 1996/11/27 22:53:10 phk Exp $ + * $Id: userconfig.c,v 1.71 1996/12/09 05:13:19 msmith Exp $ */ #include "scbus.h" @@ -2272,6 +2272,7 @@ static int set_device_mem(CmdParm *); static int set_device_flags(CmdParm *); static int set_device_enable(CmdParm *); static int set_device_disable(CmdParm *); +static int set_num_eisa_slots(CmdParm *); static int quitfunc(CmdParm *); static int helpfunc(CmdParm *); #if defined(USERCONFIG_BOOT) @@ -2280,6 +2281,9 @@ static int introfunc(CmdParm *); static int lineno; +/* XXX hack */ +extern int num_eisa_slots; + static CmdParm addr_parms[] = { { PARM_DEVSPEC, {} }, { PARM_ADDR, {} }, @@ -2297,10 +2301,16 @@ static CmdParm dev_parms[] = { { -1, {} }, }; +static CmdParm int_arg[] = { + { PARM_INT, {} }, + { -1, {} }, +}; + static Cmd CmdList[] = { { "?", helpfunc, NULL }, /* ? (help) */ { "di", set_device_disable, dev_parms }, /* disable dev */ { "dr", set_device_drq, int_parms }, /* drq dev # */ + { "ei", set_num_eisa_slots, int_arg }, /* # EISA slots */ { "en", set_device_enable, dev_parms }, /* enable dev */ { "ex", quitfunc, NULL }, /* exit (quit) */ { "f", set_device_flags, int_parms }, /* flags dev mask */ @@ -2451,6 +2461,7 @@ list_devices(CmdParm *parms) if (lsdevtab(&isa_devtab_tty[0])) return 0; if (lsdevtab(&isa_devtab_net[0])) return 0; if (lsdevtab(&isa_devtab_null[0])) return 0; + printf("\nNumber of EISA slots to probe: %d\n", num_eisa_slots); return 0; } @@ -2536,6 +2547,16 @@ set_device_disable(CmdParm *parms) return 0; } +static int +set_num_eisa_slots(CmdParm *parms) +{ + int num_slots; + + num_slots = parms[0].parm.iparm; + num_eisa_slots = (num_slots <= 16 ? num_slots : 10); + return 0; +} + static int quitfunc(CmdParm *parms) { @@ -2556,6 +2577,7 @@ helpfunc(CmdParm *parms) printf("flags \tSet device flags\n"); printf("enable \tEnable device\n"); printf("disable \tDisable device (will not be probed)\n"); + printf("eisa \t\tSet the number of EISA slots to probe\n"); printf("quit\t\t\tExit this configuration utility\n"); printf("reset\t\t\tReset CPU\n"); #ifdef VISUAL_USERCONFIG