From 2c44cea3babceac959aa8f28ed7b769b394ed9f7 Mon Sep 17 00:00:00 2001 From: mark Date: Wed, 17 Jun 1998 00:37:00 +0000 Subject: [PATCH] Added console probe and init functions so serial consoles are supported serial ports via the pioc. Removed redundant header files. --- sys/arch/arm32/mainbus/com_pioc.c | 48 +++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/sys/arch/arm32/mainbus/com_pioc.c b/sys/arch/arm32/mainbus/com_pioc.c index a0d648538b3a..39e529129716 100644 --- a/sys/arch/arm32/mainbus/com_pioc.c +++ b/sys/arch/arm32/mainbus/com_pioc.c @@ -1,4 +1,4 @@ -/* $NetBSD: com_pioc.c,v 1.3 1998/02/02 23:05:50 cgd Exp $ */ +/* $NetBSD: com_pioc.c,v 1.4 1998/06/17 00:37:00 mark Exp $ */ /*- * Copyright (c) 1993, 1994, 1995, 1996 @@ -39,17 +39,10 @@ #include #include -#include -#include #include #include -#include #include -#include -#include #include -#include -#include #include #include @@ -59,6 +52,8 @@ #include #include +#include + #include "locators.h" struct com_pioc_softc { @@ -78,6 +73,8 @@ struct cfattach com_pioc_ca = { sizeof(struct com_pioc_softc), com_pioc_probe, com_pioc_attach }; +extern bus_space_tag_t comconstag; /* From pioc.c */ + /* * int com_pioc_probe(struct device *parent, struct cfdata *cf, void *aux) * @@ -193,4 +190,39 @@ com_pioc_cleanup(arg) bus_space_write_1(sc->sc_iot, sc->sc_ioh, com_fifo, 0); } +/* + * Console attachment functions + */ + +void +comcnprobe(cp) + struct consdev *cp; +{ + +#ifdef COMCONSOLE + cp->cn_pri = CN_REMOTE; /* Force a serial port console */ +#else + cp->cn_pri = CN_NORMAL; +#endif +} + +void +comcninit(cp) + struct consdev *cp; +{ + +#ifndef CONMODE +#define CONMODE ((TTYDEF_CFLAG & ~(CSIZE | CSTOPB | PARENB)) | CS8) /* 8N1 */ +#endif +#ifndef CONSPEED +#define CONSPEED 38400 +#endif +#ifndef CONADDR +#define CONADDR 0x3f8 +#endif + if (comcnattach(comconstag, CONADDR << 2, CONSPEED, COM_FREQ, CONMODE)) + panic("can't init serial console @%x", CONADDR << 2); +} + + /* End of com_pioc.c */