1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter.git synced 2025-02-15 04:42:02 +00:00
openmptcprouter/root/target/linux/brcm2708/patches-4.19/0555-phy-bcm54213pe-configure-the-LED-outputs-to-be-more-.patch
Ycarus (Yannick Chabanois) 5f08b288eb Add RPI4 beta support
2019-06-24 19:52:48 +02:00

71 lines
2.3 KiB
Diff

From af502b2acafb23364b5757f01ae2c43e2943f195 Mon Sep 17 00:00:00 2001
From: Jonathan Bell <jonathan@raspberrypi.org>
Date: Fri, 17 May 2019 13:31:21 +0100
Subject: [PATCH 555/678] phy: bcm54213pe: configure the LED outputs to be more
user-friendly
The default state was both LEDs indicating link speed.
Change the default configuration to
- Amber: 1000/100 link speed indication
- Green: link present + activity indication
Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
---
drivers/net/phy/broadcom.c | 17 +++++++++++++++++
include/linux/brcmphy.h | 4 ++++
2 files changed, 21 insertions(+)
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 9bded877cd6e..a919a6a4c970 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -52,6 +52,21 @@ static int bcm54210e_config_init(struct phy_device *phydev)
return 0;
}
+static void bcm54213pe_config_init(struct phy_device *phydev)
+{
+ u16 val;
+
+ /* Enable ACT+LINK indication on ACTIVITY trigger */
+ val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_LEDCTL);
+ val |= BCM54XX_SHD_LEDCTL_ACTLINK_EN;
+ bcm_phy_write_shadow(phydev, BCM54XX_SHD_LEDCTL, val);
+
+ /* Set ACTIVITY on LED "1" output, LINKSPD[1] on LED "3" output */
+ val = BCM5482_SHD_LEDS1_LED1(BCM_LED_SRC_ACTIVITYLED) |
+ BCM5482_SHD_LEDS1_LED3(BCM_LED_SRC_LINKSPD1);
+ bcm_phy_write_shadow(phydev, BCM5482_SHD_LEDS1, val);
+}
+
static int bcm54612e_config_init(struct phy_device *phydev)
{
int reg;
@@ -310,6 +325,8 @@ static int bcm54xx_config_init(struct phy_device *phydev)
err = bcm54210e_config_init(phydev);
if (err)
return err;
+ } else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54213PE) {
+ bcm54213pe_config_init(phydev);
} else if (BRCM_PHY_MODEL(phydev) == PHY_ID_BCM54612E) {
err = bcm54612e_config_init(phydev);
if (err)
diff --git a/include/linux/brcmphy.h b/include/linux/brcmphy.h
index 67c7939b8307..f4c80638c515 100644
--- a/include/linux/brcmphy.h
+++ b/include/linux/brcmphy.h
@@ -168,6 +168,10 @@
#define BCM54XX_SHD_SCR3_DLLAPD_DIS 0x0002
#define BCM54XX_SHD_SCR3_TRDDAPD 0x0004
+/* 01001: Additional LED trigger options */
+#define BCM54XX_SHD_LEDCTL 0x09
+#define BCM54XX_SHD_LEDCTL_ACTLINK_EN 0x0010
+
/* 01010: Auto Power-Down */
#define BCM54XX_SHD_APD 0x0a
#define BCM_APD_CLR_MASK 0xFE9F /* clear bits 5, 6 & 8 */
--
2.19.1