diff options
author | Steve Murphree <smurph@cvs.openbsd.org> | 2000-01-24 05:20:57 +0000 |
---|---|---|
committer | Steve Murphree <smurph@cvs.openbsd.org> | 2000-01-24 05:20:57 +0000 |
commit | 39ab61f741cafb0cb8d84f052574e23344e1c4f0 (patch) | |
tree | b179a64189ccfc3539a7bd1aaa317c9235abbd8b /sys/arch | |
parent | ef8a92c5f1930d19be39674ec896d14d5c051afa (diff) |
Fixed bug in disksubr.c relating to disklabels. Added MVME376 support to le. Made installboot insert M68K for volume ID, not M88K. Correctly documented installboot.
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/mvme68k/conf/GENERIC | 9 | ||||
-rw-r--r-- | sys/arch/mvme68k/conf/MINIROOT | 5 | ||||
-rw-r--r-- | sys/arch/mvme68k/conf/files.mvme68k | 24 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/if_le.c | 287 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/if_lereg.h | 48 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/if_levar.h | 9 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/siop.c | 9 | ||||
-rw-r--r-- | sys/arch/mvme68k/dev/vme.c | 73 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/autoconf.c | 5 | ||||
-rw-r--r-- | sys/arch/mvme68k/mvme68k/disksubr.c | 81 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/installboot/installboot.8 | 20 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/installboot/installboot.c | 2 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/libsa/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/netboot/Makefile | 4 | ||||
-rw-r--r-- | sys/arch/mvme68k/stand/netboot/if_ie.c | 5 |
15 files changed, 419 insertions, 166 deletions
diff --git a/sys/arch/mvme68k/conf/GENERIC b/sys/arch/mvme68k/conf/GENERIC index ef30f738f4a..5a01c6ecd3c 100644 --- a/sys/arch/mvme68k/conf/GENERIC +++ b/sys/arch/mvme68k/conf/GENERIC @@ -1,4 +1,4 @@ -# $OpenBSD: GENERIC,v 1.11 2000/01/09 22:00:21 itojun Exp $ +# $OpenBSD: GENERIC,v 1.12 2000/01/24 05:20:53 smurph Exp $ machine mvme68k m68k @@ -33,7 +33,7 @@ clock0 at pcc0 ipl 5 nvram0 at pcc0 offset 0x0000 zs0 at pcc0 offset 0x3000 ipl 4 zs1 at pcc0 offset 0x3800 ipl 4 -le0 at pcc0 offset 0x1800 ipl 1 +le* at pcc0 offset 0x1800 ipl 1 wdsc0 at pcc0 offset 0x4000 ipl 2 lp0 at pcc0 ipl 1 vme0 at pcc0 offset 0x2000 @@ -71,6 +71,11 @@ sram0 at mainbus0 addr 0xffe00000 bugtty0 at mainbus0 vmes0 at vme0 +le* at vmes0 addr 0xffff1200 ipl 1 vec 0x74 len 0x100 +le* at vmes0 addr 0xffff1400 ipl 1 vec 0x75 len 0x100 +le* at vmes0 addr 0xffff1600 ipl 1 vec 0x76 len 0x100 +le* at vmes0 addr 0xffffd200 ipl 1 vec 0x76 len 0x100 + vmel0 at vme0 scsibus* at wdsc? diff --git a/sys/arch/mvme68k/conf/MINIROOT b/sys/arch/mvme68k/conf/MINIROOT index f57d43d4f9b..cf7c56778a3 100644 --- a/sys/arch/mvme68k/conf/MINIROOT +++ b/sys/arch/mvme68k/conf/MINIROOT @@ -1,4 +1,4 @@ -# $OpenBSD: MINIROOT,v 1.3 2000/01/06 03:50:16 smurph Exp $ +# $OpenBSD: MINIROOT,v 1.4 2000/01/24 05:20:53 smurph Exp $ machine mvme68k m68k @@ -22,7 +22,7 @@ option MVME177 # (requires M68060, 060SP, FPSP) maxusers 32 -config bsd root rd0 swap on sd0 and sd1 and sd2 +config bsd root rd0 swap on rd0b mainbus0 at root @@ -82,6 +82,7 @@ ch* at scsibus? target ? lun ? ss* at scsibus? target ? lun ? uk* at scsibus? target ? lun ? +# 2 meg ramdisk option MINIROOTSIZE=4096 option RAMDISK_HOOKS pseudo-device rd 2 diff --git a/sys/arch/mvme68k/conf/files.mvme68k b/sys/arch/mvme68k/conf/files.mvme68k index 34b3f060e22..577bcf1987c 100644 --- a/sys/arch/mvme68k/conf/files.mvme68k +++ b/sys/arch/mvme68k/conf/files.mvme68k @@ -1,4 +1,4 @@ -# $OpenBSD: files.mvme68k,v 1.11 1999/11/08 15:36:09 mickey Exp $ +# $OpenBSD: files.mvme68k,v 1.12 2000/01/24 05:20:53 smurph Exp $ # config file for mvme68k @@ -37,7 +37,17 @@ attach bugtty at mainbus file arch/mvme68k/dev/bugtty.c bugtty needs-count file arch/mvme68k/dev/bug.c bugtty -attach le at pcc +device vme { } +attach vme at pcc, mc, pcctwo +device vmes { [addr = -1], [len = -1], [vec = -1], [ipl = 0] } +attach vmes at vme +device vmel { [addr = -1], [len = -1], [vec = -1], [ipl = 0] } +attach vmel at vme +file arch/mvme68k/dev/vme.c vme | vmes | vmel +file arch/mvme68k/dev/vmes.c vmes needs-count +file arch/mvme68k/dev/vmel.c vmel needs-count + +attach le at pcc, vmes file arch/mvme68k/dev/if_le.c le attach ie at mc, pcctwo @@ -90,16 +100,6 @@ file arch/mvme68k/dev/lptwo.c lptwo needs-count # RAM disk for boot tape file arch/mvme68k/dev/rd_root.c ramdisk_hooks -device vme { } -attach vme at pcc, mc, pcctwo -device vmes { [addr = -1], [len = -1], [vec = -1], [ipl = 0] } -attach vmes at vme -device vmel { [addr = -1], [len = -1], [vec = -1], [ipl = 0] } -attach vmel at vme -file arch/mvme68k/dev/vme.c vme | vmes | vmel -file arch/mvme68k/dev/vmes.c vmes needs-count -file arch/mvme68k/dev/vmel.c vmel needs-count - device xdc {target = -1} attach xdc at vmes device xd: disk diff --git a/sys/arch/mvme68k/dev/if_le.c b/sys/arch/mvme68k/dev/if_le.c index 9414d06c491..bf6702229bf 100644 --- a/sys/arch/mvme68k/dev/if_le.c +++ b/sys/arch/mvme68k/dev/if_le.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_le.c,v 1.12 1998/09/16 22:41:18 jason Exp $ */ +/* $OpenBSD: if_le.c,v 1.13 2000/01/24 05:20:53 smurph Exp $ */ /*- * Copyright (c) 1982, 1992, 1993 @@ -57,12 +57,14 @@ #include <machine/autoconf.h> #include <machine/cpu.h> +#define LEDEBUG 1 #include <dev/ic/am7990reg.h> #include <dev/ic/am7990var.h> #include <mvme68k/dev/if_lereg.h> #include <mvme68k/dev/if_levar.h> #include <mvme68k/dev/pccreg.h> +#include <mvme68k/dev/vme.h> /* autoconfiguration driver */ void leattach(struct device *, struct device *, void *); @@ -72,15 +74,93 @@ struct cfattach le_ca = { sizeof(struct le_softc), lematch, leattach }; +static int lebustype; + hide void lewrcsr __P((struct am7990_softc *, u_int16_t, u_int16_t)); hide u_int16_t lerdcsr __P((struct am7990_softc *, u_int16_t)); +hide void vlewrcsr __P((struct am7990_softc *, u_int16_t, u_int16_t)); +hide u_int16_t vlerdcsr __P((struct am7990_softc *, u_int16_t)); + +/* send command to the nvram controller */ +nvram_cmd(sc, cmd, addr ) +struct am7990_softc *sc; +u_char cmd; +u_short addr; +{ + int i; + u_char rcmd = 0; + u_char rcmd2= 0; + struct vlereg1 *reg1 = (struct vlereg1 *)((struct le_softc *)sc)->sc_r1; + + rcmd = addr; + rcmd = rcmd << 3; + rcmd |= cmd; + for(i=0;i<8;i++){ + reg1->ler1_ear=((cmd|(addr<<1))>>i); + CDELAY; + } +} + +/* read nvram one bit at a time */ +u_int16_t +nvram_read(sc, nvram_addr) +struct am7990_softc *sc; +u_char nvram_addr; +{ + u_short val = 0, mask = 0x04000; + u_int16_t wbit; + /* these used by macros DO NOT CHANGE!*/ + int i; + struct vlereg1 *reg1 = (struct vlereg1 *)((struct le_softc *)sc)->sc_r1; + ((struct le_softc *)sc)->csr = 0x4f; + ENABLE_NVRAM; + nvram_cmd(sc, NVRAM_RCL, 0); + DISABLE_NVRAM; + CDELAY; + ENABLE_NVRAM; + nvram_cmd(sc, NVRAM_READ, nvram_addr); + for (wbit=0; wbit<15; wbit++) { + (reg1->ler1_ear & 0x01) ? (val = (val | mask)) : (val = (val & (~mask))); + mask = mask>>1; + CDELAY; + } + (reg1->ler1_ear & 0x01) ? (val = (val | 0x8000)) : (val = (val & 0x7FFF)); + CDELAY; + DISABLE_NVRAM; + return (val); +} + +void +vleetheraddr(sc) +struct am7990_softc *sc; +{ + u_char * cp = sc->sc_arpcom.ac_enaddr; + u_int16_t ival[3]; + u_char i; + + for (i=0; i<3; i++) { + ival[i] = nvram_read(sc, i); + } + memcpy(cp, &ival[0], 6); +} hide void lewrcsr(sc, port, val) struct am7990_softc *sc; u_int16_t port, val; { - register struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1; + register struct lereg1 *ler1 = (struct lereg1 *)((struct le_softc *)sc)->sc_r1; + + ler1->ler1_rap = port; + ler1->ler1_rdp = val; +} + +hide void +vlewrcsr(sc, port, val) + struct am7990_softc *sc; + u_int16_t port, val; +{ + register struct vlereg1 *ler1 = (struct vlereg1 *)((struct le_softc *)sc)->sc_r1; ler1->ler1_rap = port; ler1->ler1_rdp = val; @@ -91,7 +171,20 @@ lerdcsr(sc, port) struct am7990_softc *sc; u_int16_t port; { - register struct lereg1 *ler1 = ((struct le_softc *)sc)->sc_r1; + register struct lereg1 *ler1 = (struct lereg1 *)((struct le_softc *)sc)->sc_r1; + u_int16_t val; + + ler1->ler1_rap = port; + val = ler1->ler1_rdp; + return (val); +} + +hide u_int16_t +vlerdcsr(sc, port) + struct am7990_softc *sc; + u_int16_t port; +{ + register struct vlereg1 *ler1 = (struct vlereg1 *)((struct le_softc *)sc)->sc_r1; u_int16_t val; ler1->ler1_rap = port; @@ -99,6 +192,79 @@ lerdcsr(sc, port) return (val); } +/* init MVME376, set ipl and vec */ +void +vleinit(sc) + struct am7990_softc *sc; +{ + register struct vlereg1 *reg1 = (struct vlereg1 *)((struct le_softc *)sc)->sc_r1; + u_char vec = ((struct le_softc *)sc)->sc_vec; + u_char ipl = ((struct le_softc *)sc)->sc_ipl; + ((struct le_softc *)sc)->csr = 0x4f; + WRITE_CSR_AND( ~ipl ); + SET_VEC(vec); + return; +} + +/* MVME376 hardware reset */ +void +vlereset(sc) + struct am7990_softc *sc; +{ + register struct vlereg1 *reg1 = (struct vlereg1 *)((struct le_softc *)sc)->sc_r1; + RESET_HW; + if (sc->sc_debug) { + printf("\nle: hardware reset\n"); + } + SYSFAIL_CL; + return; +} + +int +vle_intr(sc) + register void *sc; +{ + register struct vlereg1 *reg1 = (struct vlereg1 *)((struct le_softc *)sc)->sc_r1; + int rc; + rc = am7990_intr(sc); + ENABLE_INTR; + return (rc); +} + +void +vle_copytobuf_contig(sc, from, boff, len) + struct am7990_softc *sc; + void *from; + int boff, len; +{ + volatile caddr_t buf = sc->sc_mem; + + /* + * Do the cache stuff + */ + dma_cachectl(buf + boff, len); + /* + * Just call bcopy() to do the work. + */ + bcopy(from, buf + boff, len); +} + +void +vle_zerobuf_contig(sc, boff, len) + struct am7990_softc *sc; + int boff, len; +{ + volatile caddr_t buf = sc->sc_mem; + /* + * Do the cache stuff + */ + dma_cachectl(buf + boff, len); + /* + * Just let bzero() do the work + */ + bzero(buf + boff, len); +} + int lematch(parent, vcf, args) struct device *parent; @@ -127,42 +293,111 @@ leattach(parent, self, aux) register int a; int pri = ca->ca_ipl; extern void *etherbuf; + caddr_t addr; /* XXX the following declarations should be elsewhere */ extern void myetheraddr(u_char *); + + lebustype = ca->ca_bustype; /* Are we the boot device? */ if (ca->ca_paddr == bootaddr) bootdv = self; - sc->sc_mem = etherbuf; - lesc->sc_r1 = (struct lereg1 *)ca->ca_vaddr; - sc->sc_conf3 = LE_C3_BSWP /*| LE_C3_ACON | LE_C3_BCON*/; - sc->sc_addr = kvtop(sc->sc_mem); - sc->sc_memsize = LEMEMSIZE; - - myetheraddr(sc->sc_arpcom.ac_enaddr); - + switch (lebustype) { + case BUS_VMES: + /* + * get the first avaliable etherbuf. MVME376 uses its own dual-ported + * RAM for etherbuf. It is set by dip switches on board. We support + * the four Motorola address locations, however, the board can be set up + * at any other address. We must map this space into the extio map. + * XXX-smurph. + */ + switch ((int)ca->ca_paddr) { + case 0xFFFF1200: + addr = (caddr_t)0xFD6C0000; + break; + case 0xFFFF1400: + addr = (caddr_t)0xFD700000; + break; + case 0xFFFF1600: + addr = (caddr_t)0xFD740000; + break; + case 0xFFFFD200: + addr = (caddr_t)0xFD780000; + break; + default: + panic("le: invalid address"); + } + sc->sc_mem = (void *)mapiodev(addr, VLEMEMSIZE); + if (sc->sc_mem == NULL) + panic("\nle: no more memory in external I/O map\n"); + lesc->sc_r1 = (void *)ca->ca_vaddr; + lesc->sc_ipl = ca->ca_ipl; + lesc->sc_vec = ca->ca_vec; + sc->sc_memsize = VLEMEMSIZE; + sc->sc_conf3 = LE_C3_BSWP; + sc->sc_addr = kvtop(sc->sc_mem); + sc->sc_hwreset = vlereset; + sc->sc_rdcsr = vlerdcsr; + sc->sc_wrcsr = vlewrcsr; + sc->sc_hwinit = vleinit; + sc->sc_copytodesc = vle_copytobuf_contig; + sc->sc_copyfromdesc = am7990_copyfrombuf_contig; + sc->sc_copytobuf = vle_copytobuf_contig; + sc->sc_copyfrombuf = am7990_copyfrombuf_contig; + sc->sc_zerobuf = am7990_zerobuf_contig; + /* get ether address */ + vleetheraddr(sc); + break; + case BUS_PCC: + sc->sc_mem = etherbuf; + lesc->sc_r1 = (void *)ca->ca_vaddr; + sc->sc_conf3 = LE_C3_BSWP /*| LE_C3_ACON | LE_C3_BCON*/; + sc->sc_addr = kvtop(sc->sc_mem); + sc->sc_memsize = LEMEMSIZE; + sc->sc_rdcsr = lerdcsr; + sc->sc_wrcsr = lewrcsr; + sc->sc_hwreset = NULL; + sc->sc_hwinit = NULL; + sc->sc_copytodesc = am7990_copytobuf_contig; + sc->sc_copyfromdesc = am7990_copyfrombuf_contig; + sc->sc_copytobuf = am7990_copytobuf_contig; + sc->sc_copyfrombuf = am7990_copyfrombuf_contig; + sc->sc_zerobuf = am7990_zerobuf_contig; + /* get ether address */ + myetheraddr(sc->sc_arpcom.ac_enaddr); + break; + default: + panic("\nle: unknown bus type.\n"); + } evcnt_attach(&sc->sc_dev, "intr", &lesc->sc_intrcnt); evcnt_attach(&sc->sc_dev, "errs", &lesc->sc_errcnt); - sc->sc_copytodesc = am7990_copytobuf_contig; - sc->sc_copyfromdesc = am7990_copyfrombuf_contig; - sc->sc_copytobuf = am7990_copytobuf_contig; - sc->sc_copyfrombuf = am7990_copyfrombuf_contig; - sc->sc_zerobuf = am7990_zerobuf_contig; - - sc->sc_rdcsr = lerdcsr; - sc->sc_wrcsr = lewrcsr; - sc->sc_hwreset = NULL; - sc->sc_hwinit = NULL; + /* + if (lebustype == BUS_VMES) + vleinit(sc); + */ am7990_config(sc); /* connect the interrupt */ - lesc->sc_ih.ih_fn = am7990_intr; - lesc->sc_ih.ih_arg = sc; - lesc->sc_ih.ih_ipl = pri; - pccintr_establish(PCCV_LE, &lesc->sc_ih); - ((struct pccreg *)ca->ca_master)->pcc_leirq = pri | PCC_IRQ_IEN; + switch (lebustype) { + case BUS_VMES: + lesc->sc_ih.ih_fn = vle_intr; + lesc->sc_ih.ih_arg = sc; + lesc->sc_ih.ih_ipl = pri; + vmeintr_establish(ca->ca_vec + 0, &lesc->sc_ih); + break; + case BUS_PCC: + lesc->sc_ih.ih_fn = am7990_intr; + lesc->sc_ih.ih_arg = sc; + lesc->sc_ih.ih_ipl = pri; + pccintr_establish(PCCV_LE, &lesc->sc_ih); + ((struct pccreg *)ca->ca_master)->pcc_leirq = pri | PCC_IRQ_IEN; + break; + } } + + + diff --git a/sys/arch/mvme68k/dev/if_lereg.h b/sys/arch/mvme68k/dev/if_lereg.h index a670bf81496..77cbc3aac96 100644 --- a/sys/arch/mvme68k/dev/if_lereg.h +++ b/sys/arch/mvme68k/dev/if_lereg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: if_lereg.h,v 1.5 1996/08/20 05:17:09 deraadt Exp $ */ +/* $OpenBSD: if_lereg.h,v 1.6 2000/01/24 05:20:53 smurph Exp $ */ /*- * Copyright (c) 1982, 1992, 1993 @@ -44,3 +44,49 @@ struct lereg1 { volatile u_int16_t ler1_rdp; /* data port */ volatile u_int16_t ler1_rap; /* register select port */ }; + +#define VLEMEMSIZE 0x40000 + +/* + * LANCE registers for MVME376 + */ +struct vlereg1 { + volatile u_int16_t ler1_csr; /* board control/status register */ + volatile u_int16_t ler1_vec; /* interupt vector register */ + volatile u_int16_t ler1_rdp; /* data port */ + volatile u_int16_t ler1_rap; /* register select port */ + volatile u_int16_t ler1_ear; /* ethernet address register */ +}; + +#define NVRAM_EN 0x0008 /* NVRAM enable bit */ +#define INTR_EN 0x0010 /* Interrupt enable bit */ +#define PARITYB 0x0020 /* Parity clear bit */ +#define HW_RS 0x0040 /* Hardware reset bit */ +#define SYSFAILB 0x0080 /* SYSFAIL bit */ +#define NVRAM_RWEL 0xE0 /* Reset write enable latch */ +#define NVRAM_STO 0x60 /* Store ram to eeprom */ +#define NVRAM_SLP 0xA0 /* Novram into low power mode */ +#define NVRAM_WRITE 0x20 /* Writes word from location x */ +#define NVRAM_SWEL 0xC0 /* Set write enable latch */ +#define NVRAM_RCL 0x40 /* Recall eeprom data into ram */ +#define NVRAM_READ 0x00 /* Reads word from location x */ + +#define CDELAY delay(10000) +#define WRITE_CSR_OR(x) reg1->ler1_csr=((struct le_softc *)sc)->csr|=x +#define WRITE_CSR_AND(x) reg1->ler1_csr=((struct le_softc *)sc)->csr&=x +#define ENABLE_NVRAM WRITE_CSR_AND(~NVRAM_EN) +#define DISABLE_NVRAM WRITE_CSR_OR(NVRAM_EN) +#define ENABLE_INTR WRITE_CSR_AND(~INTR_EN) +#define DISABLE_INTR WRITE_CSR_OR(INTR_EN) +#define RESET_HW WRITE_CSR_AND(~0xFF00);WRITE_CSR_AND(~HW_RS);CDELAY +#define SET_IPL(x) WRITE_CSR_AND(~x) +#define SET_VEC(x) reg1->ler1_vec=0;reg1->ler1_vec |=x; +#define PARITY_CL WRITE_CSR_AND(~PARITYB) +#define SYSFAIL_CL WRITE_CSR_AND(~SYSFAILB) +#define NVRAM_CMD(c,a) for(i=0;i<8;i++){ \ + reg1->ler1_ear=((c|(a<<1))>>i); \ + CDELAY; \ + } \ + CDELAY; + + diff --git a/sys/arch/mvme68k/dev/if_levar.h b/sys/arch/mvme68k/dev/if_levar.h index 45e8d7836b4..25f523833ae 100644 --- a/sys/arch/mvme68k/dev/if_levar.h +++ b/sys/arch/mvme68k/dev/if_levar.h @@ -48,8 +48,13 @@ struct le_softc { struct am7990_softc sc_am7990; /* glue to MI code */ - struct intrhand sc_ih; /* interrupt vectoring */ - struct lereg1 *sc_r1; /* LANCE registers */ + struct intrhand sc_ih; /* interrupt vectoring */ + void *sc_r1; /* LANCE registers */ + u_short csr; /* Control/Status reg image */ struct evcnt sc_intrcnt; struct evcnt sc_errcnt; + struct vme2reg *sc_vme2; + u_char sc_ipl; + u_char sc_vec; }; + diff --git a/sys/arch/mvme68k/dev/siop.c b/sys/arch/mvme68k/dev/siop.c index 15b0f7eef53..338bff43bca 100644 --- a/sys/arch/mvme68k/dev/siop.c +++ b/sys/arch/mvme68k/dev/siop.c @@ -1,4 +1,4 @@ -/* $OpenBSD: siop.c,v 1.7 2000/01/06 03:21:42 smurph Exp $ */ +/* $OpenBSD: siop.c,v 1.8 2000/01/24 05:20:54 smurph Exp $ */ /* * Copyright (c) 1994 Michael L. Hitch @@ -1355,6 +1355,7 @@ register struct siop_softc *sc; if (dstat & SIOP_DSTAT_SIR) sc->sc_intcode = rp->siop_dsps; sc->sc_istat = 0; + #ifdef DEBUG if (siop_debug & 1) printf ("%s: intr istat %x dstat %x sstat0 %x\n", @@ -1363,6 +1364,12 @@ register struct siop_softc *sc; printf ("%s: spurious interrupt? istat %x dstat %x sstat0 %x status %x\n", sc->sc_dev.dv_xname, istat, dstat, sstat0, sc->sc_nexus->stat[0]); } +#else + if (!sc->sc_active) { + printf ("%s: spurious interrupt? istat %x dstat %x sstat0 %x status %x\n", + sc->sc_dev.dv_xname, istat, dstat, sstat0, sc->sc_nexus->stat[0]); + return; + } #endif #ifdef DEBUG diff --git a/sys/arch/mvme68k/dev/vme.c b/sys/arch/mvme68k/dev/vme.c index f745340eef3..714a1f06e96 100644 --- a/sys/arch/mvme68k/dev/vme.c +++ b/sys/arch/mvme68k/dev/vme.c @@ -1,7 +1,8 @@ -/* $OpenBSD: vme.c,v 1.9 1998/01/19 00:13:04 etheisen Exp $ */ +/* $OpenBSD: vme.c,v 1.10 2000/01/24 05:20:54 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt + * Copyright (c) 2000 Steve Murphree, Jr. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -363,7 +364,7 @@ vmeattach(parent, self, args) case BUS_PCCTWO: vme2 = (struct vme2reg *)sc->sc_vaddr; scon = (vme2->vme2_tctl & VME2_TCTL_SCON); - printf(": %sscon\n", scon ? "" : "not "); + printf(": %ssystem controller\n", scon ? "" : "not "); vme2chip_init(sc); break; #endif @@ -443,73 +444,37 @@ vme2chip_init(sc) struct vmesoftc *sc; { struct vme2reg *vme2 = (struct vme2reg *)sc->sc_vaddr; - u_long ctl; + u_long ctl, addr, vasize; /* turn off SYSFAIL LED */ vme2->vme2_tctl &= ~VME2_TCTL_SYSFAIL; ctl = vme2->vme2_masterctl; - - /* unused decoders 1 */ - vme2->vme2_master1 = 0; - ctl &= ~(VME2_MASTERCTL_ALL << VME2_MASTERCTL_1SHIFT); - printf("%s: 1phys 0x%08x-0x%08x to VMExxx 0x%08x-0x%08x\n", + printf("%s: using BUG parameters\n", sc->sc_dev.dv_xname); + /* setup a A32D16 space */ + printf("%s: 1phys 0x%08x-0x%08x to VME 0x%08x-0x%08x\n", sc->sc_dev.dv_xname, vme2->vme2_master1 << 16, vme2->vme2_master1 & 0xffff0000, vme2->vme2_master1 << 16, vme2->vme2_master1 & 0xffff0000); - /* unused decoders 2 */ - vme2->vme2_master2 = 0; - ctl &= ~(VME2_MASTERCTL_ALL << VME2_MASTERCTL_2SHIFT); - printf("%s: 2phys 0x%08x-0x%08x to VMExxx 0x%08x-0x%08x\n", + /* setup a A32D32 space */ + printf("%s: 2phys 0x%08x-0x%08x to VME 0x%08x-0x%08x\n", sc->sc_dev.dv_xname, vme2->vme2_master2 << 16, vme2->vme2_master2 & 0xffff0000, vme2->vme2_master2 << 16, vme2->vme2_master2 & 0xffff0000); /* setup a A24D16 space */ - vme2->vme2_master3 = ((VME2_D16ENDPHYS-1) & 0xffff0000) | - (VME2_D16STARTPHYS >> 16); - ctl &= ~(VME2_MASTERCTL_ALL << VME2_MASTERCTL_3SHIFT); - ctl |= (VME2_MASTERCTL_D16 | VME2_MASTERCTL_AM24UD) << - VME2_MASTERCTL_3SHIFT; - printf("%s: 3phys 0x%08x-0x%08x to VMED16 0x%08x-0x%08x\n", + printf("%s: 3phys 0x%08x-0x%08x to VME 0x%08x-0x%08x\n", sc->sc_dev.dv_xname, vme2->vme2_master3 << 16, vme2->vme2_master3 & 0xffff0000, vme2->vme2_master3 << 16, vme2->vme2_master3 & 0xffff0000); - /* setup a A32D32 space */ - vme2->vme2_master4 = ((VME2_D32ENDPHYS-1) & 0xffff0000) | - (VME2_D32STARTPHYS >> 16); - vme2->vme2_master4mod = (VME2_D32STARTVME & 0xffff0000) | - (VME2_D32BITSVME >> 16); - ctl &= ~(VME2_MASTERCTL_ALL << VME2_MASTERCTL_4SHIFT); - ctl |= (VME2_MASTERCTL_AM32UD) << - VME2_MASTERCTL_4SHIFT; - printf("%s: 4phys 0x%08x-0x%08x to VMED32 0x%08x-0x%08x\n", + /* setup a XXXXXX space */ + printf("%s: 4phys 0x%08x-0x%08x to VME 0x%08x-0x%08x\n", sc->sc_dev.dv_xname, vme2->vme2_master4 << 16, vme2->vme2_master4 & 0xffff0000, - vme2->vme2_master4 << 16, vme2->vme2_master4 & 0xffff0000); - - vme2->vme2_masterctl = ctl; - ctl = vme2->vme2_gcsrctl; - - /* enable A16 short IO map decoder (0xffffxxxx) */ - ctl &= ~(VME2_GCSRCTL_I1EN | VME2_GCSRCTL_I1D16 | VME2_GCSRCTL_I1WP | - VME2_GCSRCTL_I1SU); - ctl |= VME2_GCSRCTL_I1EN | VME2_GCSRCTL_I1D16 | VME2_GCSRCTL_I1SU; - - /* enable A24D16 (0xf0xxxxxx) and A32D16 (0xf[1-e]xxxxxx) decoders */ - ctl &= ~(VME2_GCSRCTL_I2EN | VME2_GCSRCTL_I2WP | VME2_GCSRCTL_I2SU | - VME2_GCSRCTL_I2PD); - ctl |= VME2_GCSRCTL_I2EN | VME2_GCSRCTL_I2SU | VME2_GCSRCTL_I2PD; - - /* map decoders 3 & 4 which were just configured */ - ctl &= ~(VME2_GCSRCTL_MDEN4 | VME2_GCSRCTL_MDEN3 | VME2_GCSRCTL_MDEN1 | - VME2_GCSRCTL_MDEN2); - ctl |= VME2_GCSRCTL_MDEN4 | VME2_GCSRCTL_MDEN3; - - vme2->vme2_gcsrctl = ctl; - + vme2->vme2_master4 << 16 + vme2->vme2_master4mod << 16, + vme2->vme2_master4 & 0xffff0000 + vme2->vme2_master4 & 0xffff0000); /* * Map the VME irq levels to the cpu levels 1:1. * This is rather inflexible, but much easier. @@ -518,11 +483,16 @@ vme2chip_init(sc) (6 << VME2_IRQL4_VME6SHIFT) | (5 << VME2_IRQL4_VME5SHIFT) | (4 << VME2_IRQL4_VME4SHIFT) | (3 << VME2_IRQL4_VME3SHIFT) | (2 << VME2_IRQL4_VME2SHIFT) | (1 << VME2_IRQL4_VME1SHIFT); + printf("%s: vme to cpu irq level 1:1\n",sc->sc_dev.dv_xname); + /* printf("%s: vme2_irql4 = 0x%08x\n", sc->sc_dev.dv_xname, vme2->vme2_irql4); - + */ #if NPCCTWO > 0 if (vmebustype == BUS_PCCTWO) { + /* + * pseudo driver, abort interrupt handler + */ sc->sc_abih.ih_fn = vme2abort; sc->sc_abih.ih_arg = 0; sc->sc_abih.ih_ipl = 7; @@ -568,7 +538,7 @@ vme2abort(frame) struct vme2reg *vme2 = (struct vme2reg *)sc->sc_vaddr; if (vme2->vme2_irqstat & VME2_IRQ_AB == 0) { - printf("%s: vme2chip irq not set\n", sc->sc_dev.dv_xname); + printf("%s: abort irq not set\n", sc->sc_dev.dv_xname); return (0); } vme2->vme2_irqclr = VME2_IRQ_AB; @@ -576,5 +546,4 @@ vme2abort(frame) return (1); } #endif - #endif diff --git a/sys/arch/mvme68k/mvme68k/autoconf.c b/sys/arch/mvme68k/mvme68k/autoconf.c index 94396eed3c4..69ad02b31a2 100644 --- a/sys/arch/mvme68k/mvme68k/autoconf.c +++ b/sys/arch/mvme68k/mvme68k/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.10 1996/11/23 21:46:04 kstailey Exp $ */ +/* $OpenBSD: autoconf.c,v 1.11 2000/01/24 05:20:54 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -273,7 +273,8 @@ struct nam2blk { int maj; } nam2blk[] = { { "sd", 4 }, - { "st", 6 }, + { "st", 7 }, + { "rd", 9 }, }; static int diff --git a/sys/arch/mvme68k/mvme68k/disksubr.c b/sys/arch/mvme68k/mvme68k/disksubr.c index 71ec5656a30..ee77186693a 100644 --- a/sys/arch/mvme68k/mvme68k/disksubr.c +++ b/sys/arch/mvme68k/mvme68k/disksubr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: disksubr.c,v 1.19 1999/09/27 20:30:31 smurph Exp $ */ +/* $OpenBSD: disksubr.c,v 1.20 2000/01/24 05:20:54 smurph Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1995 Dale Rahn. @@ -108,6 +108,9 @@ readdisklabel(dev, strat, lp, clp, spoofonly) { struct buf *bp; char *msg = NULL; + char *tmot = "MOTOROLA"; + char *mot; + int t; /* minimal requirements for archetypal disk label */ if (lp->d_secsize == 0) @@ -139,7 +142,7 @@ readdisklabel(dev, strat, lp, clp, spoofonly) } else { bcopy(bp->b_data, clp, sizeof (struct cpu_disklabel)); } - + bp->b_flags = B_INVAL | B_AGE | B_READ; brelse(bp); @@ -150,58 +153,21 @@ readdisklabel(dev, strat, lp, clp, spoofonly) #endif return (msg); } - cputobsdlabel(lp, clp); -#ifdef DEBUG - if (disksubr_debug > 0) { - printlp(lp, "readdisklabel:bsd label"); - printclp(clp, "readdisklabel:cpu label"); - } -#endif - return (msg); -} - -#if 0 -char * -readdisklabel(dev, strat, lp, clp) - dev_t dev; - void (*strat)(); - struct disklabel *lp; - struct cpu_disklabel *clp; -{ - struct buf *bp; - char *msg = NULL; - - /* obtain buffer to probe drive with */ - bp = geteblk((int)lp->d_secsize); - - /* request no partition relocation by driver on I/O operations */ - bp->b_dev = dev; - bp->b_blkno = 0; /* contained in block 0 */ - bp->b_bcount = lp->d_secsize; - bp->b_flags = B_BUSY | B_READ; - bp->b_cylin = 0; /* contained in block 0 */ - (*strat)(bp); - - if (biowait(bp)) { - msg = "cpu_disklabel read error\n"; - }else { - bcopy(bp->b_data, clp, sizeof (struct cpu_disklabel)); + + if (clp->magic1 != DISKMAGIC || clp->magic2 != DISKMAGIC) { + msg = "no disk label"; + return (msg); } - - bp->b_flags = B_INVAL | B_AGE | B_READ; - brelse(bp); - - if (msg || clp->magic1 != DISKMAGIC || clp->magic2 != DISKMAGIC) { -#if defined(CD9660) - if (iso_disklabelspoof(dev, strat, lp) == 0) - msg = NULL; -#endif - return (msg); + + cputobsdlabel(lp, clp); + + if (dkcksum(lp) != 0){ + msg = "disk label corrupted"; + return (msg); } - cputobsdlabel(lp, clp); #ifdef DEBUG - if(disksubr_debug > 0) { + if (disksubr_debug > 0) { printlp(lp, "readdisklabel:bsd label"); printclp(clp, "readdisklabel:cpu label"); } @@ -209,7 +175,6 @@ readdisklabel(dev, strat, lp, clp) return (msg); } -#endif /* 0 */ /* * Check new disk label for sensibility * before setting it. @@ -415,6 +380,9 @@ bsdtocpulabel(lp, clp) struct disklabel *lp; struct cpu_disklabel *clp; { + char *tmot = "MOTOROLA"; + char *id = "M68K"; + char *mot; int i; clp->magic1 = lp->d_magic; @@ -467,6 +435,17 @@ bsdtocpulabel(lp, clp) bcopy(&lp->d_partitions[0], clp->vid_4, sizeof(struct partition) * 4); bcopy(&lp->d_partitions[4], clp->cfg_4, sizeof(struct partition) * 12); clp->version = 1; + /* put "MOTOROLA" in the VID. This makes it a valid boot disk also. xxx - smurph */ + mot = clp->vid_mot; + for (i=0; i<8; i++) { + *mot++ = *tmot++; + } + /* put volume id in the VID */ + mot = clp->vid_id; + for (i=0; i<4; i++) { + *mot++ = *id++; + } + } struct cpu_disklabel_old { diff --git a/sys/arch/mvme68k/stand/installboot/installboot.8 b/sys/arch/mvme68k/stand/installboot/installboot.8 index 55322201898..c45304ad0fd 100644 --- a/sys/arch/mvme68k/stand/installboot/installboot.8 +++ b/sys/arch/mvme68k/stand/installboot/installboot.8 @@ -1,22 +1,22 @@ -.\" $Id: installboot.8,v 1.6 2000/01/03 20:04:29 pjanzen Exp $ +.\" $Id: installboot.8,v 1.7 2000/01/24 05:20:55 smurph Exp $ .\" .Dd 31 May 1995 .Dt INSTALLBOOT 8 mvme68k .Os .Sh NAME .Nm installboot -.Nd install a bootstrap on a UFS disk +.Nd install a bootstrap on a FFS disk .Sh SYNOPSIS .Nm installboot .Op Fl n .Op Fl v -.Ar ufsboot +.Ar bootsd .Ar bootxx .Ar rawdev .Sh DESCRIPTION .Nm installboot is used to install a "first-stage" boot program into the boot area -of a UFS disk partition, and initialize the table of block numbers the +of a FFS disk partition, and initialize the table of block numbers the .Ar bootxx program uses to load the second-stage boot program. .Pp @@ -28,12 +28,12 @@ Do not actually write anything on the disk. Be verbose, printing out the block numbers that .Ar bootxx will use to load -.Ar ufsboot . +.Ar bootsd . .El .Pp The arguments are: -.Bl -tag -width ufsboot -.It Ar ufsboot +.Bl -tag -width bootsd +.It Ar bootsd the name of the second-stage boot program in the file system where the first-stage boot program is to be installed. .It Ar bootxx @@ -42,9 +42,13 @@ the name of the prototype file for the first stage boot program. the name of the raw device in which the first-stage boot program is to be installed. This should correspond to the block device on which the file system containing -.Ar ufsboot +.Ar bootsd is mounted. .El +.Sh EXAMPLE +.Bd -literal +cp /usr/mdec/bootsd / +/usr/mdec/installboot /bootsd /usr/mdec/bootxx /dev/rsd0a .Sh BUGS .Nm installboot requires simultaneous access to the mounted file system and diff --git a/sys/arch/mvme68k/stand/installboot/installboot.c b/sys/arch/mvme68k/stand/installboot/installboot.c index ad853175a69..68fda732aae 100644 --- a/sys/arch/mvme68k/stand/installboot/installboot.c +++ b/sys/arch/mvme68k/stand/installboot/installboot.c @@ -422,7 +422,7 @@ char *bootproto; pcpul->version = 1; - strcpy(pcpul->vid_id, "M88K"); + strncpy(pcpul->vid_id, "M68K", 4); fstat(exe_file, &stat); diff --git a/sys/arch/mvme68k/stand/libsa/Makefile b/sys/arch/mvme68k/stand/libsa/Makefile index a644acc01bb..f40c4a2954c 100644 --- a/sys/arch/mvme68k/stand/libsa/Makefile +++ b/sys/arch/mvme68k/stand/libsa/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.14 2000/01/06 03:21:43 smurph Exp $ +# $OpenBSD: Makefile,v 1.15 2000/01/24 05:20:55 smurph Exp $ LIB=sa @@ -35,7 +35,7 @@ SRCS= ${SRC_net} ${SRC_sa} ${SRC_mvme} ${SRC_here} ${SRC_kern} #DEFS= -DCOMPAT_UFS DEFS= -D__INTERNAL_LIBSA_CREAD INCL= -I${.CURDIR} -I${.CURDIR}/../libbug -I${S}/lib/libsa -I${S} -COPTS= #-fno-defer-pop -m68060 +COPTS= -m68060 -Wa,-m68030 CFLAGS+= ${XCFLAGS} -O2 ${COPTS} ${DEFS} ${DBG} ${INCL} .PATH: ${DIR_SA} ${DIR_KERN} diff --git a/sys/arch/mvme68k/stand/netboot/Makefile b/sys/arch/mvme68k/stand/netboot/Makefile index d292652ab51..ba9e6d8dd53 100644 --- a/sys/arch/mvme68k/stand/netboot/Makefile +++ b/sys/arch/mvme68k/stand/netboot/Makefile @@ -1,10 +1,10 @@ -# $OpenBSD: Makefile,v 1.9 2000/01/06 03:21:43 smurph Exp $ +# $OpenBSD: Makefile,v 1.10 2000/01/24 05:20:56 smurph Exp $ RELOC=0x3F0000 SIZE?= size S= ${.CURDIR}/../../../.. -DEFS= -DSUN_BOOTPARAMS +DEFS= -DSUN_BOOTPARAMS -DRELOC=${RELOC} INCPATH=-I${.CURDIR} -I${.CURDIR}/../libsa -I${.CURDIR}/../libbug \ -I${S} -I${S}/lib/libsa CFLAGS= -O2 ${DEFS} ${INCPATH} ${COPTS} -m68060 diff --git a/sys/arch/mvme68k/stand/netboot/if_ie.c b/sys/arch/mvme68k/stand/netboot/if_ie.c index 5bf1447d5e7..b85a8f5447b 100644 --- a/sys/arch/mvme68k/stand/netboot/if_ie.c +++ b/sys/arch/mvme68k/stand/netboot/if_ie.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ie.c,v 1.7 2000/01/06 03:21:44 smurph Exp $ */ +/* $OpenBSD: if_ie.c,v 1.8 2000/01/24 05:20:56 smurph Exp $ */ /* * Copyright (c) 1995 Theo de Raadt @@ -445,7 +445,8 @@ ie_init(desc, machdep_hint) bzero(&ie_softc, sizeof(ie_softc)); ie_softc.sc_reg = (struct iereg *) ie_config[desc->io_netif->nif_unit].phys_addr; - ie_softc.sc_mem = (struct iemem *) 0x2e0000; + /* printf("buffer @0x%x\n", RELOC - 0x20000);*/ + ie_softc.sc_mem = (struct iemem *) 0x3e0000; ie_reset(desc->io_netif, desc->myea); printf("device: %s%d attached to %s\n", nif->nif_driver->netif_bname, nif->nif_unit, ether_sprintf(desc->myea)); |