Skip to content

Commit ab41ca3

Browse files
muralipolicharla-brcmdavem330
authored andcommitted
net: phy: bcm7xx: add jumbo frame configuration to PHY
The BCM7XX PHY family requires special configuration to pass jumbo frames. Do that during initial PHY setup. Signed-off-by: Murali Krishna Policharla <[email protected]> Reviewed-by: Scott Branden <[email protected]> Signed-off-by: Vladimir Oltean <[email protected]> Acked-by: Florian Fainelli <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 22f3397 commit ab41ca3

File tree

4 files changed

+29
-0
lines changed

4 files changed

+29
-0
lines changed

drivers/net/phy/bcm-phy-lib.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,6 +423,28 @@ int bcm_phy_28nm_a0b0_afe_config_init(struct phy_device *phydev)
423423
}
424424
EXPORT_SYMBOL_GPL(bcm_phy_28nm_a0b0_afe_config_init);
425425

426+
int bcm_phy_enable_jumbo(struct phy_device *phydev)
427+
{
428+
int ret;
429+
430+
ret = bcm54xx_auxctl_read(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL);
431+
if (ret < 0)
432+
return ret;
433+
434+
/* Enable extended length packet reception */
435+
ret = bcm54xx_auxctl_write(phydev, MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL,
436+
ret | MII_BCM54XX_AUXCTL_ACTL_EXT_PKT_LEN);
437+
if (ret < 0)
438+
return ret;
439+
440+
/* Enable the elastic FIFO for raising the transmission limit from
441+
* 4.5KB to 10KB, at the expense of an additional 16 ns in propagation
442+
* latency.
443+
*/
444+
return phy_set_bits(phydev, MII_BCM54XX_ECR, MII_BCM54XX_ECR_FIFOE);
445+
}
446+
EXPORT_SYMBOL_GPL(bcm_phy_enable_jumbo);
447+
426448
MODULE_DESCRIPTION("Broadcom PHY Library");
427449
MODULE_LICENSE("GPL v2");
428450
MODULE_AUTHOR("Broadcom Corporation");

drivers/net/phy/bcm-phy-lib.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,5 +65,6 @@ void bcm_phy_get_stats(struct phy_device *phydev, u64 *shadow,
6565
struct ethtool_stats *stats, u64 *data);
6666
void bcm_phy_r_rc_cal_reset(struct phy_device *phydev);
6767
int bcm_phy_28nm_a0b0_afe_config_init(struct phy_device *phydev);
68+
int bcm_phy_enable_jumbo(struct phy_device *phydev);
6869

6970
#endif /* _LINUX_BCM_PHY_LIB_H */

drivers/net/phy/bcm7xxx.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ static int bcm7xxx_28nm_config_init(struct phy_device *phydev)
178178
break;
179179
}
180180

181+
if (ret)
182+
return ret;
183+
184+
ret = bcm_phy_enable_jumbo(phydev);
181185
if (ret)
182186
return ret;
183187

include/linux/brcmphy.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@
7979
#define MII_BCM54XX_ECR 0x10 /* BCM54xx extended control register */
8080
#define MII_BCM54XX_ECR_IM 0x1000 /* Interrupt mask */
8181
#define MII_BCM54XX_ECR_IF 0x0800 /* Interrupt force */
82+
#define MII_BCM54XX_ECR_FIFOE 0x0001 /* FIFO elasticity */
8283

8384
#define MII_BCM54XX_ESR 0x11 /* BCM54xx extended status register */
8485
#define MII_BCM54XX_ESR_IS 0x1000 /* Interrupt status */
@@ -119,6 +120,7 @@
119120
#define MII_BCM54XX_AUXCTL_SHDWSEL_AUXCTL 0x00
120121
#define MII_BCM54XX_AUXCTL_ACTL_TX_6DB 0x0400
121122
#define MII_BCM54XX_AUXCTL_ACTL_SMDSP_ENA 0x0800
123+
#define MII_BCM54XX_AUXCTL_ACTL_EXT_PKT_LEN 0x4000
122124

123125
#define MII_BCM54XX_AUXCTL_SHDWSEL_MISC 0x07
124126
#define MII_BCM54XX_AUXCTL_SHDWSEL_MISC_WIRESPEED_EN 0x0010

0 commit comments

Comments
 (0)