Add MD attachments for the Symbios/NCR 53c710 SCSI controller,

found on the NEC Express5800/230A.
This commit is contained in:
tsutsui 2001-04-30 04:52:53 +00:00
parent 0ceded7d3b
commit cdd9dc4e09
5 changed files with 210 additions and 25 deletions

View File

@ -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 @@ sn0 at jazzio?
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

View File

@ -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 @@ device asc: scsi
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

View File

@ -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 @@ struct pica_dev nec_rd94_cpu[] = {
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 @@ struct pica_dev nec_rd94_cpu[] = {
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 @@ struct pica_dev *pica_cpu_devs[] = {
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 @@ jazzioattach(parent, self, aux)
/* 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 @@ jazzio_intr_establish(slot, handler, val)
{
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 @@ jazzio_intr_establish(slot, handler, val)
}
}
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 @@ void
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 @@ pica_iointr(mask, cf)
{
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 @@ pica_clkintr(mask, cf)
/* 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 @@ rd94_iointr(mask, cf)
{
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 @@ rd94_clkintr(mask, cf)
/* 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 */
}

View File

@ -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;
}
sc->sc_clock_freq = 50; /* MHz */
sc->sc_ctest7 = 0; /* | OSIOP_CTEST7_TT1 */
sc->sc_dcntl = OSIOP_DCNTL_EA;
/* XXX should check ID in BIOS variables? */
scid = ffs(osiop_read_1(sc, OSIOP_SCID));
if (scid == 0)
scid = 7;
else
scid--;
sc->sc_id = scid;
/*
* Call common attachment
*/
osiop_attach(sc);
/*
* Set up interrupt handler.
*/
jazzio_intr_establish(ja->ja_intr,
(intr_handler_t)osiop_jazzio_intr, sc);
}
/*
* interrupt handler
*/
int
osiop_jazzio_intr(arg)
void *arg;
{
struct osiop_softc *sc = arg;
u_int8_t istat;
/* This is potentially nasty, since the IRQ is level triggered... */
if (sc->sc_flags & OSIOP_INTSOFF)
return (0);
istat = osiop_read_1(sc, OSIOP_ISTAT);
if ((istat & (OSIOP_ISTAT_SIP | OSIOP_ISTAT_DIP)) == 0)
return (0);
/* Save interrupt details for the back-end interrupt handler */
sc->sc_sstat0 = osiop_read_1(sc, OSIOP_SSTAT0);
sc->sc_istat = istat;
sc->sc_dstat = osiop_read_1(sc, OSIOP_DSTAT);
/* Deal with the interrupt */
osiop_intr(sc);
return (1);
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: rd94.h,v 1.2 2001/03/30 09:10:49 ur Exp $ */
/* $NetBSD: rd94.h,v 1.3 2001/04/30 04:52:54 tsutsui Exp $ */
/* $OpenBSD: pica.h,v 1.4 1996/09/14 15:58:28 pefo Exp $ */
/*
@ -76,7 +76,8 @@
#define RD94LB RD94_V_LOCAL_IO_BASE
#define RD94_SYS_SONIC (RD94LB+0x1000) /* SONIC base address */
#define RD94_SYS_SCSI (RD94LB+0x2000) /* SCSI base address */
#define RD94_SYS_SCSI0 (RD94LB+0x2000) /* SCSI0 base address */
#define RD94_SYS_SCSI1 (RD94LB+0x3000) /* SCSI1 base address */
#define RD94_SYS_CLOCK (RD94LB+0x4000) /* Clock base address */
#define RD94_SYS_KBD (RD94LB+0x5000) /* Keybrd/mouse base address */
#define RD94_SYS_COM1 (RD94LB+0x6000) /* Com port 1 */
@ -96,7 +97,8 @@
#define RD94_SYS_LB_IE_FLOPPY 0x0002 /* Floppy ctrl enable */
#define RD94_SYS_LB_IE_SOUND 0x0004 /* Sound port enable */
#define RD94_SYS_LB_IE_SONIC 0x0008 /* Ethernet ctrl enable */
#define RD94_SYS_LB_IE_SCSI 0x0010 /* Scsi crtl enable */
#define RD94_SYS_LB_IE_SCSI0 0x0010 /* Scsi0 crtl enable */
#define RD94_SYS_LB_IE_SCSI1 0x0020 /* Scsi1 crtl enable */
#define RD94_SYS_LB_IE_KBD 0x0040 /* Keyboard ctrl enable */
#define RD94_SYS_LB_IE_MOUSE 0x0080 /* Mouse ctrl enable */
#define RD94_SYS_LB_IE_COM1 0x0100 /* Serial port 1 enable */