Add a "sc_rev" member to ncr5380_softc and handle CXD1180 quirk
in MI ncr5380sbc.
This commit is contained in:
parent
807350797d
commit
9100212ef0
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: csa.c,v 1.6 2000/03/18 16:16:12 mycroft Exp $ */
|
||||
/* $NetBSD: csa.c,v 1.7 2000/03/25 15:27:54 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -170,6 +170,8 @@ csa_attach(parent, self, aux)
|
||||
sc->sc_ncr5380.sci_r6 = iobase + 24;
|
||||
sc->sc_ncr5380.sci_r7 = iobase + 28;
|
||||
|
||||
sc->sc_ncr5380.sc_rev = NCR_VARIANT_NCR5380;
|
||||
|
||||
sc->sc_ctrl = (u_char *)pa->pa_podule->slow_base + CSA_CTRL_OFFSET;
|
||||
sc->sc_status = (u_char *)pa->pa_podule->slow_base + CSA_STAT_OFFSET;
|
||||
sc->sc_data = (u_char *)pa->pa_podule->slow_base + CSA_DATA_OFFSET;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: oak.c,v 1.17 2000/03/18 16:13:22 mycroft Exp $ */
|
||||
/* $NetBSD: oak.c,v 1.18 2000/03/25 15:27:54 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
@ -146,7 +146,9 @@ oak_attach(parent, self, aux)
|
||||
sc->sc_ncr5380.sci_r5 = iobase + 20;
|
||||
sc->sc_ncr5380.sci_r6 = iobase + 24;
|
||||
sc->sc_ncr5380.sci_r7 = iobase + 28;
|
||||
|
||||
|
||||
sc->sc_ncr5380.sc_rev = NCR_VARIANT_NCR5380;
|
||||
|
||||
sc->sc_ncr5380.sc_pio_in = ncr5380_pio_in;
|
||||
sc->sc_ncr5380.sc_pio_out = ncr5380_pio_out;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: sbc_obio.c,v 1.12 2000/03/18 16:14:57 mycroft Exp $ */
|
||||
/* $NetBSD: sbc_obio.c,v 1.13 2000/03/25 15:27:55 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (C) 1996,1997 Scott Reynolds. All rights reserved.
|
||||
@ -171,6 +171,8 @@ sbc_obio_attach(parent, self, args)
|
||||
ncr_sc->sci_r6 = &sc->sc_regs->sci_pr6.sci_reg;
|
||||
ncr_sc->sci_r7 = &sc->sc_regs->sci_pr7.sci_reg;
|
||||
|
||||
ncr_sc->sc_rev = NCR_VARIANT_NCR5380;
|
||||
|
||||
/*
|
||||
* MD function pointers used by the MI code.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
# $NetBSD: files.news68k,v 1.4 2000/03/15 17:08:40 soren Exp $
|
||||
# $NetBSD: files.news68k,v 1.5 2000/03/25 15:27:55 tsutsui Exp $
|
||||
|
||||
# NEWS68K-specific configuration info
|
||||
|
||||
@ -112,11 +112,8 @@ major { cd = 16 }
|
||||
major { st = 17 }
|
||||
|
||||
# Sony CXD1180 SCSI controller
|
||||
# XXX should use MI driver...
|
||||
#device si: scsi, ncr5380sbc
|
||||
device si: scsi
|
||||
device si: scsi, ncr5380sbc
|
||||
file arch/news68k/dev/si.c si needs-flag
|
||||
file arch/news68k/dev/ncr5380sbc.c si
|
||||
attach si at hb
|
||||
|
||||
# memory disk
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: si.c,v 1.4 2000/03/19 16:28:04 tsutsui Exp $ */
|
||||
/* $NetBSD: si.c,v 1.5 2000/03/25 15:27:55 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -179,6 +179,8 @@ si_attach(parent, self, aux)
|
||||
ncr_sc->sci_r6 = addr + 6;
|
||||
ncr_sc->sci_r7 = addr + 7;
|
||||
|
||||
ncr_sc->sc_rev = NCR_VARIANT_CXD1180;
|
||||
|
||||
ncr_sc->sc_pio_in = ncr5380_pio_in;
|
||||
ncr_sc->sc_pio_out = ncr5380_pio_out;
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ncr.c,v 1.44 2000/03/18 16:13:24 mycroft Exp $ */
|
||||
/* $NetBSD: ncr.c,v 1.45 2000/03/25 15:27:56 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1996, 1997 Matthias Pfaller.
|
||||
@ -136,6 +136,8 @@ ncr_attach(parent, self, aux)
|
||||
sc->sci_r6 = NCR5380 + 6;
|
||||
sc->sci_r7 = NCR5380 + 7;
|
||||
|
||||
sc->sc_rev = NCR_VARIANT_DP8490;
|
||||
|
||||
/*
|
||||
* We only have to set the sc_pio_in and sc_pio_out
|
||||
* function pointers. The rest of the MD functions are
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: si.c,v 1.56 2000/03/18 16:13:25 mycroft Exp $ */
|
||||
/* $NetBSD: si.c,v 1.57 2000/03/25 15:27:56 tsutsui Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -449,6 +449,8 @@ si_attach_common(parent, sc)
|
||||
ncr_sc->sci_r6 = ®s->sci.sci_r6;
|
||||
ncr_sc->sci_r7 = ®s->sci.sci_r7;
|
||||
|
||||
ncr_sc->sc_rev = NCR_VARIANT_NCR5380;
|
||||
|
||||
/*
|
||||
* MD function pointers used by the MI code.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: si.c,v 1.47 2000/03/18 16:13:25 mycroft Exp $ */
|
||||
/* $NetBSD: si.c,v 1.48 2000/03/25 15:27:57 tsutsui Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -170,6 +170,8 @@ si_attach(sc)
|
||||
ncr_sc->sci_r6 = ®s->sci.sci_r6;
|
||||
ncr_sc->sci_r7 = ®s->sci.sci_r7;
|
||||
|
||||
ncr_sc->sc_rev = NCR_VARIANT_NCR5380;
|
||||
|
||||
/*
|
||||
* Allocate DMA handles.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: si_sebuf.c,v 1.10 2000/03/18 16:13:25 mycroft Exp $ */
|
||||
/* $NetBSD: si_sebuf.c,v 1.11 2000/03/25 15:27:57 tsutsui Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -263,6 +263,8 @@ se_attach(parent, self, args)
|
||||
ncr_sc->sci_r6 = ®s->ncrregs[6];
|
||||
ncr_sc->sci_r7 = ®s->ncrregs[7];
|
||||
|
||||
ncr_sc->sc_rev = NCR_VARIANT_NCR5380;
|
||||
|
||||
/*
|
||||
* Allocate DMA handles.
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ncr.c,v 1.25 2000/03/18 16:13:26 mycroft Exp $ */
|
||||
/* $NetBSD: ncr.c,v 1.26 2000/03/25 15:27:57 tsutsui Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1996 The NetBSD Foundation, Inc.
|
||||
@ -202,6 +202,8 @@ si_attach(parent, self, aux)
|
||||
ncr_sc->sci_r6 = 24;
|
||||
ncr_sc->sci_r7 = 28;
|
||||
|
||||
ncr_sc->sc_rev = NCR_VARIANT_NCR5380;
|
||||
|
||||
ncr_sc->sc_no_disconnect = 0xff;
|
||||
|
||||
ncr_sc->sc_link.scsipi_scsi.adapter_target = 7;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ncr5380sbc.c,v 1.34 2000/03/23 07:01:32 thorpej Exp $ */
|
||||
/* $NetBSD: ncr5380sbc.c,v 1.35 2000/03/25 15:27:57 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 David Jones, Gordon W. Ross
|
||||
@ -1072,7 +1072,7 @@ ncr5380_reselect(sc)
|
||||
struct sci_req *sr;
|
||||
int target, lun, phase, timo;
|
||||
int target_mask;
|
||||
u_char bus, data, icmd, msg;
|
||||
u_char bus, data, icmd, mode, msg;
|
||||
|
||||
#ifdef DIAGNOSTIC
|
||||
/*
|
||||
@ -1238,10 +1238,14 @@ ncr5380_reselect(sc)
|
||||
/* XXX: Restore the normal mode register. */
|
||||
/* If this target's bit is set, do NOT check parity. */
|
||||
if (sc->sc_parity_disable & target_mask)
|
||||
NCR5380_WRITE(sc, sci_mode, SCI_MODE_MONBSY);
|
||||
mode = SCI_MODE_MONBSY;
|
||||
else
|
||||
NCR5380_WRITE(sc, sci_mode,
|
||||
(SCI_MODE_MONBSY | SCI_MODE_PAR_CHK));
|
||||
mode = SCI_MODE_MONBSY | SCI_MODE_PAR_CHK;
|
||||
/* XXX CXD1180 asserts MONBSY before disconnect */
|
||||
if (sc->sc_rev == NCR_VARIANT_CXD1180)
|
||||
mode &= ~SCI_MODE_MONBSY;
|
||||
|
||||
NCR5380_WRITE(sc, sci_mode, mode);
|
||||
|
||||
/*
|
||||
* Another hack for the Sun3 "si", which needs
|
||||
@ -1306,7 +1310,7 @@ ncr5380_select(sc, sr)
|
||||
struct sci_req *sr;
|
||||
{
|
||||
int timo, s, target_mask;
|
||||
u_char data, icmd;
|
||||
u_char data, icmd, mode;
|
||||
|
||||
/* Check for reselect */
|
||||
ncr5380_reselect(sc);
|
||||
@ -1405,7 +1409,9 @@ ncr5380_select(sc, sr)
|
||||
* there can be a higher selection ID than ours.
|
||||
* Keep this code for reference anyway...
|
||||
*/
|
||||
if (NCR5380_READ(sc, sci_icmd) & SCI_ICMD_LST) {
|
||||
/* XXX CXD1180 asserts LST here */
|
||||
if ((sc->sc_rev != NCR_VARIANT_CXD1180) &&
|
||||
(NCR5380_READ(sc, sci_icmd) & SCI_ICMD_LST)) {
|
||||
/* Some other target asserted SEL. */
|
||||
NCR_TRACE("select: lost two, rc=%d\n", XS_BUSY);
|
||||
|
||||
@ -1493,10 +1499,14 @@ success:
|
||||
|
||||
/* If this target's bit is set, do NOT check parity. */
|
||||
if (sc->sc_parity_disable & target_mask)
|
||||
NCR5380_WRITE(sc, sci_mode, SCI_MODE_MONBSY);
|
||||
mode = SCI_MODE_MONBSY;
|
||||
else
|
||||
NCR5380_WRITE(sc, sci_mode,
|
||||
(SCI_MODE_MONBSY | SCI_MODE_PAR_CHK));
|
||||
mode = SCI_MODE_MONBSY | SCI_MODE_PAR_CHK;
|
||||
/* XXX CXD1180 asserts MONBSY before disconnect */
|
||||
if (sc->sc_rev == NCR_VARIANT_CXD1180)
|
||||
mode &= ~SCI_MODE_MONBSY;
|
||||
|
||||
NCR5380_WRITE(sc, sci_mode, mode);
|
||||
|
||||
return XS_NOERROR;
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: ncr5380var.h,v 1.17 2000/03/18 17:14:35 mycroft Exp $ */
|
||||
/* $NetBSD: ncr5380var.h,v 1.18 2000/03/25 15:27:57 tsutsui Exp $ */
|
||||
|
||||
/*
|
||||
* Copyright (c) 1995 David Jones, Gordon W. Ross
|
||||
@ -209,6 +209,12 @@ struct ncr5380_softc {
|
||||
u_char *sc_omp; /* Outgoing message pointer */
|
||||
u_char sc_imess[NCR_MAX_MSG_LEN];
|
||||
u_char *sc_imp; /* Incoming message pointer */
|
||||
int sc_rev; /* Chip revision */
|
||||
#define NCR_VARIANT_NCR5380 0
|
||||
#define NCR_VARIANT_DP8490 1
|
||||
#define NCR_VARIANT_NCR53C400 2
|
||||
#define NCR_VARIANT_PAS16 3
|
||||
#define NCR_VARIANT_CXD1180 4
|
||||
|
||||
};
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nca_isa.c,v 1.5 2000/03/18 17:14:35 mycroft Exp $ */
|
||||
/* $NetBSD: nca_isa.c,v 1.6 2000/03/25 15:27:58 tsutsui Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998, 2000 The NetBSD Foundation, Inc.
|
||||
@ -348,6 +348,7 @@ nca_isa_attach(parent, self, aux)
|
||||
sc->sci_r5 = 5;
|
||||
sc->sci_r6 = 6;
|
||||
sc->sci_r7 = 7;
|
||||
sc->sc_rev = NCR_VARIANT_NCR5380;
|
||||
break;
|
||||
case CTLR_NCR_53C400:
|
||||
printf("%s: NCR 53C400 detected\n", sc->sc_dev.dv_xname);
|
||||
@ -359,9 +360,11 @@ nca_isa_attach(parent, self, aux)
|
||||
sc->sci_r5 = C400_5380_REG_OFFSET + 5;
|
||||
sc->sci_r6 = C400_5380_REG_OFFSET + 6;
|
||||
sc->sci_r7 = C400_5380_REG_OFFSET + 7;
|
||||
sc->sc_rev = NCR_VARIANT_NCR53C400;
|
||||
break;
|
||||
case CTLR_PAS16:
|
||||
printf("%s: ProAudio Spectrum 16 detected\n", sc->sc_dev.dv_xname);
|
||||
sc->sc_rev = NCR_VARIANT_PAS16;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: nca_pcmcia.c,v 1.2 2000/03/18 21:11:16 mycroft Exp $ */
|
||||
/* $NetBSD: nca_pcmcia.c,v 1.3 2000/03/25 15:27:58 tsutsui Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 2000 The NetBSD Foundation, Inc.
|
||||
@ -175,6 +175,8 @@ nca_pcmcia_attach(parent, self, aux)
|
||||
sc->sci_r6 = C400_5380_REG_OFFSET + 6;
|
||||
sc->sci_r7 = C400_5380_REG_OFFSET + 7;
|
||||
|
||||
sc->sc_rev = NCR_VARIANT_NCR53C400;
|
||||
|
||||
/*
|
||||
* MD function pointers used by the MI code.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user