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 attaching IOP built-in s...



details:   https://anonhg.NetBSD.org/src/rev/5babf9d61966
branches:  trunk
changeset: 534572:5babf9d61966
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Mon Jul 29 17:37:14 2002 +0000

description:
Add support for attaching IOP built-in sub-devices (aau, dma, ssp,
watchdog, etc.)

diffstat:

 sys/arch/arm/xscale/files.i80321 |   4 +-
 sys/arch/arm/xscale/i80321.c     |  45 +++++++++++++++++++++++++++++++++++++++-
 sys/arch/arm/xscale/i80321var.h  |  14 +++++++++++-
 3 files changed, 59 insertions(+), 4 deletions(-)

diffs (128 lines):

diff -r 972fb4861a7d -r 5babf9d61966 sys/arch/arm/xscale/files.i80321
--- a/sys/arch/arm/xscale/files.i80321  Mon Jul 29 17:28:06 2002 +0000
+++ b/sys/arch/arm/xscale/files.i80321  Mon Jul 29 17:37:14 2002 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: files.i80321,v 1.3 2002/07/25 15:00:48 thorpej Exp $
+#      $NetBSD: files.i80321,v 1.4 2002/07/29 17:37:14 thorpej Exp $
 #
 # Configuration info for Intel i80321 XScale I/O Processor support
 #
@@ -8,7 +8,7 @@
 file   arch/arm/xscale/i80321_mcu.c
 file   arch/arm/xscale/i80321_timer.c
 
-device iopxs: pcibus, bus_space_generic
+device iopxs {}: pcibus, bus_space_generic
 # Board-specific front-end provides attachment.
 file   arch/arm/xscale/i80321.c                iopxs
 file   arch/arm/xscale/i80321_pci.c            iopxs
diff -r 972fb4861a7d -r 5babf9d61966 sys/arch/arm/xscale/i80321.c
--- a/sys/arch/arm/xscale/i80321.c      Mon Jul 29 17:28:06 2002 +0000
+++ b/sys/arch/arm/xscale/i80321.c      Mon Jul 29 17:37:14 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i80321.c,v 1.3 2002/07/25 15:00:48 thorpej Exp $       */
+/*     $NetBSD: i80321.c,v 1.4 2002/07/29 17:37:14 thorpej Exp $       */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -61,8 +61,22 @@
  */
 struct i80321_softc *i80321_softc;
 
+int    i80321_iopxs_print(void *, const char *);
 int    i80321_pcibus_print(void *, const char *);
 
+/* Built-in devices. */
+static const struct iopxs_device {
+       const char *id_name;
+       bus_addr_t id_offset;
+       bus_size_t id_size;
+} iopxs_devices[] = {
+       { "iopaau",     VERDE_AAU_BASE,         VERDE_AAU_SIZE },
+       { "iopdma",     VERDE_DMA_BASE,         VERDE_DMA_SIZE },
+       { "iopssp",     VERDE_SSP_BASE,         VERDE_SSP_SIZE },
+       { "iopwdog",    0,                      0 },
+       { NULL,         0,                      0 }
+};
+
 /*
  * i80321_attach:
  *
@@ -72,6 +86,8 @@
 i80321_attach(struct i80321_softc *sc)
 {
        struct pcibus_attach_args pba;
+       const struct iopxs_device *id;
+       struct iopxs_attach_args ia;
        pcireg_t preg;
 
        i80321_softc = sc;
@@ -190,6 +206,20 @@
        i80321_local_dma_init(&sc->sc_local_dmat, sc);
 
        /*
+        * Attach all the IOP built-ins.
+        */
+       for (id = iopxs_devices; id->id_name != NULL; id++) {
+               ia.ia_name = id->id_name;
+               ia.ia_st = sc->sc_st;
+               ia.ia_sh = sc->sc_sh;
+               ia.ia_dmat = &sc->sc_local_dmat;
+               ia.ia_offset = id->id_offset;
+               ia.ia_size = id->id_size;
+
+               (void) config_found(&sc->sc_dev, &ia, i80321_iopxs_print);
+       }
+
+       /*
         * Attach the PCI bus.
         */
        preg = bus_space_read_4(sc->sc_st, sc->sc_atu_sh, ATU_PCIXSR);
@@ -211,6 +241,19 @@
 }
 
 /*
+ * i80321_iopxs_print:
+ *
+ *     Autoconfiguration cfprint routine when attaching
+ *     to the "iopxs" device.
+ */
+int
+i80321_iopxs_print(void *aux, const char *pnp)
+{
+
+       return (QUIET);
+}
+
+/*
  * i80321_pcibus_print:
  *
  *     Autoconfiguration cfprint routine when attaching
diff -r 972fb4861a7d -r 5babf9d61966 sys/arch/arm/xscale/i80321var.h
--- a/sys/arch/arm/xscale/i80321var.h   Mon Jul 29 17:28:06 2002 +0000
+++ b/sys/arch/arm/xscale/i80321var.h   Mon Jul 29 17:37:14 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: i80321var.h,v 1.2 2002/07/25 15:00:49 thorpej Exp $    */
+/*     $NetBSD: i80321var.h,v 1.3 2002/07/29 17:37:15 thorpej Exp $    */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -137,6 +137,18 @@
        struct arm32_bus_dma_tag sc_local_dmat;
 };
 
+/*
+ * Arguments used to attach IOP built-ins.
+ */
+struct iopxs_attach_args {
+       const char *ia_name;    /* name of device */
+       bus_space_tag_t ia_st;  /* space tag */
+       bus_space_handle_t ia_sh;/* handle of IOP base */
+       bus_dma_tag_t ia_dmat;  /* DMA tag */
+       bus_addr_t ia_offset;   /* offset of device from IOP base */
+       bus_size_t ia_size;     /* size of sub-device */
+};
+
 extern struct bus_space i80321_bs_tag;
 extern struct i80321_softc *i80321_softc;
 



Home | Main Index | Thread Index | Old Index