Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/xscale Add support for the Intel i80321 I/O Pro...



details:   https://anonhg.NetBSD.org/src/rev/469ca81b5786
branches:  trunk
changeset: 534697:469ca81b5786
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Fri Aug 02 00:35:47 2002 +0000

description:
Add support for the Intel i80321 I/O Processor's Application Accelerator
Unit.  The AAU provides block fill, block copy, XOR, and XOR-parity-check
operations.  We currently provide dmover(9) functions for "zero", "fill8",
and "copy".

Much of this code can be shared with the i80312 Companion I/O AAU, and
will be when support for the older chip is implemented.

diffstat:

 sys/arch/arm/xscale/files.i80321 |    8 +-
 sys/arch/arm/xscale/i80321_aau.c |  176 +++++++++++
 sys/arch/arm/xscale/iopaau.c     |  619 +++++++++++++++++++++++++++++++++++++++
 sys/arch/arm/xscale/iopaaureg.h  |  127 ++++++++
 sys/arch/arm/xscale/iopaauvar.h  |   92 +++++
 5 files changed, 1021 insertions(+), 1 deletions(-)

diffs (truncated from 1052 to 300 lines):

diff -r f2d66700a302 -r 469ca81b5786 sys/arch/arm/xscale/files.i80321
--- a/sys/arch/arm/xscale/files.i80321  Fri Aug 02 00:33:29 2002 +0000
+++ b/sys/arch/arm/xscale/files.i80321  Fri Aug 02 00:35:47 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.i80321,v 1.6 2002/08/01 19:40:07 thorpej Exp $
+#      $NetBSD: files.i80321,v 1.7 2002/08/02 00:35:47 thorpej Exp $
 #
 # Configuration info for Intel i80321 XScale I/O Processor support
 #
@@ -14,6 +14,12 @@
 file   arch/arm/xscale/i80321_pci.c            iopxs
 file   arch/arm/xscale/i80321_space.c          iopxs
 
+# Application Accelerator Unit
+device iopaau: dmover_service
+attach iopaau at iopxs
+file   arch/arm/xscale/i80321_aau.c            iopaau
+file   arch/arm/xscale/iopaau.c                iopaau
+
 # Watchdog timer
 device iopwdog: sysmon_wdog
 attach iopwdog at iopxs
diff -r f2d66700a302 -r 469ca81b5786 sys/arch/arm/xscale/i80321_aau.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/xscale/i80321_aau.c  Fri Aug 02 00:35:47 2002 +0000
@@ -0,0 +1,176 @@
+/*     $NetBSD: i80321_aau.c,v 1.1 2002/08/02 00:35:48 thorpej Exp $   */
+
+/*
+ * Copyright (c) 2002 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ *
+ * 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 for the NetBSD Project by
+ *     Wasabi Systems, Inc.
+ * 4. The name of Wasabi Systems, Inc. may not be used to endorse
+ *    or promote products derived from this software without specific prior
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
+ * 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.
+ */
+
+/*
+ * Intel i80321 I/O Processor application accelerator unit support.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD");
+
+#include <sys/param.h>
+#include <sys/pool.h>
+#include <sys/lock.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/uio.h>
+
+#include <uvm/uvm.h>
+
+#include <machine/bus.h>
+#include <machine/intr.h>
+
+#include <arm/xscale/i80321reg.h>
+#include <arm/xscale/i80321var.h>
+
+#include <arm/xscale/iopaaureg.h>
+#include <arm/xscale/iopaauvar.h>
+
+struct aau321_softc {
+       /* Shared AAU definitions. */
+       struct iopaau_softc sc_iopaau;
+
+       /* i80321-specific stuff. */
+       void *sc_error_ih;
+       void *sc_eoc_ih;
+       void *sc_eot_ih;
+};
+
+static struct iopaau_function aau321_func_zero = {
+       iopaau_func_zero_setup,
+       iopaau_desc_4_free,
+};
+
+static struct iopaau_function aau321_func_fill8 = {
+       iopaau_func_fill8_setup,
+       iopaau_desc_4_free,
+};
+
+static struct iopaau_function aau321_func_copy = {
+       iopaau_func_copy_setup,
+       iopaau_desc_4_free,
+};
+
+static const struct dmover_algdesc aau321_algdescs[] = {
+       {
+         DMOVER_FUNC_ZERO,
+         &aau321_func_zero,
+         0
+       },
+       {
+         DMOVER_FUNC_FILL8,
+         &aau321_func_fill8,
+         0
+       },
+       {
+         DMOVER_FUNC_COPY,
+         &aau321_func_copy,
+         1
+       },
+};
+#define        AAU321_ALGDESC_COUNT \
+       (sizeof(aau321_algdescs) / sizeof(aau321_algdescs[0]))
+
+static int
+aau321_match(struct device *parent, struct cfdata *match, void *aux)
+{
+       struct iopxs_attach_args *ia = aux;
+
+       if (strcmp(match->cf_driver->cd_name, ia->ia_name) == 0)
+               return (1);
+
+       return (0);
+}
+
+static void
+aau321_attach(struct device *parent, struct device *self, void *aux)
+{
+       struct aau321_softc *sc321 = (void *) self;
+       struct iopaau_softc *sc = &sc321->sc_iopaau;
+       struct iopxs_attach_args *ia = aux;
+       int error;
+
+       printf("\n");
+
+       sc->sc_st = ia->ia_st;
+       error = bus_space_subregion(sc->sc_st, ia->ia_sh,
+           ia->ia_offset, ia->ia_size, &sc->sc_sh);
+       if (error) {
+               printf("%s: unable to subregion registers, error = %d\n",
+                   sc->sc_dev.dv_xname, error);
+               return;
+       }
+
+       sc->sc_dmat = ia->ia_dmat;
+
+       sc321->sc_error_ih = i80321_intr_establish(ICU_INT_AAUE, IPL_BIO,
+           iopaau_intr, sc);
+       if (sc321->sc_error_ih == NULL) {
+               printf("%s: unable to register error interrupt handler\n",
+                   sc->sc_dev.dv_xname);
+               return;
+       }
+
+       sc321->sc_eoc_ih = i80321_intr_establish(ICU_INT_AAU_EOC, IPL_BIO,
+           iopaau_intr, sc);
+       if (sc321->sc_eoc_ih == NULL) {
+               printf("%s: unable to register EOC interrupt handler\n",
+                   sc->sc_dev.dv_xname);
+               return;
+       }
+
+       sc321->sc_eot_ih = i80321_intr_establish(ICU_INT_AAU_EOT, IPL_BIO,
+           iopaau_intr, sc);
+       if (sc321->sc_eoc_ih == NULL) {
+               printf("%s: unable to register EOT interrupt handler\n",
+                   sc->sc_dev.dv_xname);
+               return;
+       }
+
+       sc->sc_dmb.dmb_name = sc->sc_dev.dv_xname;
+       sc->sc_dmb.dmb_speed = 1638400;                 /* XXX */
+       sc->sc_dmb.dmb_cookie = sc;
+       sc->sc_dmb.dmb_algdescs = aau321_algdescs;
+       sc->sc_dmb.dmb_nalgdescs = AAU321_ALGDESC_COUNT;
+       sc->sc_dmb.dmb_process = iopaau_process;
+
+       iopaau_attach(sc);
+}
+
+struct cfattach iopaau_ca = {
+       sizeof(struct aau321_softc), aau321_match, aau321_attach,
+};
diff -r f2d66700a302 -r 469ca81b5786 sys/arch/arm/xscale/iopaau.c
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arm/xscale/iopaau.c      Fri Aug 02 00:35:47 2002 +0000
@@ -0,0 +1,619 @@
+/*     $NetBSD: iopaau.c,v 1.1 2002/08/02 00:35:48 thorpej Exp $       */
+
+/*
+ * Copyright (c) 2002 Wasabi Systems, Inc.
+ * All rights reserved.
+ *
+ * Written by Jason R. Thorpe for Wasabi Systems, Inc.
+ *
+ * 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 for the NetBSD Project by
+ *     Wasabi Systems, Inc.
+ * 4. The name of Wasabi Systems, Inc. may not be used to endorse
+ *    or promote products derived from this software without specific prior
+ *    written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY WASABI SYSTEMS, INC. ``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 WASABI SYSTEMS, INC
+ * 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.
+ */
+
+/*
+ * Common code for XScale-based I/O Processor Application Accelerator
+ * Unit support.
+ *
+ * The AAU provides a back-end for the dmover(9) facility.
+ */
+
+#include <sys/cdefs.h>
+__KERNEL_RCSID(0, "$NetBSD");
+
+#include <sys/param.h>
+#include <sys/pool.h>
+#include <sys/lock.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+#include <sys/uio.h>
+
+#include <uvm/uvm.h>
+
+#include <machine/bus.h>
+
+#include <arm/xscale/iopaaureg.h>
+#include <arm/xscale/iopaauvar.h>
+
+#ifdef AAU_DEBUG
+#define        DPRINTF(x)      printf x
+#else
+#define        DPRINTF(x)      /* nothing */
+#endif
+
+static struct pool aau_desc_4_pool;
+static struct pool_cache aau_desc_4_cache;
+
+/*
+ * iopaau_desc_ctor:
+ *
+ *     Constructor for all types of descriptors.
+ */
+static int
+iopaau_desc_ctor(void *arg, void *object, int flags)
+{
+       struct aau_desc_4 *d = object;
+
+       /*
+        * Cache the physical address of the hardware portion of
+        * the descriptor in the software portion of the descriptor
+        * for quick reference later.
+        */
+       d->d_pa = vtophys(d) + SYNC_DESC_4_OFFSET;
+       KASSERT((d->d_pa & 31) == 0);
+       return (0);
+}
+
+/*
+ * iopaau_desc_4_free:
+ *
+ *     Free a chain of aau_desc_4 structures.



Home | Main Index | Thread Index | Old Index