/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright 2009 QLogic Corporation */
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _QL_INIT_H
#define _QL_INIT_H
/*
* ISP2xxx Solaris Fibre Channel Adapter (FCA) driver header file.
*
* ***********************************************************************
* * **
* * NOTICE **
* * COPYRIGHT (C) 1996-2009 QLOGIC CORPORATION **
* * ALL RIGHTS RESERVED **
* * **
* ***********************************************************************
*
*/
#ifdef __cplusplus
extern "C" {
#endif
/*
* ISP2200 NVRAM structure definition.
* Little endian except where noted.
*/
typedef struct nvram {
/*
* NVRAM header
*/
/*
* NVRAM RISC parameter block
*/
/*
* LSB BIT 0 = enable_hard_loop_id
* LSB BIT 1 = enable_fairness
* LSB BIT 2 = enable_full_duplex
* LSB BIT 3 = enable_fast_posting
* LSB BIT 4 = enable_target_mode
* LSB BIT 5 = disable_initiator_mode
* LSB BIT 6 = enable_adisc
* LSB BIT 7 = enable_target_inquiry_data
*
* MSB BIT 0 = enable_port_update_ae
* MSB BIT 1 = disable_initial_lip
* MSB BIT 2 = enable_decending_soft_assign
* MSB BIT 3 = previous_assigned_addressing
* MSB BIT 4 = enable_stop_q_on_full
* MSB BIT 5 = enable_full_login_on_lip
* MSB BIT 6 = enable_node_name
* MSB BIT 7 = extended_control_block
*/
/*
* LSB BIT 0 = Timer operation mode bit 0
* LSB BIT 1 = Timer operation mode bit 1
* LSB BIT 2 = Timer operation mode bit 2
* LSB BIT 3 = Timer operation mode bit 3
* LSB BIT 4 = P2P Connection option bit 0
* LSB BIT 5 = P2P Connection option bit 1
* LSB BIT 6 = P2P Connection option bit 2
* LSB BIT 7 = Enable Non part on LIHA failure
*
* MSB BIT 0 = Enable class 2
* MSB BIT 1 = Enable ACK0
* MSB BIT 2 =
* MSB BIT 3 =
* MSB BIT 4 = FC Tape Enable
* MSB BIT 5 = Enable FC Confirm
* MSB BIT 6 = Enable command queuing in target mode
* MSB BIT 7 = No Logo On Link Down
*/
/*
* LSB BIT 0 = Enable Read xfr_rdy
* LSB BIT 1 = Soft ID only
* LSB BIT 2 =
* LSB BIT 3 =
* LSB BIT 4 = FCP RSP Payload [0]
* LSB BIT 5 = FCP RSP Payload [1] / Sbus enable - 2200
* LSB BIT 6 =
* LSB BIT 7 =
*
* MSB BIT 0 = Sbus enable - 2300
* MSB BIT 1 =
* MSB BIT 2 =
* MSB BIT 3 =
* MSB BIT 4 =
* MSB BIT 5 = Enable 50 ohm termination
* MSB BIT 6 = Data Rate (2300 only)
* MSB BIT 7 = Data Rate (2300 only)
*/
/* Reserved for expanded RISC parameter block */
/*
* NVRAM host parameter block
*
* LSB BIT 0 = unused
* LSB BIT 1 = disable_bios
* LSB BIT 2 = disable_luns
* LSB BIT 3 = enable_selectable_boot
* LSB BIT 4 = disable_risc_code_load
* LSB BIT 5 = set_cache_line_size_1
* LSB BIT 6 = pci_parity_disable
* LSB BIT 7 = enable_extended_logging
*
* MSB BIT 0 = enable_64bit_addressing
* MSB BIT 1 = enable_lip_reset
* MSB BIT 2 = enable_lip_full_login
* MSB BIT 3 = enable_target_reset
* MSB BIT 4 = enable_database_storage
* MSB BIT 5 = unused
* MSB BIT 6 = unused
* MSB BIT 7 = unused
*/
/* Offset 100 */
/* offset 112 */
/* Offset 150 */
/* Offset 200 */
/*
* NVRAM Adapter Features offset 232-239
*
* LSB BIT 0 = External GBIC
* LSB BIT 1 = Risc RAM parity
* LSB BIT 2 = Buffer Plus Module
* LSB BIT 3 = Multi Chip Adapter
* LSB BIT 4 =
* LSB BIT 5 =
* LSB BIT 6 =
* LSB BIT 7 =
*
* MSB BIT 0 =
* MSB BIT 1 =
* MSB BIT 2 =
* MSB BIT 3 =
* MSB BIT 4 =
* MSB BIT 5 =
* MSB BIT 6 =
* MSB BIT 7 =
*/
/*
* Resrved for use with ISP2300 - offset 240
*/
/* Subsystem ID must be at offset 244 */
/* Subsystem device ID must be at offset 248 */
/* Subsystem vendor ID for ISP2200 */
/* Subsystem device ID for ISP2200 */
} nvram_t;
/*
* NVRAM structure definition.
*/
typedef struct nvram_24xx {
/* NVRAM header. */
/* Firmware Initialization Control Block. */
/*
* BIT 0 = Hard Assigned Loop ID
* BIT 1 = Enable Fairness
* BIT 2 = Enable Full-Duplex
* BIT 3 = Reserved
* BIT 4 = Target Mode Enable
* BIT 5 = Initiator Mode Disable
* BIT 6 = Reserved
* BIT 7 = Reserved
*
* BIT 8 = Reserved
* BIT 9 = Disable Initial LIP
* BIT 10 = Descending Loop ID Search
* BIT 11 = Previous Assigned Loop ID
* BIT 12 = Reserved
* BIT 13 = Full Login after LIP
* BIT 14 = Node Name Option
* BIT 15 = Reserved
*
* BIT 16-31 = Reserved
*/
/*
* BIT 0 = Operation Mode bit 0
* BIT 1 = Operation Mode bit 1
* BIT 2 = Operation Mode bit 2
* BIT 3 = Operation Mode bit 3
* BIT 4 = Connection Options bit 0
* BIT 5 = Connection Options bit 1
* BIT 6 = Connection Options bit 2
* BIT 7 = Enable Non part on LIHA failure
*
* BIT 8 = Enable Class 2
* BIT 9 = Enable ACK0
* BIT 10 = Enable Virtual Fabric
* BIT 11 = Enable FC-SP Security
* BIT 12 = FC Tape Enable
* BIT 13 = Reserved
* BIT 14 = Target PRLI Control
* BIT 15 = Reserved
*
* BIT 16 = Enable Emulated MSIX
* BIT 17 = Reserved
* BIT 18 = Enable Alternate Device Number
* BIT 19 = Enable Alternate Bus Number
* BIT 20 = Enable Translated Address
* BIT 21 = Enable VM Security
* BIT 22 = Enable Interrupt Handshake
* BIT 23 = Enable Multiple Queue
*
* BIT 24 = IOCB Security
* BIT 25 = qos
* BIT 26-31 = Reserved
*/
/*
* BIT 0 = Reserved
* BIT 1 = Soft ID only
* BIT 2 = Reserved
* BIT 3 = disable split completion timeout
* BIT 4 = FCP RSP Payload bit 0
* BIT 5 = FCP RSP Payload bit 1
* BIT 6 = Enable Rec Out-of-Order data frame handling
* BIT 7 = Disable Automatic PLOGI on Local Loop
*
* BIT 8 = Reserved
* BIT 9 = Enable Out-of-Order FCP_XFER_RDY relative
* offset handling
* BIT 10 = Reserved
* BIT 11 = Reserved
* BIT 12 = Reserved
* BIT 13 = Data Rate bit 0
* BIT 14 = Data Rate bit 1
* BIT 15 = Data Rate bit 2
*
* BIT 16 = 75-ohm Termination Select
* BIT 17 = Enable Multiple FCFs
* BIT 18 = MAC Addressing Mode
* BIT 19 = MAC Addressing Mode
* BIT 20 = MAC Addressing Mode
* BIT 21 = Ethernet Data Rate
* BIT 22 = Ethernet Data Rate
* BIT 23 = Ethernet Data Rate
*
* BIT 24 = Ethernet Data Rate
* BIT 25 = Ethernet Data Rate
* BIT 26 = Enable Ethernet Header ATIO Queue
* BIT 27 = Enable Ethernet Header Response Queue
* BIT 28 = SPMA Selection
* BIT 29 = SPMA Selection
* BIT 30 = Reserved
* BIT 31 = Reserved
*/
union {
struct {
/*
* Offset 56 (38h)
* Serial Link Control
* BIT 0 = control enable
* BIT 1-15 = Reserved
*/
/*
* Offset 58 (3Ah)
* Serial Link Control 1G
* BIT 0-7 = Reserved
*
* BIT 8-10 = output swing
* BIT 11-13 = output emphasis
* BIT 14-15 = Reserved
*/
/*
* Offset 60 (3Ch)
* Serial Link Control 2G
* BIT 0-7 = Reserved
*
* BIT 8-10 = output swing
* BIT 11-13 = output emphasis
* BIT 14-15 = Reserved
*/
/*
* Offset 62 (3Eh)
* Serial Link Control 4G
* BIT 0-7 = Reserved
*
* BIT 8-10 = output swing
* BIT 11-13 = output emphasis
* BIT 14-15 = Reserved
*/
/* Offset 64 (40h). */
} isp2400;
struct {
/*
* Offset 56 (38h)
* Serial Link Control
* BIT 0 = Reserved
* BIT 1 = 25xx TX control enable
* BIT 2 = 25xx RX control enable (lmtg)
* BIT 3 = 25xx RX control enable (linear)
* BIT 4 = embedded HBA
* BIT 5 = unused
* BIT 6 = 25xx E7 Addr27 Preset
* BIT 7 = 25xx E6 Addr0 Ch0 enable
*
* BIT 8-15 = 25xx E6 Addr0 Ch0
*
* BIT 16-31 = Reserved
*/
/*
* Offset 60 (3Ch)
* Serial Link TX Parameters
* BIT 0 = TX Amplitude
* BIT 1 = TX Amplitude
* BIT 2 = TX Amplitude
* BIT 3 = TX Amplitude
* BIT 4 = TX Amplitude
* BIT 5 = TX iPost
* BIT 6 = TX iPost
* BIT 7 = TX iPost
*
* BIT 8 = TX iPost
* BIT 9 = TX iPre
* BIT 10 = TX iPre
* BIT 11 = TX iPre
* BIT 12 = TX iPre
* BIT 13 = TX iMain
* BIT 14 = TX iMain
* BIT 15 = TX iMain
*
* BIT 16 = TX iMain
* BIT 17 = TX iMain
* BIT 18-23 = Reserved
*
* BIT 24-31 = Reserved
*/
/* Offset 64 (40h) */
/* Offset 68 (44h) */
/*
* Offset 72 (48h)
* Serial Link RX Parameters
* BIT 0 = RX Z1Cnt
* BIT 1 = RX Z1Cnt
* BIT 2 = RX Z1Cnt
* BIT 3 = RX Z1Cnt
* BIT 4 = RX G1Cnt
* BIT 5 = RX ZCnt
* BIT 6 = RX ZCnt
* BIT 7 = RX ZCnt
*
* BIT 8 = RX ZCnt
* BIT 9 = RX ZCnt
* BIT 10 = RX TLTH
* BIT 11 = RX TLTH
* BIT 12 = RX TLTH
* BIT 13 = RX TLTH
* BIT 14 = RX TLTH
* BIT 15 = RX TLTH
*
* BIT 16 = RX DFELTH
* BIT 17 = RX DFELTH
* BIT 18 = RX DFELTH
* BIT 19 = RX DFELTH
* BIT 20 = RX DFELTH
* BIT 21 = RX DFELTH
* BIT 22-23 = Reserved
*
* BIT 24-31 = Reserved
*/
/* Offset 76 (4Ch) */
/* Offset 80 (50h) */
/* Offset 84 (54h) */
/* Offset 88 (58h) */
/* Offset 92 (5Ch) */
} isp2500;
struct {
/* Offset 56 (38h) */
/* Offset 64 (40h). */
/* Offset 70 (46h). */
} isp8001;
} fw;
/*
* Offset 96 (60h)
* BIT 0 = initiator op
* BIT 1 = target op
* BIT 2 = VI op
* BIT 3-7 = Reserved
*/
/* Offset 112 (70h). */
/*
* Offset 128 (80h).
* PCIe table entries.
* Firmware Extended Initialization Control Block.
*/
/* Offset 192. */
/* Offset 224. */
/*
* BIT 0 = Enable spinup delay
* BIT 1 = Disable BIOS
* BIT 2 = Enable Memory Map BIOS
* BIT 3 = Enable Selectable Boot
* BIT 4 = Disable RISC code load
* BIT 5 = Disable serdes
* BIT 6 = Enable opt boot mode
* BIT 7 = Enable int mode BIOS
*
* BIT 8 = EV control enable
* BIT 9 = Enable lip reset
* BIT 10 = Enable lip full login
* BIT 11 = Enable target reset
* BIT 12 = Stop firmware
* BIT 13 = Default Node Name Option
* BIT 14 = Default WWPN valid
* BIT 15 = Enable alternate WWN
*
* CLP BIOS flags
*
* BIT 16 = clp lun string
* BIT 17 = clp target string
* BIT 18 = clp bios enable string
* BIT 19 = clp serdes_string
* BIT 20 = clp wwpn string
* BIT 21 = clp wwnn string
* BIT 22 = win reserverd 0
* BIT 23 = win reserverd 1
*
* BIT 24 = keep wwpn
* BIT 25 = temp wwpn
* BIT 26 = win reserverd 2
* BIT 27 = win reserverd 3
* BIT 28 = clear WBT in flash (win driver)
* BIT 29 = write WBT in flash (win driver)
* BIT 30 = load fw from flash (win driver)
* BIT 31 = enable alternate WWN (win driver)
*/
/*
* BIT 0 = Selective Login
* BIT 1 = Alt-Boot Enable
* BIT 2 = Reserved
* BIT 3 = Enable Boot Order List
* BIT 4 = Reserved
* BIT 5 = Enable Selective LUN
* BIT 6 = Reserved
* BIT 7-31 =
*/
/*
* FCode parameters word (offset 344)
*
* BIT 0 = Enable BIOS pathname
* BIT 1 = fcode qlc
* BIT 2 = fcode host
* BIT 3 = fcode sunid
* BIT 4-7 =
*/
/*
* Offset 352 (160h).
* uint8_t prev_drv_ver_major;
* uint8_t prev_drv_ver_submajob;
* uint8_t prev_drv_ver_minor;
* uint8_t prev_drv_ver_subminor;
* uint8_t prev_bios_ver_major[2];
* uint8_t prev_bios_ver_minor[2];
* uint8_t prev_efi_ver_major[2];
* uint8_t prev_efi_ver_minor[2];
* uint8_t prev_fw_ver_major[2];
* uint8_t prev_fw_ver_minor;
* uint8_t prev_fw_ver_subminor;
* uint8_t reserved[16];
*/
/* Offset 384 (180h). */
/* Offset 404 (194h). */
/* Offset 406 (196h). */
/* Offset 416 (1A0h). */
/* Offset 428 (1ACh). */
/* Offset 440 (1B8h). */
/* Offset 452 (1C4h). */
/* Offset 464 (1D0h). */
/* Offset 476 (1DCh). */
/* Offset 480 (1E0h). */
/* Offset 496 (1F0h). */
/* Offset 504 (1F8h). */
} nvram_24xx_t;
/*
* Firmware Dump structure definition
*/
/*
* firmware dump struct for 2300 is a superset of firmware dump struct
* for 2200. Fields which are 2300 only or are enhanced for 2300 are
* marked below.
*/
typedef struct ql_fw_dump {
} ql_fw_dump_t;
typedef struct ql_24xx_fw_dump {
typedef struct ql_25xx_fw_dump {
typedef struct ql_81xx_fw_dump {
#ifdef _KERNEL
/*
* ql_lock_nvram() flags
*/
/*
* ISP product identification definitions in mailboxes after reset.
*/
/*
* NVRAM Command values.
*/
/*
* Deivce ID list definitions.
*/
struct ql_dev_id {
};
struct ql_ex_dev_id {
};
struct ql_24_dev_id {
};
typedef union ql_dev_id_list {
struct ql_dev_id d;
/* Define maximum number of device list entries.. */
/*
* Global Data in ql_init.c source file.
*/
/*
* Global Function Prototypes in ql_init.c source file.
*/
int ql_pci_sbus_config(ql_adapter_state_t *);
int ql_nvram_config(ql_adapter_state_t *);
void ql_nv_delay(void);
void ql_release_nvram(ql_adapter_state_t *);
void ql_common_properties(ql_adapter_state_t *);
int ql_start_firmware(ql_adapter_state_t *);
int ql_set_cache_line(ql_adapter_state_t *);
int ql_init_rings(ql_adapter_state_t *);
void ql_reset_chip(ql_adapter_state_t *);
void ql_reset_24xx_chip(ql_adapter_state_t *);
int ql_abort_isp(ql_adapter_state_t *);
int ql_vport_enable(ql_adapter_state_t *);
void ql_vport_destroy(ql_adapter_state_t *);
#endif /* _KERNEL */
#ifdef __cplusplus
}
#endif
#endif /* _QL_INIT_H */