tavor_ib.h revision 9e39c5ba00a55fa05777cc94b148296af305e135
/*
* 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 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _TAVOR_IB_H
#define _TAVOR_IB_H
/*
*/
#ifdef __cplusplus
extern "C" {
#endif
#define FWFLASH_IB_DRIVER_NAME "tavor"
#define NODE_GUID_OFFSET 0x0
#define PORT1_GUID_OFFSET 0x08
#define PORT2_GUID_OFFSET 0x10
#define FLASH_SIZE_OFFSET 0x20
#define FLASH_GUID_PTR 0x24
typedef struct fw_rev_s {
} fw_rev_t;
typedef struct mlx_is {
/* offset from 0x32 to get log2sectsz */
/*
* 3rd lot of reserved bytes CAN BE variable length,
* but defaults to 0x18 bytes
*/
} mlx_is_t;
typedef struct mlx_xps {
} mlx_xps_t;
#define XFI_IMGINFO_OFFSET 28
#define XFI_IMGINFO_CKSUM_MASK 0xFF000000
#define XFI_IMGINFO_PTR_MASK 0x00FFFFFF
typedef struct mlx_xfi {
} mlx_xfi_t;
/*
* Of all the structures we poke around with, we're packing
* these because we frequently have to operate on them as
* plain old byte arrays. If we don't pack it then the compiler
* will "properly" align it for us - which results in a
* structure that's a l l s p r e a d o u t.
*/
#pragma pack(1)
typedef struct mlx_guid_sect
{
#pragma pack()
/* this is 13x 32bit words */
#define GUIDSECTION_SZ sizeof (struct mlx_guid_sect)
/* we hook this struct into vpr->encap_ident */
typedef struct ib_encap_ident {
int fd;
int cmd_set;
int pn_len;
int hwfw_match;
#define FLASH_PS_SIGNATURE 0x5a445a44
#define FLASH_IS_SECTOR_SIZE_OFFSET 0x32
#define FLASH_IS_SECTOR_SIZE_MASK 0x0000FFFF
#define FLASH_IS_HWVER_OFFSET 0x10
#define FLASH_IS_HWVER_MASK 0xFF000000
#define FLASH_IS_ISVER_MASK 0x00FF0000
#define FLASH_IS_SECT_SIZE_PTR 0x16
#define FLASH_IS_SECT_SIZE_PTR_MASK 0x0000FFFF
#define FLASH_PS_FI_ADDR_OFFSET 0x00
#define FLASH_PS_FW_SIZE_OFFSET 0x04
#define FLASH_PS_SIGNATURE_OFFSET 0x08
/* Vendor Specific Data (VSD) */
#define FLASH_PS_VSD_OFFSET 0x20
/* VSD length in bytes */
#define FLASH_PS_VSD_LENGTH 0xE0
#define FLASH_PS_VSD_LENGTH_4 0x38
/* PSID is the last 16B of VSD */
#define FLASH_PS_PSID_OFFSET 0xF0
/* For use with Cisco's VSD */
#define FLASH_VSD_CISCO_SIGNATURE 0x05ad
#define FLASH_VSD_CISCO_BOOT_OPTIONS 0x00000004
#define FLASH_VSD_CISCO_FLAG_AUTOUPGRADE 0x01000000
#define FLASH_VSD_CISCO_FLAG_BOOT_ENABLE_PORT_1 0x00010000
#define FLASH_VSD_CISCO_FLAG_BOOT_ENABLE_PORT_2 0x00020000
#define FLASH_VSD_CISCO_FLAG_BOOT_ENABLE_SCAN 0x00040000
#define FLASH_VSD_CISCO_FLAG_BOOT_TYPE_WELL_KNOWN 0x00000000
#define FLASH_VSD_CISCO_FLAG_BOOT_TRY_FOREVER 0x00001000
#define FLASH_VSD_CISCO_BOOT_VERSION 2
/* For use with Cisco's VSD */
#define MLX_CISCO_CHECK 1
#define MLX_CISCO_SET 2
#define FLASH_PS_CRC16_SIZE 0x104
#define FLASH_PS_CRC16_OFFSET 0x106
#define FLASH_FI_NGUID_OFFSET 0x0
#define FLASH_FI_P1GUID_OFFSET 0x08
#define FLASH_FI_P2GUID_OFFSET 0x10
#define FLASH_FI_SYSIMGUID_OFFSET 0x18
#define FLASH_GUID_CRC16_SIZE 0x30
#define FLASH_GUID_CRC16_OFFSET 0x32
#define FLASH_GUID_SIZE 0x34
#define FLASH_GUID_CRC_LEN 0x2F
/*
* image memory for that particular sector.
*/
/*
* Vital System Data from PCI config space.
*/
/*
* Common Flash Interface data.
*/
typedef union cfi_u {
} cfi_t;
#ifdef __cplusplus
}
#endif
#endif /* _TAVOR_IB_H */