Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/sgimips/gio Simple GIO glue.
details: https://anonhg.NetBSD.org/src/rev/80ea521fc7e7
branches: trunk
changeset: 487903:80ea521fc7e7
user: soren <soren%NetBSD.org@localhost>
date: Wed Jun 14 16:50:58 2000 +0000
description:
Simple GIO glue.
diffstat:
sys/arch/sgimips/gio/Makefile.giodevs | 7 +
sys/arch/sgimips/gio/files.gio | 19 +++++
sys/arch/sgimips/gio/gio.c | 122 ++++++++++++++++++++++++++++++++++
sys/arch/sgimips/gio/giodevs | 15 ++++
sys/arch/sgimips/gio/gioreg.h | 1 +
sys/arch/sgimips/gio/giovar.h | 61 +++++++++++++++++
sys/arch/sgimips/gio/hpc.c | 96 ++++++++++++++++++++++++++
7 files changed, 321 insertions(+), 0 deletions(-)
diffs (truncated from 349 to 300 lines):
diff -r d0f55469bbb1 -r 80ea521fc7e7 sys/arch/sgimips/gio/Makefile.giodevs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/gio/Makefile.giodevs Wed Jun 14 16:50:58 2000 +0000
@@ -0,0 +1,7 @@
+# $NetBSD: Makefile.giodevs,v 1.1 2000/06/14 16:50:58 soren Exp $
+
+AWK?= awk
+
+giodevs.h giodevs_data.h: giodevs devlist2h.awk
+ /bin/rm -f giodevs.h giodevs_data.h
+ ${AWK} -f devlist2h.awk giodevs
diff -r d0f55469bbb1 -r 80ea521fc7e7 sys/arch/sgimips/gio/files.gio
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/gio/files.gio Wed Jun 14 16:50:58 2000 +0000
@@ -0,0 +1,19 @@
+# $NetBSD: files.gio,v 1.1 2000/06/14 16:50:59 soren Exp $
+
+device gio {[slot = -1], [addr = -1]}
+attach gio at giobus
+
+file arch/sgimips/gio/gio.c gio needs-flag
+
+device hpc {}
+attach hpc at gio
+file arch/sgimips/gio/hpc.c hpc
+
+# XL graphics
+#device newport {}
+#attach newport at gio
+#file arch/sgimips/gio/newport.c newport
+
+# Challenge/S mezzanine I/O board..
+
+# Other GIO boards..
diff -r d0f55469bbb1 -r 80ea521fc7e7 sys/arch/sgimips/gio/gio.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/gio/gio.c Wed Jun 14 16:50:58 2000 +0000
@@ -0,0 +1,122 @@
+/* $NetBSD: gio.c,v 1.1 2000/06/14 16:51:00 soren Exp $ */
+
+/*
+ * Copyright (c) 2000 Soren S. Jorvang
+ * 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 for the
+ * NetBSD Project. See http://www.netbsd.org/ for
+ * information about NetBSD.
+ * 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.
+ */
+
+#include "opt_ddb.h"
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+
+#include <sgimips/gio/gioreg.h>
+#include <sgimips/gio/giovar.h>
+
+#include "locators.h"
+
+struct gio_softc {
+ struct device sc_dev;
+};
+
+static int gio_match(struct device *, struct cfdata *, void *);
+static void gio_attach(struct device *, struct device *, void *);
+static int gio_print(void *, const char *);
+static int gio_search(struct device *, struct cfdata *, void *);
+
+struct cfattach gio_ca = {
+ sizeof(struct gio_softc), gio_match, gio_attach
+};
+
+static int
+gio_match(parent, match, aux)
+ struct device *parent;
+ struct cfdata *match;
+ void *aux;
+{
+ struct giobus_attach_args *gba = aux;
+
+ if (strcmp(gba->gba_busname, match->cf_driver->cd_name) != 0)
+ return 0;
+
+ return 1;
+}
+
+static void
+gio_attach(parent, self, aux)
+ struct device *parent;
+ struct device *self;
+ void *aux;
+{
+ struct gio_attach_args ga;
+
+ printf("\n");
+
+ config_search(gio_search, self, &ga);
+}
+
+static int
+gio_print(aux, pnp)
+ void *aux;
+ const char *pnp;
+{
+ struct gio_attach_args *ga = aux;
+
+ if (pnp != 0)
+ return QUIET;
+
+ if (ga->ga_slot != GIOCF_SLOT_DEFAULT)
+ printf(" slot %d", ga->ga_slot);
+ if (ga->ga_addr != GIOCF_ADDR_DEFAULT)
+ printf(" addr 0x%x", ga->ga_addr);
+
+ return UNCONF;
+}
+
+static int
+gio_search(parent, cf, aux)
+ struct device *parent;
+ struct cfdata *cf;
+ void *aux;
+{
+ struct gio_attach_args *ga = aux;
+
+ do {
+ ga->ga_slot = cf->cf_loc[GIOCF_SLOT];
+ ga->ga_addr = cf->cf_loc[GIOCF_ADDR];
+ ga->ga_iot = 0;
+ ga->ga_ioh = MIPS_PHYS_TO_KSEG1(ga->ga_addr);
+ if ((*cf->cf_attach->ca_match)(parent, cf, ga) > 0)
+ config_attach(parent, cf, ga, gio_print);
+ } while (cf->cf_fstate == FSTATE_STAR);
+
+ return 0;
+}
diff -r d0f55469bbb1 -r 80ea521fc7e7 sys/arch/sgimips/gio/giodevs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/gio/giodevs Wed Jun 14 16:50:58 2000 +0000
@@ -0,0 +1,15 @@
+product XPI 0x01 XPI low cost FDDI
+product GTR 0x02 GTR TokenRing
+product ISDN 0x04 Synchronous ISDN
+product CANON 0x06 Canon Interface
+product JPEG_D 0x08 JPEG (Double Wide)
+product JPEG_S 0x09 JPEG (Single Wide)
+product XPI_M0 0x0a XPI mez. FDDI device 0
+product XPI_M1 0x0b XPI mez. FDDI device 1
+product EP 0x0e E-Plex 8-port Ethernet
+product IVAS 0x30 Lyon Lamb IVAS
+
+product ATM 0x85 ATM board
+product SCSI 0x87 16 bit SCSI Card
+product SMPTE 0x8c SMPTE 259M Video
+product BABBLE 0x8d Babblefish Compression
diff -r d0f55469bbb1 -r 80ea521fc7e7 sys/arch/sgimips/gio/gioreg.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/gio/gioreg.h Wed Jun 14 16:50:58 2000 +0000
@@ -0,0 +1,1 @@
+/* $NetBSD: gioreg.h,v 1.1 2000/06/14 16:51:04 soren Exp $ */
diff -r d0f55469bbb1 -r 80ea521fc7e7 sys/arch/sgimips/gio/giovar.h
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/gio/giovar.h Wed Jun 14 16:50:58 2000 +0000
@@ -0,0 +1,61 @@
+/* $NetBSD: giovar.h,v 1.1 2000/06/14 16:51:05 soren Exp $ */
+
+/*
+ * Copyright (c) 2000 Soren S. Jorvang
+ * 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 for the
+ * NetBSD Project. See http://www.netbsd.org/ for
+ * information about NetBSD.
+ * 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.
+ */
+
+/*
+ * GIO 32/32-bis/64 bus
+ */
+
+#include <machine/bus.h>
+
+struct giobus_attach_args {
+ char *gba_busname;
+
+ bus_space_tag_t gba_iot;
+ bus_space_handle_t gba_ioh;
+
+#define GIOBUS_GIO32 0
+#define GIOBUS_GIO32BIS 1
+#define GIOBUS_GIO64 2
+ int gba_type;
+};
+
+struct gio_attach_args {
+ bus_space_tag_t ga_iot;
+ bus_space_handle_t ga_ioh;
+
+ int ga_slot; /* (?) */
+ u_int32_t ga_addr; /* (?) */
+
+ u_int32_t ga_product;
+};
diff -r d0f55469bbb1 -r 80ea521fc7e7 sys/arch/sgimips/gio/hpc.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/sgimips/gio/hpc.c Wed Jun 14 16:50:58 2000 +0000
@@ -0,0 +1,96 @@
+/* $NetBSD: hpc.c,v 1.1 2000/06/14 16:51:07 soren Exp $ */
+
+/*
+ * Copyright (c) 2000 Soren S. Jorvang
+ * 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 for the
+ * NetBSD Project. See http://www.netbsd.org/ for
+ * information about NetBSD.
+ * 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.
+ */
+
+#include <sys/param.h>
+#include <sys/systm.h>
+#include <sys/device.h>
+
+#include <sgimips/gio/gioreg.h>
+#include <sgimips/gio/giovar.h>
+
+struct hpc_softc {
+ struct device sc_dev;
+};
+
+static int hpc_match(struct device *, struct cfdata *, void *);
+static void hpc_attach(struct device *, struct device *, void *);
Home |
Main Index |
Thread Index |
Old Index