1 From badc33cc4a789a51ccc5ab5e9efeb94c5dc306cd 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] phy: broadcom: split out the BCM54213PE from the
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.
11 Signed-off-by: Jonathan Bell <jonathan@raspberrypi.org>
13 drivers/net/phy/broadcom.c | 15 ++++++++++++---
14 include/linux/brcmphy.h | 1 +
15 2 files changed, 13 insertions(+), 3 deletions(-)
17 --- a/drivers/net/phy/broadcom.c
18 +++ b/drivers/net/phy/broadcom.c
19 @@ -259,7 +259,8 @@ static void bcm54xx_adjust_rxrefclk(stru
20 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM50610M &&
21 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54210E &&
22 BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54810 &&
23 - BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54811)
24 + BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54811 &&
25 + BRCM_PHY_MODEL(phydev) != PHY_ID_BCM54213PE)
28 val = bcm_phy_read_shadow(phydev, BCM54XX_SHD_SCR3);
29 @@ -906,7 +907,7 @@ static struct phy_driver broadcom_driver
30 .link_change_notify = bcm54xx_link_change_notify,
32 .phy_id = PHY_ID_BCM54210E,
33 - .phy_id_mask = 0xfffffff0,
34 + .phy_id_mask = 0xffffffff,
35 .name = "Broadcom BCM54210E",
36 /* PHY_GBIT_FEATURES */
37 .get_sset_count = bcm_phy_get_sset_count,
38 @@ -920,6 +921,13 @@ static struct phy_driver broadcom_driver
39 .suspend = bcm54xx_suspend,
40 .resume = bcm54xx_resume,
42 + .phy_id = PHY_ID_BCM54213PE,
43 + .phy_id_mask = 0xffffffff,
44 + .name = "Broadcom BCM54213PE",
45 + /* PHY_GBIT_FEATURES */
46 + .config_init = bcm54xx_config_init,
47 + .config_intr = bcm_phy_config_intr,
49 .phy_id = PHY_ID_BCM5461,
50 .phy_id_mask = 0xfffffff0,
51 .name = "Broadcom BCM5461",
52 @@ -1156,7 +1164,8 @@ module_phy_driver(broadcom_drivers);
53 static struct mdio_device_id __maybe_unused broadcom_tbl[] = {
54 { PHY_ID_BCM5411, 0xfffffff0 },
55 { PHY_ID_BCM5421, 0xfffffff0 },
56 - { PHY_ID_BCM54210E, 0xfffffff0 },
57 + { PHY_ID_BCM54210E, 0xffffffff },
58 + { PHY_ID_BCM54213PE, 0xffffffff },
59 { PHY_ID_BCM5461, 0xfffffff0 },
60 { PHY_ID_BCM54612E, 0xfffffff0 },
61 { PHY_ID_BCM54616S, 0xfffffff0 },
62 --- a/include/linux/brcmphy.h
63 +++ b/include/linux/brcmphy.h
65 #define PHY_ID_BCM5411 0x00206070
66 #define PHY_ID_BCM5421 0x002060e0
67 #define PHY_ID_BCM54210E 0x600d84a0
68 +#define PHY_ID_BCM54213PE 0x600d84a2
69 #define PHY_ID_BCM5464 0x002060b0
70 #define PHY_ID_BCM5461 0x002060c0
71 #define PHY_ID_BCM54612E 0x03625e60