brcm2708: update to latest patches from the RPi foundation
[openwrt/staging/lynxis.git] / target / linux / brcm2708 / patches-4.14 / 950-0252-lan78xx-Change-LEDs-to-include-10Mb-activity.patch
1 From 204bcf730f2f7b0806775bfd02a41e193e813eab Mon Sep 17 00:00:00 2001
2 From: Phil Elwell <phil@raspberrypi.org>
3 Date: Fri, 9 Mar 2018 17:28:07 +0000
4 Subject: [PATCH 252/454] lan78xx: Change LEDs to include 10Mb activity
5
6 The default LED modes put 1000Mb/activity on orange and 100Mb/activity
7 on green, but this leaves no indication for a 10Mb link. Change the
8 defaults to put 10Mb/100Mb/activity on green.
9
10 Signed-off-by: Phil Elwell <phil@raspberrypi.org>
11 ---
12 drivers/net/usb/lan78xx.c | 14 ++++++++++++++
13 1 file changed, 14 insertions(+)
14
15 --- a/drivers/net/usb/lan78xx.c
16 +++ b/drivers/net/usb/lan78xx.c
17 @@ -1998,6 +1998,7 @@ static int lan78xx_phy_init(struct lan78
18 {
19 int ret;
20 u32 mii_adv;
21 + u32 led_modes;
22 struct phy_device *phydev = dev->net->phydev;
23
24 phydev = phy_find_first(dev->mdiobus);
25 @@ -2070,6 +2071,19 @@ static int lan78xx_phy_init(struct lan78
26 mii_adv = (u32)mii_advertise_flowctrl(dev->fc_request_control);
27 phydev->advertising |= mii_adv_to_ethtool_adv_t(mii_adv);
28
29 + /* Change LED defaults:
30 + * orange = link1000/activity
31 + * green = link10/link100/activity
32 + * led: 0=link/activity 1=link1000/activity
33 + * 2=link100/activity 3=link10/activity
34 + * 4=link100/1000/activity 5=link10/1000/activity
35 + * 6=link10/100/activity 14=off 15=on
36 + */
37 + led_modes = phy_read(phydev, 0x1d);
38 + led_modes &= ~0xff;
39 + led_modes |= (1 << 0) | (6 << 4);
40 + (void)phy_write(phydev, 0x1d, led_modes);
41 +
42 genphy_config_aneg(phydev);
43
44 dev->fc_autoneg = phydev->autoneg;