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 Add support for VAX 6000 + VAX 8000. ...
details: https://anonhg.NetBSD.org/src/rev/4580e8fd2e85
branches: trunk
changeset: 494657:4580e8fd2e85
user: ragge <ragge%NetBSD.org@localhost>
date: Mon Jul 10 10:38:23 2000 +0000
description:
Add support for VAX 6000 + VAX 8000. Tweak console routines.
Create a fake RPB if either netbooted (on machine without RPB) or
loaded from console storage (without VMB intervention).
diffstat:
sys/arch/vax/boot/boot/autoconf.c | 39 ++++++++++-
sys/arch/vax/boot/boot/boot.c | 13 +---
sys/arch/vax/boot/boot/consio.c | 123 +++++++++++++++++++++----------------
sys/arch/vax/boot/boot/devopen.c | 32 ++++++---
sys/arch/vax/boot/boot/ra.c | 28 ++++++--
5 files changed, 148 insertions(+), 87 deletions(-)
diffs (truncated from 470 to 300 lines):
diff -r 1e44e09d419c -r 4580e8fd2e85 sys/arch/vax/boot/boot/autoconf.c
--- a/sys/arch/vax/boot/boot/autoconf.c Mon Jul 10 10:19:25 2000 +0000
+++ b/sys/arch/vax/boot/boot/autoconf.c Mon Jul 10 10:38:23 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: autoconf.c,v 1.12 2000/06/04 19:30:14 matt Exp $ */
+/* $NetBSD: autoconf.c,v 1.13 2000/07/10 10:38:23 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -54,22 +54,43 @@
void longjmp(int *);
void rtimer(void *);
+long *bootregs;
+
/*
- * Autoconf routine is really stupid; but it actually don't
- * need any intelligence. We just assume that all possible
- * devices exists on each cpu. Fast & easy.
+ * Do some initial setup. Also create a fake RPB for net-booted machines
+ * that don't have an in-prom VMB.
*/
void
autoconf()
{
+ int copyrpb = 1;
+ int fromnet = (bootregs[12] != -1);
findcpu(); /* Configures CPU variables */
consinit(); /* Allow us to print out things */
scbinit(); /* Fix interval clock etc */
+printf("fromnet %d bootregs[12] %ld &bootrpb %p\n", fromnet, bootregs[12], &bootrpb);
+for (copyrpb = 0; copyrpb < 13; copyrpb++)
+ printf("r%d: %lx\n", copyrpb, bootregs[copyrpb]);
switch (vax_boardtype) {
+ case VAX_BTYP_8000:
+ case VAX_BTYP_9CC:
+ case VAX_BTYP_9RR:
+ case VAX_BTYP_1202:
+ if (fromnet == 0)
+ break;
+ copyrpb = 0;
+ bootrpb.devtyp = bootregs[0];
+ bootrpb.adpphy = bootregs[1];
+ bootrpb.csrphy = bootregs[2];
+ bootrpb.unit = bootregs[3];
+ bootrpb.rpb_bootr5 = bootregs[5];
+ bootrpb.pfncnt = 0;
+ break;
+
case VAX_BTYP_46:
case VAX_BTYP_48:
{int *map, i;
@@ -83,6 +104,16 @@
break;
}
+
+ if (copyrpb) {
+ struct rpb *prpb = (struct rpb *)bootregs[11];
+ 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);
+ }
+ }
}
/*
diff -r 1e44e09d419c -r 4580e8fd2e85 sys/arch/vax/boot/boot/boot.c
--- a/sys/arch/vax/boot/boot/boot.c Mon Jul 10 10:19:25 2000 +0000
+++ b/sys/arch/vax/boot/boot/boot.c Mon Jul 10 10:38:23 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: boot.c,v 1.9 2000/05/26 20:15:21 ragge Exp $ */
+/* $NetBSD: boot.c,v 1.10 2000/07/10 10:38:23 ragge Exp $ */
/*-
* Copyright (c) 1982, 1986 The Regents of the University of California.
* All rights reserved.
@@ -55,7 +55,7 @@
extern unsigned opendev;
void usage(char *), boot(char *), halt(char *);
-void Xmain(struct rpb *);
+void Xmain(void);
void autoconf(void);
int getsecs(void);
int setjmp(int *);
@@ -91,18 +91,11 @@
struct rpb bootrpb;
void
-Xmain(struct rpb *prpb)
+Xmain(void)
{
int io;
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();
diff -r 1e44e09d419c -r 4580e8fd2e85 sys/arch/vax/boot/boot/consio.c
--- a/sys/arch/vax/boot/boot/consio.c Mon Jul 10 10:19:25 2000 +0000
+++ b/sys/arch/vax/boot/boot/consio.c Mon Jul 10 10:38:23 2000 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: consio.c,v 1.9 2000/05/20 13:35:07 ragge Exp $ */
+/* $NetBSD: consio.c,v 1.10 2000/07/10 10:38:23 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
* All rights reserved.
@@ -61,16 +61,16 @@
static int rom_getc; /* ROM-address of get-routine */
/* Location of address of KA630 console page */
-#define NVR_ADRS 0x200B8024
+#define NVR_ADRS 0x200B8024
/* Definitions for various locations in the KA630 console page */
#define KA630_PUTC_POLL 0x20
-#define KA630_PUTC 0x24
-#define KA630_GETC 0x1C
+#define KA630_PUTC 0x24
+#define KA630_GETC 0x1C
#define KA630_ROW 0x4C
#define KA630_MINROW 0x4D
#define KA630_MAXROW 0x4E
#define KA630_COL 0x50
-#define KA630_MINCOL 0x51
+#define KA630_MINCOL 0x51
#define KA630_MAXCOL 0x52
/* Pointer to KA630 console page, initialized by ka630_consinit */
unsigned char *ka630_conspage;
@@ -161,8 +161,8 @@
break;
case VAX_BTYP_630:
- ka630_consinit();
- break;
+ ka630_consinit();
+ break;
case VAX_BTYP_46:
case VAX_BTYP_48:
@@ -197,11 +197,27 @@
void
pr_putchar(int c)
{
- int timeout = 1<<15; /* don't hang the machine! */
- while ((mfpr(PR_TXCS) & GC_RDY) == 0) /* Wait until xmit ready */
+ int timeout = 1<<15; /* don't hang the machine! */
+
+ /*
+ * On KA88 we may get C-S/C-Q from the console.
+ * Must obey it.
+ */
+ while (mfpr(PR_RXCS) & GC_DON) {
+ if ((mfpr(PR_RXDB) & 0x7f) == 19) {
+ while (1) {
+ while ((mfpr(PR_RXCS) & GC_DON) == 0)
+ ;
+ if ((mfpr(PR_RXDB) & 0x7f) == 17)
+ break;
+ }
+ }
+ }
+
+ while ((mfpr(PR_TXCS) & GC_RDY) == 0) /* Wait until xmit ready */
if (--timeout < 0)
break;
- mtpr(c, PR_TXDB); /* xmit character */
+ mtpr(c, PR_TXDB); /* xmit character */
}
/*
@@ -210,7 +226,8 @@
int
pr_getchar()
{
- while ((mfpr(PR_RXCS) & GC_DON) == 0); /* wait for char */
+ while ((mfpr(PR_RXCS) & GC_DON) == 0)
+ ; /* wait for char */
return (mfpr(PR_RXDB)); /* now get it */
}
@@ -272,41 +289,41 @@
*/
void ka630_consinit()
{
- register short *NVR;
- register int i;
+ register short *NVR;
+ register int i;
- /* Find the console page */
- NVR = (short *) NVR_ADRS;
+ /* Find the console page */
+ NVR = (short *) NVR_ADRS;
- i = *NVR++ & 0xFF;
- i |= (*NVR++ & 0xFF) << 8;
- i |= (*NVR++ & 0xFF) << 16;
- i |= (*NVR++ & 0xFF) << 24;
+ i = *NVR++ & 0xFF;
+ i |= (*NVR++ & 0xFF) << 8;
+ i |= (*NVR++ & 0xFF) << 16;
+ i |= (*NVR++ & 0xFF) << 24;
- ka630_conspage = (char *) i;
+ ka630_conspage = (char *) i;
- /* Go to last row to minimize confusion */
+ /* Go to last row to minimize confusion */
ka630_conspage[KA630_ROW] = ka630_conspage[KA630_MAXROW];
ka630_conspage[KA630_COL] = ka630_conspage[KA630_MINCOL];
- /* Use KA630 ROM console I/O routines */
+ /* Use KA630 ROM console I/O routines */
put_fp = ka630_rom_putchar;
get_fp = ka630_rom_getchar;
test_fp = ka630_rom_testchar;
}
-
+
/*
- * int ka630_rom_getchar (void) ==> getchar() using ROM-routines on KA630
+ * int ka630_rom_getchar (void) ==> getchar() using ROM-routines on KA630
*/
asm("
.globl _ka630_rom_getchar
_ka630_rom_getchar:
.word 0x802 # save-mask: R1, R11
- movl _ka630_conspage,r11 # load location of console page
- loop630g: # do {
+ movl _ka630_conspage,r11 # load location of console page
+ loop630g: # do {
jsb *0x1C(r11) # call the getc-routine (KA630_GETC)
- blbc r0, loop630g # } while (R0 == 0)
+ blbc r0, loop630g # } while (R0 == 0)
movl r1, r0 # R1 holds char
ret # we're done
@@ -326,12 +343,12 @@
.globl _ka630_rom_putchar
_ka630_rom_putchar:
.word 0x802 # save-mask: R1, R11
- movl _ka630_conspage,r11 # load location of console page
- loop630p: # do {
+ movl _ka630_conspage,r11 # load location of console page
+ loop630p: # do {
jsb *0x20(r11) # is rom ready? (KA630_PUTC_POLL)
- blbc r0, loop630p # } while (R0 == 0)
+ blbc r0, loop630p # } while (R0 == 0)
movl 4(ap), r1 # R1 holds char
- jsb *0x24(r11) # output character (KA630_PUTC)
+ jsb *0x24(r11) # output character (KA630_PUTC)
ret # we're done
");
@@ -349,26 +366,26 @@
/*
- * int ka53_rom_getchar (void) ==> getchar() using ROM-routines on KA53
+ * int ka53_rom_getchar (void) ==> getchar() using ROM-routines on KA53
*/
asm("
.globl _ka53_rom_getchar
_ka53_rom_getchar:
- .word 0x802 # save-mask: R1, R11
- movl _ka53_conspage,r11 # load location of console page
- loop53g: # do {
- jsb *0x64(r11) # test for char
- blbc r0, loop53g # } while (R0 == 0)
- jsb *0x6c(r11) # get the char
- ret # we're done
+ .word 0x802 # save-mask: R1, R11
+ movl _ka53_conspage,r11 # load location of console page
+ loop53g: # do {
+ jsb *0x64(r11) # test for char
+ blbc r0, loop53g # } while (R0 == 0)
+ jsb *0x6c(r11) # get the char
+ ret # we're done
_ka53_rom_testchar:
- .word 0
- movl _ka53_conspage,r3
- jsb *0x64(r3)
- blbc r0,1f
- jsb *0x6c(r3) # get the char
- 1: ret
Home |
Main Index |
Thread Index |
Old Index