Commit e69dc6dc authored by Justin T. Gibbs's avatar Justin T. Gibbs

aic7xxx and aic79xx driver updates:

	o Correct memory mapped I/O test for legacy controllers
	  that do not have the "auto-access-pause" feature.
	o Prevent NMIs from triggering should the MMAP I/O test fail.
	o Fix aic7770 (EISA/VLB) controller regression.
	o Kill a few compiler warnings.
parent e8cc7930
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#100 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.h#102 $
* *
*/ */
#ifndef _AIC79XX_LINUX_H_ #ifndef _AIC79XX_LINUX_H_
...@@ -288,7 +288,7 @@ ahd_scb_timer_reset(struct scb *scb, u_int usec) ...@@ -288,7 +288,7 @@ ahd_scb_timer_reset(struct scb *scb, u_int usec)
#include <linux/smp.h> #include <linux/smp.h>
#endif #endif
#define AIC79XX_DRIVER_VERSION "1.3.0.ALPHA6" #define AIC79XX_DRIVER_VERSION "1.3.0.BETA2"
/**************************** Front End Queues ********************************/ /**************************** Front End Queues ********************************/
/* /*
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#19 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm_pci.c#20 $
*/ */
#include "aic79xx_osm.h" #include "aic79xx_osm.h"
...@@ -170,6 +170,9 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -170,6 +170,9 @@ ahd_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ahd->platform_data->hw_dma_mask = ahd->platform_data->hw_dma_mask =
(bus_addr_t)(0x7FFFFFFFFFULL & (bus_addr_t)~0); (bus_addr_t)(0x7FFFFFFFFFULL & (bus_addr_t)~0);
} }
} else {
ahd_pci_set_dma_mask(pdev, 0xFFFFFFFF);
ahd->platform_data->hw_dma_mask = 0xFFFFFFFF;
} }
#endif #endif
ahd->dev_softc = pci; ahd->dev_softc = pci;
......
...@@ -38,7 +38,7 @@ ...@@ -38,7 +38,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#60 $ * $Id: //depot/aic7xxx/aic7xxx/aic79xx_pci.c#61 $
* *
* $FreeBSD$ * $FreeBSD$
*/ */
...@@ -379,15 +379,20 @@ int ...@@ -379,15 +379,20 @@ int
ahd_pci_test_register_access(struct ahd_softc *ahd) ahd_pci_test_register_access(struct ahd_softc *ahd)
{ {
ahd_mode_state saved_modes; ahd_mode_state saved_modes;
uint32_t cmd;
int error; int error;
uint8_t seqctl; uint8_t hcntrl;
saved_modes = ahd_save_modes(ahd); saved_modes = ahd_save_modes(ahd);
error = EIO; error = EIO;
/* Enable PCI error interrupt status */ /*
seqctl = ahd_inb(ahd, SEQCTL0); * Enable PCI error interrupt status, but suppress NMIs
ahd_outb(ahd, SEQCTL0, seqctl & ~FAILDIS); * generated by SERR raised due to target aborts.
*/
cmd = ahd_pci_read_config(ahd->dev_softc, PCIR_COMMAND, /*bytes*/2);
ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND,
cmd & ~PCIM_CMD_SERRESPEN, /*bytes*/2);
/* /*
* First a simple test to see if any * First a simple test to see if any
...@@ -397,7 +402,8 @@ ahd_pci_test_register_access(struct ahd_softc *ahd) ...@@ -397,7 +402,8 @@ ahd_pci_test_register_access(struct ahd_softc *ahd)
* be zero so it is a good register to * be zero so it is a good register to
* use for this test. * use for this test.
*/ */
if (ahd_inb(ahd, HCNTRL) == 0xFF) hcntrl = ahd_inb(ahd, HCNTRL);
if (hcntrl == 0xFF)
goto fail; goto fail;
/* /*
...@@ -407,6 +413,10 @@ ahd_pci_test_register_access(struct ahd_softc *ahd) ...@@ -407,6 +413,10 @@ ahd_pci_test_register_access(struct ahd_softc *ahd)
* either, so look for data corruption and/or flaged * either, so look for data corruption and/or flaged
* PCI errors. * PCI errors.
*/ */
ahd_outb(ahd, HCNTRL, hcntrl|PAUSE);
while (ahd_is_paused(ahd) == 0)
;
ahd_outb(ahd, SEQCTL0, PERRORDIS);
ahd_outl(ahd, SRAM_BASE, 0x5aa555aa); ahd_outl(ahd, SRAM_BASE, 0x5aa555aa);
if (ahd_inl(ahd, SRAM_BASE) != 0x5aa555aa) if (ahd_inl(ahd, SRAM_BASE) != 0x5aa555aa)
goto fail; goto fail;
...@@ -440,7 +450,8 @@ ahd_pci_test_register_access(struct ahd_softc *ahd) ...@@ -440,7 +450,8 @@ ahd_pci_test_register_access(struct ahd_softc *ahd)
} }
ahd_restore_modes(ahd, saved_modes); ahd_restore_modes(ahd, saved_modes);
ahd_outb(ahd, SEQCTL0, seqctl); ahd_outb(ahd, SEQCTL0, PERRORDIS|FAILDIS);
ahd_pci_write_config(ahd->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
return (error); return (error);
} }
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#66 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.h#67 $
* *
* $FreeBSD$ * $FreeBSD$
*/ */
...@@ -1053,7 +1053,6 @@ struct ahc_softc { ...@@ -1053,7 +1053,6 @@ struct ahc_softc {
u_int pci_cachesize; u_int pci_cachesize;
u_int stack_size; u_int stack_size;
uint16_t *saved_stack;
/* Per-Unit descriptive information */ /* Per-Unit descriptive information */
const char *description; const char *description;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
* *
* $FreeBSD$ * $FreeBSD$
*/ */
VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#36 $" VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#37 $"
/* /*
* This file is processed by the aic7xxx_asm utility for use in assembling * This file is processed by the aic7xxx_asm utility for use in assembling
...@@ -673,6 +673,8 @@ register STACK { ...@@ -673,6 +673,8 @@ register STACK {
access_mode RO access_mode RO
} }
const STACK_SIZE 4
/* /*
* Board Control (p. 3-43) * Board Control (p. 3-43)
*/ */
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
* $FreeBSD$ * $FreeBSD$
*/ */
VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#52 $" VERSION = "$Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#53 $"
PATCH_ARG_LIST = "struct ahc_softc *ahc" PATCH_ARG_LIST = "struct ahc_softc *ahc"
PREFIX = "ahc_" PREFIX = "ahc_"
...@@ -70,7 +70,7 @@ bus_free_sel: ...@@ -70,7 +70,7 @@ bus_free_sel:
* Turn off the selection hardware. We need to reset the * Turn off the selection hardware. We need to reset the
* selection request in order to perform a new selection. * selection request in order to perform a new selection.
*/ */
and SCSISEQ, TEMODE|ENSELI|ENRSELI|ENAUTOATNP, SCSISEQ; and SCSISEQ, TEMODE|ENSELI|ENRSELI|ENAUTOATNP;
and SIMODE1, ~ENBUSFREE; and SIMODE1, ~ENBUSFREE;
poll_for_work: poll_for_work:
call clear_target_state; call clear_target_state;
......
...@@ -37,7 +37,7 @@ ...@@ -37,7 +37,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#107 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.c#108 $
* *
* $FreeBSD$ * $FreeBSD$
*/ */
...@@ -230,7 +230,6 @@ static int ahc_check_patch(struct ahc_softc *ahc, ...@@ -230,7 +230,6 @@ static int ahc_check_patch(struct ahc_softc *ahc,
u_int start_instr, u_int *skip_addr); u_int start_instr, u_int *skip_addr);
static void ahc_download_instr(struct ahc_softc *ahc, static void ahc_download_instr(struct ahc_softc *ahc,
u_int instrptr, uint8_t *dconsts); u_int instrptr, uint8_t *dconsts);
static int ahc_probe_stack_size(struct ahc_softc *ahc);
#ifdef AHC_TARGET_MODE #ifdef AHC_TARGET_MODE
static void ahc_queue_lstate_event(struct ahc_softc *ahc, static void ahc_queue_lstate_event(struct ahc_softc *ahc,
struct ahc_tmode_lstate *lstate, struct ahc_tmode_lstate *lstate,
...@@ -1166,6 +1165,13 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) ...@@ -1166,6 +1165,13 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
ahc_name(ahc), scbptr, scb_index); ahc_name(ahc), scbptr, scb_index);
ahc_dump_card_state(ahc); ahc_dump_card_state(ahc);
} else { } else {
#ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_SELTO) != 0) {
ahc_print_path(ahc, scb);
printf("Saw Selection Timeout for SCB 0x%x\n",
scb_index);
}
#endif
/* /*
* Force a renegotiation with this target just in * Force a renegotiation with this target just in
* case the cable was pulled and will later be * case the cable was pulled and will later be
...@@ -1178,13 +1184,6 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat) ...@@ -1178,13 +1184,6 @@ ahc_handle_scsiint(struct ahc_softc *ahc, u_int intstat)
ahc_force_renegotiation(ahc); ahc_force_renegotiation(ahc);
ahc_set_transaction_status(scb, CAM_SEL_TIMEOUT); ahc_set_transaction_status(scb, CAM_SEL_TIMEOUT);
ahc_freeze_devq(ahc, scb); ahc_freeze_devq(ahc, scb);
#ifdef AHC_DEBUG
if ((ahc_debug & AHC_SHOW_SELTO) != 0) {
ahc_print_path(ahc, scb);
printf("Saw Selection Timeout for SCB 0x%x\n",
scb_index);
}
#endif
} }
ahc_outb(ahc, CLRINT, CLRSCSIINT); ahc_outb(ahc, CLRINT, CLRSCSIINT);
ahc_restart(ahc); ahc_restart(ahc);
...@@ -4005,8 +4004,6 @@ ahc_free(struct ahc_softc *ahc) ...@@ -4005,8 +4004,6 @@ ahc_free(struct ahc_softc *ahc)
free(ahc->name, M_DEVBUF); free(ahc->name, M_DEVBUF);
if (ahc->seep_config != NULL) if (ahc->seep_config != NULL)
free(ahc->seep_config, M_DEVBUF); free(ahc->seep_config, M_DEVBUF);
if (ahc->saved_stack != NULL)
free(ahc->saved_stack, M_DEVBUF);
#ifndef __FreeBSD__ #ifndef __FreeBSD__
free(ahc, M_DEVBUF); free(ahc, M_DEVBUF);
#endif #endif
...@@ -4542,12 +4539,6 @@ ahc_init(struct ahc_softc *ahc) ...@@ -4542,12 +4539,6 @@ ahc_init(struct ahc_softc *ahc)
size_t driver_data_size; size_t driver_data_size;
uint32_t physaddr; uint32_t physaddr;
ahc->stack_size = ahc_probe_stack_size(ahc);
ahc->saved_stack = malloc(ahc->stack_size * sizeof(uint16_t),
M_DEVBUF, M_NOWAIT);
if (ahc->saved_stack == NULL)
return (ENOMEM);
#ifdef AHC_DEBUG_SEQUENCER #ifdef AHC_DEBUG_SEQUENCER
ahc->flags |= AHC_SEQUENCER_DEBUG; ahc->flags |= AHC_SEQUENCER_DEBUG;
#endif #endif
...@@ -6657,41 +6648,6 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts) ...@@ -6657,41 +6648,6 @@ ahc_download_instr(struct ahc_softc *ahc, u_int instrptr, uint8_t *dconsts)
} }
} }
static int
ahc_probe_stack_size(struct ahc_softc *ahc)
{
int last_probe;
last_probe = 0;
while (1) {
int i;
/*
* We avoid using 0 as a pattern to avoid
* confusion if the stack implementation
* "back-fills" with zeros when "poping'
* entries.
*/
for (i = 1; i <= last_probe+1; i++) {
ahc_outb(ahc, STACK, i & 0xFF);
ahc_outb(ahc, STACK, (i >> 8) & 0xFF);
}
/* Verify */
for (i = last_probe+1; i > 0; i--) {
u_int stack_entry;
stack_entry = ahc_inb(ahc, STACK)
|(ahc_inb(ahc, STACK) << 8);
if (stack_entry != i)
goto sized;
}
last_probe++;
}
sized:
return (last_probe);
}
int int
ahc_print_register(ahc_reg_parse_entry_t *table, u_int num_entries, ahc_print_register(ahc_reg_parse_entry_t *table, u_int num_entries,
const char *name, u_int address, u_int value, const char *name, u_int address, u_int value,
...@@ -6770,6 +6726,7 @@ ahc_dump_card_state(struct ahc_softc *ahc) ...@@ -6770,6 +6726,7 @@ ahc_dump_card_state(struct ahc_softc *ahc)
cur_col = 0; cur_col = 0;
if ((ahc->features & AHC_DT) != 0) if ((ahc->features & AHC_DT) != 0)
ahc_scsisigi_print(ahc_inb(ahc, SCSISIGI), &cur_col, 50); ahc_scsisigi_print(ahc_inb(ahc, SCSISIGI), &cur_col, 50);
ahc_error_print(ahc_inb(ahc, ERROR), &cur_col, 50);
ahc_scsiphase_print(ahc_inb(ahc, SCSIPHASE), &cur_col, 50); ahc_scsiphase_print(ahc_inb(ahc, SCSIPHASE), &cur_col, 50);
ahc_scsibusl_print(ahc_inb(ahc, SCSIBUSL), &cur_col, 50); ahc_scsibusl_print(ahc_inb(ahc, SCSIBUSL), &cur_col, 50);
ahc_lastphase_print(ahc_inb(ahc, LASTPHASE), &cur_col, 50); ahc_lastphase_print(ahc_inb(ahc, LASTPHASE), &cur_col, 50);
...@@ -6789,11 +6746,8 @@ ahc_dump_card_state(struct ahc_softc *ahc) ...@@ -6789,11 +6746,8 @@ ahc_dump_card_state(struct ahc_softc *ahc)
if (cur_col != 0) if (cur_col != 0)
printf("\n"); printf("\n");
printf("STACK:"); printf("STACK:");
for (i = 0; i < ahc->stack_size; i++) { for (i = 0; i < STACK_SIZE; i++)
ahc->saved_stack[i] = printf(" 0x%x", ahc_inb(ahc, STACK)|(ahc_inb(ahc, STACK) << 8));
ahc_inb(ahc, STACK)|(ahc_inb(ahc, STACK) << 8);
printf(" 0x%x", ahc->saved_stack[i]);
}
printf("\nSCB count = %d\n", ahc->scb_data->numscbs); printf("\nSCB count = %d\n", ahc->scb_data->numscbs);
printf("Kernel NEXTQSCB = %d\n", ahc->next_queued_scb->hscb->tag); printf("Kernel NEXTQSCB = %d\n", ahc->next_queued_scb->hscb->tag);
printf("Card NEXTQSCB = %d\n", ahc_inb(ahc, NEXT_QUEUED_SCB)); printf("Card NEXTQSCB = %d\n", ahc_inb(ahc, NEXT_QUEUED_SCB));
......
/* /*
* Adaptec AIC7xxx device driver for Linux. * Adaptec AIC7xxx device driver for Linux.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#167 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#169 $
* *
* Copyright (c) 1994 John Aycock * Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science. * The University of Calgary Department of Computer Science.
...@@ -576,6 +576,7 @@ static void ahc_linux_run_device_queue(struct ahc_softc*, ...@@ -576,6 +576,7 @@ static void ahc_linux_run_device_queue(struct ahc_softc*,
static void ahc_linux_setup_tag_info(char *p, char *end, char *s); static void ahc_linux_setup_tag_info(char *p, char *end, char *s);
static void ahc_linux_setup_tag_info_global(char *p); static void ahc_linux_setup_tag_info_global(char *p);
static void ahc_linux_setup_dv(char *p, char *end, char *s); static void ahc_linux_setup_dv(char *p, char *end, char *s);
static int aic7xxx_setup(char *s);
static int ahc_linux_next_unit(void); static int ahc_linux_next_unit(void);
static void ahc_runq_tasklet(unsigned long data); static void ahc_runq_tasklet(unsigned long data);
static int ahc_linux_halt(struct notifier_block *nb, u_long event, void *buf); static int ahc_linux_halt(struct notifier_block *nb, u_long event, void *buf);
...@@ -1766,7 +1767,7 @@ ahc_linux_setup_dv(char *p, char *end, char *s) ...@@ -1766,7 +1767,7 @@ ahc_linux_setup_dv(char *p, char *end, char *s)
* to a parameter with a ':' between the parameter and the value. * to a parameter with a ':' between the parameter and the value.
* ie. aic7xxx=stpwlev:1,extended * ie. aic7xxx=stpwlev:1,extended
*/ */
int static int
aic7xxx_setup(char *s) aic7xxx_setup(char *s)
{ {
int i, n; int i, n;
...@@ -1890,7 +1891,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template) ...@@ -1890,7 +1891,7 @@ ahc_linux_register_host(struct ahc_softc *ahc, Scsi_Host_Template *template)
* negotiation will occur for the first command, and DV * negotiation will occur for the first command, and DV
* will comence should that first command be successful. * will comence should that first command be successful.
*/ */
for (target = 0; target < host->max_id; target++) { for (target = 0; target < host->max_id*host->max_channel+1; target++) {
u_int channel; u_int channel;
channel = 0; channel = 0;
......
...@@ -53,7 +53,7 @@ ...@@ -53,7 +53,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#115 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.h#118 $
* *
*/ */
#ifndef _AIC7XXX_LINUX_H_ #ifndef _AIC7XXX_LINUX_H_
...@@ -301,7 +301,7 @@ ahc_scb_timer_reset(struct scb *scb, u_int usec) ...@@ -301,7 +301,7 @@ ahc_scb_timer_reset(struct scb *scb, u_int usec)
#include <linux/smp.h> #include <linux/smp.h>
#endif #endif
#define AIC7XXX_DRIVER_VERSION "6.2.25" #define AIC7XXX_DRIVER_VERSION "6.2.26"
/**************************** Front End Queues ********************************/ /**************************** Front End Queues ********************************/
/* /*
...@@ -864,6 +864,7 @@ ahc_list_unlock(unsigned long *flags) ...@@ -864,6 +864,7 @@ ahc_list_unlock(unsigned long *flags)
#define PCIM_CMD_BUSMASTEREN 0x0004 #define PCIM_CMD_BUSMASTEREN 0x0004
#define PCIM_CMD_MWRICEN 0x0010 #define PCIM_CMD_MWRICEN 0x0010
#define PCIM_CMD_PERRESPEN 0x0040 #define PCIM_CMD_PERRESPEN 0x0040
#define PCIM_CMD_SERRESPEN 0x0100
#define PCIR_STATUS 0x06 #define PCIR_STATUS 0x06
#define PCIR_REVID 0x08 #define PCIR_REVID 0x08
#define PCIR_PROGIF 0x09 #define PCIR_PROGIF 0x09
......
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#42 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm_pci.c#43 $
*/ */
#include "aic7xxx_osm.h" #include "aic7xxx_osm.h"
...@@ -167,8 +167,8 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -167,8 +167,8 @@ ahc_linux_pci_dev_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
ahc->platform_data->hw_dma_mask = ahc->platform_data->hw_dma_mask =
(bus_addr_t)(0x7FFFFFFFFFULL & (bus_addr_t)~0); (bus_addr_t)(0x7FFFFFFFFFULL & (bus_addr_t)~0);
} else { } else {
ahc_pci_set_dma_mask(pdev, 0xffffffffULL); ahc_pci_set_dma_mask(pdev, 0xFFFFFFFF);
ahc->platform_data->hw_dma_mask = 0xffffffffULL; ahc->platform_data->hw_dma_mask = 0xFFFFFFFF;
} }
#endif #endif
ahc->dev_softc = pci; ahc->dev_softc = pci;
......
...@@ -39,7 +39,7 @@ ...@@ -39,7 +39,7 @@
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES. * POSSIBILITY OF SUCH DAMAGES.
* *
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#54 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#55 $
* *
* $FreeBSD$ * $FreeBSD$
*/ */
...@@ -1202,15 +1202,20 @@ ahc_probe_ext_scbram(struct ahc_softc *ahc) ...@@ -1202,15 +1202,20 @@ ahc_probe_ext_scbram(struct ahc_softc *ahc)
int int
ahc_pci_test_register_access(struct ahc_softc *ahc) ahc_pci_test_register_access(struct ahc_softc *ahc)
{ {
int error; int error;
u_int status1; u_int status1;
uint8_t seqctl; uint32_t cmd;
uint8_t hcntrl;
error = EIO; error = EIO;
/* Enable PCI error interrupt status */ /*
seqctl = ahc_inb(ahc, SEQCTL); * Enable PCI error interrupt status, but suppress NMIs
ahc_outb(ahc, SEQCTL, seqctl & ~FAILDIS); * generated by SERR raised due to target aborts.
*/
cmd = ahc_pci_read_config(ahc->dev_softc, PCIR_COMMAND, /*bytes*/2);
ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND,
cmd & ~PCIM_CMD_SERRESPEN, /*bytes*/2);
/* /*
* First a simple test to see if any * First a simple test to see if any
...@@ -1220,7 +1225,8 @@ ahc_pci_test_register_access(struct ahc_softc *ahc) ...@@ -1220,7 +1225,8 @@ ahc_pci_test_register_access(struct ahc_softc *ahc)
* be zero so it is a good register to * be zero so it is a good register to
* use for this test. * use for this test.
*/ */
if (ahc_inb(ahc, HCNTRL) == 0xFF) hcntrl = ahc_inb(ahc, HCNTRL);
if (hcntrl == 0xFF)
goto fail; goto fail;
/* /*
...@@ -1230,8 +1236,13 @@ ahc_pci_test_register_access(struct ahc_softc *ahc) ...@@ -1230,8 +1236,13 @@ ahc_pci_test_register_access(struct ahc_softc *ahc)
* either, so look for data corruption and/or flagged * either, so look for data corruption and/or flagged
* PCI errors. * PCI errors.
*/ */
ahc_outl(ahc, SRAM_BASE, 0x5aa555aa); ahc_outb(ahc, HCNTRL, hcntrl|PAUSE);
if (ahc_inl(ahc, SRAM_BASE) != 0x5aa555aa) while (ahc_is_paused(ahc) == 0)
;
ahc_outb(ahc, SEQCTL, PERRORDIS);
ahc_outb(ahc, SCBPTR, 0);
ahc_outl(ahc, SCB_BASE, 0x5aa555aa);
if (ahc_inl(ahc, SCB_BASE) != 0x5aa555aa)
goto fail; goto fail;
status1 = ahc_pci_read_config(ahc->dev_softc, status1 = ahc_pci_read_config(ahc->dev_softc,
...@@ -1248,7 +1259,8 @@ ahc_pci_test_register_access(struct ahc_softc *ahc) ...@@ -1248,7 +1259,8 @@ ahc_pci_test_register_access(struct ahc_softc *ahc)
ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1, ahc_pci_write_config(ahc->dev_softc, PCIR_STATUS + 1,
status1, /*bytes*/1); status1, /*bytes*/1);
ahc_outb(ahc, CLRINT, CLRPARERR); ahc_outb(ahc, CLRINT, CLRPARERR);
ahc_outb(ahc, SEQCTL, seqctl); ahc_outb(ahc, SEQCTL, PERRORDIS|FAILDIS);
ahc_pci_write_config(ahc->dev_softc, PCIR_COMMAND, cmd, /*bytes*/2);
return (error); return (error);
} }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* DO NOT EDIT - This file is automatically generated * DO NOT EDIT - This file is automatically generated
* from the following source files: * from the following source files:
* *
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#52 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#53 $
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#36 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#37 $
*/ */
typedef int (ahc_reg_print_t)(u_int, u_int *, u_int); typedef int (ahc_reg_print_t)(u_int, u_int *, u_int);
typedef struct ahc_reg_parse_entry { typedef struct ahc_reg_parse_entry {
...@@ -1779,6 +1779,7 @@ ahc_reg_print_t ahc_sg_cache_pre_print; ...@@ -1779,6 +1779,7 @@ ahc_reg_print_t ahc_sg_cache_pre_print;
#define MAX_OFFSET 0xff #define MAX_OFFSET 0xff
#define BUS_16_BIT 0x01 #define BUS_16_BIT 0x01
#define SCB_UPLOAD_SIZE 0x20 #define SCB_UPLOAD_SIZE 0x20
#define STACK_SIZE 0x04
/* Downloaded Constant Definitions */ /* Downloaded Constant Definitions */
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* DO NOT EDIT - This file is automatically generated * DO NOT EDIT - This file is automatically generated
* from the following source files: * from the following source files:
* *
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#52 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#53 $
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#36 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#37 $
*/ */
#include "aic7xxx_osm.h" #include "aic7xxx_osm.h"
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
* DO NOT EDIT - This file is automatically generated * DO NOT EDIT - This file is automatically generated
* from the following source files: * from the following source files:
* *
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#52 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.seq#53 $
* $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#36 $ * $Id: //depot/aic7xxx/aic7xxx/aic7xxx.reg#37 $
*/ */
static uint8_t seqprog[] = { static uint8_t seqprog[] = {
0xb2, 0x00, 0x00, 0x08, 0xb2, 0x00, 0x00, 0x08,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment