Lines Matching +full:m +full:- +full:phy
1 // SPDX-License-Identifier: GPL-2.0+
24 uchar *m = dev->enetaddr; in smc911x_handle_mac_address() local
26 addrl = m[0] | (m[1] << 8) | (m[2] << 16) | (m[3] << 24); in smc911x_handle_mac_address()
27 addrh = m[4] | (m[5] << 8); in smc911x_handle_mac_address()
31 printf(DRIVERNAME ": MAC %pM\n", m); in smc911x_handle_mac_address()
35 u8 phy, u8 reg, u16 *val) in smc911x_eth_phy_read() argument
40 smc911x_set_mac_csr(dev, MII_ACC, phy << 11 | reg << 6 | in smc911x_eth_phy_read()
52 u8 phy, u8 reg, u16 val) in smc911x_eth_phy_write() argument
59 phy << 11 | reg << 6 | MII_ACC_MII_BUSY | MII_ACC_MII_WRITE); in smc911x_eth_phy_write()
96 if ((timeout--) == 0) in smc911x_phy_configure()
103 printf(DRIVERNAME ": phy initialized\n"); in smc911x_phy_configure()
130 struct chip_id *id = dev->priv; in smc911x_init()
132 printf(DRIVERNAME ": detected %s controller\n", id->name); in smc911x_init()
136 /* Configure the PHY, initialize the link state */ in smc911x_init()
159 while (tmplen--) in smc911x_send()
183 return -1; in smc911x_send()
205 while (tmplen--) in smc911x_rx()
221 static int smc911x_miiphy_read(struct mii_dev *bus, int phy, int devad, in smc911x_miiphy_read() argument
225 struct eth_device *dev = eth_get_dev_by_name(bus->name); in smc911x_miiphy_read()
227 int retval = smc911x_eth_phy_read(dev, phy, reg, &val); in smc911x_miiphy_read()
232 return -ENODEV; in smc911x_miiphy_read()
235 static int smc911x_miiphy_write(struct mii_dev *bus, int phy, int devad, in smc911x_miiphy_write() argument
238 struct eth_device *dev = eth_get_dev_by_name(bus->name); in smc911x_miiphy_write()
240 return smc911x_eth_phy_write(dev, phy, reg, val); in smc911x_miiphy_write()
241 return -ENODEV; in smc911x_miiphy_write()
252 return -1; in smc911x_initialize()
256 dev->iobase = base_addr; in smc911x_initialize()
268 dev->enetaddr[0] = addrl; in smc911x_initialize()
269 dev->enetaddr[1] = addrl >> 8; in smc911x_initialize()
270 dev->enetaddr[2] = addrl >> 16; in smc911x_initialize()
271 dev->enetaddr[3] = addrl >> 24; in smc911x_initialize()
272 dev->enetaddr[4] = addrh; in smc911x_initialize()
273 dev->enetaddr[5] = addrh >> 8; in smc911x_initialize()
276 dev->init = smc911x_init; in smc911x_initialize()
277 dev->halt = smc911x_halt; in smc911x_initialize()
278 dev->send = smc911x_send; in smc911x_initialize()
279 dev->recv = smc911x_rx; in smc911x_initialize()
280 sprintf(dev->name, "%s-%hu", DRIVERNAME, dev_num); in smc911x_initialize()
288 return -ENOMEM; in smc911x_initialize()
289 strncpy(mdiodev->name, dev->name, MDIO_NAME_LEN); in smc911x_initialize()
290 mdiodev->read = smc911x_miiphy_read; in smc911x_initialize()
291 mdiodev->write = smc911x_miiphy_write; in smc911x_initialize()