Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

net: bgmac: use PHY subsystem for initializing PHY

This adds support for using bgmac with PHYs supported by standalone PHY
drivers. Having any PHY initialization in bgmac is hacky and shouldn't
be extended but rather removed if anyone has hardware to test it.

Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Rafał Miłecki and committed by
David S. Miller
8e6f31ba aa8863e5

+10
+10
drivers/net/ethernet/broadcom/bgmac-bcma-mdio.c
··· 132 132 struct bcma_chipinfo *ci = &bgmac->bcma.core->bus->chipinfo; 133 133 u8 i; 134 134 135 + /* For some legacy hardware we do chipset-based PHY initialization here 136 + * without even detecting PHY ID. It's hacky and should be cleaned as 137 + * soon as someone can test it. 138 + */ 135 139 if (ci->id == BCMA_CHIP_ID_BCM5356) { 136 140 for (i = 0; i < 5; i++) { 137 141 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x008b); ··· 144 140 bcma_mdio_phy_write(bgmac, i, 0x12, 0x2aaa); 145 141 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); 146 142 } 143 + return; 147 144 } 148 145 if ((ci->id == BCMA_CHIP_ID_BCM5357 && ci->pkg != 10) || 149 146 (ci->id == BCMA_CHIP_ID_BCM4749 && ci->pkg != 10) || ··· 166 161 bcma_mdio_phy_write(bgmac, i, 0x17, 0x9273); 167 162 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); 168 163 } 164 + return; 169 165 } 166 + 167 + /* For all other hw do initialization using PHY subsystem. */ 168 + if (bgmac->net_dev && bgmac->net_dev->phydev) 169 + phy_init_hw(bgmac->net_dev->phydev); 170 170 } 171 171 172 172 /* http://bcm-v4.sipsolutions.net/mac-gbit/gmac/chipphyreset */