From 2f53429551d913b6f43b2c9c7401c56ee9544065 Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Sun, 7 Jan 1996 19:26:12 +0000 Subject: [PATCH] Write the cahesize and latency timer values back into configuration space (whoops!). Add a missing argument to the cachesize/lattime printf. Set the CACHETHEN bit in DSCommand. --- sys/pci/aic7870.c | 7 ++++++- sys/pci/ncr.c | 15 ++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/sys/pci/aic7870.c b/sys/pci/aic7870.c index 73ab551e4f05..60ceea49c3d7 100644 --- a/sys/pci/aic7870.c +++ b/sys/pci/aic7870.c @@ -19,7 +19,7 @@ * 4. Modifications may be freely made to this file if the above conditions * are met. * - * $Id: aic7870.c,v 1.20 1995/12/14 09:53:55 phk Exp $ + * $Id: aic7870.c,v 1.21 1996/01/03 06:34:10 gibbs Exp $ */ #include @@ -301,11 +301,16 @@ aic7870_attach(config_id, unit) if(bootverbose) printf("ahc%d: BurstLen = %dDWDs, " "Latency Timer = %dPCLKS\n", + unit, csize_lattime & CACHESIZE, (csize_lattime >> 8) & 0xff); + pci_conf_write(config_id, CSIZE_LATTIME, csize_lattime); } + /* Enable cache sized transfers, memory, and data parity checking */ + outb(DSCOMMAND + io_port, CACHETHEN|DPARCKEN|MPARCKEN); + if(!(ahc = ahc_alloc(unit, io_port, ahc_t, ahc_f))) return; /* XXX PCI code should take return status */ diff --git a/sys/pci/ncr.c b/sys/pci/ncr.c index 86883e48eed8..cd33a5045943 100644 --- a/sys/pci/ncr.c +++ b/sys/pci/ncr.c @@ -1,6 +1,6 @@ /************************************************************************** ** -** $Id: ncr.c,v 1.52 1995/12/16 00:27:44 bde Exp $ +** $Id: ncr.c,v 1.53 1995/12/28 13:04:03 se Exp $ ** ** Device driver for the NCR 53C810 PCI-SCSI-Controller. ** @@ -1249,7 +1249,7 @@ static void ncr_attach (pcici_t tag, int unit); static char ident[] = - "\n$Id: ncr.c,v 1.52 1995/12/16 00:27:44 bde Exp $\n"; + "\n$Id: ncr.c,v 1.53 1995/12/28 13:04:03 se Exp $\n"; static u_long ncr_version = NCR_VERSION * 11 + (u_long) sizeof (struct ncb) * 7 @@ -1259,9 +1259,6 @@ static u_long ncr_version = NCR_VERSION * 11 #ifdef KERNEL -#ifndef __NetBSD__ -static ncb_p ncrp [MAX_UNITS]; -#endif /* !__NetBSD__ */ static int ncr_debug = SCSI_DEBUG_FLAGS; SYSCTL_INT(_debug, OID_AUTO, ncr_debug, CTLFLAG_RW, &ncr_debug, 0, ""); @@ -3267,7 +3264,6 @@ static void ncr_attach (pcici_t config_id, int unit) if (!np) { np = (ncb_p) malloc (sizeof (struct ncb), M_DEVBUF, M_WAITOK); if (!np) return; - ncrp[unit]=np; } /* @@ -3431,6 +3427,7 @@ static void ncr_attach (pcici_t config_id, int unit) np->sc_link.openings = 1; #else /* !__NetBSD__ */ np->sc_link.adapter_unit = unit; + np->sc_link.adapter_softc = np; np->sc_link.adapter_targ = np->myaddr; np->sc_link.fordriver = 0; #endif /* !__NetBSD__ */ @@ -3535,11 +3532,7 @@ ncr_intr(vnp) static INT32 ncr_start (struct scsi_xfer * xp) { -#ifdef __NetBSD__ - ncb_p np = xp->sc_link->adapter_softc; -#else /*__NetBSD__*/ - ncb_p np = ncrp[xp->sc_link->adapter_unit]; -#endif/*__NetBSD__*/ + ncb_p np = (ncb_p) xp->sc_link->adapter_softc; struct scsi_generic * cmd = xp->cmd; ccb_p cp;