Lines Matching refs:bgmac

35 static u16 bcma_mdio_phy_read(struct bgmac *bgmac, u8 phyaddr, u8 reg)  in bcma_mdio_phy_read()  argument
54 if (bgmac->bcma.core->id.id == BCMA_CORE_4706_MAC_GBIT) { in bcma_mdio_phy_read()
55 core = bgmac->bcma.core->bus->drv_gmac_cmn.core; in bcma_mdio_phy_read()
59 core = bgmac->bcma.core; in bcma_mdio_phy_read()
85 static int bcma_mdio_phy_write(struct bgmac *bgmac, u8 phyaddr, u8 reg, in bcma_mdio_phy_write() argument
93 if (bgmac->bcma.core->id.id == BCMA_CORE_4706_MAC_GBIT) { in bcma_mdio_phy_write()
94 core = bgmac->bcma.core->bus->drv_gmac_cmn.core; in bcma_mdio_phy_write()
98 core = bgmac->bcma.core; in bcma_mdio_phy_write()
108 bcma_write32(bgmac->bcma.core, BGMAC_INT_STATUS, BGMAC_IS_MDIO); in bcma_mdio_phy_write()
109 if (bcma_read32(bgmac->bcma.core, BGMAC_INT_STATUS) & BGMAC_IS_MDIO) in bcma_mdio_phy_write()
130 static void bcma_mdio_phy_init(struct bgmac *bgmac) in bcma_mdio_phy_init() argument
132 struct bcma_chipinfo *ci = &bgmac->bcma.core->bus->chipinfo; in bcma_mdio_phy_init()
141 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x008b); in bcma_mdio_phy_init()
142 bcma_mdio_phy_write(bgmac, i, 0x15, 0x0100); in bcma_mdio_phy_init()
143 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000f); in bcma_mdio_phy_init()
144 bcma_mdio_phy_write(bgmac, i, 0x12, 0x2aaa); in bcma_mdio_phy_init()
145 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); in bcma_mdio_phy_init()
152 struct bcma_drv_cc *cc = &bgmac->bcma.core->bus->drv_cc; in bcma_mdio_phy_init()
157 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000f); in bcma_mdio_phy_init()
158 bcma_mdio_phy_write(bgmac, i, 0x16, 0x5284); in bcma_mdio_phy_init()
159 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); in bcma_mdio_phy_init()
160 bcma_mdio_phy_write(bgmac, i, 0x17, 0x0010); in bcma_mdio_phy_init()
161 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000f); in bcma_mdio_phy_init()
162 bcma_mdio_phy_write(bgmac, i, 0x16, 0x5296); in bcma_mdio_phy_init()
163 bcma_mdio_phy_write(bgmac, i, 0x17, 0x1073); in bcma_mdio_phy_init()
164 bcma_mdio_phy_write(bgmac, i, 0x17, 0x9073); in bcma_mdio_phy_init()
165 bcma_mdio_phy_write(bgmac, i, 0x16, 0x52b6); in bcma_mdio_phy_init()
166 bcma_mdio_phy_write(bgmac, i, 0x17, 0x9273); in bcma_mdio_phy_init()
167 bcma_mdio_phy_write(bgmac, i, 0x1f, 0x000b); in bcma_mdio_phy_init()
173 if (bgmac->net_dev && bgmac->net_dev->phydev) in bcma_mdio_phy_init()
174 phy_init_hw(bgmac->net_dev->phydev); in bcma_mdio_phy_init()
180 struct bgmac *bgmac = bus->priv; in bcma_mdio_phy_reset() local
181 u8 phyaddr = bgmac->phyaddr; in bcma_mdio_phy_reset()
186 bcma_mdio_phy_write(bgmac, phyaddr, MII_BMCR, BMCR_RESET); in bcma_mdio_phy_reset()
188 if (bcma_mdio_phy_read(bgmac, phyaddr, MII_BMCR) & BMCR_RESET) in bcma_mdio_phy_reset()
189 dev_err(bgmac->dev, "PHY reset failed\n"); in bcma_mdio_phy_reset()
190 bcma_mdio_phy_init(bgmac); in bcma_mdio_phy_reset()
210 struct mii_bus *bcma_mdio_mii_register(struct bgmac *bgmac) in bcma_mdio_mii_register() argument
212 struct bcma_device *core = bgmac->bcma.core; in bcma_mdio_mii_register()
225 mii_bus->priv = bgmac; in bcma_mdio_mii_register()
230 mii_bus->phy_mask = ~(1 << bgmac->phyaddr); in bcma_mdio_mii_register()