Source-Changes-HG archive

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

[src/netbsd-1-5]: src/sys/arch/arc for DeskStation RPC44



details:   https://anonhg.NetBSD.org/src/rev/705169a98ca0
branches:  netbsd-1-5
changeset: 488182:705169a98ca0
user:      soda <soda%NetBSD.org@localhost>
date:      Tue Jun 20 08:26:55 2000 +0000

description:
for DeskStation RPC44

diffstat:

 sys/arch/arc/include/isa_machdep.h |  136 +++++++
 sys/arch/arc/isa/isabus.c          |  574 ++++++++++++++++++++++++++++++++
 sys/arch/arc/isa/isadma_bounce.c   |  647 +++++++++++++++++++++++++++++++++++++
 sys/arch/arc/isa/joy.c             |  255 ++++++++++++++
 4 files changed, 1612 insertions(+), 0 deletions(-)

diffs (truncated from 1628 to 300 lines):

diff -r ee8eee073b13 -r 705169a98ca0 sys/arch/arc/include/isa_machdep.h
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arc/include/isa_machdep.h        Tue Jun 20 08:26:55 2000 +0000
@@ -0,0 +1,136 @@
+/*     $NetBSD: isa_machdep.h,v 1.6.2.2 2000/06/20 08:26:55 soda Exp $ */
+/*      $OpenBSD: isa_machdep.h,v 1.5 1997/04/19 17:20:00 pefo Exp $  */
+
+/*
+ * Copyright (c) 1996 Per Fogelstrom
+ * 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 Per Fogelstrom
+ * 4. The name of the author may not be used to endorse or promote products
+ *    derived from this software without specific prior written permission
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``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 AUTHOR 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.
+ */
+#ifndef _ISA_MACHDEP_H_
+#define _ISA_MACHDEP_H_
+
+#include <dev/isa/isadmavar.h>
+
+typedef struct arc_isa_bus *isa_chipset_tag_t;
+
+/*
+ *      I/O macros to access isa bus ports/memory.
+ *      At the first glance theese macros may seem inefficient.
+ *      However, the cpu executes an instruction every 7.5ns
+ *      so the bus is much slower so it doesn't matter, really.
+ */
+#define isa_outb(x,y)   outb(arc_bus_io.bs_vbase + (x)- arc_bus_io.bs_start, y)
+#define isa_inb(x)      inb(arc_bus_io.bs_vbase + (x) - arc_bus_io.bs_start)
+ 
+struct arc_isa_bus {
+        void    *ic_data;
+
+       struct isa_dma_state ic_dmastate;
+
+        void    (*ic_attach_hook)(struct device *, struct device *,
+                    struct isabus_attach_args *);
+       const struct evcnt *(*ic_intr_evcnt)(isa_chipset_tag_t, int);
+        void    *(*ic_intr_establish)(isa_chipset_tag_t, int, int, int,
+                    int (*)(void *), void *);
+        void    (*ic_intr_disestablish)(isa_chipset_tag_t, void *);
+};
+
+
+/*
+ * Functions provided to machine-independent ISA code.
+ */
+#define isa_attach_hook(p, s, a)                             /*           \
+    (*(a)->iba_ic->ic_attach_hook)((p), (s), (a)) */
+#define        isa_intr_evcnt(c, i)                                    \
+    (*(c)->ic_intr_evcnt)((c)->ic_data, (i))
+#define isa_intr_establish(c, i, t, l, f, a)                         \
+    (*(c)->ic_intr_establish)((c)->ic_data, (i), (t), (l), (f), (a))
+#define isa_intr_disestablish(c, h)                                     \
+    (*(c)->ic_intr_disestablish)((c)->ic_data, (h))
+
+#define        isa_dmainit(ic, bst, dmat, d)                                   \
+       _isa_dmainit(&(ic)->ic_dmastate, (bst), (dmat), (d))
+#define        isa_dmacascade(ic, c)                                           \
+       _isa_dmacascade(&(ic)->ic_dmastate, (c))
+#define        isa_dmamaxsize(ic, c)                                           \
+       _isa_dmamaxsize(&(ic)->ic_dmastate, (c))
+#define        isa_dmamap_create(ic, c, s, f)                                  \
+       _isa_dmamap_create(&(ic)->ic_dmastate, (c), (s), (f))
+#define        isa_dmamap_destroy(ic, c)                                       \
+       _isa_dmamap_destroy(&(ic)->ic_dmastate, (c))
+#define        isa_dmastart(ic, c, a, n, p, f, bf)                             \
+       _isa_dmastart(&(ic)->ic_dmastate, (c), (a), (n), (p), (f), (bf))
+#define        isa_dmaabort(ic, c)                                             \
+       _isa_dmaabort(&(ic)->ic_dmastate, (c))
+#define        isa_dmacount(ic, c)                                             \
+       _isa_dmacount(&(ic)->ic_dmastate, (c))
+#define        isa_dmafinished(ic, c)                                          \
+       _isa_dmafinished(&(ic)->ic_dmastate, (c))
+#define        isa_dmadone(ic, c)                                              \
+       _isa_dmadone(&(ic)->ic_dmastate, (c))
+#define        isa_dmafreeze(ic)                                               \
+       _isa_dmafreeze(&(ic)->ic_dmastate)
+#define        isa_dmathaw(ic)                                                 \
+       _isa_dmathaw(&(ic)->ic_dmastate)
+#define        isa_dmamem_alloc(ic, c, s, ap, f)                               \
+       _isa_dmamem_alloc(&(ic)->ic_dmastate, (c), (s), (ap), (f))
+#define        isa_dmamem_free(ic, c, a, s)                                    \
+       _isa_dmamem_free(&(ic)->ic_dmastate, (c), (a), (s))
+#define        isa_dmamem_map(ic, c, a, s, kp, f)                              \
+       _isa_dmamem_map(&(ic)->ic_dmastate, (c), (a), (s), (kp), (f))
+#define        isa_dmamem_unmap(ic, c, k, s)                                   \
+       _isa_dmamem_unmap(&(ic)->ic_dmastate, (c), (k), (s))
+#define        isa_dmamem_mmap(ic, c, a, s, o, p, f)                           \
+       _isa_dmamem_mmap(&(ic)->ic_dmastate, (c), (a), (s), (o), (p), (f))
+#define        isa_drq_isfree(ic, c)                                           \
+       _isa_drq_isfree(&(ic)->ic_dmastate, (c))
+#define        isa_malloc(ic, c, s, p, f)                                      \
+       _isa_malloc(&(ic)->ic_dmastate, (c), (s), (p), (f))
+#define        isa_free(a, p)                                                  \
+       _isa_free((a), (p))
+#define        isa_mappage(m, o, p)                                            \
+       _isa_mappage((m), (o), (p))
+
+void sysbeepstop(void *);
+void sysbeep(int, int);
+
+
+/*
+ *     Interrupt control struct used to control the ICU setup.
+ */
+
+struct intrhand {
+       struct  intrhand *ih_next;
+       int     (*ih_fun)(void *);
+       void    *ih_arg;
+       u_long  ih_count;
+       int     ih_level;
+       int     ih_irq;
+       char    *ih_what;
+};
+
+#endif /* _ISA_MACHDEP_H_ */
diff -r ee8eee073b13 -r 705169a98ca0 sys/arch/arc/isa/isabus.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arc/isa/isabus.c Tue Jun 20 08:26:55 2000 +0000
@@ -0,0 +1,574 @@
+/*     $NetBSD: isabus.c,v 1.12.2.2 2000/06/20 08:26:56 soda Exp $     */
+/*     $OpenBSD: isabus.c,v 1.15 1998/03/16 09:38:46 pefo Exp $        */
+/*     NetBSD: isa.c,v 1.33 1995/06/28 04:30:51 cgd Exp        */
+
+/*-
+ * Copyright (c) 1995 Per Fogelstrom
+ * Copyright (c) 1993, 1994 Charles M. Hannum.
+ * Copyright (c) 1990 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * This code is derived from software contributed to Berkeley by
+ * William Jolitz and Don Ahn.
+ *
+ * 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.
+ *
+ *     @(#)isa.c       7.2 (Berkeley) 5/12/91
+ */
+/* 
+ * Mach Operating System
+ * Copyright (c) 1991,1990,1989 Carnegie Mellon University
+ * All Rights Reserved.
+ * 
+ * Permission to use, copy, modify and distribute this software and its
+ * documentation is hereby granted, provided that both the copyright
+ * notice and this permission notice appear in all copies of the
+ * software, derivative works or modified versions, and any portions
+ * thereof, and that both notices appear in supporting documentation.
+ * 
+ * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
+ * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND FOR
+ * ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
+ * 
+ * Carnegie Mellon requests users of this software to return to
+ * 
+ *  Software Distribution Coordinator  or  Software.Distribution%CS.CMU.EDU@localhost
+ *  School of Computer Science
+ *  Carnegie Mellon University
+ *  Pittsburgh PA 15213-3890
+ * 
+ * any improvements or extensions that they make and grant Carnegie Mellon
+ * the rights to redistribute these changes.
+ */
+/*
+  Copyright 1988, 1989 by Intel Corporation, Santa Clara, California.
+
+               All Rights Reserved
+
+Permission to use, copy, modify, and distribute this software and
+its documentation for any purpose and without fee is hereby
+granted, provided that the above copyright notice appears in all
+copies and that both the copyright notice and this permission notice
+appear in supporting documentation, and that the name of Intel
+not be used in advertising or publicity pertaining to distribution
+of the software without specific, written prior permission.
+
+INTEL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE
+INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
+IN NO EVENT SHALL INTEL BE LIABLE FOR ANY SPECIAL, INDIRECT, OR
+CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN ACTION OF CONTRACT,
+NEGLIGENCE, OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
+WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+*/
+
+#include <sys/param.h>
+#include <sys/proc.h>
+#include <sys/user.h>
+#include <sys/systm.h>
+#include <sys/callout.h>
+#include <sys/time.h>
+#include <sys/kernel.h>
+#include <sys/device.h>
+#include <sys/malloc.h>
+#include <vm/vm.h>
+
+#include <machine/cpu.h>
+#include <machine/pio.h>
+#include <machine/autoconf.h>
+#include <machine/intr.h>
+
+#include <arc/arc/arctype.h>
+#include <arc/pica/pica.h>
+#include <arc/pica/rd94.h>
+
+#include <dev/isa/isareg.h>
+#include <dev/isa/isavar.h>
+#include <arc/isa/timerreg.h>
+#include <arc/isa/spkrreg.h>
+#include <machine/isa_machdep.h>
+
+static int beeping;
+static struct callout sysbeep_ch = CALLOUT_INITIALIZER;
+
+#define        IRQ_SLAVE       2
+#define ICU_LEN                16
+
+struct isabr_softc {
+       struct  device sc_dv;
+       struct  arc_isa_bus arc_isa_cs;
+       struct  abus sc_bus;
+       struct arc_bus_dma_tag sc_dmat;
+};
+
+/* Definition of the driver for autoconfig. */
+int    isabrmatch(struct device *, struct cfdata *, void *);
+void   isabrattach(struct device *, struct device *, void *);
+int    isabrprint(void *, const char *);
+
+struct cfattach isabr_ca = {
+       sizeof(struct isabr_softc), isabrmatch, isabrattach
+};
+extern struct cfdriver isabr_cd;
+
+extern struct arc_bus_space arc_bus_io, arc_bus_mem;
+
+void   isabr_attach_hook __P((struct device *, struct device *,
+                       struct isabus_attach_args *));
+const struct evcnt *isabr_intr_evcnt __P((isa_chipset_tag_t, int));
+void   *isabr_intr_establish __P((isa_chipset_tag_t, int, int, int,
+                       int (*)(void *), void *));
+void   isabr_intr_disestablish __P((isa_chipset_tag_t, void*));
+int    isabr_iointr __P((unsigned int, struct clockframe *));
+void   isabr_initicu __P((void));
+void   intr_calculatemasks __P((void));
+int    fakeintr __P((void *a));
+
+int
+isabrmatch(parent, match, aux)
+       struct device *parent;
+       struct cfdata *match;



Home | Main Index | Thread Index | Old Index