summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/luna88k/luna88k/locore0.S26
-rw-r--r--sys/arch/luna88k/luna88k/machdep.c4
2 files changed, 18 insertions, 12 deletions
diff --git a/sys/arch/luna88k/luna88k/locore0.S b/sys/arch/luna88k/luna88k/locore0.S
index 1866071803d..d41d172bc97 100644
--- a/sys/arch/luna88k/luna88k/locore0.S
+++ b/sys/arch/luna88k/luna88k/locore0.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: locore0.S,v 1.2 2018/06/06 12:58:05 aoyama Exp $ */
+/* $OpenBSD: locore0.S,v 1.3 2021/07/25 07:12:51 aoyama Exp $ */
/*
* Copyright (c) 1998 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -228,24 +228,30 @@ ASLOCAL(main_init)
/* read dispswitch setting */
ld.bu %r10, %r11, %lo16(OBIO_PIO0A) /* dipsw-1 (from portA) */
- mak %r10, %r10, 0<8> /* shift left 8 bit */
+ mak %r10, %r10, 0<8> /* shift left 8 bit */
ld.bu %r12, %r11, %lo16(OBIO_PIO0B) /* dipsw-2 (from portB) */
or %r10, %r10, %r12
-
or.u %r11, %r0, %hi16(_C_LABEL(dipswitch))
st.h %r10, %r11, %lo16(_C_LABEL(dipswitch))
- bb1 14, %r10, 1f /* XXX: if dipsw-1:2 is on, */
- or %r10, %r0, %r0 /* XXX: console is ttya */
+ /* read frame buffer depth from ROM work area */
+ ld %r12, %r0, %lo16(0x00001114) /* frame buffer depth */
+ or.u %r13, %r0, %hi16(_C_LABEL(hwplanebits))
+ st %r12, %r13, %lo16(_C_LABEL(hwplanebits))
+
+ /*
+ * By default, sysconsole is set to 0 (means using ttya). If
+ * a) Not forced to use serial console (by DIP SW setting), and
+ * b) Some graphic board are installed (hwplanebits != 0),
+ * we can use graphic console, so change sysconsole to 1.
+ */
+ bb0 14, %r10, 1f /* if dipsw-1:2 is on, skip */
+ bcnd eq0, %r12, 1f /* if hwplanebits == 0, skip */
+ or %r10, %r0, 1 /* set sysconsole = 1 */
or.u %r11, %r0, %hi16(_C_LABEL(sysconsole))
st %r10, %r11, %lo16(_C_LABEL(sysconsole))
1:
- /* read frame buffer depth from ROM work area */
- ld %r10, %r0, %lo16(0x00001114) /* frame buffer depth */
- or.u %r11, %r0, %hi16(_C_LABEL(hwplanebits))
- st %r10, %r11, %lo16(_C_LABEL(hwplanebits))
-
or %r10, %r0, 0x84 /* initialize pio1 */
or.u %r11, %r0, %hi16(OBIO_PIO1)
st.b %r10, %r11, %lo16(OBIO_PIO1)
diff --git a/sys/arch/luna88k/luna88k/machdep.c b/sys/arch/luna88k/luna88k/machdep.c
index a2f0949eef7..4feb436afb1 100644
--- a/sys/arch/luna88k/luna88k/machdep.c
+++ b/sys/arch/luna88k/luna88k/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.135 2021/02/23 11:48:21 aoyama Exp $ */
+/* $OpenBSD: machdep.c,v 1.136 2021/07/25 07:12:51 aoyama Exp $ */
/*
* Copyright (c) 1998, 1999, 2000, 2001 Steve Murphree, Jr.
* Copyright (c) 1996 Nivas Madhur
@@ -189,7 +189,7 @@ int machtype = LUNA_88K; /* may be overwritten in cpu_startup() */
int cputyp = CPU_88100;
int bootdev; /* XXX: should be set in boot loader and locore.S */
int cpuspeed = 33; /* safe guess */
-int sysconsole = 1; /* 0 = ttya, 1 = keyboard/mouse, used in dev/sio.c */
+int sysconsole = 0; /* 0 = ttya, may be overwritten in locore0.S */
u_int16_t dipswitch = 0; /* set in locore.S */
int hwplanebits; /* set in locore.S */