d7ed6be7d9c8be8ae147bb31b9e8c4027b57d1b8
[openwrt/staging/jogo.git] /
1 From de6919e4b4fcd07a9d77fbbaf71162e2a9ba549e Mon Sep 17 00:00:00 2001
2 From: Jonathan Bell <jonathan@raspberrypi.org>
3 Date: Tue, 14 May 2019 17:00:41 +0100
4 Subject: [PATCH 543/782] phy: broadcom: split out the BCM54213PE from the
5 BCM54210E IDs
6
7 The last nibble is a revision ID, and the 54213pe is a later rev
8 than the 54210e. Running the 54210e setup code on a 54213pe results
9 in a broken RGMII interface.
10
11 Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
12 ---
13 drivers/net/phy/broadcom.c | 17 ++++++++++++++---
14 include/linux/brcmphy.h | 1 +
15 2 files changed, 15 insertions(+), 3 deletions(-)
16
17 --- a/drivers/net/phy/broadcom.c
18 +++ b/drivers/net/phy/broadcom.c
19 @@ -222,7 +222,8 @@ static void bcm54xx_adjust_rxrefclk(stru
20 /* Abort if we are using an untested phy. */
21 if (BRCM_PHY_MODEL(phydev) != PHY_ID_BCM57780 &&
22 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610 &&
23 - BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M)
24 + BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M &&
25 + BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54213PE)
26 return;
27
28 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3);
29 @@ -604,7 +605,7 @@ static struct phy_driver broadcom_driver
30 .config_intr = bcm_phy_config_intr,
31 }, {
32 .phy_id = PHY_ID_BCM54210E,
33 - .phy_id_mask = 0xfffffff0,
34 + .phy_id_mask = 0xffffffff,
35 .name = "Broadcom BCM54210E",
36 .features = PHY_GBIT_FEATURES,
37 .flags = PHY_HAS_INTERRUPT,
38 @@ -612,6 +613,15 @@ static struct phy_driver broadcom_driver
39 .ack_interrupt = bcm_phy_ack_intr,
40 .config_intr = bcm_phy_config_intr,
41 }, {
42 + .phy_id = PHY_ID_BCM54213PE,
43 + .phy_id_mask = 0xffffffff,
44 + .name = "Broadcom BCM54213PE",
45 + .features = PHY_GBIT_FEATURES,
46 + .flags = PHY_HAS_INTERRUPT,
47 + .config_init = bcm54xx_config_init,
48 + .ack_interrupt = bcm_phy_ack_intr,
49 + .config_intr = bcm_phy_config_intr,
50 +}, {
51 .phy_id = PHY_ID_BCM5461,
52 .phy_id_mask = 0xfffffff0,
53 .name = "Broadcom BCM5461",
54 @@ -748,7 +758,8 @@ module_phy_driver(broadcom_drivers);
55 static struct mdio_device_id __maybe_unused broadcom_tbl[] = {
56 { PHY_ID_BCM5411, 0xfffffff0 },
57 { PHY_ID_BCM5421, 0xfffffff0 },
58 - { PHY_ID_BCM54210E, 0xfffffff0 },
59 + { PHY_ID_BCM54210E, 0xffffffff },
60 + { PHY_ID_BCM54213PE, 0xffffffff },
61 { PHY_ID_BCM5461, 0xfffffff0 },
62 { PHY_ID_BCM54612E, 0xfffffff0 },
63 { PHY_ID_BCM54616S, 0xfffffff0 },
64 --- a/include/linux/brcmphy.h
65 +++ b/include/linux/brcmphy.h
66 @@ -20,6 +20,7 @@
67 #define PHY_ID_BCM5411 0x00206070
68 #define PHY_ID_BCM5421 0x002060e0
69 #define PHY_ID_BCM54210E 0x600d84a0
70 +#define PHY_ID_BCM54213PE 0x600d84a2
71 #define PHY_ID_BCM5464 0x002060b0
72 #define PHY_ID_BCM5461 0x002060c0
73 #define PHY_ID_BCM54612E 0x03625e60