Remove old-style boot device recognition.
This commit is contained in:
parent
ac8d6acaa7
commit
cd1f76b21b
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: fd.c,v 1.8 1999/06/07 05:28:03 eeh Exp $ */
|
||||
/* $NetBSD: fd.c,v 1.9 2000/01/14 14:33:31 pk Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1993, 1994, 1995 Charles M. Hannum.
|
||||
|
@ -322,7 +322,6 @@ fdcmatch(parent, match, aux)
|
|||
*/
|
||||
struct fdc_attach_args {
|
||||
int fa_drive;
|
||||
struct bootpath *fa_bootpath;
|
||||
struct fd_type *fa_deftype;
|
||||
};
|
||||
|
||||
|
@ -377,7 +376,6 @@ fdcattach(parent, self, aux)
|
|||
register struct confargs *ca = aux;
|
||||
struct fdc_softc *fdc = (void *)self;
|
||||
struct fdc_attach_args fa;
|
||||
struct bootpath *bp;
|
||||
int pri;
|
||||
char code;
|
||||
|
||||
|
@ -451,49 +449,6 @@ fdcattach(parent, self, aux)
|
|||
|
||||
printf(" pri %d, softpri %d: chip 8207%c\n", pri, PIL_FDSOFT, code);
|
||||
|
||||
/*
|
||||
* Controller and drives are represented by one and the same
|
||||
* Openprom node, so we can as well check for the floppy boots here.
|
||||
*/
|
||||
fa.fa_bootpath = 0;
|
||||
if ((bp = ca->ca_ra.ra_bp) && strcmp(bp->name, OBP_FDNAME) == 0) {
|
||||
|
||||
switch (ca->ca_bustype) {
|
||||
case BUS_MAIN:
|
||||
/*
|
||||
* We can get the bootpath in several different
|
||||
* formats! The faked v1 bootpath looks like /fd@0,0.
|
||||
* The v2 bootpath is either just /fd0, in which case
|
||||
* `bp->val[0]' will have been set to -1, or /fd@x,y
|
||||
* where <x,y> is the prom address specifier.
|
||||
*/
|
||||
if (((bp->val[0] == ca->ca_ra.ra_iospace) &&
|
||||
(bp->val[1] == (int)ca->ca_ra.ra_paddr)) ||
|
||||
|
||||
((bp->val[0] == -1) && /* v2: /fd0 */
|
||||
(bp->val[1] == 0)) ||
|
||||
|
||||
((bp->val[0] == 0) && /* v1: /fd@0,0 */
|
||||
(bp->val[1] == 0))
|
||||
)
|
||||
fa.fa_bootpath = bp;
|
||||
break;
|
||||
|
||||
case BUS_OBIO:
|
||||
/*
|
||||
* floppy controller on obio (such as on the sun4m),
|
||||
* e.g.: `/obio0/SUNW,fdtwo@0,700000'.
|
||||
* We use "slot, offset" to determine if this is the
|
||||
* right one.
|
||||
*/
|
||||
if ((bp->val[0] == ca->ca_slot) &&
|
||||
(bp->val[1] == ca->ca_offset))
|
||||
fa.fa_bootpath = bp;
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/* physical limit: four drives per controller. */
|
||||
for (fa.fa_drive = 0; fa.fa_drive < 4; fa.fa_drive++) {
|
||||
fa.fa_deftype = NULL; /* unknown */
|
||||
|
@ -501,7 +456,6 @@ fdcattach(parent, self, aux)
|
|||
(void)config_found(self, (void *)&fa, fdprint);
|
||||
}
|
||||
|
||||
bootpath_store(1, NULL);
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -609,12 +563,6 @@ fdattach(parent, self, aux)
|
|||
fd->sc_dk.dk_driver = &fddkdriver;
|
||||
disk_attach(&fd->sc_dk);
|
||||
|
||||
/*
|
||||
* We're told if we're the boot device in fdcattach().
|
||||
*/
|
||||
if (fa->fa_bootpath)
|
||||
fa->fa_bootpath->dev = &fd->sc_dv;
|
||||
|
||||
/*
|
||||
* Establish a mountroot_hook anyway in case we booted
|
||||
* with RB_ASKNAME and get selected as the boot device.
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: sbus.c,v 1.22 1999/11/25 05:03:53 mrg Exp $ */
|
||||
/* $NetBSD: sbus.c,v 1.23 2000/01/14 14:27:14 pk Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -271,7 +271,6 @@ sbus_attach(parent, self, aux)
|
|||
bus_space_tag_t sbt;
|
||||
struct sbus_attach_args sa;
|
||||
char *busname = "sbus";
|
||||
struct bootpath *bp = ma->ma_bp;
|
||||
|
||||
|
||||
sc->sc_bustag = ma->ma_bustag;
|
||||
|
@ -299,12 +298,6 @@ sbus_attach(parent, self, aux)
|
|||
*/
|
||||
sc->sc_burst = getpropint(node, "burst-sizes", 0);
|
||||
|
||||
/* Propagate bootpath */
|
||||
if (bp != NULL && strcmp(bp->name, busname) == 0)
|
||||
bp++;
|
||||
else
|
||||
bp = NULL;
|
||||
|
||||
/*
|
||||
* Collect address translations from the OBP.
|
||||
*/
|
||||
|
@ -334,7 +327,7 @@ sbus_attach(parent, self, aux)
|
|||
char *name = getpropstring(node, "name");
|
||||
|
||||
if (sbus_setup_attach_args(sc, sbt, sc->sc_dmatag,
|
||||
node, bp, &sa) != 0) {
|
||||
node, &sa) != 0) {
|
||||
printf("sbus_attach: %s: incomplete\n", name);
|
||||
continue;
|
||||
}
|
||||
|
@ -344,12 +337,11 @@ sbus_attach(parent, self, aux)
|
|||
}
|
||||
|
||||
int
|
||||
sbus_setup_attach_args(sc, bustag, dmatag, node, bp, sa)
|
||||
sbus_setup_attach_args(sc, bustag, dmatag, node, sa)
|
||||
struct sbus_softc *sc;
|
||||
bus_space_tag_t bustag;
|
||||
bus_dma_tag_t dmatag;
|
||||
int node;
|
||||
struct bootpath *bp;
|
||||
struct sbus_attach_args *sa;
|
||||
{
|
||||
/*struct sbus_reg sbusreg;*/
|
||||
|
@ -366,7 +358,6 @@ sbus_setup_attach_args(sc, bustag, dmatag, node, bp, sa)
|
|||
sa->sa_bustag = bustag;
|
||||
sa->sa_dmatag = dmatag;
|
||||
sa->sa_node = node;
|
||||
sa->sa_bp = bp;
|
||||
|
||||
error = getprop(node, "reg", sizeof(struct sbus_reg),
|
||||
&sa->sa_nreg, (void **)&sa->sa_reg);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: upa.c,v 1.5 1999/06/07 05:28:04 eeh Exp $ */
|
||||
/* $NetBSD: upa.c,v 1.6 2000/01/14 14:33:31 pk Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -234,7 +234,7 @@ upa_attach_mainbus(parent, self, aux)
|
|||
sc->sc_clockfreq = getpropint(node, "clock-frequency", 25*1000*1000);
|
||||
printf(": clock = %s MHz\n", clockfreq(sc->sc_clockfreq));
|
||||
|
||||
upa_attach(sc, "upa", node, ma->ma_bp, NULL);
|
||||
upa_attach(sc, "upa", node, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -260,7 +260,7 @@ upa_attach_iommu(parent, self, aux)
|
|||
sc->sc_clockfreq = getpropint(node, "clock-frequency", 25*1000*1000);
|
||||
printf(": clock = %s MHz\n", clockfreq(sc->sc_clockfreq));
|
||||
|
||||
upa_attach(sc, "upa", node, ia->iom_bp, NULL);
|
||||
upa_attach(sc, "upa", node, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -286,15 +286,14 @@ upa_attach_xbox(parent, self, aux)
|
|||
sc->sc_clockfreq = getpropint(node, "clock-frequency", 25*1000*1000);
|
||||
printf(": clock = %s MHz\n", clockfreq(sc->sc_clockfreq));
|
||||
|
||||
upa_attach(sc, "upa", node, xa->xa_bp, NULL);
|
||||
upa_attach(sc, "upa", node, NULL);
|
||||
}
|
||||
|
||||
void
|
||||
upa_attach(sc, busname, busnode, bp, specials)
|
||||
upa_attach(sc, busname, busnode, specials)
|
||||
struct upa_softc *sc;
|
||||
char *busname;
|
||||
int busnode;
|
||||
struct bootpath *bp;
|
||||
const char * const *specials;
|
||||
{
|
||||
int node0, node, error;
|
||||
|
@ -310,12 +309,6 @@ upa_attach(sc, busname, busnode, bp, specials)
|
|||
*/
|
||||
sc->sc_burst = getpropint(busnode, "burst-sizes", 0);
|
||||
|
||||
/* Propagate bootpath */
|
||||
if (bp != NULL && strcmp(bp->name, busname) == 0)
|
||||
bp++;
|
||||
else
|
||||
bp = NULL;
|
||||
|
||||
/*
|
||||
* Collect address translations from the OBP.
|
||||
*/
|
||||
|
@ -391,7 +384,7 @@ upa_attach(sc, busname, busnode, bp, specials)
|
|||
}
|
||||
|
||||
if (upa_setup_attach_args(sc, sbt, sc->sc_dmatag,
|
||||
node, bp, &ua) != 0) {
|
||||
node, &ua) != 0) {
|
||||
panic("upa_attach: %s: incomplete", sp);
|
||||
}
|
||||
(void) config_found(&sc->sc_dev, (void *)&ua, upa_print);
|
||||
|
@ -462,12 +455,11 @@ upa_attach(sc, busname, busnode, bp, specials)
|
|||
}
|
||||
|
||||
int
|
||||
upa_setup_attach_args(sc, bustag, dmatag, node, bp, ua)
|
||||
upa_setup_attach_args(sc, bustag, dmatag, node, ua)
|
||||
struct upa_softc *sc;
|
||||
bus_space_tag_t bustag;
|
||||
bus_dma_tag_t dmatag;
|
||||
int node;
|
||||
struct bootpath *bp;
|
||||
struct upa_attach_args *ua;
|
||||
{
|
||||
struct rom_reg romreg;
|
||||
|
@ -479,7 +471,6 @@ upa_setup_attach_args(sc, bustag, dmatag, node, bp, ua)
|
|||
ua->ua_bustag = bustag;
|
||||
ua->ua_dmatag = dmatag;
|
||||
ua->ua_node = node;
|
||||
ua->ua_bp = bp;
|
||||
|
||||
if ((error = getprop_reg1(node, &romreg)) != 0)
|
||||
return (error);
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: upavar.h,v 1.1.1.1 1998/06/20 04:58:51 eeh Exp $ */
|
||||
/* $NetBSD: upavar.h,v 1.2 2000/01/14 14:33:31 pk Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -122,11 +122,10 @@ struct upa_attach_args {
|
|||
int *ua_interrupts; /* "interrupts" properties */
|
||||
int ua_ninterrupts;
|
||||
int ua_pri; /* priority (IPL) */
|
||||
struct bootpath *ua_bp; /* used for locating boot device */
|
||||
};
|
||||
|
||||
/* upa_attach() is also used from obio.c */
|
||||
void upa_attach __P((struct upa_softc *, char *, int, struct bootpath *,
|
||||
void upa_attach __P((struct upa_softc *, char *, int,
|
||||
const char * const *));
|
||||
int upa_print __P((void *, const char *));
|
||||
|
||||
|
@ -138,7 +137,6 @@ int upa_setup_attach_args __P((
|
|||
bus_space_tag_t,
|
||||
bus_dma_tag_t,
|
||||
int, /*node*/
|
||||
struct bootpath *,
|
||||
struct upa_attach_args *));
|
||||
|
||||
#define upa_bus_map(t, bt, a, s, f, v, hp) \
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: disksubr.c,v 1.5 1999/06/04 14:00:38 mrg Exp $ */
|
||||
/* $NetBSD: disksubr.c,v 1.6 2000/01/14 14:34:44 pk Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1994, 1995 Gordon W. Ross
|
||||
|
@ -61,44 +61,12 @@ static int disklabel_bsd_to_sun __P((struct disklabel *, char *));
|
|||
|
||||
extern struct device *bootdv;
|
||||
|
||||
/*
|
||||
* find the boot device (if it was a disk). we must check to see if
|
||||
* unit info in saved bootpath structure matches unit info in our softc.
|
||||
* note that knowing the device name (e.g. "xd0") is not useful... we
|
||||
* must check the drive number (or target/lun, in the case of SCSI).
|
||||
* (XXX is it worth ifdef'ing this?)
|
||||
*/
|
||||
|
||||
void
|
||||
dk_establish(dk, dev)
|
||||
struct disk *dk;
|
||||
struct device *dev;
|
||||
{
|
||||
struct bootpath *bp = bootpath_store(0, NULL); /* restore bootpath! */
|
||||
struct scsibus_softc *sbsc;
|
||||
int target, lun;
|
||||
|
||||
if (bp == NULL)
|
||||
return;
|
||||
|
||||
/*
|
||||
* scsi: sd,cd
|
||||
*/
|
||||
if (strncmp("sd", dev->dv_xname, 2) == 0 ||
|
||||
strncmp("wd", dev->dv_xname, 2) == 0 ||
|
||||
strncmp("cd", dev->dv_xname, 2) == 0) {
|
||||
|
||||
sbsc = (struct scsibus_softc *)dev->dv_parent;
|
||||
|
||||
target = bp->val[0];
|
||||
lun = bp->val[1];
|
||||
|
||||
if (sbsc->sc_link[target][lun] != NULL &&
|
||||
sbsc->sc_link[target][lun]->device_softc == (void *)dev) {
|
||||
bp->dev = dev; /* got it! */
|
||||
return;
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue