diff options
author | Miod Vallat <miod@cvs.openbsd.org> | 2005-12-31 17:59:48 +0000 |
---|---|---|
committer | Miod Vallat <miod@cvs.openbsd.org> | 2005-12-31 17:59:48 +0000 |
commit | 298afceafb8876c4bb8e892f737e6b0f2ca98490 (patch) | |
tree | fcd8897b4bb3076228490ebad7bab764a956736b | |
parent | 1e29b950a8c0e51a63687d8f1295bb84fbfa5345 (diff) |
Sync with recent kernel changes: recognize more models, use the same logic
to pick apci as a console on 425e. Crank version.
-rw-r--r-- | sys/arch/hp300/stand/cdboot/cons.c | 5 | ||||
-rw-r--r-- | sys/arch/hp300/stand/common/apci.c | 23 | ||||
-rw-r--r-- | sys/arch/hp300/stand/common/autoconf.c | 20 | ||||
-rw-r--r-- | sys/arch/hp300/stand/common/cons.c | 17 | ||||
-rw-r--r-- | sys/arch/hp300/stand/common/dca.c | 7 | ||||
-rw-r--r-- | sys/arch/hp300/stand/common/dcm.c | 6 | ||||
-rw-r--r-- | sys/arch/hp300/stand/common/machdep.c | 8 | ||||
-rw-r--r-- | sys/arch/hp300/stand/common/version.c | 6 | ||||
-rw-r--r-- | sys/arch/hp300/stand/include/consdefs.h | 4 | ||||
-rw-r--r-- | sys/arch/hp300/stand/uboot/srt0.S | 34 |
10 files changed, 67 insertions, 63 deletions
diff --git a/sys/arch/hp300/stand/cdboot/cons.c b/sys/arch/hp300/stand/cdboot/cons.c index d73c1dbe4fa..5437604bd69 100644 --- a/sys/arch/hp300/stand/cdboot/cons.c +++ b/sys/arch/hp300/stand/cdboot/cons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cons.c,v 1.2 2003/06/02 23:27:45 millert Exp $ */ +/* $OpenBSD: cons.c,v 1.3 2005/12/31 17:59:43 miod Exp $ */ /* $NetBSD: cons.c,v 1.2 1997/05/12 07:44:53 thorpej Exp $ */ /* @@ -42,6 +42,7 @@ #include <sys/param.h> #include <dev/cons.h> +#include "consdefs.h" #include "samachdep.h" @@ -58,7 +59,7 @@ cninit() { cn_tab = NULL; noconsole = 1; - cons_scode = 256; /* larger than last valid select code */ + cons_scode = CONSCODE_INVALID; userom = 1; donottwiddle = 1; } diff --git a/sys/arch/hp300/stand/common/apci.c b/sys/arch/hp300/stand/common/apci.c index a97b0816691..a4556efc27c 100644 --- a/sys/arch/hp300/stand/common/apci.c +++ b/sys/arch/hp300/stand/common/apci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: apci.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ +/* $OpenBSD: apci.c,v 1.6 2005/12/31 17:59:47 miod Exp $ */ /* $NetBSD: apci.c,v 1.2 1997/10/04 17:20:15 thorpej Exp $ */ /*- @@ -90,6 +90,7 @@ void apciprobe(cp) struct consdev *cp; { + volatile u_int8_t *frodoregs; cp->cn_pri = CN_DEAD; @@ -100,12 +101,20 @@ apciprobe(cp) if (machineid != HP_425 || mmuid != MMUID_425_E) return; -#ifdef FORCEAPCICONSOLE - cp->cn_pri = CN_REMOTE; -#else - cp->cn_pri = CN_NORMAL; -#endif - curcons_scode = -2; + /* + * Check the service switch. On the 425e, this is a physical + * switch, unlike other frodo-based machines, so we can use it + * as a serial vs internal video selector, since the PROM can not + * be configured for serial console. + */ + frodoregs = (volatile u_int8_t *)IIOV(FRODO_BASE); + if (badaddr((caddr_t)frodoregs) == 0 && + (frodoregs[FRODO_IISR] & FRODO_IISR_SERVICE) == 0) + cp->cn_pri = CN_REMOTE; + else + cp->cn_pri = CN_NORMAL; + + curcons_scode = CONSCODE_INVALID; } void diff --git a/sys/arch/hp300/stand/common/autoconf.c b/sys/arch/hp300/stand/common/autoconf.c index 962d8d4647f..88815ecd52f 100644 --- a/sys/arch/hp300/stand/common/autoconf.c +++ b/sys/arch/hp300/stand/common/autoconf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: autoconf.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ +/* $OpenBSD: autoconf.c,v 1.6 2005/12/31 17:59:47 miod Exp $ */ /* $NetBSD: autoconf.c,v 1.12 1997/01/30 10:32:51 thorpej Exp $ */ /* @@ -94,21 +94,26 @@ configure() break; case HP_350: case HP_360: +#if 0 /* bootblocks do not tell 360 apart from 362 at the moment */ + case HP_362: +#endif cpuspeed = MHZ_25; break; case HP_370: cpuspeed = MHZ_33; break; - case HP_375: - cpuspeed = MHZ_50; - break; case HP_380: + case HP_382: + case HP_425: cpuspeed = MHZ_25 * 2; /* XXX */ break; case HP_385: case HP_433: cpuspeed = MHZ_33 * 2; /* XXX */ break; + case HP_345: + case HP_375: + case HP_400: default: /* assume the fastest (largest delay value) */ cpuspeed = MHZ_50; break; @@ -233,10 +238,13 @@ find_devs() hw->hw_type = D_BITMAP; hw->hw_secid = id_reg[0x15]; switch (hw->hw_secid) { - case 4: /* renaissance */ - case 8: /* davinci */ + case 4: /* renaissance */ + case 8: /* davinci */ sc++; /* occupy 2 select codes */ break; + case 0x11: /* 3x2 internal display */ + sc += 3; /* occupy 4 select codes */ + break; } break; case 9: diff --git a/sys/arch/hp300/stand/common/cons.c b/sys/arch/hp300/stand/common/cons.c index 555d85df4dd..c73eab4a7c9 100644 --- a/sys/arch/hp300/stand/common/cons.c +++ b/sys/arch/hp300/stand/common/cons.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cons.c,v 1.2 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: cons.c,v 1.3 2005/12/31 17:59:47 miod Exp $ */ /* $NetBSD: cons.c,v 1.2 1997/05/12 07:44:53 thorpej Exp $ */ /* @@ -74,7 +74,7 @@ cninit() cn_tab = NULL; noconsole = 1; - cons_scode = 256; /* larger than last valid select code */ + cons_scode = CONSCODE_INVALID; for (cp = constab; cp->cn_probe; cp++) { (*cp->cn_probe)(cp); if (cp->cn_pri > CN_DEAD && @@ -86,19 +86,6 @@ cninit() if (cn_tab) { (*cn_tab->cn_init)(cn_tab); noconsole = 0; -#if 0 - printf("console: "); - switch (cons_scode) { - case -2: - printf("apci\n"); - break; - case -1: - printf("internal grf\n"); - break; - default: - printf("scode %d\n", cons_scode); - } -#endif } } diff --git a/sys/arch/hp300/stand/common/dca.c b/sys/arch/hp300/stand/common/dca.c index bc93e87fb7d..463f37ac5ab 100644 --- a/sys/arch/hp300/stand/common/dca.c +++ b/sys/arch/hp300/stand/common/dca.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dca.c,v 1.3 2005/12/28 21:13:45 miod Exp $ */ +/* $OpenBSD: dca.c,v 1.4 2005/12/31 17:59:47 miod Exp $ */ /* $NetBSD: dca.c,v 1.10 1996/10/06 01:42:48 mycroft Exp $ */ /* @@ -67,9 +67,7 @@ dcaprobe(cp) cp->cn_pri = CN_DEAD; return; } -#ifdef FORCEDCACONSOLE - cp->cn_pri = CN_REMOTE; -#else + dca = dcacnaddr; switch (dca->dca_id) { case DCAID0: @@ -85,7 +83,6 @@ dcaprobe(cp) break; } -#endif curcons_scode = DCACONSCODE; } diff --git a/sys/arch/hp300/stand/common/dcm.c b/sys/arch/hp300/stand/common/dcm.c index 8247ad5f55b..14579f1d22a 100644 --- a/sys/arch/hp300/stand/common/dcm.c +++ b/sys/arch/hp300/stand/common/dcm.c @@ -1,4 +1,4 @@ -/* $OpenBSD: dcm.c,v 1.2 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: dcm.c,v 1.3 2005/12/31 17:59:47 miod Exp $ */ /* $NetBSD: dcm.c,v 1.2 1997/04/14 05:58:32 scottr Exp $ */ /* @@ -68,9 +68,6 @@ dcmprobe(cp) } dcmcnaddr = (struct dcmdevice *) hw->hw_kva; -#ifdef FORCEDCMCONSOLE - cp->cn_pri = CN_REMOTE; -#else dcm = dcmcnaddr; switch (dcm->dcm_rsid) { case DCMID: @@ -85,7 +82,6 @@ dcmprobe(cp) } curcons_scode = hw->hw_sc; -#endif } void diff --git a/sys/arch/hp300/stand/common/machdep.c b/sys/arch/hp300/stand/common/machdep.c index e3404df7ed2..00bdd9a364e 100644 --- a/sys/arch/hp300/stand/common/machdep.c +++ b/sys/arch/hp300/stand/common/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.5 2005/04/22 00:42:16 miod Exp $ */ +/* $OpenBSD: machdep.c,v 1.6 2005/12/31 17:59:47 miod Exp $ */ /* $NetBSD: machdep.c,v 1.4 1997/06/28 07:20:25 thorpej Exp $ */ /* @@ -62,12 +62,18 @@ getmachineid() cp = "350"; break; case HP_360: cp = "360"; break; +#if 0 /* bootblocks do not tell 360 apart from 362 at the moment */ + case HP_362: + cp = "362"; break; +#endif case HP_370: cp = "370"; break; case HP_375: cp = "375"; break; case HP_380: cp = "380"; break; + case HP_382: + cp = "382"; break; case HP_385: cp = "385"; break; case HP_400: diff --git a/sys/arch/hp300/stand/common/version.c b/sys/arch/hp300/stand/common/version.c index 8c386833861..cbad9c2aa50 100644 --- a/sys/arch/hp300/stand/common/version.c +++ b/sys/arch/hp300/stand/common/version.c @@ -1,4 +1,4 @@ -/* $OpenBSD: version.c,v 1.5 2000/01/14 09:11:01 downsj Exp $ */ +/* $OpenBSD: version.c,v 1.6 2005/12/31 17:59:47 miod Exp $ */ /* * Record major changes in the boot code here, and increment the version @@ -20,6 +20,8 @@ * * 2.6 Fixed RTC reading for 2001. * + * 2.7 Minor syncs with the kernel (recognize more models + * and use the same logic to pick the console on 425e). */ -const char version[] = "2.6"; +const char version[] = "2.7"; diff --git a/sys/arch/hp300/stand/include/consdefs.h b/sys/arch/hp300/stand/include/consdefs.h index f4b7531c4b7..5817d105911 100644 --- a/sys/arch/hp300/stand/include/consdefs.h +++ b/sys/arch/hp300/stand/include/consdefs.h @@ -1,4 +1,4 @@ -/* $OpenBSD: consdefs.h,v 1.3 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: consdefs.h,v 1.4 2005/12/31 17:59:47 miod Exp $ */ /* $NetBSD: consdefs.h,v 1.2 1997/05/12 07:45:41 thorpej Exp $ */ /* @@ -35,6 +35,8 @@ */ extern int curcons_scode; extern int cons_scode; +#define CONSCODE_INTERNAL (-1) +#define CONSCODE_INVALID (-2) /* * Console routine prototypes. diff --git a/sys/arch/hp300/stand/uboot/srt0.S b/sys/arch/hp300/stand/uboot/srt0.S index dfe5085cb34..5b5f1095051 100644 --- a/sys/arch/hp300/stand/uboot/srt0.S +++ b/sys/arch/hp300/stand/uboot/srt0.S @@ -1,4 +1,4 @@ -/* $OpenBSD: srt0.S,v 1.4 2003/06/02 23:27:46 millert Exp $ */ +/* $OpenBSD: srt0.S,v 1.5 2005/12/31 17:59:47 miod Exp $ */ /* $NetBSD: srt0.S,v 1.4 1997/05/12 07:56:00 thorpej Exp $ */ /* @@ -43,11 +43,8 @@ * Startup code for standalone system */ -/* For machineid and mmuid constants */ -#include <machine/hp300spu.h> - -/* For _C_LABEL() and friends. */ #include <machine/asm.h> +#include <machine/hp300spu.h> STACK = 0xfffff000 | below the ROM page BOOTTYPE = 0xfffffdc0 @@ -64,16 +61,12 @@ .data GLOBAL(bootdev) .long 0 - GLOBAL(howto) .long 0 - GLOBAL(lowram) .long 0 - GLOBAL(machineid) .long 0 - GLOBAL(mmuid) .long 0 @@ -101,13 +94,12 @@ ASENTRY_NOPROFILE(begin) tstl d0 | zero? jeq not68030 | yes, we have 68020/68040 - movl #0x808,d0 - movc d0,cacr | clear data freeze bit again - /* * 68030 models */ + movl #0x808,d0 + movc d0,cacr | clear data freeze bit again movl #0x80,MMUCMD | set magic cookie movl MMUCMD,d0 | read it back btst #7,d0 | cookie still on? @@ -125,7 +117,7 @@ not370: movl #0,MMUCMD | clear magic cookie2 movl MMUCMD,d0 | read it back btst #16,d0 | still on? - jeq ihpibcheck | no, a 360 + jeq ihpibcheck | no, a 360 or a 362 lsrl #MMUID_SHIFT,d0 | save MMU ID andl #MMUID_MASK,d0 movl d0,_C_LABEL(mmuid) | save mmuid @@ -155,16 +147,15 @@ not68030: moveq #0,d0 | now turn it back off movec d0,cacr | before we access any data + /* + * 68040 models + */ + .long 0x4e7b0004 | movc d0,itt0 .long 0x4e7b0005 | movc d0,itt1 .long 0x4e7b0006 | movc d0,dtt0 .long 0x4e7b0007 | movc d0,dtt1 .word 0xf4d8 | cinva bc - - /* - * 68040 models - */ - movl MMUCMD,d0 | get MMU ID lsrl #MMUID_SHIFT,d0 andl #MMUID_MASK,d0 @@ -179,8 +170,10 @@ not68030: jeq isa433 cmpb #MMUID_433_S,d0 | maybe a 433s? jeq isa433 - cmpb #MMUID_385,d0 | last chance... + cmpb #MMUID_385,d0 | then a 385? jeq isa385 + cmpb #MMUID_382,d0 | last chance... + jeq isa382 movl #HP_380,a0@ | guess we're a 380 jra ihpibcheck isa425: @@ -192,6 +185,9 @@ isa433: isa385: movl #HP_385,a0@ jra ihpibcheck +isa382: + movl #HP_382,a0@ + jra ihpibcheck /* * End 68040 section |