Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/arch/evbppc/walnut Use com_opb_cnattach().



details:   https://anonhg.NetBSD.org/src/rev/a33efa69ddea
branches:  trunk
changeset: 960805:a33efa69ddea
user:      rin <rin%NetBSD.org@localhost>
date:      Mon Mar 29 13:59:15 2021 +0000

description:
Use com_opb_cnattach().

diffstat:

 sys/arch/evbppc/walnut/consinit.c |  32 ++++----------------------------
 1 files changed, 4 insertions(+), 28 deletions(-)

diffs (64 lines):

diff -r d8ccc6a027f5 -r a33efa69ddea sys/arch/evbppc/walnut/consinit.c
--- a/sys/arch/evbppc/walnut/consinit.c Mon Mar 29 13:49:15 2021 +0000
+++ b/sys/arch/evbppc/walnut/consinit.c Mon Mar 29 13:59:15 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: consinit.c,v 1.8 2011/07/01 19:03:50 dyoung Exp $      */
+/*     $NetBSD: consinit.c,v 1.9 2021/03/29 13:59:15 rin Exp $ */
 
 /*
  * Copyright (c) 1998
@@ -27,7 +27,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.8 2011/07/01 19:03:50 dyoung Exp $");
+__KERNEL_RCSID(0, "$NetBSD: consinit.c,v 1.9 2021/03/29 13:59:15 rin Exp $");
 
 #include "opt_kgdb.h"
 
@@ -44,6 +44,7 @@
 #include <sys/termios.h>
 #include <dev/ic/comreg.h>
 #include <dev/ic/comvar.h>
+#include <powerpc/ibm4xx/dev/comopbvar.h>
 #endif
 
 #include <dev/cons.h>
@@ -92,36 +93,11 @@
 
 #endif /* KGDB */
 
-/*
- * consinit:
- * initialize the system console.
- * XXX - shouldn't deal with this initted thing, but then,
- * it shouldn't be called from initppc either.
- */
 void
 consinit(void)
 {
-       static int initted = 0;
-#if (NCOM > 0)
-       bus_space_tag_t tag;
-#endif
 
-       if (initted)
-               return;
-       initted = 1;
-
-#if (NCOM > 0)
-       /* We *know* the com-console attaches to opb */
-       tag = opb_get_bus_space_tag();
-
-       if (comcnattach(tag, CONADDR, CONSPEED, COM_FREQ * 6,
-           COM_TYPE_NORMAL, comcnmode))
-               panic("can't init serial console @%x", CONADDR);
-       else
-               return;
-#endif
-       panic("console device missing -- serial console not in kernel");
-       /* Of course, this is moot if there is no console... */
+       com_opb_cnattach(COM_FREQ * 6, CONADDR, CONSPEED, comcnmode);
 }
 
 #ifdef KGDB



Home | Main Index | Thread Index | Old Index