linux/drivers/scsi/aic7xxx/aic7xxx_pci.c

/*
 * Product specific probe and attach routines for:
 *      3940, 2940, aic7895, aic7890, aic7880,
 *	aic7870, aic7860 and aic7850 SCSI controllers
 *
 * Copyright (c) 1994-2001 Justin T. Gibbs.
 * Copyright (c) 2000-2001 Adaptec Inc.
 * All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions, and the following disclaimer,
 *    without modification.
 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
 *    substantially similar to the "NO WARRANTY" disclaimer below
 *    ("Disclaimer") and any redistribution must be conditioned upon
 *    including a substantially similar Disclaimer requirement for further
 *    binary redistribution.
 * 3. Neither the names of the above-listed copyright holders nor the names
 *    of any contributors may be used to endorse or promote products derived
 *    from this software without specific prior written permission.
 *
 * Alternatively, this software may be distributed under the terms of the
 * GNU General Public License ("GPL") version 2 as published by the Free
 * Software Foundation.
 *
 * NO WARRANTY
 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 * POSSIBILITY OF SUCH DAMAGES.
 *
 * $Id: //depot/aic7xxx/aic7xxx/aic7xxx_pci.c#79 $
 */

#include "aic7xxx_osm.h"
#include "aic7xxx_inline.h"
#include "aic7xxx_93cx6.h"
#include "aic7xxx_pci.h"

static inline uint64_t
ahc_compose_id(u_int device, u_int vendor, u_int subdevice, u_int subvendor)
{}

#define AHC_PCI_IOADDR
#define AHC_PCI_MEMADDR

#define DEVID_9005_TYPE(id)
#define DEVID_9005_TYPE_HBA
#define DEVID_9005_TYPE_AAA
#define DEVID_9005_TYPE_SISL
#define DEVID_9005_TYPE_MB

#define DEVID_9005_MAXRATE(id)
#define DEVID_9005_MAXRATE_U160
#define DEVID_9005_MAXRATE_ULTRA2
#define DEVID_9005_MAXRATE_ULTRA
#define DEVID_9005_MAXRATE_FAST

#define DEVID_9005_MFUNC(id)

#define DEVID_9005_CLASS(id)
#define DEVID_9005_CLASS_SPI

#define SUBID_9005_TYPE(id)
#define SUBID_9005_TYPE_MB
#define SUBID_9005_TYPE_CARD
#define SUBID_9005_TYPE_LCCARD
#define SUBID_9005_TYPE_RAID

#define SUBID_9005_TYPE_KNOWN(id)

#define SUBID_9005_MAXRATE(id)
#define SUBID_9005_MAXRATE_ULTRA2
#define SUBID_9005_MAXRATE_ULTRA
#define SUBID_9005_MAXRATE_U160
#define SUBID_9005_MAXRATE_RESERVED

#define SUBID_9005_SEEPTYPE(id)
#define SUBID_9005_SEEPTYPE_NONE
#define SUBID_9005_SEEPTYPE_1K
#define SUBID_9005_SEEPTYPE_2K_4K
#define SUBID_9005_SEEPTYPE_RESERVED
#define SUBID_9005_AUTOTERM(id)

#define SUBID_9005_NUMCHAN(id)

#define SUBID_9005_LEGACYCONN(id)

#define SUBID_9005_MFUNCENB(id)
/*
 * Informational only. Should use chip register to be
 * certain, but may be use in identification strings.
 */
#define SUBID_9005_CARD_SCSIWIDTH_MASK
#define SUBID_9005_CARD_PCIWIDTH_MASK
#define SUBID_9005_CARD_SEDIFF_MASK

static ahc_device_setup_t ahc_aic785X_setup;
static ahc_device_setup_t ahc_aic7860_setup;
static ahc_device_setup_t ahc_apa1480_setup;
static ahc_device_setup_t ahc_aic7870_setup;
static ahc_device_setup_t ahc_aic7870h_setup;
static ahc_device_setup_t ahc_aha394X_setup;
static ahc_device_setup_t ahc_aha394Xh_setup;
static ahc_device_setup_t ahc_aha494X_setup;
static ahc_device_setup_t ahc_aha494Xh_setup;
static ahc_device_setup_t ahc_aha398X_setup;
static ahc_device_setup_t ahc_aic7880_setup;
static ahc_device_setup_t ahc_aic7880h_setup;
static ahc_device_setup_t ahc_aha2940Pro_setup;
static ahc_device_setup_t ahc_aha394XU_setup;
static ahc_device_setup_t ahc_aha394XUh_setup;
static ahc_device_setup_t ahc_aha398XU_setup;
static ahc_device_setup_t ahc_aic7890_setup;
static ahc_device_setup_t ahc_aic7892_setup;
static ahc_device_setup_t ahc_aic7895_setup;
static ahc_device_setup_t ahc_aic7895h_setup;
static ahc_device_setup_t ahc_aic7896_setup;
static ahc_device_setup_t ahc_aic7899_setup;
static ahc_device_setup_t ahc_aha29160C_setup;
static ahc_device_setup_t ahc_raid_setup;
static ahc_device_setup_t ahc_aha394XX_setup;
static ahc_device_setup_t ahc_aha494XX_setup;
static ahc_device_setup_t ahc_aha398XX_setup;

static const struct ahc_pci_identity ahc_pci_ident_table[] =;

static const u_int ahc_num_pci_devs =;
		
#define AHC_394X_SLOT_CHANNEL_A
#define AHC_394X_SLOT_CHANNEL_B

#define AHC_398X_SLOT_CHANNEL_A
#define AHC_398X_SLOT_CHANNEL_B
#define AHC_398X_SLOT_CHANNEL_C

#define AHC_494X_SLOT_CHANNEL_A
#define AHC_494X_SLOT_CHANNEL_B
#define AHC_494X_SLOT_CHANNEL_C
#define AHC_494X_SLOT_CHANNEL_D

#define DEVCONFIG
#define PCIERRGENDIS
#define SCBSIZE32
#define REXTVALID
#define MPORTMODE
#define RAMPSM
#define VOLSENSE
#define PCI64BIT
#define SCBRAMSEL
#define MRDCEN
#define EXTSCBTIME
#define EXTSCBPEN
#define BERREN
#define DACEN
#define STPWLEVEL
#define DIFACTNEGEN

#define CSIZE_LATTIME
#define CACHESIZE
#define LATTIME

/* PCI STATUS definitions */
#define DPE
#define SSE
#define RMA
#define RTA
#define STA
#define DPR

static int ahc_9005_subdevinfo_valid(uint16_t device, uint16_t vendor,
				     uint16_t subdevice, uint16_t subvendor);
static int ahc_ext_scbram_present(struct ahc_softc *ahc);
static void ahc_scbram_config(struct ahc_softc *ahc, int enable,
				  int pcheck, int fast, int large);
static void ahc_probe_ext_scbram(struct ahc_softc *ahc);
static void check_extport(struct ahc_softc *ahc, u_int *sxfrctl1);
static void ahc_parse_pci_eeprom(struct ahc_softc *ahc,
				 struct seeprom_config *sc);
static void configure_termination(struct ahc_softc *ahc,
				  struct seeprom_descriptor *sd,
				  u_int adapter_control,
	 			  u_int *sxfrctl1);

static void ahc_new_term_detect(struct ahc_softc *ahc,
				int *enableSEC_low,
				int *enableSEC_high,
				int *enablePRI_low,
				int *enablePRI_high,
				int *eeprom_present);
static void aic787X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
				 int *internal68_present,
				 int *externalcable_present,
				 int *eeprom_present);
static void aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
				 int *externalcable_present,
				 int *eeprom_present);
static void    write_brdctl(struct ahc_softc *ahc, uint8_t value);
static uint8_t read_brdctl(struct ahc_softc *ahc);
static void ahc_pci_intr(struct ahc_softc *ahc);
static int  ahc_pci_chip_init(struct ahc_softc *ahc);

static int
ahc_9005_subdevinfo_valid(uint16_t device, uint16_t vendor,
			  uint16_t subdevice, uint16_t subvendor)
{}

const struct ahc_pci_identity *
ahc_find_pci_device(ahc_dev_softc_t pci)
{}

int
ahc_pci_config(struct ahc_softc *ahc, const struct ahc_pci_identity *entry)
{}

/*
 * Test for the presence of external sram in an
 * "unshared" configuration.
 */
static int
ahc_ext_scbram_present(struct ahc_softc *ahc)
{}

/*
 * Enable external scbram.
 */
static void
ahc_scbram_config(struct ahc_softc *ahc, int enable, int pcheck,
		  int fast, int large)
{}

/*
 * Take a look to see if we have external SRAM.
 * We currently do not attempt to use SRAM that is
 * shared among multiple controllers.
 */
static void
ahc_probe_ext_scbram(struct ahc_softc *ahc)
{}

/*
 * Perform some simple tests that should catch situations where
 * our registers are invalidly mapped.
 */
int
ahc_pci_test_register_access(struct ahc_softc *ahc)
{}

/*
 * Check the external port logic for a serial eeprom
 * and termination/cable detection contrls.
 */
static void
check_extport(struct ahc_softc *ahc, u_int *sxfrctl1)
{}

static void
ahc_parse_pci_eeprom(struct ahc_softc *ahc, struct seeprom_config *sc)
{}

static void
configure_termination(struct ahc_softc *ahc,
		      struct seeprom_descriptor *sd,
		      u_int adapter_control,
		      u_int *sxfrctl1)
{}

static void
ahc_new_term_detect(struct ahc_softc *ahc, int *enableSEC_low,
		    int *enableSEC_high, int *enablePRI_low,
		    int *enablePRI_high, int *eeprom_present)
{}

static void
aic787X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
		     int *internal68_present, int *externalcable_present,
		     int *eeprom_present)
{}

static void
aic785X_cable_detect(struct ahc_softc *ahc, int *internal50_present,
		     int *externalcable_present, int *eeprom_present)
{}
	
int
ahc_acquire_seeprom(struct ahc_softc *ahc, struct seeprom_descriptor *sd)
{}

void
ahc_release_seeprom(struct seeprom_descriptor *sd)
{}

static void
write_brdctl(struct ahc_softc *ahc, uint8_t value)
{}

static uint8_t
read_brdctl(struct ahc_softc *ahc)
{}

static void
ahc_pci_intr(struct ahc_softc *ahc)
{}

static int
ahc_pci_chip_init(struct ahc_softc *ahc)
{}

void __maybe_unused
ahc_pci_resume(struct ahc_softc *ahc)
{}

static int
ahc_aic785X_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7860_setup(struct ahc_softc *ahc)
{}

static int
ahc_apa1480_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7870_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7870h_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha394X_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha394Xh_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha398X_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha494X_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha494Xh_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7880_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7880h_setup(struct ahc_softc *ahc)
{}


static int
ahc_aha2940Pro_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha394XU_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha394XUh_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha398XU_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7890_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7892_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7895_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7895h_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7896_setup(struct ahc_softc *ahc)
{}

static int
ahc_aic7899_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha29160C_setup(struct ahc_softc *ahc)
{}

static int
ahc_raid_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha394XX_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha398XX_setup(struct ahc_softc *ahc)
{}

static int
ahc_aha494XX_setup(struct ahc_softc *ahc)
{}