Clean up some stuff
Remove chip version check Now compile again on 68k based systems
This commit is contained in:
parent
a7de1e5f5d
commit
d0fb45fdf3
@ -1,4 +1,4 @@
|
||||
/* $NetBSD: advlib.c,v 1.9 1999/06/06 17:33:18 dante Exp $ */
|
||||
/* $NetBSD: advlib.c,v 1.10 1999/06/12 12:09:01 dante Exp $ */
|
||||
|
||||
/*
|
||||
* Low level routines for the Advanced Systems Inc. SCSI controllers chips
|
||||
@ -89,8 +89,9 @@ static void AscInitLram __P((ASC_SOFTC *));
|
||||
static void AscInitQLinkVar __P((ASC_SOFTC *));
|
||||
static int AscResetChipAndScsiBus __P((bus_space_tag_t, bus_space_handle_t));
|
||||
static u_int16_t AscGetChipBusType __P((bus_space_tag_t, bus_space_handle_t));
|
||||
/*
|
||||
static u_int16_t AscGetEisaChipCfg __P((bus_space_tag_t, bus_space_handle_t));
|
||||
|
||||
*/
|
||||
/* Chip register routines */
|
||||
static void AscSetBank __P((bus_space_tag_t, bus_space_handle_t, u_int8_t));
|
||||
|
||||
@ -100,8 +101,6 @@ static int AscStopChip __P((bus_space_tag_t, bus_space_handle_t));
|
||||
static u_int8_t AscSetChipScsiID __P((bus_space_tag_t, bus_space_handle_t,
|
||||
u_int8_t));
|
||||
static u_int8_t AscGetChipScsiCtrl __P((bus_space_tag_t, bus_space_handle_t));
|
||||
static u_int8_t AscGetChipVersion __P((bus_space_tag_t, bus_space_handle_t,
|
||||
u_int16_t));
|
||||
static int AscSetRunChipSynRegAtID __P((bus_space_tag_t, bus_space_handle_t,
|
||||
u_int8_t, u_int8_t));
|
||||
static int AscSetChipSynRegAtID __P((bus_space_tag_t, bus_space_handle_t,
|
||||
@ -255,7 +254,6 @@ AscInitASC_SOFTC(sc)
|
||||
bus_space_tag_t iot = sc->sc_iot;
|
||||
bus_space_handle_t ioh = sc->sc_ioh;
|
||||
int i;
|
||||
u_int8_t chip_version;
|
||||
|
||||
|
||||
ASC_SET_CHIP_CONTROL(iot, ioh, ASC_CC_HALT);
|
||||
@ -284,10 +282,8 @@ AscInitASC_SOFTC(sc)
|
||||
sc->chip_scsi_id = ASC_DEF_CHIP_SCSI_ID;
|
||||
sc->lib_serial_no = ASC_LIB_SERIAL_NUMBER;
|
||||
sc->lib_version = (ASC_LIB_VERSION_MAJOR << 8) | ASC_LIB_VERSION_MINOR;
|
||||
chip_version = AscGetChipVersion(iot, ioh, sc->bus_type);
|
||||
sc->chip_version = chip_version;
|
||||
if ((sc->bus_type & ASC_IS_PCI) &&
|
||||
(chip_version >= ASC_CHIP_VER_PCI_ULTRA_3150)) {
|
||||
(sc->chip_version >= ASC_CHIP_VER_PCI_ULTRA_3150)) {
|
||||
sc->bus_type = ASC_IS_PCI_ULTRA;
|
||||
sc->sdtr_period_tbl[0] = SYN_ULTRA_XFER_NS_0;
|
||||
sc->sdtr_period_tbl[1] = SYN_ULTRA_XFER_NS_1;
|
||||
@ -306,10 +302,10 @@ AscInitASC_SOFTC(sc)
|
||||
sc->sdtr_period_tbl[14] = SYN_ULTRA_XFER_NS_14;
|
||||
sc->sdtr_period_tbl[15] = SYN_ULTRA_XFER_NS_15;
|
||||
sc->max_sdtr_index = 15;
|
||||
if (chip_version == ASC_CHIP_VER_PCI_ULTRA_3150)
|
||||
if (sc->chip_version == ASC_CHIP_VER_PCI_ULTRA_3150)
|
||||
ASC_SET_EXTRA_CONTROL(iot, ioh,
|
||||
(SEC_ACTIVE_NEGATE | SEC_SLEW_RATE));
|
||||
else if (chip_version >= ASC_CHIP_VER_PCI_ULTRA_3050)
|
||||
else if (sc->chip_version >= ASC_CHIP_VER_PCI_ULTRA_3050)
|
||||
ASC_SET_EXTRA_CONTROL(iot, ioh,
|
||||
(SEC_ACTIVE_NEGATE | SEC_ENABLE_FILTER));
|
||||
} else {
|
||||
@ -415,8 +411,7 @@ AscInitFromEEP(sc)
|
||||
eep_config->cfg_lsw |= ASC_CFG0_HOST_INT_ON;
|
||||
|
||||
if (chksum != eep_config->chksum) {
|
||||
if (AscGetChipVersion(iot, ioh, sc->bus_type) ==
|
||||
ASC_CHIP_VER_PCI_ULTRA_3050) {
|
||||
if (sc->chip_version == ASC_CHIP_VER_PCI_ULTRA_3050) {
|
||||
eep_config->init_sdtr = 0xFF;
|
||||
eep_config->disc_enable = 0xFF;
|
||||
eep_config->start_motor = 0xFF;
|
||||
@ -564,8 +559,7 @@ AscInitFromASC_SOFTC(sc)
|
||||
}
|
||||
}
|
||||
} else if (sc->bus_type == ASC_IS_ISAPNP) {
|
||||
if (AscGetChipVersion(iot, ioh, sc->bus_type) ==
|
||||
ASC_CHIP_VER_ASYN_BUG) {
|
||||
if (sc->chip_version == ASC_CHIP_VER_ASYN_BUG) {
|
||||
sc->bug_fix_cntl |= ASC_BUG_FIX_ASYN_USE_SYN;
|
||||
}
|
||||
}
|
||||
@ -743,7 +737,7 @@ AscGetChipBusType(iot, ioh)
|
||||
u_int16_t chip_ver;
|
||||
|
||||
chip_ver = ASC_GET_CHIP_VER_NO(iot, ioh);
|
||||
if ((chip_ver >= ASC_CHIP_MIN_VER_VL) &&
|
||||
/* if ((chip_ver >= ASC_CHIP_MIN_VER_VL) &&
|
||||
(chip_ver <= ASC_CHIP_MAX_VER_VL)) {
|
||||
if(((ioh & 0x0C30) == 0x0C30) || ((ioh & 0x0C50) == 0x0C50)) {
|
||||
return (ASC_IS_EISA);
|
||||
@ -752,7 +746,7 @@ AscGetChipBusType(iot, ioh)
|
||||
return (ASC_IS_VL);
|
||||
}
|
||||
}
|
||||
if ((chip_ver >= ASC_CHIP_MIN_VER_ISA) &&
|
||||
*/ if ((chip_ver >= ASC_CHIP_MIN_VER_ISA) &&
|
||||
(chip_ver <= ASC_CHIP_MAX_VER_ISA)) {
|
||||
if (chip_ver >= ASC_CHIP_MIN_VER_ISA_PNP)
|
||||
return (ASC_IS_ISAPNP);
|
||||
@ -765,7 +759,7 @@ AscGetChipBusType(iot, ioh)
|
||||
return (0);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
static u_int16_t
|
||||
AscGetEisaChipCfg(iot, ioh)
|
||||
bus_space_tag_t iot;
|
||||
@ -776,7 +770,7 @@ AscGetEisaChipCfg(iot, ioh)
|
||||
eisa_cfg_iop = ASC_GET_EISA_SLOT(ioh) | (ASC_EISA_CFG_IOP_MASK);
|
||||
return (inw(eisa_cfg_iop));
|
||||
}
|
||||
|
||||
*/
|
||||
|
||||
/******************************************************************************/
|
||||
/* Chip register routines */
|
||||
@ -851,24 +845,6 @@ AscStopChip(iot, ioh)
|
||||
}
|
||||
|
||||
|
||||
static u_int8_t
|
||||
AscGetChipVersion(iot, ioh, bus_type)
|
||||
bus_space_tag_t iot;
|
||||
bus_space_handle_t ioh;
|
||||
u_int16_t bus_type;
|
||||
{
|
||||
u_int16_t eisa_iop;
|
||||
u_int8_t revision;
|
||||
|
||||
if (bus_type & ASC_IS_EISA) {
|
||||
eisa_iop = ASC_GET_EISA_SLOT(ioh) | ASC_EISA_REV_IOP_MASK;
|
||||
revision = inb(eisa_iop);
|
||||
return((ASC_CHIP_MIN_VER_EISA - 1) + revision);
|
||||
}
|
||||
return (ASC_GET_CHIP_VER_NO(iot, ioh));
|
||||
}
|
||||
|
||||
|
||||
static u_int8_t
|
||||
AscSetChipScsiID(iot, ioh, new_id)
|
||||
bus_space_tag_t iot;
|
||||
@ -2106,14 +2082,14 @@ AscGetChipIRQ(iot, ioh, bus_type)
|
||||
u_int8_t chip_irq;
|
||||
|
||||
|
||||
if (bus_type & ASC_IS_EISA) {
|
||||
/* if (bus_type & ASC_IS_EISA) {
|
||||
cfg_lsw = AscGetEisaChipCfg(iot, ioh);
|
||||
chip_irq = ((cfg_lsw >> 8) & 0x07) + 10;
|
||||
if((chip_irq == 13) || (chip_irq > 15))
|
||||
return (0);
|
||||
return(chip_irq);
|
||||
}
|
||||
if ((bus_type & ASC_IS_VL) != 0) {
|
||||
*/ if ((bus_type & ASC_IS_VL) != 0) {
|
||||
cfg_lsw = ASC_GET_CHIP_CFG_LSW(iot, ioh);
|
||||
chip_irq = (cfg_lsw >> 2) & 0x07;
|
||||
if ((chip_irq == 0) ||
|
||||
|
Loading…
Reference in New Issue
Block a user