diff options
author | Eilon Greenstein <eilong@broadcom.com> | 2009-02-12 03:36:47 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-02-16 02:31:15 -0500 |
commit | 35b19ba51c1e6258a338a0855c72384abc33ce11 (patch) | |
tree | cf67f18b4ec1d228fdef2e607e814c2fa48d8137 /drivers | |
parent | 1c06328c0345638ea7532b45cadfe713c9e9781e (diff) |
bnx2x: Removing the board type
There are too many different board types and this field is not scalable.
Removing it and making decisions according to other fields
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/net/bnx2x.h | 1 | ||||
-rw-r--r-- | drivers/net/bnx2x_hsi.h | 34 | ||||
-rw-r--r-- | drivers/net/bnx2x_main.c | 20 |
3 files changed, 14 insertions, 41 deletions
diff --git a/drivers/net/bnx2x.h b/drivers/net/bnx2x.h index 8c2124e0eaea..a18ace07fa42 100644 --- a/drivers/net/bnx2x.h +++ b/drivers/net/bnx2x.h | |||
@@ -523,7 +523,6 @@ struct bnx2x_common { | |||
523 | u32 shmem_base; | 523 | u32 shmem_base; |
524 | 524 | ||
525 | u32 hw_config; | 525 | u32 hw_config; |
526 | u32 board; | ||
527 | 526 | ||
528 | u32 bc_ver; | 527 | u32 bc_ver; |
529 | 528 | ||
diff --git a/drivers/net/bnx2x_hsi.h b/drivers/net/bnx2x_hsi.h index b0f41d1f9ab4..85e4df68b5d8 100644 --- a/drivers/net/bnx2x_hsi.h +++ b/drivers/net/bnx2x_hsi.h | |||
@@ -119,35 +119,15 @@ struct shared_hw_cfg { /* NVRAM Offset */ | |||
119 | #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_BCM5221 0x00010000 | 119 | #define SHARED_HW_CFG_UMP_NC_SI_EXT_PHY_TYPE_BCM5221 0x00010000 |
120 | 120 | ||
121 | u32 board; /* 0x124 */ | 121 | u32 board; /* 0x124 */ |
122 | #define SHARED_HW_CFG_BOARD_TYPE_MASK 0x0000ffff | 122 | #define SHARED_HW_CFG_BOARD_REV_MASK 0x00FF0000 |
123 | #define SHARED_HW_CFG_BOARD_TYPE_SHIFT 0 | ||
124 | #define SHARED_HW_CFG_BOARD_TYPE_NONE 0x00000000 | ||
125 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710T1000 0x00000001 | ||
126 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710T1001 0x00000002 | ||
127 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710T1002G 0x00000003 | ||
128 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710T1004G 0x00000004 | ||
129 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710T1007G 0x00000005 | ||
130 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710T1015G 0x00000006 | ||
131 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1020G 0x00000007 | ||
132 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710T1003G 0x00000008 | ||
133 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1022G 0x00000009 | ||
134 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1021G 0x0000000a | ||
135 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1023G 0x0000000b | ||
136 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957710A1033G 0x0000000c | ||
137 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957711T1101 0x0000000d | ||
138 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957711ET1201 0x0000000e | ||
139 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957711A1133G 0x0000000f | ||
140 | #define SHARED_HW_CFG_BOARD_TYPE_BCM957711EA1233G 0x00000010 | ||
141 | |||
142 | #define SHARED_HW_CFG_BOARD_VER_MASK 0xffff0000 | ||
143 | #define SHARED_HW_CFG_BOARD_VER_SHIFT 16 | ||
144 | #define SHARED_HW_CFG_BOARD_MAJOR_VER_MASK 0xf0000000 | ||
145 | #define SHARED_HW_CFG_BOARD_MAJOR_VER_SHIFT 28 | ||
146 | #define SHARED_HW_CFG_BOARD_MINOR_VER_MASK 0x0f000000 | ||
147 | #define SHARED_HW_CFG_BOARD_MINOR_VER_SHIFT 24 | ||
148 | #define SHARED_HW_CFG_BOARD_REV_MASK 0x00ff0000 | ||
149 | #define SHARED_HW_CFG_BOARD_REV_SHIFT 16 | 123 | #define SHARED_HW_CFG_BOARD_REV_SHIFT 16 |
150 | 124 | ||
125 | #define SHARED_HW_CFG_BOARD_MAJOR_VER_MASK 0x0F000000 | ||
126 | #define SHARED_HW_CFG_BOARD_MAJOR_VER_SHIFT 24 | ||
127 | |||
128 | #define SHARED_HW_CFG_BOARD_MINOR_VER_MASK 0xF0000000 | ||
129 | #define SHARED_HW_CFG_BOARD_MINOR_VER_SHIFT 28 | ||
130 | |||
151 | u32 reserved; /* 0x128 */ | 131 | u32 reserved; /* 0x128 */ |
152 | 132 | ||
153 | }; | 133 | }; |
diff --git a/drivers/net/bnx2x_main.c b/drivers/net/bnx2x_main.c index 77793bba7a9f..f4486580b99f 100644 --- a/drivers/net/bnx2x_main.c +++ b/drivers/net/bnx2x_main.c | |||
@@ -2505,9 +2505,8 @@ static inline void bnx2x_attn_int_deasserted0(struct bnx2x *bp, u32 attn) | |||
2505 | 2505 | ||
2506 | BNX2X_ERR("SPIO5 hw attention\n"); | 2506 | BNX2X_ERR("SPIO5 hw attention\n"); |
2507 | 2507 | ||
2508 | switch (bp->common.board & SHARED_HW_CFG_BOARD_TYPE_MASK) { | 2508 | switch (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config)) { |
2509 | case SHARED_HW_CFG_BOARD_TYPE_BCM957710A1021G: | 2509 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101: |
2510 | case SHARED_HW_CFG_BOARD_TYPE_BCM957710A1022G: | ||
2511 | /* Fan failure attention */ | 2510 | /* Fan failure attention */ |
2512 | 2511 | ||
2513 | /* The PHY reset is controlled by GPIO 1 */ | 2512 | /* The PHY reset is controlled by GPIO 1 */ |
@@ -5622,9 +5621,8 @@ static int bnx2x_init_common(struct bnx2x *bp) | |||
5622 | return -EBUSY; | 5621 | return -EBUSY; |
5623 | } | 5622 | } |
5624 | 5623 | ||
5625 | switch (bp->common.board & SHARED_HW_CFG_BOARD_TYPE_MASK) { | 5624 | switch (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config)) { |
5626 | case SHARED_HW_CFG_BOARD_TYPE_BCM957710A1021G: | 5625 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101: |
5627 | case SHARED_HW_CFG_BOARD_TYPE_BCM957710A1022G: | ||
5628 | /* Fan failure is indicated by SPIO 5 */ | 5626 | /* Fan failure is indicated by SPIO 5 */ |
5629 | bnx2x_set_spio(bp, MISC_REGISTERS_SPIO_5, | 5627 | bnx2x_set_spio(bp, MISC_REGISTERS_SPIO_5, |
5630 | MISC_REGISTERS_SPIO_INPUT_HI_Z); | 5628 | MISC_REGISTERS_SPIO_INPUT_HI_Z); |
@@ -5830,9 +5828,8 @@ static int bnx2x_init_port(struct bnx2x *bp) | |||
5830 | /* Port MCP comes here */ | 5828 | /* Port MCP comes here */ |
5831 | /* Port DMAE comes here */ | 5829 | /* Port DMAE comes here */ |
5832 | 5830 | ||
5833 | switch (bp->common.board & SHARED_HW_CFG_BOARD_TYPE_MASK) { | 5831 | switch (XGXS_EXT_PHY_TYPE(bp->link_params.ext_phy_config)) { |
5834 | case SHARED_HW_CFG_BOARD_TYPE_BCM957710A1021G: | 5832 | case PORT_HW_CFG_XGXS_EXT_PHY_TYPE_SFX7101: |
5835 | case SHARED_HW_CFG_BOARD_TYPE_BCM957710A1022G: | ||
5836 | /* add SPIO 5 to group 0 */ | 5833 | /* add SPIO 5 to group 0 */ |
5837 | val = REG_RD(bp, MISC_REG_AEU_ENABLE1_FUNC_0_OUT_0); | 5834 | val = REG_RD(bp, MISC_REG_AEU_ENABLE1_FUNC_0_OUT_0); |
5838 | val |= AEU_INPUTS_ATTN_BITS_SPIO5; | 5835 | val |= AEU_INPUTS_ATTN_BITS_SPIO5; |
@@ -7433,10 +7430,7 @@ static void __devinit bnx2x_get_common_hwinfo(struct bnx2x *bp) | |||
7433 | BNX2X_ERR("BAD MCP validity signature\n"); | 7430 | BNX2X_ERR("BAD MCP validity signature\n"); |
7434 | 7431 | ||
7435 | bp->common.hw_config = SHMEM_RD(bp, dev_info.shared_hw_config.config); | 7432 | bp->common.hw_config = SHMEM_RD(bp, dev_info.shared_hw_config.config); |
7436 | bp->common.board = SHMEM_RD(bp, dev_info.shared_hw_config.board); | 7433 | BNX2X_DEV_INFO("hw_config 0x%08x\n", bp->common.hw_config); |
7437 | |||
7438 | BNX2X_DEV_INFO("hw_config 0x%08x board 0x%08x\n", | ||
7439 | bp->common.hw_config, bp->common.board); | ||
7440 | 7434 | ||
7441 | bp->link_params.hw_led_mode = ((bp->common.hw_config & | 7435 | bp->link_params.hw_led_mode = ((bp->common.hw_config & |
7442 | SHARED_HW_CFG_LED_MODE_MASK) >> | 7436 | SHARED_HW_CFG_LED_MODE_MASK) >> |