aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2014-06-12 13:28:49 -0400
committerDavid S. Miller <davem@davemloft.net>2014-06-12 13:28:49 -0400
commita4d3de0d5fdf4393577ab8e2c7b7ebf6504bbb66 (patch)
tree555f786ec35500d64f95c03605bc041a178c2543
parentd3217b15a19a4779c39b212358a5c71d725822ee (diff)
parentf2cfa997ef77bcfc3900eb968fa5254f951bb8f2 (diff)
Merge branch 'bnx2x'
Yuval Mintz says: ==================== bnx2x: Bug fixes patch series This patch series contains various bug fixes - 2 link related fixes, one sriov-related issue and an additional fix for a theoretical bug on new boards. Please consider applying these patches to `net'. ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c26
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c43
-rw-r--r--drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c6
3 files changed, 54 insertions, 21 deletions
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
index 4fef1e199366..53fb4fa61b40 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c
@@ -3702,7 +3702,8 @@ static void bnx2x_warpcore_restart_AN_KR(struct bnx2x_phy *phy,
3702static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy, 3702static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
3703 struct link_params *params, 3703 struct link_params *params,
3704 struct link_vars *vars) { 3704 struct link_vars *vars) {
3705 u16 lane, i, cl72_ctrl, an_adv = 0; 3705 u16 lane, i, cl72_ctrl, an_adv = 0, val;
3706 u32 wc_lane_config;
3706 struct bnx2x *bp = params->bp; 3707 struct bnx2x *bp = params->bp;
3707 static struct bnx2x_reg_set reg_set[] = { 3708 static struct bnx2x_reg_set reg_set[] = {
3708 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7}, 3709 {MDIO_WC_DEVAD, MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X2, 0x7},
@@ -3821,15 +3822,27 @@ static void bnx2x_warpcore_enable_AN_KR(struct bnx2x_phy *phy,
3821 /* Enable Auto-Detect to support 1G over CL37 as well */ 3822 /* Enable Auto-Detect to support 1G over CL37 as well */
3822 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, 3823 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3823 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, 0x10); 3824 MDIO_WC_REG_SERDESDIGITAL_CONTROL1000X1, 0x10);
3824 3825 wc_lane_config = REG_RD(bp, params->shmem_base +
3826 offsetof(struct shmem_region, dev_info.
3827 shared_hw_config.wc_lane_config));
3828 bnx2x_cl45_read(bp, phy, MDIO_WC_DEVAD,
3829 MDIO_WC_REG_RX0_PCI_CTRL + (lane << 4), &val);
3825 /* Force cl48 sync_status LOW to avoid getting stuck in CL73 3830 /* Force cl48 sync_status LOW to avoid getting stuck in CL73
3826 * parallel-detect loop when CL73 and CL37 are enabled. 3831 * parallel-detect loop when CL73 and CL37 are enabled.
3827 */ 3832 */
3828 CL22_WR_OVER_CL45(bp, phy, MDIO_REG_BANK_AER_BLOCK, 3833 val |= 1 << 11;
3829 MDIO_AER_BLOCK_AER_REG, 0); 3834
3835 /* Restore Polarity settings in case it was run over by
3836 * previous link owner
3837 */
3838 if (wc_lane_config &
3839 (SHARED_HW_CFG_RX_LANE0_POL_FLIP_ENABLED << lane))
3840 val |= 3 << 2;
3841 else
3842 val &= ~(3 << 2);
3830 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD, 3843 bnx2x_cl45_write(bp, phy, MDIO_WC_DEVAD,
3831 MDIO_WC_REG_RXB_ANA_RX_CONTROL_PCI, 0x0800); 3844 MDIO_WC_REG_RX0_PCI_CTRL + (lane << 4),
3832 bnx2x_set_aer_mmd(params, phy); 3845 val);
3833 3846
3834 bnx2x_disable_kr2(params, vars, phy); 3847 bnx2x_disable_kr2(params, vars, phy);
3835 } 3848 }
@@ -12459,6 +12472,7 @@ static int bnx2x_avoid_link_flap(struct link_params *params,
12459 u32 dont_clear_stat, lfa_sts; 12472 u32 dont_clear_stat, lfa_sts;
12460 struct bnx2x *bp = params->bp; 12473 struct bnx2x *bp = params->bp;
12461 12474
12475 bnx2x_set_mdio_emac_per_phy(bp, params);
12462 /* Sync the link parameters */ 12476 /* Sync the link parameters */
12463 bnx2x_link_status_update(params, vars); 12477 bnx2x_link_status_update(params, vars);
12464 12478
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
index cf14218697e4..c5061353a475 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c
@@ -10053,6 +10053,24 @@ static void bnx2x_prev_unload_close_mac(struct bnx2x *bp,
10053#define BCM_5710_UNDI_FW_MF_VERS (0x05) 10053#define BCM_5710_UNDI_FW_MF_VERS (0x05)
10054#define BNX2X_PREV_UNDI_MF_PORT(p) (BAR_TSTRORM_INTMEM + 0x150c + ((p) << 4)) 10054#define BNX2X_PREV_UNDI_MF_PORT(p) (BAR_TSTRORM_INTMEM + 0x150c + ((p) << 4))
10055#define BNX2X_PREV_UNDI_MF_FUNC(f) (BAR_TSTRORM_INTMEM + 0x184c + ((f) << 4)) 10055#define BNX2X_PREV_UNDI_MF_FUNC(f) (BAR_TSTRORM_INTMEM + 0x184c + ((f) << 4))
10056
10057static bool bnx2x_prev_is_after_undi(struct bnx2x *bp)
10058{
10059 /* UNDI marks its presence in DORQ -
10060 * it initializes CID offset for normal bell to 0x7
10061 */
10062 if (!(REG_RD(bp, MISC_REG_RESET_REG_1) &
10063 MISC_REGISTERS_RESET_REG_1_RST_DORQ))
10064 return false;
10065
10066 if (REG_RD(bp, DORQ_REG_NORM_CID_OFST) == 0x7) {
10067 BNX2X_DEV_INFO("UNDI previously loaded\n");
10068 return true;
10069 }
10070
10071 return false;
10072}
10073
10056static bool bnx2x_prev_unload_undi_fw_supports_mf(struct bnx2x *bp) 10074static bool bnx2x_prev_unload_undi_fw_supports_mf(struct bnx2x *bp)
10057{ 10075{
10058 u8 major, minor, version; 10076 u8 major, minor, version;
@@ -10302,6 +10320,10 @@ static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)
10302 10320
10303 BNX2X_DEV_INFO("Path is unmarked\n"); 10321 BNX2X_DEV_INFO("Path is unmarked\n");
10304 10322
10323 /* Cannot proceed with FLR if UNDI is loaded, since FW does not match */
10324 if (bnx2x_prev_is_after_undi(bp))
10325 goto out;
10326
10305 /* If function has FLR capabilities, and existing FW version matches 10327 /* If function has FLR capabilities, and existing FW version matches
10306 * the one required, then FLR will be sufficient to clean any residue 10328 * the one required, then FLR will be sufficient to clean any residue
10307 * left by previous driver 10329 * left by previous driver
@@ -10322,6 +10344,7 @@ static int bnx2x_prev_unload_uncommon(struct bnx2x *bp)
10322 10344
10323 BNX2X_DEV_INFO("Could not FLR\n"); 10345 BNX2X_DEV_INFO("Could not FLR\n");
10324 10346
10347out:
10325 /* Close the MCP request, return failure*/ 10348 /* Close the MCP request, return failure*/
10326 rc = bnx2x_prev_mcp_done(bp); 10349 rc = bnx2x_prev_mcp_done(bp);
10327 if (!rc) 10350 if (!rc)
@@ -10360,19 +10383,13 @@ static int bnx2x_prev_unload_common(struct bnx2x *bp)
10360 /* close LLH filters towards the BRB */ 10383 /* close LLH filters towards the BRB */
10361 bnx2x_set_rx_filter(&bp->link_params, 0); 10384 bnx2x_set_rx_filter(&bp->link_params, 0);
10362 10385
10363 /* Check if the UNDI driver was previously loaded 10386 /* Check if the UNDI driver was previously loaded */
10364 * UNDI driver initializes CID offset for normal bell to 0x7 10387 if (bnx2x_prev_is_after_undi(bp)) {
10365 */ 10388 prev_undi = true;
10366 if (reset_reg & MISC_REGISTERS_RESET_REG_1_RST_DORQ) { 10389 /* clear the UNDI indication */
10367 tmp_reg = REG_RD(bp, DORQ_REG_NORM_CID_OFST); 10390 REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
10368 if (tmp_reg == 0x7) { 10391 /* clear possible idle check errors */
10369 BNX2X_DEV_INFO("UNDI previously loaded\n"); 10392 REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0);
10370 prev_undi = true;
10371 /* clear the UNDI indication */
10372 REG_WR(bp, DORQ_REG_NORM_CID_OFST, 0);
10373 /* clear possible idle check errors */
10374 REG_RD(bp, NIG_REG_NIG_INT_STS_CLR_0);
10375 }
10376 } 10393 }
10377 if (!CHIP_IS_E1x(bp)) 10394 if (!CHIP_IS_E1x(bp))
10378 /* block FW from writing to host */ 10395 /* block FW from writing to host */
diff --git a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
index a93c7af7afe6..f7edb4204f91 100644
--- a/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
+++ b/drivers/net/ethernet/broadcom/bnx2x/bnx2x_sriov.c
@@ -1071,8 +1071,10 @@ void bnx2x_iov_init_dq(struct bnx2x *bp)
1071 REG_WR(bp, DORQ_REG_VF_TYPE_MIN_MCID_0, 0); 1071 REG_WR(bp, DORQ_REG_VF_TYPE_MIN_MCID_0, 0);
1072 REG_WR(bp, DORQ_REG_VF_TYPE_MAX_MCID_0, 0x1ffff); 1072 REG_WR(bp, DORQ_REG_VF_TYPE_MAX_MCID_0, 0x1ffff);
1073 1073
1074 /* set the VF doorbell threshold */ 1074 /* set the VF doorbell threshold. This threshold represents the amount
1075 REG_WR(bp, DORQ_REG_VF_USAGE_CT_LIMIT, 4); 1075 * of doorbells allowed in the main DORQ fifo for a specific VF.
1076 */
1077 REG_WR(bp, DORQ_REG_VF_USAGE_CT_LIMIT, 64);
1076} 1078}
1077 1079
1078void bnx2x_iov_init_dmae(struct bnx2x *bp) 1080void bnx2x_iov_init_dmae(struct bnx2x *bp)