Lines Matching refs:emaclite
191 static u32 phyread(struct xemaclite *emaclite, u32 phyaddress, u32 registernum, in phyread() argument
194 struct emaclite_regs *regs = emaclite->regs; in phyread()
213 static u32 phywrite(struct xemaclite *emaclite, u32 phyaddress, u32 registernum, in phywrite() argument
216 struct emaclite_regs *regs = emaclite->regs; in phywrite()
260 struct xemaclite *emaclite = dev_get_priv(dev); in setup_phy() local
268 if (emaclite->phyaddr != -1) { in setup_phy()
269 phyread(emaclite, emaclite->phyaddr, PHY_DETECT_REG, &phyreg); in setup_phy()
274 emaclite->phyaddr); in setup_phy()
277 emaclite->phyaddr); in setup_phy()
278 emaclite->phyaddr = -1; in setup_phy()
282 if (emaclite->phyaddr == -1) { in setup_phy()
285 phyread(emaclite, i, PHY_DETECT_REG, &phyreg); in setup_phy()
289 emaclite->phyaddr = i; in setup_phy()
298 phydev = phy_connect(emaclite->bus, emaclite->phyaddr, dev, in setup_phy()
308 emaclite->phydev = phydev; in setup_phy()
325 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_start() local
327 struct emaclite_regs *regs = emaclite->regs; in emaclite_start()
348 if (emaclite->txpp) { in emaclite_start()
366 if (emaclite->rxpp) in emaclite_start()
378 static int xemaclite_txbufferavailable(struct xemaclite *emaclite) in xemaclite_txbufferavailable() argument
381 struct emaclite_regs *regs = emaclite->regs; in xemaclite_txbufferavailable()
388 if (emaclite->txpp) in xemaclite_txbufferavailable()
397 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_send() local
398 struct emaclite_regs *regs = emaclite->regs; in emaclite_send()
405 while (xemaclite_txbufferavailable(emaclite) && maxtry) { in emaclite_send()
414 if (emaclite->txpp) { in emaclite_send()
435 if (emaclite->txpp) { in emaclite_send()
461 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_recv() local
462 struct emaclite_regs *regs = emaclite->regs; in emaclite_recv()
467 if (!emaclite->use_rx_pong_buffer_next) { in emaclite_recv()
477 if (!emaclite->rxpp) in emaclite_recv()
483 emaclite->use_rx_pong_buffer_next = in emaclite_recv()
484 !emaclite->use_rx_pong_buffer_next; in emaclite_recv()
499 emaclite->use_rx_pong_buffer_next = in emaclite_recv()
500 !emaclite->use_rx_pong_buffer_next; in emaclite_recv()
564 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_probe() local
567 emaclite->bus = mdio_alloc(); in emaclite_probe()
568 emaclite->bus->read = emaclite_miiphy_read; in emaclite_probe()
569 emaclite->bus->write = emaclite_miiphy_write; in emaclite_probe()
570 emaclite->bus->priv = emaclite; in emaclite_probe()
572 ret = mdio_register_seq(emaclite->bus, dev_seq(dev)); in emaclite_probe()
581 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_remove() local
583 free(emaclite->phydev); in emaclite_remove()
584 mdio_unregister(emaclite->bus); in emaclite_remove()
585 mdio_free(emaclite->bus); in emaclite_remove()
600 struct xemaclite *emaclite = dev_get_priv(dev); in emaclite_of_to_plat() local
604 emaclite->regs = (struct emaclite_regs *)ioremap_nocache(pdata->iobase, in emaclite_of_to_plat()
607 emaclite->phyaddr = -1; in emaclite_of_to_plat()
612 emaclite->phyaddr = fdtdec_get_int(gd->fdt_blob, offset, in emaclite_of_to_plat()
615 emaclite->txpp = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), in emaclite_of_to_plat()
617 emaclite->rxpp = fdtdec_get_int(gd->fdt_blob, dev_of_offset(dev), in emaclite_of_to_plat()
620 printf("EMACLITE: %lx, phyaddr %d, %d/%d\n", (ulong)emaclite->regs, in emaclite_of_to_plat()
621 emaclite->phyaddr, emaclite->txpp, emaclite->rxpp); in emaclite_of_to_plat()
631 U_BOOT_DRIVER(emaclite) = {