summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPer Fogelstrom <pefo@cvs.openbsd.org>1997-03-17 08:11:13 +0000
committerPer Fogelstrom <pefo@cvs.openbsd.org>1997-03-17 08:11:13 +0000
commit47a16fa735755fe59828366fc2cded5dd5e2b2fe (patch)
tree1324dec55da516978ff74f37d4dc33028b952980
parent0416f3710bc1dd9d239b62e3f3fd84828fc2a5de (diff)
Serial console trouble again...
-rw-r--r--sys/arch/arc/arc/machdep.c53
-rw-r--r--sys/dev/ic/com.c11
2 files changed, 52 insertions, 12 deletions
diff --git a/sys/arch/arc/arc/machdep.c b/sys/arch/arc/arc/machdep.c
index 98ea7203f16..4615d24396f 100644
--- a/sys/arch/arc/arc/machdep.c
+++ b/sys/arch/arc/arc/machdep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: machdep.c,v 1.21 1997/03/12 19:16:43 pefo Exp $ */
+/* $OpenBSD: machdep.c,v 1.22 1997/03/17 08:11:12 pefo Exp $ */
/*
* Copyright (c) 1988 University of Utah.
* Copyright (c) 1992, 1993
@@ -38,7 +38,7 @@
* SUCH DAMAGE.
*
* from: @(#)machdep.c 8.3 (Berkeley) 1/12/94
- * $Id: machdep.c,v 1.21 1997/03/12 19:16:43 pefo Exp $
+ * $Id: machdep.c,v 1.22 1997/03/17 08:11:12 pefo Exp $
*/
/* from: Utah Hdr: machdep.c 1.63 91/04/24 */
@@ -96,11 +96,13 @@
#include <arc/dti/desktech.h>
#include <arc/algor/algor.h>
+#if 0
#include <asc.h>
#if NASC > 0
#include <arc/dev/ascreg.h>
#endif
+#endif
extern struct consdev *cn_tab;
extern char kernel_start[];
@@ -147,6 +149,7 @@ int (*Mach_splstatclock)() = splhigh;
static void tlb_init_pica();
static void tlb_init_tyne();
+static int get_simm_size(int *fadr, int max);
/*
@@ -225,14 +228,14 @@ mips_init(argc, argv, code)
strcpy(cpu_model, "Deskstation rPC44");
arc_bus.isa_io_base = 0xb0000000; /*XXX*/
arc_bus.isa_mem_base = 0xa0000000; /*XXX*/
- CONADDR = 0xa0000000+0x3f8; /* Standard PC Com0 address */
+ CONADDR = 0; /* Don't screew the mouse... */
break;
case DESKSTATION_TYNE:
strcpy(cpu_model, "Deskstation Tyne");
arc_bus.isa_io_base = TYNE_V_ISA_IO;
arc_bus.isa_mem_base = TYNE_V_ISA_MEM;
- CONADDR = TYNE_V_ISA_MEM+0x3f8; /* Standard PC Com0 address */
+ CONADDR = 0; /* Don't screew the mouse... */
break;
case -1: /* Not identified as an ARC system. We have a couple */
@@ -253,8 +256,9 @@ mips_init(argc, argv, code)
mem_layout[0].mem_start = 0;
mem_layout[0].mem_size = mips_trunc_page(CACHED_TO_PHYS(kernel_start));
mem_layout[1].mem_start = CACHED_TO_PHYS((int)sysend);
- mem_layout[1].mem_size = 0x800000 - (int)(CACHED_TO_PHYS(sysend));
- physmem = 8192 * 1024;
+ i = get_simm_size((int *)0, 128*1024*1024);
+ mem_layout[1].mem_size = i - (int)(CACHED_TO_PHYS(sysend));
+ physmem = i;
#if 0
mem_layout[2].mem_start = 0x800000;
mem_layout[2].mem_size = 0x1000000;
@@ -494,8 +498,6 @@ mips_init(argc, argv, code)
* Clear allocated memory.
*/
bzero(start, sysend - start);
-consinit();
-mdbpanic();
/*
* Initialize the virtual memory system.
@@ -571,6 +573,41 @@ tlb_init_tyne()
}
/*
+ * Simple routine to figure out SIMM module size.
+ */
+static int
+get_simm_size(fadr, max)
+ int *fadr;
+ int max;
+{
+ int msave;
+ int msize;
+
+ fadr = (int *)PHYS_TO_UNCACHED(CACHED_TO_PHYS((int)fadr));
+
+ msize = 1024*1024;
+
+ while(max >= msize) {
+ msave = fadr[0];
+ fadr[0] = 0xC0DEB00F;
+ if(fadr[msize/4] == 0xC0DEB00F) {
+ fadr[0] = msave;
+ if(fadr[msize/4] == msave) {
+ break; /* Wrap around */
+ }
+ }
+ fadr[0] = msave;
+ msize += msize;
+ }
+ if(msize <= max) {
+ return(msize);
+ }
+ else {
+ return(-1);
+ }
+}
+
+/*
* Console initialization: called early on from main,
* before vm init or startup. Do enough configuration
* to choose and initialize a console.
diff --git a/sys/dev/ic/com.c b/sys/dev/ic/com.c
index 9aaf899d440..ee2251969b0 100644
--- a/sys/dev/ic/com.c
+++ b/sys/dev/ic/com.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: com.c,v 1.32 1997/03/12 20:17:37 pefo Exp $ */
+/* $OpenBSD: com.c,v 1.33 1997/03/17 08:11:11 pefo Exp $ */
/* $NetBSD: com.c,v 1.82.4.1 1996/06/02 09:08:00 mrg Exp $ */
/*-
@@ -1433,9 +1433,7 @@ ohfudge:
*/
#include <dev/cons.h>
-#if NCOM_PICA
-#include <arc/arc/arctype.h>
- extern int cputype;
+#if NCOM_LOCALBUS
#undef CONADDR
extern int CONADDR;
#endif
@@ -1453,6 +1451,11 @@ comcnprobe(cp)
bus_space_handle_t ioh;
int found;
+ if(CONADDR == 0) {
+ cp->cn_pri = CN_DEAD;
+ return;
+ }
+
comconsiot = iot;
if (bus_space_map(iot, CONADDR, COM_NPORTS, 0, &ioh)) {
cp->cn_pri = CN_DEAD;