Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sparc Add preliminary support for the built-in mode...
details: https://anonhg.NetBSD.org/src/rev/e5f97863abe4
branches: trunk
changeset: 475070:e5f97863abe4
user: matt <matt%NetBSD.org@localhost>
date: Fri Jul 30 23:58:25 1999 +0000
description:
Add preliminary support for the built-in modem on Tadpole 3GX/S
laptops. There is currently something wrong with the interrupt
code but it does attach and sense a 16550a. (anyways the built
in modem is only a 14.4Kb and you'd really want to use a PCMCIA
modem to get faster dialup rates).
diffstat:
sys/arch/sparc/conf/files.sparc | 5 +-
sys/arch/sparc/dev/com_obio.c | 178 ++++++++++++++++++++++++++++++++++++++++
sys/arch/sparc/include/conf.h | 3 +-
sys/arch/sparc/sparc/conf.c | 5 +-
4 files changed, 187 insertions(+), 4 deletions(-)
diffs (244 lines):
diff -r ec290d78b0f0 -r e5f97863abe4 sys/arch/sparc/conf/files.sparc
--- a/sys/arch/sparc/conf/files.sparc Fri Jul 30 23:55:43 1999 +0000
+++ b/sys/arch/sparc/conf/files.sparc Fri Jul 30 23:58:25 1999 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.sparc,v 1.80 1999/07/28 09:39:48 drochner Exp $
+# $NetBSD: files.sparc,v 1.81 1999/07/30 23:58:25 matt Exp $
# @(#)files.sparc 8.1 (Berkeley) 7/19/93
# sparc-specific configuration info
@@ -192,6 +192,9 @@
attach ie at obio with ie_obio
file arch/sparc/dev/if_ie_obio.c ie_obio
+attach com at obio with com_obio
+file arch/sparc/dev/com_obio.c com_obio
+
device si: scsi, ncr5380sbc
attach si at vme
device sw: scsi, ncr5380sbc
diff -r ec290d78b0f0 -r e5f97863abe4 sys/arch/sparc/dev/com_obio.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sparc/dev/com_obio.c Fri Jul 30 23:58:25 1999 +0000
@@ -0,0 +1,178 @@
+/* $NetBSD: com_obio.c,v 1.1 1999/07/30 23:58:25 matt Exp $ */
+
+/*-
+ * Copyright (c) 1998 The NetBSD Foundation, Inc.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to The NetBSD Foundation
+ * by Charles M. Hannum.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the NetBSD
+ * Foundation, Inc. and its contributors.
+ * 4. Neither the name of The NetBSD Foundation nor the names of its
+ * contributors may be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
+ * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
+ * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
+ * POSSIBILITY OF SUCH DAMAGE.
+ */
+
+/*-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ *
+ * @(#)com.c 7.5 (Berkeley) 5/16/91
+ */
+
+#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/autoconf.h>
+#include <machine/cpu.h>
+
+#include <dev/ic/comreg.h>
+#include <dev/ic/comvar.h>
+
+struct com_obio_softc {
+ struct com_softc osc_com; /* real "com" softc */
+
+ /* OBIO-specific goo. */
+ struct evcnt osc_intrcnt; /* interrupt counting */
+};
+
+static int com_obio_match __P((struct device *, struct cfdata *, void *));
+static void com_obio_attach __P((struct device *, struct device *, void *));
+static void com_obio_cleanup __P((void *));
+
+struct cfattach com_obio_ca = {
+ sizeof(struct com_obio_softc), com_obio_match, com_obio_attach
+};
+
+static int
+com_obio_match(parent, cf, aux)
+ struct device *parent;
+ struct cfdata *cf;
+ void *aux;
+{
+ union obio_attach_args *uoba = aux;
+ struct sbus_attach_args *sa = &uoba->uoba_sbus;
+
+ if (uoba->uoba_isobio4 != 0) {
+ return (0);
+ }
+
+ /* Tadpole 3GX/3GS uses "modem" for a 16450 port
+ */
+ if (strcmp("modem", sa->sa_name) == 0) {
+ return (1);
+ }
+ return (0);
+}
+
+static void
+com_obio_attach(parent, self, aux)
+ struct device *parent, *self;
+ void *aux;
+{
+ struct com_obio_softc *osc = (void *)self;
+ struct com_softc *sc = &osc->osc_com;
+ union obio_attach_args *uoba = aux;
+ struct sbus_attach_args *sa = &uoba->uoba_sbus;
+
+ /*
+ * We're living on an obio (or an obio that looks like an sbus slot).
+ */
+ sc->sc_iot = sa->sa_bustag;
+ sc->sc_iobase = sa->sa_offset;
+ if (!com_is_console(sc->sc_iot, sc->sc_iobase, &sc->sc_ioh) &&
+ bus_space_map(sc->sc_iot, sc->sc_iobase, COM_NPORTS,
+ BUS_SPACE_MAP_LINEAR, &sc->sc_ioh)) {
+ printf(": can't map registers\n");
+ return;
+ }
+
+ sc->sc_frequency = COM_FREQ;
+
+ com_attach_subr(sc);
+
+ (void)bus_intr_establish(sc->sc_iot, sa->sa_pri, 0, comintr, sc);
+
+ evcnt_attach(&osc->osc_com.sc_dev, "intr", &osc->osc_intrcnt);
+
+ /*
+ * Shutdown hook for buggy BIOSs that don't recognize the UART
+ * without a disabled FIFO.
+ */
+ if (shutdownhook_establish(com_obio_cleanup, sc) == NULL) {
+ panic("com_obio_attach: could not establish shutdown hook");
+ }
+}
+
+static void
+com_obio_cleanup(arg)
+ void *arg;
+{
+ struct com_softc *sc = arg;
+
+ if (ISSET(sc->sc_hwflags, COM_HW_FIFO))
+ bus_space_write_1(sc->sc_iot, sc->sc_ioh, com_fifo, 0);
+}
diff -r ec290d78b0f0 -r e5f97863abe4 sys/arch/sparc/include/conf.h
--- a/sys/arch/sparc/include/conf.h Fri Jul 30 23:55:43 1999 +0000
+++ b/sys/arch/sparc/include/conf.h Fri Jul 30 23:58:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.h,v 1.14 1998/11/13 04:47:08 oster Exp $ */
+/* $NetBSD: conf.h,v 1.15 1999/07/30 23:58:25 matt Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@@ -52,6 +52,7 @@
cdev_decl(cn);
cdev_decl(zs);
+cdev_decl(com);
bdev_decl(fd);
cdev_decl(fd);
diff -r ec290d78b0f0 -r e5f97863abe4 sys/arch/sparc/sparc/conf.c
--- a/sys/arch/sparc/sparc/conf.c Fri Jul 30 23:55:43 1999 +0000
+++ b/sys/arch/sparc/sparc/conf.c Fri Jul 30 23:58:25 1999 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: conf.c,v 1.58 1998/12/18 16:55:39 drochner Exp $ */
+/* $NetBSD: conf.c,v 1.59 1999/07/30 23:58:26 matt Exp $ */
/*
* Copyright (c) 1992, 1993
@@ -72,6 +72,7 @@
#include "kbd.h"
#include "ms.h"
+#include "com.h"
#include "zstty.h"
#include "bpp.h"
#include "magma.h" /* has NMTTY and NMBPP */
@@ -164,7 +165,7 @@
cdev_notdef(), /* 33 */
cdev_notdef(), /* 34 */
cdev_notdef(), /* 35 */
- cdev_notdef(), /* 36 */
+ cdev_tty_init(NCOM,com), /* 36: NS16x50 compatible ports */
cdev_notdef(), /* 37 */
cdev_notdef(), /* 38 */
cdev_fb_init(NCGFOUR,cgfour), /* 39: /dev/cgfour */
Home |
Main Index |
Thread Index |
Old Index