diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2004-07-20 20:33:22 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2004-07-20 20:33:22 +0000 |
commit | 59a2d56dba00c5ee9139955a0541b8e7295d8358 (patch) | |
tree | 08f044b6b72ec841d04f86d964c0d91c12dca19a /sys/arch/mvme88k | |
parent | 0066da537c51c58d6f5acb9e239b3a3027b9f442 (diff) |
Let the boot device detection code handle secondary SCSI buses.
Diffstat (limited to 'sys/arch/mvme88k')
-rw-r--r-- | sys/arch/mvme88k/dev/vs.c | 6 | ||||
-rw-r--r-- | sys/arch/mvme88k/include/autoconf.h | 3 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/autoconf.c | 4 | ||||
-rw-r--r-- | sys/arch/mvme88k/mvme88k/disksubr.c | 38 |
4 files changed, 31 insertions, 20 deletions
diff --git a/sys/arch/mvme88k/dev/vs.c b/sys/arch/mvme88k/dev/vs.c index 053cbd725a7..327fcfb2adb 100644 --- a/sys/arch/mvme88k/dev/vs.c +++ b/sys/arch/mvme88k/dev/vs.c @@ -1,4 +1,4 @@ -/* $OpenBSD: vs.c,v 1.49 2004/07/20 20:32:02 miod Exp $ */ +/* $OpenBSD: vs.c,v 1.50 2004/07/20 20:33:18 miod Exp $ */ /* * Copyright (c) 2004, Miodrag Vallat. @@ -221,10 +221,12 @@ vsattach(struct device *parent, struct device *self, void *args) if (sc->sc_id[bus] < 0) continue; + bootbus = bus; config_found(self, &sc->sc_link[bus], scsiprint); } - bootpart = tmp; /* restore old value */ + bootpart = tmp; /* restore old values */ + bootbus = 0; } int diff --git a/sys/arch/mvme88k/include/autoconf.h b/sys/arch/mvme88k/include/autoconf.h index 6e64d776de5..e88d4074970 100644 --- a/sys/arch/mvme88k/include/autoconf.h +++ b/sys/arch/mvme88k/include/autoconf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.h,v 1.14 2004/05/07 18:10:28 miod Exp $ */ +/* $OpenBSD: autoconf.h,v 1.15 2004/07/20 20:33:19 miod Exp $ */ /* * Copyright (c) 1999, Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -60,6 +60,7 @@ struct confargs { /* the following are from the prom/bootblocks */ extern paddr_t bootaddr; /* PA of boot device */ extern int bootpart; /* boot partition (disk) */ +extern int bootbus; /* scsi bus (disk) */ extern struct device *bootdv; /* boot device */ diff --git a/sys/arch/mvme88k/mvme88k/autoconf.c b/sys/arch/mvme88k/mvme88k/autoconf.c index afa4ebbbeeb..2d1ac6ef381 100644 --- a/sys/arch/mvme88k/mvme88k/autoconf.c +++ b/sys/arch/mvme88k/mvme88k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.28 2004/05/04 15:27:20 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.29 2004/07/20 20:33:21 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -66,7 +66,7 @@ struct device *getdisk(char *, int, int, dev_t *); int cold = 1; /* 1 if still booting */ paddr_t bootaddr; -int bootpart; +int bootpart, bootbus; struct device *bootdv; /* set by device drivers (if found) */ /* diff --git a/sys/arch/mvme88k/mvme88k/disksubr.c b/sys/arch/mvme88k/mvme88k/disksubr.c index 18c2ce788c5..737fd9607b7 100644 --- a/sys/arch/mvme88k/mvme88k/disksubr.c +++ b/sys/arch/mvme88k/mvme88k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.25 2004/03/17 14:16:04 miod Exp $ */ +/* $OpenBSD: disksubr.c,v 1.26 2004/07/20 20:33:21 miod Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. @@ -47,7 +47,7 @@ int disksubr_debug; void bsdtocpulabel(struct disklabel *, struct cpu_disklabel *); void cputobsdlabel(struct disklabel *, struct cpu_disklabel *); -int get_target(void); +int get_target(int *, int *); #ifdef DEBUG void printlp(struct disklabel *, char *); @@ -61,7 +61,7 @@ void printclp(struct cpu_disklabel *, char *); * MVME328 daughter cards (DLUN >= 0x40) are not handled correctly yet. */ int -get_target() +get_target(int *target, int *bus) { extern int bootdev; @@ -71,7 +71,9 @@ get_target() /* MVME327 */ case 0x02: case 0x03: - return ((bootdev & 0xff) >> 4); + *bus = 0; + *target = (bootdev & 0x70) >> 4; + return 0; /* MVME328 */ case 0x06: case 0x07: @@ -79,9 +81,11 @@ get_target() case 0x17: case 0x18: case 0x19: - return ((bootdev & 0xff) >> 3); - default: + *bus = (bootdev & 0x40) >> 6; + *target = (bootdev & 0x38) >> 3; return 0; + default: + return ENODEV; } } @@ -91,24 +95,28 @@ dk_establish(dk, dev) struct device *dev; { struct scsibus_softc *sbsc; - int target, lun; + int target, bus; if (bootpart == -1) /* ignore flag from controller driver? */ return; /* - * scsi: sd,cd + * scsi: sd,cd,st */ - if (strncmp("sd", dev->dv_xname, 2) == 0 || - strncmp("cd", dev->dv_xname, 2) == 0) { - + if (strncmp("cd", dev->dv_xname, 2) == 0 || + strncmp("sd", dev->dv_xname, 2) == 0 || + strncmp("st", dev->dv_xname, 2) == 0) { sbsc = (struct scsibus_softc *)dev->dv_parent; - target = get_target(); /* Work the Motorola Magic */ - lun = 0; + if (get_target(&target, &bus) != 0) + return; - if (sbsc->sc_link[target][lun] != NULL && - sbsc->sc_link[target][lun]->device_softc == (void *)dev) { + /* make sure we are on the expected scsibus */ + if (bootbus != bus) + return; + + if (sbsc->sc_link[target][0] != NULL && + sbsc->sc_link[target][0]->device_softc == (void *)dev) { bootdv = dev; return; } |