Lines Matching refs:emaclite
188 static u32 phyread(struct xemaclite *emaclite, u32 phyaddress, u32 registernum, in phyread() argument
191 struct emaclite_regs *regs = emaclite->regs; in phyread()
210 static u32 phywrite(struct xemaclite *emaclite, u32 phyaddress, u32 registernum, in phywrite() argument
213 struct emaclite_regs *regs = emaclite->regs; in phywrite()
257 struct xemaclite *emaclite = dev_get_priv(dev); in setup_phy() local
265 if (emaclite->phyaddr != -1) { in setup_phy()
266 phyread(emaclite, emaclite->phyaddr, PHY_DETECT_REG, &phyreg); in setup_phy()
271 emaclite->phyaddr); in setup_phy()
274 emaclite->phyaddr); in setup_phy()
275 emaclite->phyaddr = -1; in setup_phy()
279 if (emaclite->phyaddr == -1) { in setup_phy()
282 phyread(emaclite, i, PHY_DETECT_REG, &phyreg); in setup_phy()
286 emaclite->phyaddr = i; in setup_phy()
295 phydev = phy_connect(emaclite->bus, emaclite->phyaddr, dev, in setup_phy()
305 emaclite->phydev = phydev; in setup_phy()
322 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_start() local
324 struct emaclite_regs *regs = emaclite->regs; in emaclite_start()
345 if (emaclite->txpp) { in emaclite_start()
363 if (emaclite->rxpp) in emaclite_start()
375 static int xemaclite_txbufferavailable(struct xemaclite *emaclite) in xemaclite_txbufferavailable() argument
378 struct emaclite_regs *regs = emaclite->regs; in xemaclite_txbufferavailable()
385 if (emaclite->txpp) in xemaclite_txbufferavailable()
394 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_send() local
395 struct emaclite_regs *regs = emaclite->regs; in emaclite_send()
402 while (xemaclite_txbufferavailable(emaclite) && maxtry) { in emaclite_send()
411 if (emaclite->txpp) { in emaclite_send()
432 if (emaclite->txpp) { in emaclite_send()
458 struct xemaclite *emaclite = dev->priv; in emaclite_recv() local
459 struct emaclite_regs *regs = emaclite->regs; in emaclite_recv()
464 if (!emaclite->use_rx_pong_buffer_next) { in emaclite_recv()
474 if (!emaclite->rxpp) in emaclite_recv()
480 emaclite->use_rx_pong_buffer_next = in emaclite_recv()
481 !emaclite->use_rx_pong_buffer_next; in emaclite_recv()
496 emaclite->use_rx_pong_buffer_next = in emaclite_recv()
497 !emaclite->use_rx_pong_buffer_next; in emaclite_recv()
561 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_probe() local
564 emaclite->bus = mdio_alloc(); in emaclite_probe()
565 emaclite->bus->read = emaclite_miiphy_read; in emaclite_probe()
566 emaclite->bus->write = emaclite_miiphy_write; in emaclite_probe()
567 emaclite->bus->priv = emaclite; in emaclite_probe()
569 ret = mdio_register_seq(emaclite->bus, dev->seq); in emaclite_probe()
578 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_remove() local
580 free(emaclite->phydev); in emaclite_remove()
581 mdio_unregister(emaclite->bus); in emaclite_remove()
582 mdio_free(emaclite->bus); in emaclite_remove()
597 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_ofdata_to_platdata() local
601 emaclite->regs = (struct emaclite_regs *)ioremap_nocache(pdata->iobase, in emaclite_ofdata_to_platdata()
604 emaclite->phyaddr = -1; in emaclite_ofdata_to_platdata()
609 emaclite->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, in emaclite_ofdata_to_platdata()
612 emaclite->txpp = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), in emaclite_ofdata_to_platdata()
614 emaclite->rxpp = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), in emaclite_ofdata_to_platdata()
617 printf("EMACLITE: %lx, phyaddr %d, %d/%d\n", (ulong)emaclite->regs, in emaclite_ofdata_to_platdata()
618 emaclite->phyaddr, emaclite->txpp, emaclite->rxpp); in emaclite_ofdata_to_platdata()
628 U_BOOT_DRIVER(emaclite) = {