Lines Matching +full:m +full:- +full:phy

6  * SPDX-License-Identifier:	GPL-2.0+
25 uchar *m = dev->enetaddr; in smc911x_handle_mac_address() local
27 addrl = m[0] | (m[1] << 8) | (m[2] << 16) | (m[3] << 24); in smc911x_handle_mac_address()
28 addrh = m[4] | (m[5] << 8); in smc911x_handle_mac_address()
32 printf(DRIVERNAME ": MAC %pM\n", m); in smc911x_handle_mac_address()
36 u8 phy, u8 reg, u16 *val) in smc911x_eth_phy_read() argument
41 smc911x_set_mac_csr(dev, MII_ACC, phy << 11 | reg << 6 | in smc911x_eth_phy_read()
53 u8 phy, u8 reg, u16 val) in smc911x_eth_phy_write() argument
60 phy << 11 | reg << 6 | MII_ACC_MII_BUSY | MII_ACC_MII_WRITE); in smc911x_eth_phy_write()
97 if ((timeout--) == 0) in smc911x_phy_configure()
104 printf(DRIVERNAME ": phy initialized\n"); in smc911x_phy_configure()
131 struct chip_id *id = dev->priv; in smc911x_init()
133 printf(DRIVERNAME ": detected %s controller\n", id->name); in smc911x_init()
137 /* Configure the PHY, initialize the link state */ in smc911x_init()
160 while (tmplen--) in smc911x_send()
184 return -1; in smc911x_send()
206 while (tmplen--) in smc911x_rx()
222 static int smc911x_miiphy_read(struct mii_dev *bus, int phy, int devad, in smc911x_miiphy_read() argument
226 struct eth_device *dev = eth_get_dev_by_name(bus->name); in smc911x_miiphy_read()
228 int retval = smc911x_eth_phy_read(dev, phy, reg, &val); in smc911x_miiphy_read()
233 return -ENODEV; in smc911x_miiphy_read()
236 static int smc911x_miiphy_write(struct mii_dev *bus, int phy, int devad, in smc911x_miiphy_write() argument
239 struct eth_device *dev = eth_get_dev_by_name(bus->name); in smc911x_miiphy_write()
241 return smc911x_eth_phy_write(dev, phy, reg, val); in smc911x_miiphy_write()
242 return -ENODEV; in smc911x_miiphy_write()
253 return -1; in smc911x_initialize()
257 dev->iobase = base_addr; in smc911x_initialize()
269 dev->enetaddr[0] = addrl; in smc911x_initialize()
270 dev->enetaddr[1] = addrl >> 8; in smc911x_initialize()
271 dev->enetaddr[2] = addrl >> 16; in smc911x_initialize()
272 dev->enetaddr[3] = addrl >> 24; in smc911x_initialize()
273 dev->enetaddr[4] = addrh; in smc911x_initialize()
274 dev->enetaddr[5] = addrh >> 8; in smc911x_initialize()
277 dev->init = smc911x_init; in smc911x_initialize()
278 dev->halt = smc911x_halt; in smc911x_initialize()
279 dev->send = smc911x_send; in smc911x_initialize()
280 dev->recv = smc911x_rx; in smc911x_initialize()
281 sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num); in smc911x_initialize()
289 return -ENOMEM; in smc911x_initialize()
290 strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); in smc911x_initialize()
291 mdiodev->read = smc911x_miiphy_read; in smc911x_initialize()
292 mdiodev->write = smc911x_miiphy_write; in smc911x_initialize()