aboutsummaryrefslogtreecommitdiffstats
path: root/target/linux/brcm2708/patches-4.19/950-0750-net-phy-bcm54xx-Encode-link-speed-and-activity-into-.patch
diff options
context:
space:
mode:
authorÁlvaro Fernández Rojas <noltari@gmail.com>2019-12-23 17:25:19 +0100
committerÁlvaro Fernández Rojas <noltari@gmail.com>2019-12-24 18:49:49 +0100
commitc2308a7e4adbb2acc8ff149f91d1ca46801c135e (patch)
treeffc720dc7c05c331d6569fc3c2f0772fb375e419 /target/linux/brcm2708/patches-4.19/950-0750-net-phy-bcm54xx-Encode-link-speed-and-activity-into-.patch
parent67dcc43f3a22dc3a7ac07a7065971b426feeb043 (diff)
downloadupstream-c2308a7e4adbb2acc8ff149f91d1ca46801c135e.tar.gz
upstream-c2308a7e4adbb2acc8ff149f91d1ca46801c135e.tar.bz2
upstream-c2308a7e4adbb2acc8ff149f91d1ca46801c135e.zip
brcm2708: update to latest patches from RPi Foundation
Also removes reverted patches. Signed-off-by: Álvaro Fernández Rojas <noltari@gmail.com>
Diffstat (limited to 'target/linux/brcm2708/patches-4.19/950-0750-net-phy-bcm54xx-Encode-link-speed-and-activity-into-.patch')
-rw-r--r--target/linux/brcm2708/patches-4.19/950-0750-net-phy-bcm54xx-Encode-link-speed-and-activity-into-.patch67
1 files changed, 67 insertions, 0 deletions
diff --git a/target/linux/brcm2708/patches-4.19/950-0750-net-phy-bcm54xx-Encode-link-speed-and-activity-into-.patch b/target/linux/brcm2708/patches-4.19/950-0750-net-phy-bcm54xx-Encode-link-speed-and-activity-into-.patch
new file mode 100644
index 0000000000..9a5e29c208
--- /dev/null
+++ b/target/linux/brcm2708/patches-4.19/950-0750-net-phy-bcm54xx-Encode-link-speed-and-activity-into-.patch
@@ -0,0 +1,67 @@
+From b1e290ec968186530ec59479adfba89d2cfe21c8 Mon Sep 17 00:00:00 2001
+From: Vladimir Oltean <olteanv@gmail.com>
+Date: Sun, 24 Mar 2019 00:18:46 +0200
+Subject: [PATCH] net: phy: bcm54xx: Encode link speed and activity
+ into LEDs
+
+Previously the green and amber LEDs on this quad PHY were solid, to
+indicate an encoding of the link speed (10/100/1000).
+
+This keeps the LEDs always on just as before, but now they flash on
+Rx/Tx activity.
+
+Signed-off-by: Vladimir Oltean <olteanv@gmail.com>
+Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
+Signed-off-by: David S. Miller <davem@davemloft.net>
+---
+ drivers/net/phy/broadcom.c | 13 +++++++++++++
+ include/linux/brcmphy.h | 16 ++++++++++++++++
+ 2 files changed, 29 insertions(+)
+
+--- a/drivers/net/phy/broadcom.c
++++ b/drivers/net/phy/broadcom.c
+@@ -345,6 +345,19 @@ static int bcm54xx_config_init(struct ph
+
+ bcm54xx_phydsp_config(phydev);
+
++ /* Encode link speed into LED1 and LED3 pair (green/amber).
++ * Also flash these two LEDs on activity. This means configuring
++ * them for MULTICOLOR and encoding link/activity into them.
++ */
++ val = BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_MULTICOLOR1) |
++ BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_MULTICOLOR1);
++ bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1, val);
++
++ val = BCM_LED_MULTICOLOR_IN_PHASE |
++ BCM5482_SHD_LEDS1_LED1(BCM_LED_MULTICOLOR_LINK_ACT) |
++ BCM5482_SHD_LEDS1_LED3(BCM_LED_MULTICOLOR_LINK_ACT);
++ bcm_phy_write_exp(phydev, BCM_EXP_MULTICOLOR, val);
++
+ return 0;
+ }
+
+--- a/include/linux/brcmphy.h
++++ b/include/linux/brcmphy.h
+@@ -148,6 +148,22 @@
+ #define BCM_LED_SRC_OFF 0xe /* Tied high */
+ #define BCM_LED_SRC_ON 0xf /* Tied low */
+
++/*
++ * Broadcom Multicolor LED configurations (expansion register 4)
++ */
++#define BCM_EXP_MULTICOLOR (MII_BCM54XX_EXP_SEL_ER + 0x04)
++#define BCM_LED_MULTICOLOR_IN_PHASE BIT(8)
++#define BCM_LED_MULTICOLOR_LINK_ACT 0x0
++#define BCM_LED_MULTICOLOR_SPEED 0x1
++#define BCM_LED_MULTICOLOR_ACT_FLASH 0x2
++#define BCM_LED_MULTICOLOR_FDX 0x3
++#define BCM_LED_MULTICOLOR_OFF 0x4
++#define BCM_LED_MULTICOLOR_ON 0x5
++#define BCM_LED_MULTICOLOR_ALT 0x6
++#define BCM_LED_MULTICOLOR_FLASH 0x7
++#define BCM_LED_MULTICOLOR_LINK 0x8
++#define BCM_LED_MULTICOLOR_ACT 0x9
++#define BCM_LED_MULTICOLOR_PROGRAM 0xa
+
+ /*
+ * BCM5482: Shadow registers