nvm_map.h revision d14abf155341d55053c76eeec58b787a456b753b
/****************************************************************************
* 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 2014 QLogic Corporation
* The contents of this file are subject to the terms of the
* QLogic End User License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing permissions
* and limitations under the License.
*
*
* Name: nvm_map.h
*
* Description: Everest NVRAM map
*
* Created: 05/03/2006 eilong
*
* $Date: 2014/07/16 $ $Revision: #111 $
****************************************************************************/
#ifndef NVM_MAP_H
#define NVM_MAP_H
#include "mcp_shmem.h"
#include "types.h"
#include "invm_cfg.h"
#define __FAR__ /*Need to define this as NULL, as it is defined in preboot make file*/
#include "fcb_nvm.h"
#endif
#define CRC_MAGIC_VALUE 0xDEBB20E3
#define CRC32_POLYNOMIAL 0xEDB88320
/****************************************************************************
* Boot Strap Region *
****************************************************************************/
typedef struct _bootstrap_region_t
{
#define NVM_MAGIC_VALUE 0x669955aa
#define NVM_DEFAULT_SRAM_ADDR 0x08000010
typedef struct {
#else
typedef struct {
#endif
/****************************************************************************
* Directories Region *
****************************************************************************/
typedef struct _code_entry_t
{
agent in code_attribute field */
#define CODE_IMAGE_TYPE_MASK 0xf0800003
/* Images which are stored in extended dir have bit 0 set to 1 */
#define CODE_IMAGE_IN_EXTENDED_DIR_MASK 0x00000001
#define CODE_IMAGE_TYPE_BC2 0x00000000
#define CODE_IMAGE_TYPE_MBA 0x10000000
#define CODE_IMAGE_TYPE_NC_SI_CMN 0x20000000
#define CODE_IMAGE_TYPE_MODULES_PN 0x30000000
#define CODE_IMAGE_TYPE_IPMI 0x40000000
#define CODE_IMAGE_TYPE_ISCSI_BOOT_CFG2 0x50000000
#define CODE_IMAGE_TYPE_NC_SI_EVEREST 0x60000000
#define CODE_IMAGE_TYPE_L2T 0x70000000
#define CODE_IMAGE_TYPE_L2C 0x80000000
#define CODE_IMAGE_TYPE_L2X 0x90000000
#define CODE_IMAGE_TYPE_L2U 0xa0000000
#define CODE_IMAGE_TYPE_ISCSI_BOOT_CPRG 0xb0000000
#define CODE_IMAGE_TYPE_ISCSI_BOOT_CFG 0xc0000000
#define CODE_IMAGE_TYPE_ISCSI_BOOT 0xd0000000
#define CODE_IMAGE_TYPE_FCOE_BOOT_CFG 0x10000001
#define CODE_IMAGE_TYPE_FCOE_BOOT 0x20000001
#define CODE_IMAGE_TYPE_FCOE_BOOT_CFG2 0x30000001
#define CODE_IMAGE_TYPE_FCOE_BOOT_CPRG_EVRST 0x40000001
#define CODE_IMAGE_TYPE_NIC_PARTITION_CFG 0x50000001
#define CODE_IMAGE_TYPE_FCOE_BOOT_CFG3 0x60000001
#define CODE_IMAGE_TYPE_FCOE_BOOT_CFG4 0x70000001
#define CODE_IMAGE_TYPE_ISCSI_BOOT_CFG3 0x80000001
#define CODE_IMAGE_TYPE_ISCSI_BOOT_CFG4 0x90000001
#define CODE_IMAGE_TYPE_BOOT_CFG_SHADOW 0x10800001
#define CODE_IMAGE_TYPE_VPD 0xa0000001
#define CODE_IMAGE_TYPE_E3_WC 0xb0000001
#define CODE_IMAGE_TYPE_E3_PCIE 0xc0000001
#define CODE_IMAGE_VNTAG_DATA 0xd0000001
#define CODE_IMAGE_TYPE_SWIM1 0xe0000001
#define CODE_IMAGE_TYPE_SWIM2 0xf0000001
#define CODE_IMAGE_TYPE_SWIM3 0x10000003
#define CODE_IMAGE_TYPE_SWIM4 0x40000003
#define CODE_IMAGE_TYPE_SWIM5 0x50000003
#define CODE_IMAGE_TYPE_SWIM6 0x60000003
#define CODE_IMAGE_TYPE_SWIM7 0x70000003
#define CODE_IMAGE_TYPE_SWIM8 0x80000003
#define CODE_IMAGE_TYPE_MFW2_A 0x90000003
#define CODE_IMAGE_VNTAG_PROFILES_DATA 0xd0000003
#define CODE_IMAGE_NVM_CFG_EXTENDED_SHARED 0xe0000003
#define CODE_IMAGE_TYPE_CCM 0x90800003
/* for shaddow SWIMs feature */
#define CODE_IMAGE_TYPE_SWIM1_B 0x10800003
#define CODE_IMAGE_TYPE_SWIM2_B 0x20800003
#define CODE_IMAGE_TYPE_SWIM3_B 0x30800003
#define CODE_IMAGE_TYPE_SWIM4_B 0x40800003
#define CODE_IMAGE_TYPE_SWIM5_B 0x50800003
#define CODE_IMAGE_TYPE_SWIM6_B 0x60800003
#define CODE_IMAGE_TYPE_SWIM7_B 0x70800003
#define CODE_IMAGE_TYPE_SWIM8_B 0x80800003
#define CODE_IMAGE_TYPE_CCM 0x90800003
#define CODE_IMAGE_TYPE_HW_SET 0xa0800003
#define CODE_IMAGE_TYPE_USR_BLK 0xb0000003
#define CODE_IMAGE_TYPE_ISCSI_PERS 0xc0000003
/* next few groups of image: 0x90800003 -- 0xf0800003
0x00800001 -- 0xf0800001*/
#define CODE_IMAGE_TYPE_EXTENDED_DIR 0xe0000000
#define CODE_IMAGE_TYPE_MAX 0xf0000000
#define CODE_IMAGE_AGENT_TYPE_MASK 0x0f000000
#define CODE_IMAGE_AGENT_NONE 0x00000000
#define CODE_IMAGE_AGENT_HOST 0x01000000
#define CODE_IMAGE_AGENT_MCP 0x02000000
#define CODE_IMAGE_AGENT_TSTORM 0x03000000
#define CODE_IMAGE_AGENT_CSTORM 0x04000000
#define CODE_IMAGE_AGENT_XSTORM 0x05000000
#define CODE_IMAGE_AGENT_USTORM 0x06000000
#define CODE_IMAGE_AGENT_E3WC 0x07000000
#define CODE_IMAGE_AGENT_E3PCIE 0x08000000
#define CODE_IMAGE_AGENT_HOST_BCV 0x09000000
#define CODE_IMAGE_TYPE_BDN 0xc0800003
#define CODE_IMAGE_LENGTH_MASK 0x007ffffc
} code_entry_t;
#define CODE_ENTRY_MAX 16
#define CODE_ENTRY_EXTENDED_DIR_IDX 15
#define MAX_IMAGES_IN_EXTENDED_DIR 64
#define MAX_SPARE_NUM_LENGTH 20
/* version since which shadow feature is supported */
#define MFW_SHADOW_FEATURE_SUPPORTED_MAJOR 7
#define MFW_SHADOW_FEATURE_SUPPORTED_MINOR 0
#define MFW_SHADOW_FEATURE_SUPPORTED_BUILD 24
typedef struct _dir_t
{
/* Similar to the part number in VPD */
} dir_t;
/****************************************************************************
* Manufacturing Information Region *
****************************************************************************/
typedef struct _manuf_info_t
{ /* NVM Offset (size) */
#define MANUF_INFO_FORMAT_REV_MASK 0xff000000
#define MANUF_INFO_LENGTH_MASK 0x0000ffff
#define MANUF_INFO_LENGTH 0x00000000
} manuf_info_t;
/****************************************************************************
* Features Information Region *
****************************************************************************/
typedef struct _feature_info_t
{
/****************************************************************************
* VPD Region *
****************************************************************************/
#define MAX_VPD_R_LENGTH 128
#define MAX_VPD_W_LENGTH 128
typedef struct media_vpd_read_t
{
typedef struct media_vpd_write_t
{
typedef struct media_vpd_t
{
} media_vpd_t;
/****************************************************************************
* License Region *
****************************************************************************/
#define SHARED_SECRET_BYTE_CNT 20
#define OEM_OPAQUE_DATA_BYTE_CNT 32
#define MAC_ADDRESS_ALIGNED_BYTE_CNT 8
/* Upgrade License Region */
#define UPGRADE_KEY_COUNT 1
typedef struct _upgrade_key_info_t
{
#define KEY_AVAILABLE_UPGRADE_KEY_0 0x1
(SVID followed by MAC addr) */
/* Manufacturing License Region */
typedef struct _manuf_key_info_t
{
#define LICENSE_REV_A 'A'
#define LICENSE_REV_MASK 0x0000ffff
#define LICENSE_SIGNATURE_MASK 0xffff0000
#define SSECRET_ENCODED_32BIT_VALUE 0x5a5a5a5a
#define SSECRET_ENCODED_8BIT_VALUE 0x5a
/****************************************************************************
* NVRAM FULL MAP *
****************************************************************************/
typedef struct _nvm_image_t
{ /* NVM Offset (size) */
} nvm_image_t; /* 0x7e8 */
/* This struct defines the additional NVM configuration parameters needed for PATH 1 in E2 */
typedef struct _path1_nvm_image_t
{ /* NVM Offset (size) */
} path1_nvm_image_t; /* 0xdd0 */
/****************************************/
/*** NVM RETAIN section ***/
/****************************************/
// Max nvm retain bitmap size is currently set to the size of manuf_info
// To be to preserve manuf_info in a dword resolution, we need sizeof(manuf_info_t) >> 2
// To represent each dword in bit, divide by 32 ( >>5), and add 1 to round up.
#define NVM_RETAIN_BEGIN 0
/*******************************************************/
/* These structs define the modules image block in NVM */
/*******************************************************/
#define SFF_VENDOR_NAME_LEN 16
#define SFF_VENDOR_OUI_LEN 3
#define SFF_VENDOR_PN_LEN 16
typedef struct _module_info_t
{
#define MODULE_INFO_FLAG_CHECK_VENDOR_NAME (1 << 0)
char vendor_name[SFF_VENDOR_NAME_LEN];
char vendor_pn[SFF_VENDOR_PN_LEN];
typedef struct _module_image_t
{
#define MODULE_IMAGE_VERSION_1 1
/* With branding */
/* This array length depends on the no_modules */
typedef struct _vpd_image_t
{
#define VPD_IMAGE_VERSION 1
/* This array length depends on the number of VPD fields */
} vpd_image_t;
typedef struct _extended_dir_image_t
{
the extended dir image */
included in the extended dir */
/* Array of images information
within extended dir image */
#define MAC_PARTITION_FORMAT_VERSION 1
struct macp_gbl_cfg {
/* Reserved bits: 0-0 */
#define MACP_GBL_CFG_FORMAT_VER_MASK 0x000000FF
#define MACP_GBL_CFG_FORMAT_VER_SHIFT 0
#define MACP_GBL_CFG_GBL_CFG_MASK 0x0000FF00
#define MACP_GBL_CFG_GBL_CFG_SHIFT 8
#define MACP_GBL_CFG_GBL_CFG_DISABLED 0x00000000
#define MACP_GBL_CFG_GBL_CFG_ENABLED 0x00000100
};
struct macp_port_cfg {
#define MACP_PORT_CFG_FLOW_CTRL_MASK 0x000000FF
#define MACP_PORT_CFG_FLOW_CTRL_SHIFT 0
#define MACP_PORT_CFG_FLOW_CTRL_AUTO 0x00000000
#define MACP_PORT_CFG_FLOW_CTRL_TX_ONLY 0x00000001
#define MACP_PORT_CFG_FLOW_CTRL_RX_ONLY 0x00000002
#define MACP_PORT_CFG_FLOW_CTRL_BOTH 0x00000003
#define MACP_PORT_CFG_FLOW_CTRL_NONE 0x00000004
#define MACP_PORT_CFG_PHY_LINK_SPD_MASK 0x0000FF00
#define MACP_PORT_CFG_PHY_LINK_SPD_SHIFT 8
#define MACP_PORT_CFG_PHY_LINK_SPD_1G 0x00000000
#define MACP_PORT_CFG_PHY_LINK_SPD_2_DOT_5G 0x00000100
#define MACP_PORT_CFG_PHY_LINK_SPD_10G 0x00000200
#define MACP_PORT_CFG_PHY_LINK_SPD_20G 0x00000400
#define MACP_PORT_CFG_NUM_PARTITIONS_MASK 0x00FF0000
#define MACP_PORT_CFG_NUM_PARTITIONS_SHIFT 16
};
struct macp_func_cfg {
#define MACP_FUNC_CFG_FLAGS_MASK 0x0000007F
#define MACP_FUNC_CFG_FLAGS_SHIFT 0
#define MACP_FUNC_CFG_FLAGS_ENABLED 0x00000001
#define MACP_FUNC_CFG_FLAGS_ETHERNET 0x00000002
#define MACP_FUNC_CFG_FLAGS_ISCSI_OFFLOAD 0x00000004
#define MACP_FUNC_CFG_FLAGS_FCOE_OFFLOAD 0x00000008
/* pause on host ring */
#define MACP_FUNC_CFG_PAUSE_ON_HOST_RING_MASK 0x00000080
#define MACP_FUNC_CFG_PAUSE_ON_HOST_RING_SHIFT 7
#define MACP_FUNC_CFG_PAUSE_ON_HOST_RING_DISABLED 0x00000000
#define MACP_FUNC_CFG_PAUSE_ON_HOST_RING_ENABLED 0x00000080
#define MACP_FUNC_CFG_BW_WEIGHT_MASK 0x0000FF00
#define MACP_FUNC_CFG_BW_WEIGHT_SHIFT 8
#define MACP_FUNC_CFG_BW_MAX_MASK 0xFFFF0000
#define MACP_FUNC_CFG_BW_MAX_SHIFT 16
/* number of vfs in function, if 0 - sriov disabled */
#define MACP_FUNC_CFG_NUMBER_OF_VFS_MASK 0x000000FF
#define MACP_FUNC_CFG_NUMBER_OF_VFS_SHIFT 0
};
typedef struct _nvm_nic_part_cfg_t
{
struct macp_gbl_cfg global_cfg;
/* NOTE: CRC will be appended by nvm_program procedure */
#define NIV_FORMAT_VERSION_ONE 1
#define NIV_MAX_PROFILE_LEN 80
#define NIV_NUM_PROFILES_SUPPORTED 64
struct niv_gbl_cfg { /* NVRAM OFFSET */
#define NIV_GBL_CFG_IMAGE_VER_MASK 0x000000FF
#define NIV_GBL_CFG_IMAGE_VER_SHIFT 0
};
struct niv_port_cfg { /* port 0: 0x100C port 1: 0x1018 */
#define NIV_PORT_CFG_FLOW_CTRL_MASK 0x000000FF
#define NIV_PORT_CFG_FLOW_CTRL_SHIFT 0
#define NIV_PORT_CFG_FLOW_CTRL_AUTO 0x00000000
#define NIV_PORT_CFG_FLOW_CTRL_TX_ONLY 0x00000001
#define NIV_PORT_CFG_FLOW_CTRL_RX_ONLY 0x00000002
#define NIV_PORT_CFG_FLOW_CTRL_BOTH 0x00000003
#define NIV_PORT_CFG_FLOW_CTRL_NONE 0x00000004
#define NIV_PORT_CFG_PHY_LINK_SPD_MASK 0x0000FF00
#define NIV_PORT_CFG_PHY_LINK_SPD_SHIFT 8
#define NIV_PORT_CFG_PHY_LINK_SPD_1G 0x00000000
#define NIV_PORT_CFG_PHY_LINK_SPD_2_DOT_5G 0x00000100
#define NIV_PORT_CFG_PHY_LINK_SPD_10G 0x00000200
#define NIV_PORT_CFG_PHY_LINK_SPD_20G 0x00000400
};
struct niv_func_cfg { /* port 0: 0x1024 port 1: 0x10AC */
#define NIV_FUNC_CFG_bw_weight_MASK 0x0000FFFF
#define NIV_FUNC_CFG_bw_weight_SHIFT 0
#define NIV_FUNC_CFG_bw_max_MASK 0xFFFF0000
#define NIV_FUNC_CFG_bw_max_SHIFT 16
#define NIV_FUNC_CFG_vif_type_MASK 0x0000007F
#define NIV_FUNC_CFG_vif_type_SHIFT 0
#define NIV_FUNC_CFG_vif_type_ENABLED 0x00000001
#define NIV_FUNC_CFG_vif_type_ETHERNET 0x00000002
#define NIV_FUNC_CFG_vif_type_ISCSI_OFFLOAD 0x00000004
#define NIV_FUNC_CFG_vif_type_FCOE_OFFLOAD 0x00000008
/* pause on host ring */
#define NIV_FUNC_CFG_PAUSE_ON_HOST_RING_MASK 0x00000080
#define NIV_FUNC_CFG_PAUSE_ON_HOST_RING_SHIFT 7
#define NIV_FUNC_CFG_PAUSE_ON_HOST_RING_DISABLED 0x00000000
#define NIV_FUNC_CFG_PAUSE_ON_HOST_RING_ENABLED 0x00000080
#define NIV_FUNC_CFG_remote_boot_enabled_MASK 0x0000FF00
#define NIV_FUNC_CFG_remote_boot_enabled_SHIFT 8
#define NIV_FUNC_CFG_remote_boot_enabled_DISABLED 0x00000000
#define NIV_FUNC_CFG_remote_boot_enabled_ENABLED 0x00000100
#define NIV_FUNC_CFG_profile_enabled_MASK 0x00FF0000
#define NIV_FUNC_CFG_profile_enabled_SHIFT 16
#define NIV_FUNC_CFG_profile_enabled_DISABLED 0x00000000
#define NIV_FUNC_CFG_profile_enabled_ENABLED 0x00010000
};
typedef struct _nvm_niv_cfg_t
{
struct niv_port_profiles_cfg { /* port 0: 0x1600 port 1: 0x2A00 */
};
typedef struct _nvm_niv_port_profile_t
{
typedef struct _hw_set_info_t
{
#define GRC_REG_TYPE 1
#define PHY_REG_TYPE 2
#define PCI_REG_TYPE 4
#define READ_OP 1
#define WRITE_OP 2
#define RMW_SET_OP 3
#define RMW_CLR_OP 4
#define POR_RESET_TYPE (1 << 0)
typedef struct _hw_set_image_t
{
#define HW_SET_IMAGE_VERSION 1
/* This array length depends on the no_hw_sets */
struct iscsi_flash_meta_data {
};
#define ISID_SIZE 6
struct iscsi_flash_session {
#define FLASH_SESS_CTRL_ENTRY_ENABLE (0)
#define FLASH_SESS_CTRL_AUTO_CONNECT (1)
#define FLASH_SESS_CTRL_AUTO_SEND_TGT_DISABLE (2)
#define FLASH_SESS_CTRL_DISCOVERY_SESS (3)
#define FLASH_SESS_CTRL_ENABLE_IMM_DATA (4)
#define FLASH_SESS_CTRL_ENABLE_INIT_R2T (5)
#define FLASH_SESS_CTRL_DATA_SEQ_IN_ORDER (6)
#define FLASH_SESS_CTRL_DATA_PDU_IN_ORDER (7)
#define FLASH_SESS_CTRL_CHAP_AUTH (8)
#define FLASH_SESS_CTRL_BIDI_CHAP (9)
#define FLASH_SESS_CTRL_DISCOVERY_LOGOUT (10)
#define FLASH_SESS_CTRL_DISCOVERY_AUTH_OPT (11)
#define FLASH_SESS_STAT_IS_BOOT_TARGET (0)
char portal_type[4];
char targetalias[32];
char username[64];
char username_in[64];
char password[64];
char password_in[64];
char targetname[256];
};
struct iscsi_flash_connection {
#define FLASH_CONN_CTRL_HEADER_DIGEST (0)
#define FLASH_CONN_CTRL_DATA_DIGEST (1)
#define FLASH_CONN_CTRL_SNACK_REQ (2)
#define FLASH_CONN_CTRL_TCP_TIMESTAMP_STAT (3)
#define FLASH_CONN_CTRL_TCP_NAGLE_DISABLE (4)
#define FLASH_CONN_CTRL_TCP_WSF_DISABLE (5)
#define FLASH_CONN_CTRL_TCP_TIMER_SCALE (6)
#define FLASH_CONN_CTRL_TCP_TIMESTAMP_ENABLE (7)
#define FLASH_CONN_CTRL_IP_FRAG_DISABLE (8)
#define FLASH_CONN_STAT_IS_FW_ASSIGNED_IPV6 (0)
};
struct iscsi_flash_initiator {
char initiatorname[256];
};
struct iscsi_flashnode {
struct iscsi_flash_session session;
struct iscsi_flash_connection connection;
struct iscsi_flash_initiator initiator;
};
struct iscsi_persistent_image {
struct iscsi_flash_meta_data meta_data;
};
#define NVM_CFG_EXTENDED_SHARED_IMAGE_MAX_SIZE 256
#endif //NVM_MAP_H