diff options
Diffstat (limited to 'sys/arch')
-rw-r--r-- | sys/arch/luna88k/dev/lunafb.c | 20 | ||||
-rw-r--r-- | sys/arch/luna88k/luna88k/locore.S | 7 | ||||
-rw-r--r-- | sys/arch/luna88k/luna88k/machdep.c | 37 |
3 files changed, 29 insertions, 35 deletions
diff --git a/sys/arch/luna88k/dev/lunafb.c b/sys/arch/luna88k/dev/lunafb.c index 959c0ec501e..b85377cf91b 100644 --- a/sys/arch/luna88k/dev/lunafb.c +++ b/sys/arch/luna88k/dev/lunafb.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lunafb.c,v 1.2 2004/04/24 13:37:44 miod Exp $ */ +/* $OpenBSD: lunafb.c,v 1.3 2004/05/10 10:30:23 aoyama Exp $ */ /* $NetBSD: lunafb.c,v 1.7.6.1 2002/08/07 01:48:34 lukem Exp $ */ /*- @@ -162,7 +162,7 @@ const struct cfdriver fb_cd = { NULL, "fb", DV_DULL }; -extern int hwplanemask; /* hardware planemask; retrieved at boot */ +extern int hwplanebits; /* hardware plane bits; retrieved at boot */ int omfb_console; int omfb_cnattach(void); @@ -180,7 +180,7 @@ omfbmatch(parent, cf, aux) if (badaddr((caddr_t)ma->ma_addr, 4)) return (0); #else - if (hwplanemask == 0) + if (hwplanebits == 0) return (0); #endif return (1); @@ -346,7 +346,7 @@ omsetcmap(sc, p) if (error != 0) return (error); - if (hwplanemask == 0x0f) { + if (hwplanebits == 4) { struct bt454 *odac = (struct bt454 *)OMFB_RAMDAC; odac->bt_addr = index; for (i = index; i < count; i++) { @@ -355,7 +355,7 @@ omsetcmap(sc, p) odac->bt_cmap = sc->sc_cmap.b[i]; } } - else if (hwplanemask == 0xff) { + else if (hwplanebits == 8) { struct bt458 *ndac = (struct bt458 *)OMFB_RAMDAC; ndac->bt_addr = index; for (i = index; i < count; i++) { @@ -380,12 +380,12 @@ omfb_getdevconfig(paddr, dc) u_int32_t u; } rfcnt; - switch (hwplanemask) { - case 0xff: + switch (hwplanebits) { + case 8: bpp = 8; /* XXX check monochrome bit in DIPSW */ break; default: - case 0x0f: + case 4: bpp = 4; /* XXX check monochrome bit in DIPSW */ break; case 1: @@ -400,7 +400,7 @@ omfb_getdevconfig(paddr, dc) dc->dc_videobase = paddr; #if 0 /* WHITE on BLACK XXX experiment resulted in WHITE on SKYBLUE... */ - if (hwplanemask == 0x0f) { + if (hwplanebits == 4) { /* XXX Need Bt454 initialization */ struct bt454 *odac = (struct bt454 *)OMFB_RAMDAC; odac->bt_addr = 0; @@ -413,7 +413,7 @@ omfb_getdevconfig(paddr, dc) odac->bt_cmap = 255; } } - else if (hwplanemask == 0xff) { + else if (hwplanebits == 8) { struct bt458 *ndac = (struct bt458 *)OMFB_RAMDAC; ndac->bt_addr = 0x04; diff --git a/sys/arch/luna88k/luna88k/locore.S b/sys/arch/luna88k/luna88k/locore.S index eac93ff6211..9f8c7013a26 100644 --- a/sys/arch/luna88k/luna88k/locore.S +++ b/sys/arch/luna88k/luna88k/locore.S @@ -1,4 +1,4 @@ -/* $OpenBSD: locore.S,v 1.2 2004/04/22 08:54:17 miod Exp $ */ +/* $OpenBSD: locore.S,v 1.3 2004/05/10 10:30:24 aoyama Exp $ */ /* * Copyright (c) 1998 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -292,6 +292,11 @@ ASLOCAL(master_start) st r10, r11, lo16(_sysconsole) 1: + /* read frame buffer depth from ROM work area */ + ld r10, r0, lo16(0x00001114) /* frame buffer depth */ + or.u r11, r0, hi16(_hwplanebits) + st r10, r11, lo16(_hwplanebits) + or r10, r0, 0x84 /* initialize pio1 */ or.u r11, r0, hi16(0x4d00000c) st.b r10, r11, lo16(0x4d00000c) diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c index 6ab6a22c237..7bccea52c0b 100644 --- a/sys/arch/luna88k/luna88k/machdep.c +++ b/sys/arch/luna88k/luna88k/machdep.c @@ -1,4 +1,4 @@ -/* $OpenBSD: machdep.c,v 1.3 2004/05/07 15:08:25 aoyama Exp $ */ +/* $OpenBSD: machdep.c,v 1.4 2004/05/10 10:30:24 aoyama Exp $ */ /* * Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr. * Copyright (c) 1996 Nivas Madhur @@ -209,7 +209,7 @@ int cpuspeed; double cycles_per_microsecond; /* used in locore.S:delay() */ int sysconsole = 1; /* 0 = ttya, 1 = keyboard/mouse, used in dev/sio.c */ u_int16_t dipswitch = 0; /* set in locore.S */ -int hwplanemask; /* set in luna88k_bootstrap() */ +int hwplanebits; /* set in locore.S */ int netisr; @@ -436,29 +436,18 @@ cpu_startup() } /* - * Get frame buffer depth from ROM work area. + * Check frame buffer depth. */ - { - int depth; - - depth = *((volatile int *)0x00001114); - switch (depth) { - case 1: - hwplanemask = 0x01; - break; - case 4: - hwplanemask = 0x0f; - break; - case 8: - hwplanemask = 0xff; - break; - default: - printf("unexpected frame buffer depth = %d\n", depth); - /* FALLTHROUGH */ - case 0: - hwplanemask = 0; /* No frame buffer */ - break; - } + switch (hwplanebits) { + case 0: /* No frame buffer */ + case 1: + case 4: + case 8: + break; + default: + printf("unexpected frame buffer depth = %d\n", hwplanebits); + hwplanebits = 0; + break; } #if 0 /* just for test */ |