Added console probe and init functions so serial consoles are supported

serial ports via the pioc.
Removed redundant header files.
This commit is contained in:
mark 1998-06-17 00:37:00 +00:00
parent b0c0bd5382
commit 2c44cea3ba
1 changed files with 40 additions and 8 deletions

View File

@ -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 <sys/param.h>
#include <sys/systm.h>
#include <sys/ioctl.h>
#include <sys/select.h>
#include <sys/tty.h>
#include <sys/proc.h>
#include <sys/user.h>
#include <sys/conf.h>
#include <sys/file.h>
#include <sys/uio.h>
#include <sys/kernel.h>
#include <sys/syslog.h>
#include <sys/types.h>
#include <sys/device.h>
#include <machine/irqhandler.h>
@ -59,6 +52,8 @@
#include <dev/ic/comreg.h>
#include <dev/ic/comvar.h>
#include <dev/cons.h>
#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 */