From 6405ed07d709cbf884d3045b208ce9fe5197d8ff Mon Sep 17 00:00:00 2001 From: "Justin T. Gibbs" Date: Wed, 7 Oct 1998 03:40:51 +0000 Subject: [PATCH] ahc_pci.c: Disable DPARCKEN in the DSCOMMAND0 register on the aic7890/91/96/97. Parity checking is broken for some chip/MB combinations and this is the work around recommended by Adaptec. dpt_pci.c: Remove a superflous '{' that prevented DPT_ALLOW_MEMIO from working. pcireg.h: Add a definition for Parity Error Reponse bit in the PCI Space command register. --- sys/dev/aic7xxx/ahc_pci.c | 18 +++++++++++++----- sys/dev/dpt/dpt_pci.c | 4 ++-- sys/dev/pci/pcireg.h | 3 ++- sys/pci/ahc_pci.c | 18 +++++++++++++----- sys/pci/dpt_pci.c | 4 ++-- sys/pci/pcireg.h | 3 ++- 6 files changed, 34 insertions(+), 16 deletions(-) diff --git a/sys/dev/aic7xxx/ahc_pci.c b/sys/dev/aic7xxx/ahc_pci.c index 50d8efc5cb7b..344658de7a13 100644 --- a/sys/dev/aic7xxx/ahc_pci.c +++ b/sys/dev/aic7xxx/ahc_pci.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: ahc_pci.c,v 1.1 1998/09/15 07:25:33 gibbs Exp $ */ #include @@ -510,10 +510,14 @@ ahc_pci_attach(pcici_t config_id, int unit) { u_int dscommand0; + /* + * DPARCKEN doesn't work correctly on + * some MBs so don't use it. + */ id_string = "aic7896/97 "; dscommand0 = ahc_inb(ahc, DSCOMMAND0); - dscommand0 &= ~USCBSIZE32; - dscommand0 |= CACHETHEN|DPARCKEN|MPARCKEN; + dscommand0 &= ~(USCBSIZE32|DPARCKEN); + dscommand0 |= CACHETHEN|MPARCKEN; ahc_outb(ahc, DSCOMMAND0, dscommand0); break; } @@ -521,10 +525,14 @@ ahc_pci_attach(pcici_t config_id, int unit) { u_int dscommand0; + /* + * DPARCKEN doesn't work correctly on + * some MBs so don't use it. + */ id_string = "aic7890/91 "; dscommand0 = ahc_inb(ahc, DSCOMMAND0); - dscommand0 &= ~USCBSIZE32; - dscommand0 |= CACHETHEN|DPARCKEN|MPARCKEN; + dscommand0 &= ~(USCBSIZE32|DPARCKEN); + dscommand0 |= CACHETHEN|MPARCKEN; ahc_outb(ahc, DSCOMMAND0, dscommand0); break; } diff --git a/sys/dev/dpt/dpt_pci.c b/sys/dev/dpt/dpt_pci.c index 2e2e16b9b29d..7af9a2aece84 100644 --- a/sys/dev/dpt/dpt_pci.c +++ b/sys/dev/dpt/dpt_pci.c @@ -32,7 +32,7 @@ * dptpci.c: PCI Bus Attachment for DPT SCSI HBAs */ -#ident "$Id: dpt_pci.c,v 1.7 1998/08/05 00:54:37 eivind Exp $" +#ident "$Id: dpt_pci.c,v 1.8 1998/09/15 08:33:38 gibbs Exp $" #include "opt_devfs.h" #include "opt_dpt.h" @@ -126,7 +126,7 @@ dpt_pci_attach(pcici_t config_id, int unit) command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG); #ifdef DPT_ALLOW_MEMIO if ((command & PCI_COMMAND_MEM_ENABLE) == 0 - || (pci_map_mem(config_id, PCI_BASEADR1, &vaddr, &paddr)) == 0) { + || (pci_map_mem(config_id, PCI_BASEADR1, &vaddr, &paddr)) == 0) #endif if ((command & PCI_COMMAND_IO_ENABLE) == 0 || (pci_map_port(config_id, PCI_BASEADR0, &io_base)) == 0) diff --git a/sys/dev/pci/pcireg.h b/sys/dev/pci/pcireg.h index 9e8c85e34d5e..0adb5404021e 100644 --- a/sys/dev/pci/pcireg.h +++ b/sys/dev/pci/pcireg.h @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcireg.h,v 1.18 1997/06/01 16:00:43 peter Exp $ + * $Id: pcireg.h,v 1.19 1997/09/20 07:41:58 dyson Exp $ * */ @@ -56,6 +56,7 @@ #define PCIM_CMD_PORTEN 0x0001 #define PCIM_CMD_MEMEN 0x0002 #define PCIM_CMD_BUSMASTEREN 0x0004 +#define PCIM_CMD_PERRESPEN 0x0040 #define PCIR_STATUS 0x06 #define PCIR_REVID 0x08 #define PCIR_PROGIF 0x09 diff --git a/sys/pci/ahc_pci.c b/sys/pci/ahc_pci.c index 50d8efc5cb7b..344658de7a13 100644 --- a/sys/pci/ahc_pci.c +++ b/sys/pci/ahc_pci.c @@ -34,7 +34,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id$ + * $Id: ahc_pci.c,v 1.1 1998/09/15 07:25:33 gibbs Exp $ */ #include @@ -510,10 +510,14 @@ ahc_pci_attach(pcici_t config_id, int unit) { u_int dscommand0; + /* + * DPARCKEN doesn't work correctly on + * some MBs so don't use it. + */ id_string = "aic7896/97 "; dscommand0 = ahc_inb(ahc, DSCOMMAND0); - dscommand0 &= ~USCBSIZE32; - dscommand0 |= CACHETHEN|DPARCKEN|MPARCKEN; + dscommand0 &= ~(USCBSIZE32|DPARCKEN); + dscommand0 |= CACHETHEN|MPARCKEN; ahc_outb(ahc, DSCOMMAND0, dscommand0); break; } @@ -521,10 +525,14 @@ ahc_pci_attach(pcici_t config_id, int unit) { u_int dscommand0; + /* + * DPARCKEN doesn't work correctly on + * some MBs so don't use it. + */ id_string = "aic7890/91 "; dscommand0 = ahc_inb(ahc, DSCOMMAND0); - dscommand0 &= ~USCBSIZE32; - dscommand0 |= CACHETHEN|DPARCKEN|MPARCKEN; + dscommand0 &= ~(USCBSIZE32|DPARCKEN); + dscommand0 |= CACHETHEN|MPARCKEN; ahc_outb(ahc, DSCOMMAND0, dscommand0); break; } diff --git a/sys/pci/dpt_pci.c b/sys/pci/dpt_pci.c index 2e2e16b9b29d..7af9a2aece84 100644 --- a/sys/pci/dpt_pci.c +++ b/sys/pci/dpt_pci.c @@ -32,7 +32,7 @@ * dptpci.c: PCI Bus Attachment for DPT SCSI HBAs */ -#ident "$Id: dpt_pci.c,v 1.7 1998/08/05 00:54:37 eivind Exp $" +#ident "$Id: dpt_pci.c,v 1.8 1998/09/15 08:33:38 gibbs Exp $" #include "opt_devfs.h" #include "opt_dpt.h" @@ -126,7 +126,7 @@ dpt_pci_attach(pcici_t config_id, int unit) command = pci_conf_read(config_id, PCI_COMMAND_STATUS_REG); #ifdef DPT_ALLOW_MEMIO if ((command & PCI_COMMAND_MEM_ENABLE) == 0 - || (pci_map_mem(config_id, PCI_BASEADR1, &vaddr, &paddr)) == 0) { + || (pci_map_mem(config_id, PCI_BASEADR1, &vaddr, &paddr)) == 0) #endif if ((command & PCI_COMMAND_IO_ENABLE) == 0 || (pci_map_port(config_id, PCI_BASEADR0, &io_base)) == 0) diff --git a/sys/pci/pcireg.h b/sys/pci/pcireg.h index 9e8c85e34d5e..0adb5404021e 100644 --- a/sys/pci/pcireg.h +++ b/sys/pci/pcireg.h @@ -26,7 +26,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: pcireg.h,v 1.18 1997/06/01 16:00:43 peter Exp $ + * $Id: pcireg.h,v 1.19 1997/09/20 07:41:58 dyson Exp $ * */ @@ -56,6 +56,7 @@ #define PCIM_CMD_PORTEN 0x0001 #define PCIM_CMD_MEMEN 0x0002 #define PCIM_CMD_BUSMASTEREN 0x0004 +#define PCIM_CMD_PERRESPEN 0x0040 #define PCIR_STATUS 0x06 #define PCIR_REVID 0x08 #define PCIR_PROGIF 0x09