them, thanks to old ultrix bootblocks lying around.
Also, enable M-Bus clock on the I/O slot IOCSR, this unstucks the cpu
clocks (which really are implemented on the SSC on the I/O module, but
need to be controlled via the cpu's ``internal'' processor registers...)
-/* $OpenBSD: autoconf.c,v 1.11 2008/08/10 18:20:07 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.12 2008/08/12 17:23:21 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.19 2002/06/01 15:33:22 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
mtpr(-10000, PR_NICR); /* Load in count register */
mtpr(0x800000d1, PR_ICCS); /* Start clock and enable interrupt */
+ if (vax_boardtype == VAX_BTYP_60) {
+ extern int ka60_ioslot;
+
+ /* enable M-Bus clock in IOCSR */
+ *(unsigned int *)(0x30800000 + (ka60_ioslot << 25)) |=
+ 0x20000000; /* CLKIEN */
+ }
+
mtpr(20, PR_IPL);
}
-/* $OpenBSD: consio.c,v 1.8 2008/08/10 18:20:07 miod Exp $ */
+/* $OpenBSD: consio.c,v 1.9 2008/08/12 17:23:21 miod Exp $ */
/* $NetBSD: consio.c,v 1.13 2002/05/24 21:40:59 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
int vxt_testchar(void);
/*
- * I/O using the VS3[58][24]0 serial ports
+ * I/O using the KA60 ROM console routines
*/
-void ff_consinit(void);
-void ff_putchar(int c);
-int ff_getchar(void);
-int ff_testchar(void);
+unsigned char *ka60_conspage;
+void ka60_consinit(void);
+
+void ka60_rom_putchar(int c);
+int ka60_rom_getchar(void);
+int ka60_rom_testchar(void);
void putchar(int);
int getchar(void);
break;
case VAX_BTYP_60:
- put_fp = ff_putchar;
- get_fp = ff_getchar;
- test_fp = ff_testchar;
- ff_consinit();
+ ka60_consinit();
break;
#ifdef notdef
}
/*
- * void ka630_rom_getchar (void) ==> initialize KA630 ROM console I/O
+ * void ka630_consinit (void) ==> initialize KA630 ROM console I/O
*/
void ka630_consinit(void)
{
}
}
+int ka60_ioslot = -1;
+
/*
- * VaxStation 3[58][24]0 console routines.
- *
- * We do not know what the proper ROM entry points are, so these routines
- * drive the serial ports directly.
- *
- * Unfortunately the address of the serial ports depend on the position
- * of the L2003 I/O board in the system, which requires us to check all
- * slots for their ID. Of course, empty slots will cause a machine check,
- * and the suggested method of looking at the BUSCTL register to know
- * which slots are populated is not usable, since we are way too late in
- * the boot process.
+ * void ka60_consinit (void) ==> initialize KA60 ROM console I/O
*/
-
-struct ff_dzregs {
- volatile unsigned short csr;
- volatile unsigned short unused;
- volatile unsigned short rbuf;
- volatile unsigned short unused2;
- volatile unsigned short tcr;
- volatile unsigned short unused3;
- volatile unsigned short tdr;
-};
-
-#define DZ_CSR_TX_READY 0100000
-#define DZ_CSR_RX_DONE 0000200
-
-int ff_ioslot = -1;
-static struct ff_dzregs *ff_dz;
-
-void
-ff_consinit()
+void ka60_consinit(void)
{
extern int jbuf[10];
extern int mcheck_silent;
extern int setjmp(int *);
- int line = 3; /* printer port */
int mid, modaddr, modtype;
mcheck_silent = 1;
}
modtype = *(int *)modaddr;
if ((modtype & 0xff) == 0x04) {
- ff_ioslot = mid;
+ ka60_ioslot = mid;
break;
}
}
mcheck_silent = 0;
- if (ff_ioslot < 0) {
+ if (ka60_ioslot < 0) {
/*
* This shouldn't happen. Try mid #5 (slot #4) as a
* supposedly sane default.
*/
- ff_ioslot = 5;
- }
-
- ff_dz = (struct ff_dzregs *)
- (0x30000000 + (ff_ioslot << 25) + 0x00600000);
- ff_dz->tcr = 1 << line;
-}
-
-void
-ff_putchar(int c)
-{
- while ((ff_dz->csr & DZ_CSR_TX_READY) == 0)
- ;
- ff_dz->tdr = c;
- while ((ff_dz->csr & DZ_CSR_TX_READY) == 0)
- ;
-}
-
-int
-ff_getchar()
-{
- int line = 3; /* printer port */
- unsigned short rbuf;
-
- for(;;) {
- while ((ff_dz->csr & DZ_CSR_RX_DONE) == 0)
- ;
- rbuf = ff_dz->rbuf;
- if (((rbuf >> 8) & 3) == line)
- break;
+ ka60_ioslot = 5;
}
- rbuf &= 0x7f;
- if (rbuf == 13)
- rbuf = 10;
-
- return (int)rbuf;
-}
-
-int
-ff_testchar()
-{
- int line = 3; /* printer port */
- unsigned short rbuf;
-
- if ((ff_dz->csr & DZ_CSR_RX_DONE) == 0)
- return 0;
- rbuf = ff_dz->rbuf;
- if (((rbuf >> 8) & 3) != line)
- return 0;
-
- rbuf &= 0x7f;
- if (rbuf == 13)
- rbuf = 10;
-
- return (int)rbuf;
+ ka60_conspage = (char *) *(unsigned int *)0x20140514;
+ put_fp = ka60_rom_putchar;
+ get_fp = ka60_rom_getchar;
+ test_fp = ka60_rom_testchar;
}
-/* $OpenBSD: consio2.S,v 1.1 2002/06/11 09:36:23 hugh Exp $ */
+/* $OpenBSD: consio2.S,v 1.2 2008/08/12 17:23:21 miod Exp $ */
/* $NetBSD: consio2.S,v 1.1 2002/02/24 01:04:24 matt Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
/*
* int rom_putchar (int c) ==> putchar() using ROM-routines
*/
-ENTRY(rom_putchar, 0x0004) # save-mask: R2
+ENTRY(rom_putchar, R2)
movl 4(ap), r2 # move argument to R2
jsb *_C_LABEL(rom_putc) # write it
ret # that is all
/*
* int rom_getchar (void) ==> getchar() using ROM-routines
*/
-ENTRY(rom_getchar, 0x0002) # save-mask: R1
+ENTRY(rom_getchar, R1)
loop: # do {
jsb *_C_LABEL(rom_getc) # call the getc-routine
tstl r0 # check if char ready
/*
* int ka630_rom_getchar (void) ==> getchar() using ROM-routines on KA630
*/
-ENTRY(ka630_rom_getchar, 0x0802) # save-mask: R1, R11
+ENTRY(ka630_rom_getchar, R11|R1)
movl _C_LABEL(ka630_conspage),r11 # load location of console page
1: # do {
jsb *0x1C(r11) # call the getc-routine (KA630_GETC)
movl r1,r0 # R1 holds char
ret # we are done
-ENTRY(ka630_rom_testchar, 0)
+ENTRY(ka630_rom_testchar, R3|R1)
movl _C_LABEL(ka630_conspage),r3
jsb *0x1C(r3)
blbc r0,1f
/*
* int ka630_rom_putchar (int c) ==> putchar() using ROM-routines on KA630
*/
-ENTRY(ka630_rom_putchar, 0x802) # save-mask: R1, R11
+ENTRY(ka630_rom_putchar, R11|R1)
movl _C_LABEL(ka630_conspage),r11
# load location of console page
1: # do {
/*
* int ka53_rom_getchar (void) ==> getchar() using ROM-routines on KA53
*/
-ENTRY(ka53_rom_getchar, 0x0802) # save-mask: R1, R11
+ENTRY(ka53_rom_getchar, R11|R1)
movl _C_LABEL(ka53_conspage),r11
# load location of console page
1: # do {
jsb *0x6c(r11) # get the char
ret # we are done
-ENTRY(ka53_rom_testchar, 0)
+ENTRY(ka53_rom_testchar, R3|R1)
movl _C_LABEL(ka53_conspage),r3
jsb *0x64(r3)
blbc r0,1f
/*
* int ka53_rom_putchar (int c) ==> putchar() using ROM-routines on KA53
*/
-ENTRY(ka53_rom_putchar, 0x0802) # save-mask: R1, R11
+ENTRY(ka53_rom_putchar, R11|R1)
movl _C_LABEL(ka53_conspage),r11
# load location of console page
1: # do {
movl 4(ap),r1 # R1 holds char
jsb *0x24(r11) # output character
ret # we are done
+
+/*
+ * int ka60_rom_getchar (void) ==> getchar() using ROM-routines on KA60
+ */
+ENTRY(ka60_rom_getchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1)
+1:
+ movl _C_LABEL(ka60_conspage),r0
+ # load location of console page
+ # do {
+ jsb *0xfc(r0) # get the char, if any
+ blbc r0,1b # } while (R0 == 0)
+ movl r1,r0
+ ret # we are done
+
+ENTRY(ka60_rom_testchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1)
+ movl _C_LABEL(ka60_conspage),r0
+ jsb *0xfc(r0)
+ blbc r0,1f
+ movl r1,r0
+1: ret
+
+/*
+ * int ka60_rom_putchar (int c) ==> putchar() using ROM-routines on KA60
+ */
+ENTRY(ka60_rom_putchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1)
+1:
+ movl _C_LABEL(ka60_conspage),r0
+ # load location of console page
+ movl 4(ap),r1 # R1 holds char
+ jsb *0x114(r0) # output character
+ blbc r0, 1b # failed? retry
+ ret # we are done
-/* $OpenBSD: if_le.c,v 1.4 2008/08/10 18:20:07 miod Exp $ */
+/* $OpenBSD: if_le.c,v 1.5 2008/08/12 17:23:21 miod Exp $ */
/* $NetBSD: if_le.c,v 1.6 2000/05/20 13:30:03 ragge Exp $ */
/*
* Copyright (c) 1997, 1999 Ludd, University of Lule}, Sweden.
ea = (void *)0x20084200;
nireg = (void *)0x20084400;
} else if (vax_boardtype == VAX_BTYP_60) {
- extern int ff_ioslot;
- lebufaddr = 0x30a00000 + (ff_ioslot << 25);
- ea = (int *)(0x30800000 + (ff_ioslot << 25));
+ extern int ka60_ioslot;
+ lebufaddr = 0x30a00000 + (ka60_ioslot << 25);
+ ea = (int *)(0x30800000 + (ka60_ioslot << 25));
for (i = 0; i < 6; i++) {
eaddr[i] = *(u_char *)((int)ea + 2);
ea++;
}
ea = NULL;
- nireg = (void *)(0x30200000 + (ff_ioslot << 25));
+ nireg = (void *)(0x30200000 + (ka60_ioslot << 25));
} else {
*(int *)0x20080014 = 0; /* Be sure we do DMA in low 16MB */
ea = (void *)0x20090000; /* XXX Ethernet address */
-$OpenBSD: version,v 1.6 2008/08/10 18:20:07 miod Exp $
+$OpenBSD: version,v 1.7 2008/08/12 17:23:21 miod Exp $
$NetBSD: version,v 1.4 2001/11/09 19:53:15 scw Exp $
NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
1.11: Better VXT2000{,+} support.
1.12: Glass console support on VXT2000{,+}.
1.13: Enable the loadfile code added in revision 1.8.
-1.14: Support for VaxStation 3[58][24]0 (serial port console only).
+1.14: Support for VaxStation 3[58][24]0.
-/* $OpenBSD: autoconf.c,v 1.11 2008/08/10 18:20:07 miod Exp $ */
+/* $OpenBSD: autoconf.c,v 1.12 2008/08/12 17:23:21 miod Exp $ */
/* $NetBSD: autoconf.c,v 1.19 2002/06/01 15:33:22 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
mtpr(-10000, PR_NICR); /* Load in count register */
mtpr(0x800000d1, PR_ICCS); /* Start clock and enable interrupt */
+ if (vax_boardtype == VAX_BTYP_60) {
+ extern int ka60_ioslot;
+
+ /* enable M-Bus clock in IOCSR */
+ *(unsigned int *)(0x30800000 + (ka60_ioslot << 25)) |=
+ 0x20000000; /* CLKIEN */
+ }
+
mtpr(20, PR_IPL);
}
-/* $OpenBSD: consio.c,v 1.8 2008/08/10 18:20:07 miod Exp $ */
+/* $OpenBSD: consio.c,v 1.9 2008/08/12 17:23:21 miod Exp $ */
/* $NetBSD: consio.c,v 1.13 2002/05/24 21:40:59 ragge Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
int vxt_testchar(void);
/*
- * I/O using the VS3[58][24]0 serial ports
+ * I/O using the KA60 ROM console routines
*/
-void ff_consinit(void);
-void ff_putchar(int c);
-int ff_getchar(void);
-int ff_testchar(void);
+unsigned char *ka60_conspage;
+void ka60_consinit(void);
+
+void ka60_rom_putchar(int c);
+int ka60_rom_getchar(void);
+int ka60_rom_testchar(void);
void putchar(int);
int getchar(void);
break;
case VAX_BTYP_60:
- put_fp = ff_putchar;
- get_fp = ff_getchar;
- test_fp = ff_testchar;
- ff_consinit();
+ ka60_consinit();
break;
#ifdef notdef
}
/*
- * void ka630_rom_getchar (void) ==> initialize KA630 ROM console I/O
+ * void ka630_consinit (void) ==> initialize KA630 ROM console I/O
*/
void ka630_consinit(void)
{
}
}
+int ka60_ioslot = -1;
+
/*
- * VaxStation 3[58][24]0 console routines.
- *
- * We do not know what the proper ROM entry points are, so these routines
- * drive the serial ports directly.
- *
- * Unfortunately the address of the serial ports depend on the position
- * of the L2003 I/O board in the system, which requires us to check all
- * slots for their ID. Of course, empty slots will cause a machine check,
- * and the suggested method of looking at the BUSCTL register to know
- * which slots are populated is not usable, since we are way too late in
- * the boot process.
+ * void ka60_consinit (void) ==> initialize KA60 ROM console I/O
*/
-
-struct ff_dzregs {
- volatile unsigned short csr;
- volatile unsigned short unused;
- volatile unsigned short rbuf;
- volatile unsigned short unused2;
- volatile unsigned short tcr;
- volatile unsigned short unused3;
- volatile unsigned short tdr;
-};
-
-#define DZ_CSR_TX_READY 0100000
-#define DZ_CSR_RX_DONE 0000200
-
-int ff_ioslot = -1;
-static struct ff_dzregs *ff_dz;
-
-void
-ff_consinit()
+void ka60_consinit(void)
{
extern int jbuf[10];
extern int mcheck_silent;
extern int setjmp(int *);
- int line = 3; /* printer port */
int mid, modaddr, modtype;
mcheck_silent = 1;
}
modtype = *(int *)modaddr;
if ((modtype & 0xff) == 0x04) {
- ff_ioslot = mid;
+ ka60_ioslot = mid;
break;
}
}
mcheck_silent = 0;
- if (ff_ioslot < 0) {
+ if (ka60_ioslot < 0) {
/*
* This shouldn't happen. Try mid #5 (slot #4) as a
* supposedly sane default.
*/
- ff_ioslot = 5;
- }
-
- ff_dz = (struct ff_dzregs *)
- (0x30000000 + (ff_ioslot << 25) + 0x00600000);
- ff_dz->tcr = 1 << line;
-}
-
-void
-ff_putchar(int c)
-{
- while ((ff_dz->csr & DZ_CSR_TX_READY) == 0)
- ;
- ff_dz->tdr = c;
- while ((ff_dz->csr & DZ_CSR_TX_READY) == 0)
- ;
-}
-
-int
-ff_getchar()
-{
- int line = 3; /* printer port */
- unsigned short rbuf;
-
- for(;;) {
- while ((ff_dz->csr & DZ_CSR_RX_DONE) == 0)
- ;
- rbuf = ff_dz->rbuf;
- if (((rbuf >> 8) & 3) == line)
- break;
+ ka60_ioslot = 5;
}
- rbuf &= 0x7f;
- if (rbuf == 13)
- rbuf = 10;
-
- return (int)rbuf;
-}
-
-int
-ff_testchar()
-{
- int line = 3; /* printer port */
- unsigned short rbuf;
-
- if ((ff_dz->csr & DZ_CSR_RX_DONE) == 0)
- return 0;
- rbuf = ff_dz->rbuf;
- if (((rbuf >> 8) & 3) != line)
- return 0;
-
- rbuf &= 0x7f;
- if (rbuf == 13)
- rbuf = 10;
-
- return (int)rbuf;
+ ka60_conspage = (char *) *(unsigned int *)0x20140514;
+ put_fp = ka60_rom_putchar;
+ get_fp = ka60_rom_getchar;
+ test_fp = ka60_rom_testchar;
}
-/* $OpenBSD: consio2.S,v 1.1 2002/06/11 09:36:23 hugh Exp $ */
+/* $OpenBSD: consio2.S,v 1.2 2008/08/12 17:23:21 miod Exp $ */
/* $NetBSD: consio2.S,v 1.1 2002/02/24 01:04:24 matt Exp $ */
/*
* Copyright (c) 1994, 1998 Ludd, University of Lule}, Sweden.
/*
* int rom_putchar (int c) ==> putchar() using ROM-routines
*/
-ENTRY(rom_putchar, 0x0004) # save-mask: R2
+ENTRY(rom_putchar, R2)
movl 4(ap), r2 # move argument to R2
jsb *_C_LABEL(rom_putc) # write it
ret # that is all
/*
* int rom_getchar (void) ==> getchar() using ROM-routines
*/
-ENTRY(rom_getchar, 0x0002) # save-mask: R1
+ENTRY(rom_getchar, R1)
loop: # do {
jsb *_C_LABEL(rom_getc) # call the getc-routine
tstl r0 # check if char ready
/*
* int ka630_rom_getchar (void) ==> getchar() using ROM-routines on KA630
*/
-ENTRY(ka630_rom_getchar, 0x0802) # save-mask: R1, R11
+ENTRY(ka630_rom_getchar, R11|R1)
movl _C_LABEL(ka630_conspage),r11 # load location of console page
1: # do {
jsb *0x1C(r11) # call the getc-routine (KA630_GETC)
movl r1,r0 # R1 holds char
ret # we are done
-ENTRY(ka630_rom_testchar, 0)
+ENTRY(ka630_rom_testchar, R3|R1)
movl _C_LABEL(ka630_conspage),r3
jsb *0x1C(r3)
blbc r0,1f
/*
* int ka630_rom_putchar (int c) ==> putchar() using ROM-routines on KA630
*/
-ENTRY(ka630_rom_putchar, 0x802) # save-mask: R1, R11
+ENTRY(ka630_rom_putchar, R11|R1)
movl _C_LABEL(ka630_conspage),r11
# load location of console page
1: # do {
/*
* int ka53_rom_getchar (void) ==> getchar() using ROM-routines on KA53
*/
-ENTRY(ka53_rom_getchar, 0x0802) # save-mask: R1, R11
+ENTRY(ka53_rom_getchar, R11|R1)
movl _C_LABEL(ka53_conspage),r11
# load location of console page
1: # do {
jsb *0x6c(r11) # get the char
ret # we are done
-ENTRY(ka53_rom_testchar, 0)
+ENTRY(ka53_rom_testchar, R3|R1)
movl _C_LABEL(ka53_conspage),r3
jsb *0x64(r3)
blbc r0,1f
/*
* int ka53_rom_putchar (int c) ==> putchar() using ROM-routines on KA53
*/
-ENTRY(ka53_rom_putchar, 0x0802) # save-mask: R1, R11
+ENTRY(ka53_rom_putchar, R11|R1)
movl _C_LABEL(ka53_conspage),r11
# load location of console page
1: # do {
movl 4(ap),r1 # R1 holds char
jsb *0x24(r11) # output character
ret # we are done
+
+/*
+ * int ka60_rom_getchar (void) ==> getchar() using ROM-routines on KA60
+ */
+ENTRY(ka60_rom_getchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1)
+1:
+ movl _C_LABEL(ka60_conspage),r0
+ # load location of console page
+ # do {
+ jsb *0xfc(r0) # get the char, if any
+ blbc r0,1b # } while (R0 == 0)
+ movl r1,r0
+ ret # we are done
+
+ENTRY(ka60_rom_testchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1)
+ movl _C_LABEL(ka60_conspage),r0
+ jsb *0xfc(r0)
+ blbc r0,1f
+ movl r1,r0
+1: ret
+
+/*
+ * int ka60_rom_putchar (int c) ==> putchar() using ROM-routines on KA60
+ */
+ENTRY(ka60_rom_putchar, R11|R10|R9|R8|R7|R6|R5|R4|R3|R2|R1)
+1:
+ movl _C_LABEL(ka60_conspage),r0
+ # load location of console page
+ movl 4(ap),r1 # R1 holds char
+ jsb *0x114(r0) # output character
+ blbc r0, 1b # failed? retry
+ ret # we are done
-/* $OpenBSD: if_le.c,v 1.4 2008/08/10 18:20:07 miod Exp $ */
+/* $OpenBSD: if_le.c,v 1.5 2008/08/12 17:23:21 miod Exp $ */
/* $NetBSD: if_le.c,v 1.6 2000/05/20 13:30:03 ragge Exp $ */
/*
* Copyright (c) 1997, 1999 Ludd, University of Lule}, Sweden.
ea = (void *)0x20084200;
nireg = (void *)0x20084400;
} else if (vax_boardtype == VAX_BTYP_60) {
- extern int ff_ioslot;
- lebufaddr = 0x30a00000 + (ff_ioslot << 25);
- ea = (int *)(0x30800000 + (ff_ioslot << 25));
+ extern int ka60_ioslot;
+ lebufaddr = 0x30a00000 + (ka60_ioslot << 25);
+ ea = (int *)(0x30800000 + (ka60_ioslot << 25));
for (i = 0; i < 6; i++) {
eaddr[i] = *(u_char *)((int)ea + 2);
ea++;
}
ea = NULL;
- nireg = (void *)(0x30200000 + (ff_ioslot << 25));
+ nireg = (void *)(0x30200000 + (ka60_ioslot << 25));
} else {
*(int *)0x20080014 = 0; /* Be sure we do DMA in low 16MB */
ea = (void *)0x20090000; /* XXX Ethernet address */
-$OpenBSD: version,v 1.6 2008/08/10 18:20:07 miod Exp $
+$OpenBSD: version,v 1.7 2008/08/12 17:23:21 miod Exp $
$NetBSD: version,v 1.4 2001/11/09 19:53:15 scw Exp $
NOTE ANY CHANGES YOU MAKE TO THE BOOTBLOCKS HERE. The format of this
1.11: Better VXT2000{,+} support.
1.12: Glass console support on VXT2000{,+}.
1.13: Enable the loadfile code added in revision 1.8.
-1.14: Support for VaxStation 3[58][24]0 (serial port console only).
+1.14: Support for VaxStation 3[58][24]0.