Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/vax/boot/boot Adopt to the RPB changes. Complete ch...



details:   https://anonhg.NetBSD.org/src/rev/5fd46390cc3b
branches:  trunk
changeset: 486369:5fd46390cc3b
user:      ragge <ragge%NetBSD.org@localhost>
date:      Sat May 20 13:35:07 2000 +0000

description:
Adopt to the RPB changes. Complete change of how network devices are
handled. No more hacks to find bus addresses.

diffstat:

 sys/arch/vax/boot/boot/autoconf.c |  120 ++++----------------------
 sys/arch/vax/boot/boot/boot.c     |   67 ++++++++------
 sys/arch/vax/boot/boot/conf.c     |   31 +-----
 sys/arch/vax/boot/boot/consio.c   |   36 ++++---
 sys/arch/vax/boot/boot/data.h     |    4 +-
 sys/arch/vax/boot/boot/devopen.c  |   89 +++++++++++++++----
 sys/arch/vax/boot/boot/netio.c    |  170 ++++++++-----------------------------
 sys/arch/vax/boot/boot/vaxstand.h |   59 ++++++++----
 8 files changed, 234 insertions(+), 342 deletions(-)

diffs (truncated from 1011 to 300 lines):

diff -r 7dfac1e79ef2 -r 5fd46390cc3b sys/arch/vax/boot/boot/autoconf.c
--- a/sys/arch/vax/boot/boot/autoconf.c Sat May 20 13:30:03 2000 +0000
+++ b/sys/arch/vax/boot/boot/autoconf.c Sat May 20 13:35:07 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: autoconf.c,v 1.10 2000/05/08 17:06:48 ragge Exp $ */
+/*     $NetBSD: autoconf.c,v 1.11 2000/05/20 13:35:07 ragge Exp $ */
 /*
  * Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
  * All rights reserved.
@@ -33,45 +33,26 @@
                
 
 
-#include "sys/param.h"
+#include <sys/param.h>
+
+#include <lib/libsa/stand.h>
+
 #include "../include/mtpr.h"
 #include "../include/sid.h"
 #include "../include/trap.h"
 #include "../include/frame.h"
+#include "../include/rpb.h"
+
 #include "vaxstand.h"
 
-int    nmba=0, nuba=0, nbi=0,nsbi=0,nuda=0;
-int    *mbaaddr, *ubaaddr, *biaddr;
-int    *udaaddr, *uioaddr, tmsaddr, *bioaddr;
-
-static int mba750[]={0xf28000,0xf2a000,0xf2c000};
-static int uba750[]={0xf30000,0xf32000};
-static int uio750[]={0xfc0000,0xf80000};
-static int uda750[]={0772150};
-
-/* 11/780's only have 4, 8600 have 8 of these. */
-/* XXX - all of these should be bound to physical addresses */
-static int mba780[]={0x20010000,0x20012000,0x20014000,0x20016000,
-       0x22010000,0x22012000,0x22014000,0x22016000};
-static int uba780[]={0, 0, 0, 0x20006000,0x20008000,0x2000a000,0x2000c000, 0,
-               0, 0, 0, 0, 0, 0, 0, 0, 
-               0, 0, 0, 0x22006000,0x22008000,0x2200a000,0x2200c000};
-static int uio780[]={0, 0, 0, 0x20100000,0x20140000,0x20180000,0x201c0000, 0,
-               0, 0, 0, 0, 0, 0, 0, 0, 
-               0, 0, 0, 0x22100000,0x22140000,0x22180000,0x221c0000};
-static int bi8200[]={0x20000000, 0x22000000, 0x24000000, 0x26000000,
-       0x28000000, 0x2a000000};
-static int bio8200[]={0x20400000};
-
-static int uba630[]={0x20087800};
-static int uio630[]={0x30000000};
-#define qbdev(csr) (((csr) & 017777)-0x10000000)
-static int uda630[]={qbdev(0772150),qbdev(0760334)};
-
-static int uba670[]={0x20040000};
-static int uio670[]={0x20000000};
-static int uda670[]={0x20004030,0x20004230};
-#define qb670dev(csr) (((csr) & 017777)+0x20000000)
+void autoconf(void);
+void findcpu(void);
+void consinit(void);
+void scbinit(void);
+int getsecs(void);
+void scb_stray(void *);
+void longjmp(int *);
+void rtimer(void *);
 
 /*
  * Autoconf routine is really stupid; but it actually don't
@@ -79,9 +60,9 @@
  * devices exists on each cpu. Fast & easy.
  */
 
+void
 autoconf()
 {
-       extern int memsz;
 
        findcpu(); /* Configures CPU variables */
        consinit(); /* Allow us to print out things */
@@ -89,57 +70,6 @@
 
        switch (vax_boardtype) {
 
-       default:
-               printf("\nCPU type %d not supported by boot\n",vax_cputype);
-               printf("trying anyway...\n");
-               break;
-
-       case VAX_BTYP_780:
-       case VAX_BTYP_790:
-               memsz = 0;
-               nmba = 8;
-               nuba = 32; /* XXX */
-               nuda = 1;
-               mbaaddr = mba780;
-               ubaaddr = uba780;
-               udaaddr = uda750;
-               uioaddr = uio780;
-               tmsaddr = 0774500;
-               break;
-
-       case VAX_BTYP_750:
-               memsz = 0;
-               nmba = 3;
-               nuba = 2;
-               nuda = 1;
-               mbaaddr = mba750;
-               ubaaddr = uba750;
-               udaaddr = uda750;
-               uioaddr = uio750;
-               tmsaddr = 0774500;
-               break;
-
-       case VAX_BTYP_630:      /* the same for uvaxIII */
-       case VAX_BTYP_650:
-       case VAX_BTYP_660:
-       case VAX_BTYP_670:
-       case VAX_BTYP_680:
-       case VAX_BTYP_53:
-               nuba = 1;
-               nuda = 2;
-               ubaaddr = uba630;
-               udaaddr = uda630;
-               uioaddr = uio630;
-               tmsaddr = qbdev(0774500);
-               break;
-
-       case VAX_BTYP_8000:
-               memsz = 0;
-               nbi = 1;
-               biaddr = bi8200;
-               bioaddr = bio8200;
-               break;
-
        case VAX_BTYP_46:
        case VAX_BTYP_48:
                {int *map, i;
@@ -151,10 +81,6 @@
                        map[i] = 0x80000000 | i;
                }break;
 
-       case VAX_BTYP_410:
-       case VAX_BTYP_420:
-       case VAX_BTYP_43:
-       case VAX_BTYP_49:
                break;
        }
 }
@@ -165,15 +91,12 @@
 
 volatile int tickcnt;
 
+int
 getsecs()
 {
-       volatile int loop;
-       int todr;
-
        return tickcnt/100;
 }
 
-void scb_stray(), rtimer();
 struct ivec_dsp **scb;
 struct ivec_dsp *scb_vec;
 extern struct ivec_dsp idsptch;
@@ -182,16 +105,16 @@
  * Init the SCB and set up a handler for all vectors in the lower space,
  * to detect unwanted interrupts.
  */
+void
 scbinit()
 {
-       extern int timer;
        int i;
 
        /*
         * Allocate space. We need one page for the SCB, and 128*16 == 2k
         * for the vectors. The SCB must be on a page boundary.
         */
-       i = alloc(VAX_NBPG * 6) + VAX_PGOFSET;
+       i = (int)alloc(VAX_NBPG * 6) + VAX_PGOFSET;
        i &= ~VAX_PGOFSET;
 
        mtpr(i, PR_SCBB);
@@ -216,7 +139,7 @@
 extern int sluttid, senast, skip;
 
 void
-rtimer()
+rtimer(void *arg)
 {
        mtpr(31, PR_IPL);
        tickcnt++;
@@ -255,8 +178,7 @@
  * This function must _not_ save any registers (in the reg save mask).
  */
 void
-scb_stray(arg)
-       int arg;
+scb_stray(void *arg)
 {
        static struct callsframe *cf;
        static int vector, ipl, *a;
diff -r 7dfac1e79ef2 -r 5fd46390cc3b sys/arch/vax/boot/boot/boot.c
--- a/sys/arch/vax/boot/boot/boot.c     Sat May 20 13:30:03 2000 +0000
+++ b/sys/arch/vax/boot/boot/boot.c     Sat May 20 13:35:07 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: boot.c,v 1.5 2000/04/22 20:29:59 ragge Exp $ */
+/*     $NetBSD: boot.c,v 1.6 2000/05/20 13:35:07 ragge Exp $ */
 /*-
  * Copyright (c) 1982, 1986 The Regents of the University of California.
  * All rights reserved.
@@ -40,6 +40,8 @@
 
 #define V750UCODE(x)    ((x>>8)&255)
 
+#include "machine/rpb.h"
+
 #include "vaxstand.h"
 
 /*
@@ -49,15 +51,20 @@
  */
 
 char line[100];
-int    devtype, bootdev, howto, debug;
+int    bootdev, debug;
 extern unsigned opendev;
-extern  unsigned *bootregs;
 
-void   usage(), boot(), halt();
+void   usage(char *), boot(char *), halt(char *);
+void   Xmain(struct rpb *);
+void   autoconf(void);
+int    getsecs(void);
+int    setjmp(int *);
+int    testkey(void);
+void   loadpcs(void);
 
 struct vals {
        char    *namn;
-       void    (*func)();
+       void    (*func)(char *);
        char    *info;
 } val[] = {
        {"?", usage, "Show this help menu"},
@@ -76,18 +83,27 @@
 };
 
 int jbuf[10];
-int sluttid, senast, skip;
+int sluttid, senast, skip, askname;
+struct rpb bootrpb;
 
-Xmain()
+void
+Xmain(struct rpb *prpb)
 {
-       int io, type, askname, filindex = 0;
+       int io, filindex = 0;
        int j, nu;
 
+       /* First copy rpb/bqo to its new location */
+       bcopy((caddr_t)prpb, &bootrpb, sizeof(struct rpb));
+       if (prpb->iovec) {
+               bootrpb.iovec = (int)alloc(prpb->iovecsz);
+               bcopy((caddr_t)prpb->iovec, (caddr_t)bootrpb.iovec,
+                   prpb->iovecsz);
+       }
        io = 0;
        skip = 1;
        autoconf();
 
-       askname = howto & RB_ASKNAME;
+       askname = bootrpb.rpb_bootr5 & RB_ASKNAME;
        printf("\n\r>> NetBSD/vax boot [%s %s] <<\n", __DATE__, __TIME__);
        printf(">> Press any key to abort autoboot  ");
        sluttid = getsecs() + 5;
@@ -115,16 +131,14 @@
 
        /* First try to autoboot */
        if (askname == 0) {
-               type = (devtype >> B_TYPESHIFT) & B_TYPEMASK;
-               if ((unsigned)type < ndevs && devsw[type].dv_name)
-                       while (filer[filindex]) {
-                               errno = 0;
-                               printf("> boot %s\n", filer[filindex]);
-                               exec(filer[filindex++], 0, 0);
-                               printf("boot failed: %s\n", strerror(errno));
-                               if (testkey())
-                                       break;
-                       }
+               while (filer[filindex]) {
+                       errno = 0;
+                       printf("> boot %s\n", filer[filindex]);
+                       exec(filer[filindex++], 0, 0);
+                       printf("boot failed: %s\n", strerror(errno));
+                       if (testkey())
+                               break;



Home | Main Index | Thread Index | Old Index