Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/arch/arc Add MD attachments for the Symbios/NCR 53c710 S...
details: https://anonhg.NetBSD.org/src/rev/8ac5f9a9c4e5
branches: trunk
changeset: 509247:8ac5f9a9c4e5
user: tsutsui <tsutsui%NetBSD.org@localhost>
date: Mon Apr 30 04:52:53 2001 +0000
description:
Add MD attachments for the Symbios/NCR 53c710 SCSI controller,
found on the NEC Express5800/230A.
diffstat:
sys/arch/arc/conf/GENERIC | 15 ++-
sys/arch/arc/conf/files.arc | 6 +-
sys/arch/arc/jazz/jazzio.c | 58 +++++++++++----
sys/arch/arc/jazz/osiop_jazzio.c | 148 +++++++++++++++++++++++++++++++++++++++
sys/arch/arc/jazz/rd94.h | 8 +-
5 files changed, 210 insertions(+), 25 deletions(-)
diffs (truncated from 384 to 300 lines):
diff -r 42655a6eb56d -r 8ac5f9a9c4e5 sys/arch/arc/conf/GENERIC
--- a/sys/arch/arc/conf/GENERIC Mon Apr 30 04:49:57 2001 +0000
+++ b/sys/arch/arc/conf/GENERIC Mon Apr 30 04:52:53 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: GENERIC,v 1.41 2000/12/24 09:25:25 ur Exp $
+# $NetBSD: GENERIC,v 1.42 2001/04/30 04:52:53 tsutsui Exp $
# $OpenBSD: GENERIC,v 1.29 1999/08/29 12:14:03 niklas Exp $
#
# GENERIC -- everything that's currently supported
@@ -6,7 +6,7 @@
include "arch/arc/conf/std.arc"
-#ident "GENERIC-$Revision: 1.41 $"
+#ident "GENERIC-$Revision: 1.42 $"
maxusers 32 # estimated number of users
@@ -137,11 +137,16 @@
fdc0 at jazzio?
fd* at fdc? drive ?
-asc0 at jazzio?
+asc0 at jazzio? # NCR53C9x SCSI
scsibus* at asc?
-#siop0 at jazzio?
-#scsibus* at siop?
+osiop0 at jazzio? flags 0x00000 # NCR53C710 SCSI
+osiop1 at jazzio? flags 0x00000
+scsibus* at osiop?
+
+#oosiop0 at jazzio? # NCR53C700 SCSI
+#oosiop1 at jazzio?
+#scsibus* at oosiop?
#### ISA bus devices
diff -r 42655a6eb56d -r 8ac5f9a9c4e5 sys/arch/arc/conf/files.arc
--- a/sys/arch/arc/conf/files.arc Mon Apr 30 04:49:57 2001 +0000
+++ b/sys/arch/arc/conf/files.arc Mon Apr 30 04:52:53 2001 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: files.arc,v 1.28 2001/02/17 04:32:59 tsutsui Exp $
+# $NetBSD: files.arc,v 1.29 2001/04/30 04:52:53 tsutsui Exp $
# $OpenBSD: files.arc,v 1.21 1999/09/11 10:20:20 niklas Exp $
#
# maxpartitions must be first item in files.${ARCH}
@@ -117,6 +117,10 @@
attach asc at jazzio
file arch/arc/jazz/asc.c asc
+# Symbios 53C710 SCSI interface driver on Jazz-Internal bus
+attach osiop at jazzio with osiop_jazzio
+file arch/arc/jazz/osiop_jazzio.c osiop_jazzio
+
# Floppy disk controller on Jazz-internal bus
device fdc {drive = -1}
attach fdc at jazzio
diff -r 42655a6eb56d -r 8ac5f9a9c4e5 sys/arch/arc/jazz/jazzio.c
--- a/sys/arch/arc/jazz/jazzio.c Mon Apr 30 04:49:57 2001 +0000
+++ b/sys/arch/arc/jazz/jazzio.c Mon Apr 30 04:52:53 2001 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: jazzio.c,v 1.3 2001/03/30 09:10:49 ur Exp $ */
+/* $NetBSD: jazzio.c,v 1.4 2001/04/30 04:52:53 tsutsui Exp $ */
/* $OpenBSD: picabus.c,v 1.11 1999/01/11 05:11:10 millert Exp $ */
/* NetBSD: tc.c,v 1.2 1995/03/08 00:39:05 cgd Exp */
@@ -171,7 +171,7 @@
0, pica_intrnull, (void *)NULL, },
{{ "sonic", 4, 0, },
RD94_SYS_LB_IE_SONIC, pica_intrnull, (void *)RD94_SYS_SONIC, },
- {{ NULL, 5, 0, },
+ {{ NULL, 5, NULL, },
0, pica_intrnull, (void *)NULL, },
{{ NULL, 6, NULL, },
0, pica_intrnull, (void *)NULL, },
@@ -187,6 +187,33 @@
0, NULL, (void *)NULL, },
};
+struct pica_dev nec_jc94_cpu[] = {
+ {{ "dallas_rtc",0, 0, },
+ 0, pica_intrnull, (void *)RD94_SYS_CLOCK, },
+ {{ "lpt", 1, 0, },
+ RD94_SYS_LB_IE_PAR1, pica_intrnull, (void *)RD94_SYS_PAR1, },
+ {{ "fdc", 2, 0, },
+ RD94_SYS_LB_IE_FLOPPY,pica_intrnull, (void *)RD94_SYS_FLOPPY, },
+ {{ NULL, 3, NULL, },
+ 0, pica_intrnull, (void *)NULL, },
+ {{ "sonic", 4, 0, },
+ RD94_SYS_LB_IE_SONIC, pica_intrnull, (void *)RD94_SYS_SONIC, },
+ {{ "osiop", 5, 0, },
+ RD94_SYS_LB_IE_SCSI0, pica_intrnull, (void *)RD94_SYS_SCSI0, },
+ {{ "osiop", 6, 0, },
+ RD94_SYS_LB_IE_SCSI1, pica_intrnull, (void *)RD94_SYS_SCSI1, },
+ {{ "pckbd", 7, 0, },
+ RD94_SYS_LB_IE_KBD, pica_intrnull, (void *)RD94_SYS_KBD, },
+ {{ "pms", 8, NULL, },
+ RD94_SYS_LB_IE_MOUSE, pica_intrnull, (void *)RD94_SYS_KBD, },
+ {{ "com", 9, 0, },
+ RD94_SYS_LB_IE_COM1, pica_intrnull, (void *)RD94_SYS_COM1, },
+ {{ "com", 10, 0, },
+ RD94_SYS_LB_IE_COM2, pica_intrnull, (void *)RD94_SYS_COM2, },
+ {{ NULL, -1, NULL, },
+ 0, NULL, (void *)NULL, },
+};
+
struct pica_dev *pica_cpu_devs[] = {
NULL, /* Unused */
acer_pica_61_cpu, /* Acer PICA */
@@ -199,7 +226,7 @@
NULL,
NULL,
NULL,
- nec_rd94_cpu, /* NEC-JC94 */
+ nec_jc94_cpu, /* NEC-JC94 */
};
int npica_cpu_devs = sizeof pica_cpu_devs / sizeof pica_cpu_devs[0];
@@ -271,7 +298,7 @@
/* Try to configure each PICA attached device */
for (i = 0; sc->sc_devs[i].ps_ca.ca_slot >= 0; i++) {
- if(sc->sc_devs[i].ps_ca.ca_name == NULL)
+ if (sc->sc_devs[i].ps_ca.ca_name == NULL)
continue; /* Empty slot */
ja.ja_name = sc->sc_devs[i].ps_ca.ca_name;
@@ -308,7 +335,7 @@
{
struct jazzio_softc *sc = jazzio_cd.cd_devs[0];
- if(slot == 0) { /* Slot 0 is special, clock */
+ if (slot == 0) { /* Slot 0 is special, clock */
pica_clock_handler = handler;
switch (cputype) {
case ACER_PICA_61:
@@ -325,11 +352,10 @@
}
}
- if(int_table[slot].int_mask != 0) {
+ if (int_table[slot].int_mask != 0) {
panic("pica intr already set");
- }
- else {
- int_table[slot].int_mask = sc->sc_devs[slot].ps_mask;;
+ } else {
+ int_table[slot].int_mask = sc->sc_devs[slot].ps_mask;
local_int_mask |= int_table[slot].int_mask;
int_table[slot].int_hand = handler;
int_table[slot].param = val;
@@ -362,7 +388,7 @@
jazzio_intr_disestablish(slot)
int slot;
{
- if(slot != 0) { /* Slot 0 is special, clock */
+ if (slot != 0) { /* Slot 0 is special, clock */
local_int_mask &= ~int_table[slot].int_mask;
int_table[slot].int_mask = 0;
int_table[slot].int_hand = pica_intrnull;
@@ -387,10 +413,10 @@
{
int vector;
- while((vector = inb(PVIS) >> 2) != 0) {
+ while ((vector = inb(PVIS) >> 2) != 0) {
(*int_table[vector].int_hand)(int_table[vector].param);
}
- return(~0); /* Dont reenable */
+ return (~0); /* Dont reenable */
}
/*
@@ -409,7 +435,7 @@
/* Re-enable clock interrupts */
splx(MIPS_INT_MASK_4 | MIPS_SR_INT_IE);
- return(~MIPS_INT_MASK_4); /* Keep clock interrupts enabled */
+ return (~MIPS_INT_MASK_4); /* Keep clock interrupts enabled */
}
/*
@@ -422,10 +448,10 @@
{
int vector;
- while((vector = inb(RD94_SYS_INTSTAT1) >> 2) != 0) {
+ while ((vector = inb(RD94_SYS_INTSTAT1) >> 2) != 0) {
(*int_table[vector].int_hand)(int_table[vector].param);
}
- return(~0); /* Dont reenable */
+ return (~0); /* Dont reenable */
}
/*
@@ -444,5 +470,5 @@
/* Re-enable clock interrupts */
splx(MIPS_INT_MASK_3 | MIPS_SR_INT_IE);
- return(~MIPS_INT_MASK_3); /* Keep clock interrupts enabled */
+ return (~MIPS_INT_MASK_3); /* Keep clock interrupts enabled */
}
diff -r 42655a6eb56d -r 8ac5f9a9c4e5 sys/arch/arc/jazz/osiop_jazzio.c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sys/arch/arc/jazz/osiop_jazzio.c Mon Apr 30 04:52:53 2001 +0000
@@ -0,0 +1,148 @@
+/* $NetBSD: osiop_jazzio.c,v 1.1 2001/04/30 04:52:54 tsutsui Exp $ */
+
+/*
+ * Copyright (c) 2001 Izumi Tsutsui. 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. 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 <sys/buf.h>
+#include <sys/malloc.h>
+
+#include <dev/scsipi/scsi_all.h>
+#include <dev/scsipi/scsipi_all.h>
+#include <dev/scsipi/scsiconf.h>
+
+#include <machine/cpu.h>
+#include <machine/autoconf.h>
+#include <machine/bus.h>
+
+#include <dev/ic/osiopreg.h>
+#include <dev/ic/osiopvar.h>
+
+#include <arc/jazz/jazziovar.h>
+
+int osiop_jazzio_match(struct device *, struct cfdata *, void *);
+void osiop_jazzio_attach(struct device *, struct device *, void *);
+int osiop_jazzio_intr(void *);
+
+struct cfattach osiop_jazzio_ca = {
+ sizeof(struct osiop_softc), osiop_jazzio_match, osiop_jazzio_attach
+};
+
+int
+osiop_jazzio_match(parent, match, aux)
+ struct device *parent;
+ struct cfdata *match;
+ void *aux;
+{
+ struct jazzio_attach_args *ja = aux;
+
+ if (strcmp(ja->ja_name, "osiop") != 0)
+ return (0);
+
+ return (1);
+}
+
+void
+osiop_jazzio_attach(parent, self, aux)
+ struct device *parent;
+ struct device *self;
+ void *aux;
+{
+ struct jazzio_attach_args *ja = aux;
+ struct osiop_softc *sc = (void *)self;
+ int err, scid;
+
+ sc->sc_bst = ja->ja_bust;
+ sc->sc_dmat = ja->ja_dmat;
+
+ /*
+ * Map registers
+ */
+ err = bus_space_map(sc->sc_bst, ja->ja_addr,
+ OSIOP_NREGS, 0, &sc->sc_reg);
+ if (err) {
+ printf("%s: failed to map registers, err=%d\n",
+ sc->sc_dev.dv_xname, err);
+ return;
+ }
+
Home |
Main Index |
Thread Index |
Old Index