Source-Changes-HG archive

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

[src/trunk]: src/sys Repopulate 4 files, zs_ioasic.c and zs_ioasicvar.h from ...



details:   https://anonhg.NetBSD.org/src/rev/3bd7097669a5
branches:  trunk
changeset: 494285:3bd7097669a5
user:      nisimura <nisimura%NetBSD.org@localhost>
date:      Wed Jul 05 02:48:50 2000 +0000

description:
Repopulate 4 files, zs_ioasic.c and zs_ioasicvar.h from arch/alpha/tc,
zskbd.c and zsms.c from dev/dec/, respectively.  No functionality
change this time.

diffstat:

 sys/arch/alpha/tc/zs_ioasic.c    |  875 ---------------------------------------
 sys/arch/alpha/tc/zs_ioasicvar.h |   45 --
 sys/dev/dec/zskbd.c              |  535 -----------------------
 sys/dev/dec/zskbdvar.h           |    6 -
 sys/dev/dec/zsms.c               |  479 ---------------------
 sys/dev/tc/zs_ioasic.c           |  874 ++++++++++++++++++++++++++++++++++++++
 sys/dev/tc/zs_ioasicvar.h        |   49 ++
 sys/dev/tc/zskbd.c               |  535 +++++++++++++++++++++++
 sys/dev/tc/zsms.c                |  479 +++++++++++++++++++++
 9 files changed, 1937 insertions(+), 1940 deletions(-)

diffs (truncated from 3913 to 300 lines):

diff -r 17249a6ff240 -r 3bd7097669a5 sys/arch/alpha/tc/zs_ioasic.c
--- a/sys/arch/alpha/tc/zs_ioasic.c     Wed Jul 05 02:47:23 2000 +0000
+++ /dev/null   Thu Jan 01 00:00:00 1970 +0000
@@ -1,875 +0,0 @@
-/* $NetBSD: zs_ioasic.c,v 1.12 2000/06/03 20:47:41 thorpej Exp $ */
-
-/*-
- * Copyright (c) 1996, 1998 The NetBSD Foundation, Inc.
- * All rights reserved.
- *
- * This code is derived from software contributed to The NetBSD Foundation
- * by Gordon W. Ross, Ken Hornstein, and by Jason R. Thorpe of the
- * Numerical Aerospace Simulation Facility, NASA Ames Research Center.
- *
- * 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.
- */
-
-#include <sys/cdefs.h>                 /* RCS ID & Copyright macro defns */
-
-__KERNEL_RCSID(0, "$NetBSD: zs_ioasic.c,v 1.12 2000/06/03 20:47:41 thorpej Exp $");
-
-/*
- * Zilog Z8530 Dual UART driver (machine-dependent part).  This driver
- * handles Z8530 chips attached to the Alpha IOASIC.  Modified for
- * NetBSD/alpha by Ken Hornstein and Jason R. Thorpe.
- *
- * Runs two serial lines per chip using slave drivers.
- * Plain tty/async lines use the zstty slave.
- */
-
-#include "opt_ddb.h"
-#include "opt_dec_3000_300.h"
-#include "opt_zs_ioasic_dma.h"
-#include "zskbd.h"
-
-#include <sys/param.h>
-#include <sys/systm.h>
-#include <sys/conf.h>
-#include <sys/device.h>
-#include <sys/file.h>
-#include <sys/ioctl.h>
-#include <sys/kernel.h>
-#include <sys/proc.h>
-#include <sys/tty.h>
-#include <sys/time.h>
-#include <sys/syslog.h>
-
-#include <machine/autoconf.h>
-#include <machine/intr.h>
-#include <machine/z8530var.h>
-
-#include <dev/cons.h>
-#include <dev/ic/z8530reg.h>
-
-#include <dev/tc/tcvar.h>
-#include <dev/tc/ioasicreg.h>
-#include <dev/tc/ioasicvar.h>
-#include <dev/dec/zskbdvar.h>
-
-#include <alpha/tc/zs_ioasicvar.h>
-
-#if 1
-#define SPARSE
-#endif
-
-/*
- * Helpers for console support.
- */
-
-int    zs_ioasic_cngetc __P((dev_t));
-void   zs_ioasic_cnputc __P((dev_t, int));
-void   zs_ioasic_cnpollc __P((dev_t, int));
-
-struct consdev zs_ioasic_cons = {
-       NULL, NULL, zs_ioasic_cngetc, zs_ioasic_cnputc,
-       zs_ioasic_cnpollc, NULL, NODEV, CN_NORMAL,
-};
-
-tc_offset_t zs_ioasic_console_offset;
-int zs_ioasic_console_channel;
-int zs_ioasic_console;
-
-int    zs_ioasic_isconsole __P((tc_offset_t, int));
-
-struct zs_chanstate zs_ioasic_conschanstate_store;
-struct zs_chanstate *zs_ioasic_conschanstate;
-
-int    zs_getc __P((struct zs_chanstate *));
-void   zs_putc __P((struct zs_chanstate *, int));
-void   zs_ioasic_cninit __P((tc_addr_t, tc_offset_t, int));
-
-/*
- * Some warts needed by z8530tty.c
- */
-int zs_def_cflag = (TTYDEF_CFLAG & ~(CSIZE | PARENB)) | CS8;
-int zs_major = 15;
-
-/*
- * The Alpha provides a 7.372 MHz clock to the ZS chips.
- */
-#define        PCLK    (9600 * 768)    /* PCLK pin input clock rate */
-
-/* The layout of this is hardware-dependent (padding, order). */
-struct zshan {
-       volatile u_int  zc_csr;         /* ctrl,status, and indirect access */
-#ifdef SPARSE
-       u_int           zc_pad0;
-#endif
-       volatile u_int  zc_data;        /* data */
-#ifdef SPARSE
-       u_int           sc_pad1;
-#endif
-};
-
-struct zsdevice {
-       /* Yes, they are backwards. */
-       struct  zshan zs_chan_b;
-       struct  zshan zs_chan_a;
-};
-
-static u_char zs_ioasic_init_reg[16] = {
-       0,      /* 0: CMD (reset, etc.) */
-       0,      /* 1: No interrupts yet. */
-       0xf0,   /* 2: IVECT */
-       ZSWR3_RX_8 | ZSWR3_RX_ENABLE,
-       ZSWR4_CLK_X16 | ZSWR4_ONESB,
-       ZSWR5_TX_8 | ZSWR5_TX_ENABLE,
-       0,      /* 6: TXSYNC/SYNCLO */
-       0,      /* 7: RXSYNC/SYNCHI */
-       0,      /* 8: alias for data port */
-       ZSWR9_MASTER_IE | ZSWR9_VECTOR_INCL_STAT,
-       0,      /*10: Misc. TX/RX control bits */
-       ZSWR11_TXCLK_BAUD | ZSWR11_RXCLK_BAUD,
-       22,     /*12: BAUDLO (default=9600) */
-       0,      /*13: BAUDHI (default=9600) */
-       ZSWR14_BAUD_ENA | ZSWR14_BAUD_FROM_PCLK,
-       ZSWR15_BREAK_IE,
-};
-
-struct zshan *zs_ioasic_get_chan_addr __P((tc_addr_t, int));
-
-struct zshan *
-zs_ioasic_get_chan_addr(zsaddr, channel)
-       tc_addr_t zsaddr;
-       int channel;
-{
-       struct zsdevice *addr;
-       struct zshan *zc;
-
-       addr = (struct zsdevice *) zsaddr;
-#ifdef SPARSE
-       addr = (struct zsdevice *) TC_DENSE_TO_SPARSE((tc_addr_t) addr);
-#endif
-
-       if (channel == 0)
-               zc = &addr->zs_chan_a;
-       else
-               zc = &addr->zs_chan_b;
-
-       return (zc);
-}
-
-
-/****************************************************************
- * Autoconfig
- ****************************************************************/
-
-/* Definition of the driver for autoconfig. */
-int    zs_ioasic_match __P((struct device *, struct cfdata *, void *));
-void   zs_ioasic_attach __P((struct device *, struct device *, void *));
-int    zs_ioasic_print __P((void *, const char *name));
-
-struct cfattach zsc_ioasic_ca = {
-       sizeof(struct zsc_softc), zs_ioasic_match, zs_ioasic_attach
-};
-
-/* Interrupt handlers. */
-int    zs_ioasic_hardintr __P((void *));
-void   zs_ioasic_softintr __P((void *));
-
-/* Misc. */
-void   zs_ioasic_enable __P((int));
-
-extern struct cfdriver ioasic_cd;
-extern struct cfdriver zsc_cd;
-
-/*
- * Is the zs chip present?
- */
-int
-zs_ioasic_match(parent, cf, aux)
-       struct device *parent;
-       struct cfdata *cf;
-       void *aux;
-{
-       struct ioasicdev_attach_args *d = aux;
-       void *zs_addr;
-
-       if (parent->dv_cfdata->cf_driver != &ioasic_cd)
-               return (0);
-
-       /*
-        * Make sure that we're looking for the right kind of device.
-        */
-       if (strncmp(d->iada_modname, "z8530   ", TC_ROM_LLEN) != 0 &&
-           strncmp(d->iada_modname, "scc", TC_ROM_LLEN) != 0)
-               return (0);
-
-       /*
-        * Check user-specified offset against the ioasic offset.
-        * Allow it to be wildcarded.
-        */
-       if (cf->cf_loc[IOASICCF_OFFSET] != IOASICCF_OFFSET_DEFAULT &&
-           cf->cf_loc[IOASICCF_OFFSET] != d->iada_offset)
-               return (0);
-
-       /*
-        * Find out the device address, and check it for validity.
-        */
-       zs_addr = (void *) d->iada_addr;
-#ifdef SPARSE
-       zs_addr = (void *) TC_DENSE_TO_SPARSE((tc_addr_t) zs_addr);
-#endif
-       if (tc_badaddr(zs_addr))
-               return (0);
-
-       return (1);
-}
-
-/*
- * Attach a found zs.
- */
-void
-zs_ioasic_attach(parent, self, aux)
-       struct device *parent;
-       struct device *self;
-       void *aux;
-{
-       struct zsc_softc *zs = (void *) self;
-       struct zsc_attach_args zs_args;
-       struct zs_chanstate *cs;
-       struct ioasicdev_attach_args *d = aux;
-       volatile struct zshan *zc;
-       tc_addr_t zs_addr;
-       int s, channel;
-
-       printf("\n");
-
-       /*
-        * Initialize software state for each channel.
-        */
-       for (channel = 0; channel < 2; channel++) {
-               zs_args.channel = channel;
-               zs_args.hwflags = 0;
-
-               cs = &zs->zsc_cs_store[channel];
-               zs->zsc_cs[channel] = cs;
-
-               /*
-                * If we're the console, copy the channel state, and
-                * adjust the console channel pointer.
-                */
-               if (zs_ioasic_isconsole(d->iada_offset, channel)) {
-                       bcopy(zs_ioasic_conschanstate, cs,
-                           sizeof(struct zs_chanstate));
-                       zs_ioasic_conschanstate = cs;
-                       zs_args.hwflags |= ZS_HWFLAG_CONSOLE;
-               } else {
-                       zs_addr = d->iada_addr;
-                       zc = zs_ioasic_get_chan_addr(zs_addr, channel);
-                       cs->cs_reg_csr  = (volatile u_char *)&zc->zc_csr;
-                       cs->cs_reg_data = (volatile u_char *)&zc->zc_data;
-
-                       bcopy(zs_ioasic_init_reg, cs->cs_creg, 16);



Home | Main Index | Thread Index | Old Index