diff options
author | Yaniv Rosner <yanivr@broadcom.com> | 2011-08-02 18:59:32 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-08-03 06:22:17 -0400 |
commit | 157fa283a7cb5bc6a55dd4e0daf6eeef66adf354 (patch) | |
tree | 40c5e3948438124045acd346f4c0672a7c4a1df3 /drivers/net | |
parent | de6f3377d2da3b384ca3d716ffb8687ad175788a (diff) |
bnx2x: Fix BCM578xx-B0 MDIO access
Fix MDIO access to Warpcore on new chip version of 578xx.
Signed-off-by: Yaniv Rosner <yanivr@broadcom.com>
Signed-off-by: Eilon Greenstein <eilong@broadcom.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net')
-rw-r--r-- | drivers/net/bnx2x/bnx2x_link.c | 16 | ||||
-rw-r--r-- | drivers/net/bnx2x/bnx2x_link.h | 1 | ||||
-rw-r--r-- | drivers/net/bnx2x/bnx2x_reg.h | 4 |
3 files changed, 18 insertions, 3 deletions
diff --git a/drivers/net/bnx2x/bnx2x_link.c b/drivers/net/bnx2x/bnx2x_link.c index 8e68e1582ec2..45255bdc5136 100644 --- a/drivers/net/bnx2x/bnx2x_link.c +++ b/drivers/net/bnx2x/bnx2x_link.c | |||
@@ -2953,7 +2953,9 @@ static int bnx2x_cl45_read(struct bnx2x *bp, struct bnx2x_phy *phy, | |||
2953 | u32 val; | 2953 | u32 val; |
2954 | u16 i; | 2954 | u16 i; |
2955 | int rc = 0; | 2955 | int rc = 0; |
2956 | 2956 | if (phy->flags & FLAGS_MDC_MDIO_WA_B0) | |
2957 | bnx2x_bits_en(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS, | ||
2958 | EMAC_MDIO_STATUS_10MB); | ||
2957 | /* address */ | 2959 | /* address */ |
2958 | val = ((phy->addr << 21) | (devad << 16) | reg | | 2960 | val = ((phy->addr << 21) | (devad << 16) | reg | |
2959 | EMAC_MDIO_COMM_COMMAND_ADDRESS | | 2961 | EMAC_MDIO_COMM_COMMAND_ADDRESS | |
@@ -3007,6 +3009,9 @@ static int bnx2x_cl45_read(struct bnx2x *bp, struct bnx2x_phy *phy, | |||
3007 | } | 3009 | } |
3008 | } | 3010 | } |
3009 | 3011 | ||
3012 | if (phy->flags & FLAGS_MDC_MDIO_WA_B0) | ||
3013 | bnx2x_bits_dis(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS, | ||
3014 | EMAC_MDIO_STATUS_10MB); | ||
3010 | return rc; | 3015 | return rc; |
3011 | } | 3016 | } |
3012 | 3017 | ||
@@ -3016,6 +3021,9 @@ static int bnx2x_cl45_write(struct bnx2x *bp, struct bnx2x_phy *phy, | |||
3016 | u32 tmp; | 3021 | u32 tmp; |
3017 | u8 i; | 3022 | u8 i; |
3018 | int rc = 0; | 3023 | int rc = 0; |
3024 | if (phy->flags & FLAGS_MDC_MDIO_WA_B0) | ||
3025 | bnx2x_bits_en(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS, | ||
3026 | EMAC_MDIO_STATUS_10MB); | ||
3019 | 3027 | ||
3020 | /* address */ | 3028 | /* address */ |
3021 | 3029 | ||
@@ -3069,7 +3077,9 @@ static int bnx2x_cl45_write(struct bnx2x *bp, struct bnx2x_phy *phy, | |||
3069 | bnx2x_cl45_read(bp, phy, devad, 0xf, &temp_val); | 3077 | bnx2x_cl45_read(bp, phy, devad, 0xf, &temp_val); |
3070 | } | 3078 | } |
3071 | } | 3079 | } |
3072 | 3080 | if (phy->flags & FLAGS_MDC_MDIO_WA_B0) | |
3081 | bnx2x_bits_dis(bp, phy->mdio_ctrl + EMAC_REG_EMAC_MDIO_STATUS, | ||
3082 | EMAC_MDIO_STATUS_10MB); | ||
3073 | return rc; | 3083 | return rc; |
3074 | } | 3084 | } |
3075 | 3085 | ||
@@ -11118,6 +11128,8 @@ static int bnx2x_populate_int_phy(struct bnx2x *bp, u32 shmem_base, u8 port, | |||
11118 | */ | 11128 | */ |
11119 | if (CHIP_REV(bp) == CHIP_REV_Ax) | 11129 | if (CHIP_REV(bp) == CHIP_REV_Ax) |
11120 | phy->flags |= FLAGS_MDC_MDIO_WA; | 11130 | phy->flags |= FLAGS_MDC_MDIO_WA; |
11131 | else | ||
11132 | phy->flags |= FLAGS_MDC_MDIO_WA_B0; | ||
11121 | } else { | 11133 | } else { |
11122 | switch (switch_cfg) { | 11134 | switch (switch_cfg) { |
11123 | case SWITCH_CFG_1G: | 11135 | case SWITCH_CFG_1G: |
diff --git a/drivers/net/bnx2x/bnx2x_link.h b/drivers/net/bnx2x/bnx2x_link.h index 7ee6b51f4fb8..c12db6da213e 100644 --- a/drivers/net/bnx2x/bnx2x_link.h +++ b/drivers/net/bnx2x/bnx2x_link.h | |||
@@ -145,6 +145,7 @@ struct bnx2x_phy { | |||
145 | #define FLAGS_SFP_NOT_APPROVED (1<<7) | 145 | #define FLAGS_SFP_NOT_APPROVED (1<<7) |
146 | #define FLAGS_MDC_MDIO_WA (1<<8) | 146 | #define FLAGS_MDC_MDIO_WA (1<<8) |
147 | #define FLAGS_DUMMY_READ (1<<9) | 147 | #define FLAGS_DUMMY_READ (1<<9) |
148 | #define FLAGS_MDC_MDIO_WA_B0 (1<<10) | ||
148 | #define FLAGS_TX_ERROR_CHECK (1<<12) | 149 | #define FLAGS_TX_ERROR_CHECK (1<<12) |
149 | 150 | ||
150 | /* preemphasis values for the rx side */ | 151 | /* preemphasis values for the rx side */ |
diff --git a/drivers/net/bnx2x/bnx2x_reg.h b/drivers/net/bnx2x/bnx2x_reg.h index d84642aca450..27b5ecb11830 100644 --- a/drivers/net/bnx2x/bnx2x_reg.h +++ b/drivers/net/bnx2x/bnx2x_reg.h | |||
@@ -5624,8 +5624,9 @@ | |||
5624 | #define EMAC_MDIO_COMM_START_BUSY (1L<<29) | 5624 | #define EMAC_MDIO_COMM_START_BUSY (1L<<29) |
5625 | #define EMAC_MDIO_MODE_AUTO_POLL (1L<<4) | 5625 | #define EMAC_MDIO_MODE_AUTO_POLL (1L<<4) |
5626 | #define EMAC_MDIO_MODE_CLAUSE_45 (1L<<31) | 5626 | #define EMAC_MDIO_MODE_CLAUSE_45 (1L<<31) |
5627 | #define EMAC_MDIO_MODE_CLOCK_CNT (0x3fL<<16) | 5627 | #define EMAC_MDIO_MODE_CLOCK_CNT (0x3ffL<<16) |
5628 | #define EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT 16 | 5628 | #define EMAC_MDIO_MODE_CLOCK_CNT_BITSHIFT 16 |
5629 | #define EMAC_MDIO_STATUS_10MB (1L<<1) | ||
5629 | #define EMAC_MODE_25G_MODE (1L<<5) | 5630 | #define EMAC_MODE_25G_MODE (1L<<5) |
5630 | #define EMAC_MODE_HALF_DUPLEX (1L<<1) | 5631 | #define EMAC_MODE_HALF_DUPLEX (1L<<1) |
5631 | #define EMAC_MODE_PORT_GMII (2L<<2) | 5632 | #define EMAC_MODE_PORT_GMII (2L<<2) |
@@ -5636,6 +5637,7 @@ | |||
5636 | #define EMAC_REG_EMAC_MAC_MATCH 0x10 | 5637 | #define EMAC_REG_EMAC_MAC_MATCH 0x10 |
5637 | #define EMAC_REG_EMAC_MDIO_COMM 0xac | 5638 | #define EMAC_REG_EMAC_MDIO_COMM 0xac |
5638 | #define EMAC_REG_EMAC_MDIO_MODE 0xb4 | 5639 | #define EMAC_REG_EMAC_MDIO_MODE 0xb4 |
5640 | #define EMAC_REG_EMAC_MDIO_STATUS 0xb0 | ||
5639 | #define EMAC_REG_EMAC_MODE 0x0 | 5641 | #define EMAC_REG_EMAC_MODE 0x0 |
5640 | #define EMAC_REG_EMAC_RX_MODE 0xc8 | 5642 | #define EMAC_REG_EMAC_RX_MODE 0xc8 |
5641 | #define EMAC_REG_EMAC_RX_MTU_SIZE 0x9c | 5643 | #define EMAC_REG_EMAC_RX_MTU_SIZE 0x9c |