Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/sparc64 Remove old-style boot device recognition.



details:   https://anonhg.NetBSD.org/src/rev/135b0cb4c5fd
branches:  trunk
changeset: 480516:135b0cb4c5fd
user:      pk <pk%NetBSD.org@localhost>
date:      Fri Jan 14 14:27:14 2000 +0000

description:
Remove old-style boot device recognition.

diffstat:

 sys/arch/sparc64/dev/fd.c           |  54 +------------------------------------
 sys/arch/sparc64/dev/sbus.c         |  15 ++--------
 sys/arch/sparc64/dev/upa.c          |  23 ++++----------
 sys/arch/sparc64/dev/upavar.h       |   6 +--
 sys/arch/sparc64/sparc64/disksubr.c |  36 +-----------------------
 5 files changed, 15 insertions(+), 119 deletions(-)

diffs (truncated from 331 to 300 lines):

diff -r e03121deb08c -r 135b0cb4c5fd sys/arch/sparc64/dev/fd.c
--- a/sys/arch/sparc64/dev/fd.c Fri Jan 14 13:58:06 2000 +0000
+++ b/sys/arch/sparc64/dev/fd.c Fri Jan 14 14:27:14 2000 +0000
@@ -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 @@
  */
 struct fdc_attach_args {
        int fa_drive;
-       struct bootpath *fa_bootpath;
        struct fd_type *fa_deftype;
 };
 
@@ -377,7 +376,6 @@
        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 @@
 
        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 @@
                (void)config_found(self, (void *)&fa, fdprint);
        }
 
-       bootpath_store(1, NULL);
 }
 
 int
@@ -610,12 +564,6 @@
        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.
         */
diff -r e03121deb08c -r 135b0cb4c5fd sys/arch/sparc64/dev/sbus.c
--- a/sys/arch/sparc64/dev/sbus.c       Fri Jan 14 13:58:06 2000 +0000
+++ b/sys/arch/sparc64/dev/sbus.c       Fri Jan 14 14:27:14 2000 +0000
@@ -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 @@
        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 @@
         */
        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 @@
                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 @@
 }
 
 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 @@
        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);
diff -r e03121deb08c -r 135b0cb4c5fd sys/arch/sparc64/dev/upa.c
--- a/sys/arch/sparc64/dev/upa.c        Fri Jan 14 13:58:06 2000 +0000
+++ b/sys/arch/sparc64/dev/upa.c        Fri Jan 14 14:27:14 2000 +0000
@@ -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 @@
        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 @@
        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 @@
        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 @@
         */
        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 @@
                }
 
                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 @@
 }
 
 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 @@
        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);
diff -r e03121deb08c -r 135b0cb4c5fd sys/arch/sparc64/dev/upavar.h
--- a/sys/arch/sparc64/dev/upavar.h     Fri Jan 14 13:58:06 2000 +0000
+++ b/sys/arch/sparc64/dev/upavar.h     Fri Jan 14 14:27:14 2000 +0000
@@ -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 @@
        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 @@
                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) \
diff -r e03121deb08c -r 135b0cb4c5fd sys/arch/sparc64/sparc64/disksubr.c
--- a/sys/arch/sparc64/sparc64/disksubr.c       Fri Jan 14 13:58:06 2000 +0000
+++ b/sys/arch/sparc64/sparc64/disksubr.c       Fri Jan 14 14:27:14 2000 +0000
@@ -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 @@
 
 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;



Home | Main Index | Thread Index | Old Index