kernel: b53: support phy ids for BCM5365
authorJonas Gorski <jogo@openwrt.org>
Thu, 5 Sep 2013 20:30:34 +0000 (20:30 +0000)
committerJonas Gorski <jogo@openwrt.org>
Thu, 5 Sep 2013 20:30:34 +0000 (20:30 +0000)
BCM5365 (and probably other older variants) use a different phy id, so
the phy driver never attached for them.
Fix this by adding the appropriate phy id to the fixup and the phy
driver.

Reported-by: Russell Senior <russell@personaltelco.net>
Signed-off-by: Jonas Gorski <jogo@openwrt.org>
SVN-Revision: 37906

target/linux/generic/files/drivers/net/phy/b53/b53_mdio.c
target/linux/generic/files/drivers/net/phy/b53/b53_phy_fixup.c

index 1ba05914eadff667fcc09c24aced5ecba27a93e9..6403cc63886f029a2f6948638c169d6459fe31c4 100644 (file)
@@ -373,6 +373,22 @@ static struct phy_driver b53_phy_driver_id2 = {
        },
 };
 
+/* BCM5365 */
+static struct phy_driver b53_phy_driver_id3 = {
+       .phy_id         = 0x00406000,
+       .name           = "Broadcom B53 (3)",
+       .phy_id_mask    = 0x1ffffc00,
+       .features       = 0,
+       .probe          = b53_phy_probe,
+       .remove         = b53_phy_remove,
+       .config_aneg    = b53_phy_config_aneg,
+       .config_init    = b53_phy_config_init,
+       .read_status    = b53_phy_read_status,
+       .driver = {
+               .owner = THIS_MODULE,
+       },
+};
+
 int __init b53_phy_driver_register(void)
 {
        int ret;
@@ -383,13 +399,21 @@ int __init b53_phy_driver_register(void)
 
        ret = phy_driver_register(&b53_phy_driver_id2);
        if (ret)
-               phy_driver_unregister(&b53_phy_driver_id1);
+               goto err1;
 
+       ret = phy_driver_register(&b53_phy_driver_id3);
+       if (!ret)
+               return 0;
+
+       phy_driver_unregister(&b53_phy_driver_id2);
+err1:
+       phy_driver_unregister(&b53_phy_driver_id1);
        return ret;
 }
 
 void __exit b53_phy_driver_unregister(void)
 {
+       phy_driver_unregister(&b53_phy_driver_id3);
        phy_driver_unregister(&b53_phy_driver_id2);
        phy_driver_unregister(&b53_phy_driver_id1);
 }
index 447f30b649f5acd8054ab7e1400a57eef8477156..72d1373d7f58ddf19856a7a656b346484318390c 100644 (file)
@@ -24,6 +24,7 @@
 
 #define B53_BRCM_OUI_1 0x0143bc00
 #define B53_BRCM_OUI_2 0x03625c00
+#define B53_BRCM_OUI_3 0x00406000
 
 static int b53_phy_fixup(struct phy_device *dev)
 {
@@ -38,7 +39,8 @@ static int b53_phy_fixup(struct phy_device *dev)
        phy_id |= mdiobus_read(bus, 0, 3);
 
        if ((phy_id & 0xfffffc00) == B53_BRCM_OUI_1 ||
-           (phy_id & 0xfffffc00) == B53_BRCM_OUI_2) {
+           (phy_id & 0xfffffc00) == B53_BRCM_OUI_2 ||
+           (phy_id & 0xfffffc00) == B53_BRCM_OUI_3) {
                dev->phy_id = phy_id;
        }