aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/bnx2.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/bnx2.h')
-rw-r--r--drivers/net/bnx2.h119
1 files changed, 115 insertions, 4 deletions
diff --git a/drivers/net/bnx2.h b/drivers/net/bnx2.h
index 62857b6a6ee4..76bb5f1a250b 100644
--- a/drivers/net/bnx2.h
+++ b/drivers/net/bnx2.h
@@ -1449,8 +1449,9 @@ struct l2_fhdr {
1449#define BNX2_EMAC_MODE_PORT_NONE (0L<<2) 1449#define BNX2_EMAC_MODE_PORT_NONE (0L<<2)
1450#define BNX2_EMAC_MODE_PORT_MII (1L<<2) 1450#define BNX2_EMAC_MODE_PORT_MII (1L<<2)
1451#define BNX2_EMAC_MODE_PORT_GMII (2L<<2) 1451#define BNX2_EMAC_MODE_PORT_GMII (2L<<2)
1452#define BNX2_EMAC_MODE_PORT_UNDEF (3L<<2) 1452#define BNX2_EMAC_MODE_PORT_MII_10 (3L<<2)
1453#define BNX2_EMAC_MODE_MAC_LOOP (1L<<4) 1453#define BNX2_EMAC_MODE_MAC_LOOP (1L<<4)
1454#define BNX2_EMAC_MODE_25G (1L<<5)
1454#define BNX2_EMAC_MODE_TAGGED_MAC_CTL (1L<<7) 1455#define BNX2_EMAC_MODE_TAGGED_MAC_CTL (1L<<7)
1455#define BNX2_EMAC_MODE_TX_BURST (1L<<8) 1456#define BNX2_EMAC_MODE_TX_BURST (1L<<8)
1456#define BNX2_EMAC_MODE_MAX_DEFER_DROP_ENA (1L<<9) 1457#define BNX2_EMAC_MODE_MAX_DEFER_DROP_ENA (1L<<9)
@@ -3714,6 +3715,15 @@ struct l2_fhdr {
3714#define BNX2_MCP_ROM 0x00150000 3715#define BNX2_MCP_ROM 0x00150000
3715#define BNX2_MCP_SCRATCH 0x00160000 3716#define BNX2_MCP_SCRATCH 0x00160000
3716 3717
3718#define BNX2_SHM_HDR_SIGNATURE BNX2_MCP_SCRATCH
3719#define BNX2_SHM_HDR_SIGNATURE_SIG_MASK 0xffff0000
3720#define BNX2_SHM_HDR_SIGNATURE_SIG 0x53530000
3721#define BNX2_SHM_HDR_SIGNATURE_VER_MASK 0x000000ff
3722#define BNX2_SHM_HDR_SIGNATURE_VER_ONE 0x00000001
3723
3724#define BNX2_SHM_HDR_ADDR_0 BNX2_MCP_SCRATCH + 4
3725#define BNX2_SHM_HDR_ADDR_1 BNX2_MCP_SCRATCH + 8
3726
3717 3727
3718#define NUM_MC_HASH_REGISTERS 8 3728#define NUM_MC_HASH_REGISTERS 8
3719 3729
@@ -3724,6 +3734,53 @@ struct l2_fhdr {
3724#define PHY_ID(id) ((id) & 0xfffffff0) 3734#define PHY_ID(id) ((id) & 0xfffffff0)
3725#define PHY_REV_ID(id) ((id) & 0xf) 3735#define PHY_REV_ID(id) ((id) & 0xf)
3726 3736
3737/* 5708 Serdes PHY registers */
3738
3739#define BCM5708S_UP1 0xb
3740
3741#define BCM5708S_UP1_2G5 0x1
3742
3743#define BCM5708S_BLK_ADDR 0x1f
3744
3745#define BCM5708S_BLK_ADDR_DIG 0x0000
3746#define BCM5708S_BLK_ADDR_DIG3 0x0002
3747#define BCM5708S_BLK_ADDR_TX_MISC 0x0005
3748
3749/* Digital Block */
3750#define BCM5708S_1000X_CTL1 0x10
3751
3752#define BCM5708S_1000X_CTL1_FIBER_MODE 0x0001
3753#define BCM5708S_1000X_CTL1_AUTODET_EN 0x0010
3754
3755#define BCM5708S_1000X_CTL2 0x11
3756
3757#define BCM5708S_1000X_CTL2_PLLEL_DET_EN 0x0001
3758
3759#define BCM5708S_1000X_STAT1 0x14
3760
3761#define BCM5708S_1000X_STAT1_SGMII 0x0001
3762#define BCM5708S_1000X_STAT1_LINK 0x0002
3763#define BCM5708S_1000X_STAT1_FD 0x0004
3764#define BCM5708S_1000X_STAT1_SPEED_MASK 0x0018
3765#define BCM5708S_1000X_STAT1_SPEED_10 0x0000
3766#define BCM5708S_1000X_STAT1_SPEED_100 0x0008
3767#define BCM5708S_1000X_STAT1_SPEED_1G 0x0010
3768#define BCM5708S_1000X_STAT1_SPEED_2G5 0x0018
3769#define BCM5708S_1000X_STAT1_TX_PAUSE 0x0020
3770#define BCM5708S_1000X_STAT1_RX_PAUSE 0x0040
3771
3772/* Digital3 Block */
3773#define BCM5708S_DIG_3_0 0x10
3774
3775#define BCM5708S_DIG_3_0_USE_IEEE 0x0001
3776
3777/* Tx/Misc Block */
3778#define BCM5708S_TX_ACTL1 0x15
3779
3780#define BCM5708S_TX_ACTL1_DRIVER_VCM 0x30
3781
3782#define BCM5708S_TX_ACTL3 0x17
3783
3727#define MIN_ETHERNET_PACKET_SIZE 60 3784#define MIN_ETHERNET_PACKET_SIZE 60
3728#define MAX_ETHERNET_PACKET_SIZE 1514 3785#define MAX_ETHERNET_PACKET_SIZE 1514
3729#define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014 3786#define MAX_ETHERNET_JUMBO_PACKET_SIZE 9014
@@ -3799,7 +3856,7 @@ struct sw_bd {
3799#define BUFFERED_FLASH_PHY_PAGE_SIZE (1 << BUFFERED_FLASH_PAGE_BITS) 3856#define BUFFERED_FLASH_PHY_PAGE_SIZE (1 << BUFFERED_FLASH_PAGE_BITS)
3800#define BUFFERED_FLASH_BYTE_ADDR_MASK (BUFFERED_FLASH_PHY_PAGE_SIZE-1) 3857#define BUFFERED_FLASH_BYTE_ADDR_MASK (BUFFERED_FLASH_PHY_PAGE_SIZE-1)
3801#define BUFFERED_FLASH_PAGE_SIZE 264 3858#define BUFFERED_FLASH_PAGE_SIZE 264
3802#define BUFFERED_FLASH_TOTAL_SIZE 131072 3859#define BUFFERED_FLASH_TOTAL_SIZE 0x21000
3803 3860
3804#define SAIFUN_FLASH_PAGE_BITS 8 3861#define SAIFUN_FLASH_PAGE_BITS 8
3805#define SAIFUN_FLASH_PHY_PAGE_SIZE (1 << SAIFUN_FLASH_PAGE_BITS) 3862#define SAIFUN_FLASH_PHY_PAGE_SIZE (1 << SAIFUN_FLASH_PAGE_BITS)
@@ -3807,6 +3864,12 @@ struct sw_bd {
3807#define SAIFUN_FLASH_PAGE_SIZE 256 3864#define SAIFUN_FLASH_PAGE_SIZE 256
3808#define SAIFUN_FLASH_BASE_TOTAL_SIZE 65536 3865#define SAIFUN_FLASH_BASE_TOTAL_SIZE 65536
3809 3866
3867#define ST_MICRO_FLASH_PAGE_BITS 8
3868#define ST_MICRO_FLASH_PHY_PAGE_SIZE (1 << ST_MICRO_FLASH_PAGE_BITS)
3869#define ST_MICRO_FLASH_BYTE_ADDR_MASK (ST_MICRO_FLASH_PHY_PAGE_SIZE-1)
3870#define ST_MICRO_FLASH_PAGE_SIZE 256
3871#define ST_MICRO_FLASH_BASE_TOTAL_SIZE 65536
3872
3810#define NVRAM_TIMEOUT_COUNT 30000 3873#define NVRAM_TIMEOUT_COUNT 30000
3811 3874
3812 3875
@@ -3815,6 +3878,8 @@ struct sw_bd {
3815 BNX2_NVM_CFG1_PROTECT_MODE | \ 3878 BNX2_NVM_CFG1_PROTECT_MODE | \
3816 BNX2_NVM_CFG1_FLASH_SIZE) 3879 BNX2_NVM_CFG1_FLASH_SIZE)
3817 3880
3881#define FLASH_BACKUP_STRAP_MASK (0xf << 26)
3882
3818struct flash_spec { 3883struct flash_spec {
3819 u32 strapping; 3884 u32 strapping;
3820 u32 config1; 3885 u32 config1;
@@ -3849,6 +3914,9 @@ struct bnx2 {
3849 u16 tx_cons; 3914 u16 tx_cons;
3850 int tx_ring_size; 3915 int tx_ring_size;
3851 3916
3917 u16 hw_tx_cons;
3918 u16 hw_rx_cons;
3919
3852#ifdef BCM_VLAN 3920#ifdef BCM_VLAN
3853 struct vlan_group *vlgrp; 3921 struct vlan_group *vlgrp;
3854#endif 3922#endif
@@ -3893,6 +3961,7 @@ struct bnx2 {
3893#define PHY_SERDES_FLAG 1 3961#define PHY_SERDES_FLAG 1
3894#define PHY_CRC_FIX_FLAG 2 3962#define PHY_CRC_FIX_FLAG 2
3895#define PHY_PARALLEL_DETECT_FLAG 4 3963#define PHY_PARALLEL_DETECT_FLAG 4
3964#define PHY_2_5G_CAPABLE_FLAG 8
3896#define PHY_INT_MODE_MASK_FLAG 0x300 3965#define PHY_INT_MODE_MASK_FLAG 0x300
3897#define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100 3966#define PHY_INT_MODE_AUTO_POLLING_FLAG 0x100
3898#define PHY_INT_MODE_LINK_READY_FLAG 0x200 3967#define PHY_INT_MODE_LINK_READY_FLAG 0x200
@@ -3901,6 +3970,7 @@ struct bnx2 {
3901 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */ 3970 /* chip num:16-31, rev:12-15, metal:4-11, bond_id:0-3 */
3902#define CHIP_NUM(bp) (((bp)->chip_id) & 0xffff0000) 3971#define CHIP_NUM(bp) (((bp)->chip_id) & 0xffff0000)
3903#define CHIP_NUM_5706 0x57060000 3972#define CHIP_NUM_5706 0x57060000
3973#define CHIP_NUM_5708 0x57080000
3904 3974
3905#define CHIP_REV(bp) (((bp)->chip_id) & 0x0000f000) 3975#define CHIP_REV(bp) (((bp)->chip_id) & 0x0000f000)
3906#define CHIP_REV_Ax 0x00000000 3976#define CHIP_REV_Ax 0x00000000
@@ -3913,6 +3983,9 @@ struct bnx2 {
3913#define CHIP_ID(bp) (((bp)->chip_id) & 0xfffffff0) 3983#define CHIP_ID(bp) (((bp)->chip_id) & 0xfffffff0)
3914#define CHIP_ID_5706_A0 0x57060000 3984#define CHIP_ID_5706_A0 0x57060000
3915#define CHIP_ID_5706_A1 0x57060010 3985#define CHIP_ID_5706_A1 0x57060010
3986#define CHIP_ID_5706_A2 0x57060020
3987#define CHIP_ID_5708_A0 0x57080000
3988#define CHIP_ID_5708_B0 0x57081000
3916 3989
3917#define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf) 3990#define CHIP_BOND_ID(bp) (((bp)->chip_id) & 0xf)
3918 3991
@@ -3991,6 +4064,8 @@ struct bnx2 {
3991 4064
3992 u8 mac_addr[8]; 4065 u8 mac_addr[8];
3993 4066
4067 u32 shmem_base;
4068
3994 u32 fw_ver; 4069 u32 fw_ver;
3995 4070
3996 int pm_cap; 4071 int pm_cap;
@@ -4130,14 +4205,46 @@ struct fw_info {
4130#define BNX2_FW_MSG_STATUS_FAILURE 0x00ff0000 4205#define BNX2_FW_MSG_STATUS_FAILURE 0x00ff0000
4131 4206
4132#define BNX2_LINK_STATUS 0x0000000c 4207#define BNX2_LINK_STATUS 0x0000000c
4208#define BNX2_LINK_STATUS_INIT_VALUE 0xffffffff
4209#define BNX2_LINK_STATUS_LINK_UP 0x1
4210#define BNX2_LINK_STATUS_LINK_DOWN 0x0
4211#define BNX2_LINK_STATUS_SPEED_MASK 0x1e
4212#define BNX2_LINK_STATUS_AN_INCOMPLETE (0<<1)
4213#define BNX2_LINK_STATUS_10HALF (1<<1)
4214#define BNX2_LINK_STATUS_10FULL (2<<1)
4215#define BNX2_LINK_STATUS_100HALF (3<<1)
4216#define BNX2_LINK_STATUS_100BASE_T4 (4<<1)
4217#define BNX2_LINK_STATUS_100FULL (5<<1)
4218#define BNX2_LINK_STATUS_1000HALF (6<<1)
4219#define BNX2_LINK_STATUS_1000FULL (7<<1)
4220#define BNX2_LINK_STATUS_2500HALF (8<<1)
4221#define BNX2_LINK_STATUS_2500FULL (9<<1)
4222#define BNX2_LINK_STATUS_AN_ENABLED (1<<5)
4223#define BNX2_LINK_STATUS_AN_COMPLETE (1<<6)
4224#define BNX2_LINK_STATUS_PARALLEL_DET (1<<7)
4225#define BNX2_LINK_STATUS_RESERVED (1<<8)
4226#define BNX2_LINK_STATUS_PARTNER_AD_1000FULL (1<<9)
4227#define BNX2_LINK_STATUS_PARTNER_AD_1000HALF (1<<10)
4228#define BNX2_LINK_STATUS_PARTNER_AD_100BT4 (1<<11)
4229#define BNX2_LINK_STATUS_PARTNER_AD_100FULL (1<<12)
4230#define BNX2_LINK_STATUS_PARTNER_AD_100HALF (1<<13)
4231#define BNX2_LINK_STATUS_PARTNER_AD_10FULL (1<<14)
4232#define BNX2_LINK_STATUS_PARTNER_AD_10HALF (1<<15)
4233#define BNX2_LINK_STATUS_TX_FC_ENABLED (1<<16)
4234#define BNX2_LINK_STATUS_RX_FC_ENABLED (1<<17)
4235#define BNX2_LINK_STATUS_PARTNER_SYM_PAUSE_CAP (1<<18)
4236#define BNX2_LINK_STATUS_PARTNER_ASYM_PAUSE_CAP (1<<19)
4237#define BNX2_LINK_STATUS_SERDES_LINK (1<<20)
4238#define BNX2_LINK_STATUS_PARTNER_AD_2500FULL (1<<21)
4239#define BNX2_LINK_STATUS_PARTNER_AD_2500HALF (1<<22)
4133 4240
4134#define BNX2_DRV_PULSE_MB 0x00000010 4241#define BNX2_DRV_PULSE_MB 0x00000010
4135#define BNX2_DRV_PULSE_SEQ_MASK 0x0000ffff 4242#define BNX2_DRV_PULSE_SEQ_MASK 0x00007fff
4136 4243
4137/* Indicate to the firmware not to go into the 4244/* Indicate to the firmware not to go into the
4138 * OS absent when it is not getting driver pulse. 4245 * OS absent when it is not getting driver pulse.
4139 * This is used for debugging. */ 4246 * This is used for debugging. */
4140#define BNX2_DRV_MSG_DATA_PULSE_CODE_ALWAYS_ALIVE 0x00010000 4247#define BNX2_DRV_MSG_DATA_PULSE_CODE_ALWAYS_ALIVE 0x00080000
4141 4248
4142#define BNX2_DEV_INFO_SIGNATURE 0x00000020 4249#define BNX2_DEV_INFO_SIGNATURE 0x00000020
4143#define BNX2_DEV_INFO_SIGNATURE_MAGIC 0x44564900 4250#define BNX2_DEV_INFO_SIGNATURE_MAGIC 0x44564900
@@ -4160,6 +4267,8 @@ struct fw_info {
4160#define BNX2_SHARED_HW_CFG_DESIGN_LOM 0x1 4267#define BNX2_SHARED_HW_CFG_DESIGN_LOM 0x1
4161#define BNX2_SHARED_HW_CFG_PHY_COPPER 0 4268#define BNX2_SHARED_HW_CFG_PHY_COPPER 0
4162#define BNX2_SHARED_HW_CFG_PHY_FIBER 0x2 4269#define BNX2_SHARED_HW_CFG_PHY_FIBER 0x2
4270#define BNX2_SHARED_HW_CFG_PHY_2_5G 0x20
4271#define BNX2_SHARED_HW_CFG_PHY_BACKPLANE 0x40
4163#define BNX2_SHARED_HW_CFG_LED_MODE_SHIFT_BITS 8 4272#define BNX2_SHARED_HW_CFG_LED_MODE_SHIFT_BITS 8
4164#define BNX2_SHARED_HW_CFG_LED_MODE_MASK 0x300 4273#define BNX2_SHARED_HW_CFG_LED_MODE_MASK 0x300
4165#define BNX2_SHARED_HW_CFG_LED_MODE_MAC 0 4274#define BNX2_SHARED_HW_CFG_LED_MODE_MAC 0
@@ -4173,9 +4282,11 @@ struct fw_info {
4173 4282
4174#define BNX2_PORT_HW_CFG_MAC_LOWER 0x00000054 4283#define BNX2_PORT_HW_CFG_MAC_LOWER 0x00000054
4175#define BNX2_PORT_HW_CFG_CONFIG 0x00000058 4284#define BNX2_PORT_HW_CFG_CONFIG 0x00000058
4285#define BNX2_PORT_HW_CFG_CFG_TXCTL3_MASK 0x0000ffff
4176#define BNX2_PORT_HW_CFG_CFG_DFLT_LINK_MASK 0x001f0000 4286#define BNX2_PORT_HW_CFG_CFG_DFLT_LINK_MASK 0x001f0000
4177#define BNX2_PORT_HW_CFG_CFG_DFLT_LINK_AN 0x00000000 4287#define BNX2_PORT_HW_CFG_CFG_DFLT_LINK_AN 0x00000000
4178#define BNX2_PORT_HW_CFG_CFG_DFLT_LINK_1G 0x00030000 4288#define BNX2_PORT_HW_CFG_CFG_DFLT_LINK_1G 0x00030000
4289#define BNX2_PORT_HW_CFG_CFG_DFLT_LINK_2_5G 0x00040000
4179 4290
4180#define BNX2_PORT_HW_CFG_IMD_MAC_A_UPPER 0x00000068 4291#define BNX2_PORT_HW_CFG_IMD_MAC_A_UPPER 0x00000068
4181#define BNX2_PORT_HW_CFG_IMD_MAC_A_LOWER 0x0000006c 4292#define BNX2_PORT_HW_CFG_IMD_MAC_A_LOWER 0x0000006c