Lines Matching refs:emac
166 at91_emac_t *emac; in at91emac_mii_read() local
168 emac = get_emacbase_by_name(bus->name); in at91emac_mii_read()
169 at91emac_read(emac , addr, reg, &value); in at91emac_mii_read()
177 at91_emac_t *emac; in at91emac_mii_write() local
179 emac = get_emacbase_by_name(bus->name); in at91emac_mii_write()
180 at91emac_write(emac, addr, reg, value); in at91emac_mii_write()
190 at91_emac_t *emac; in at91emac_phy_reset() local
192 emac = (at91_emac_t *) netdev->iobase; in at91emac_phy_reset()
195 at91emac_write(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_reset()
198 at91emac_write(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, MII_BMCR, in at91emac_phy_reset()
202 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_reset()
225 at91_emac_t *emac; in at91emac_phy_init() local
227 emac = (at91_emac_t *) netdev->iobase; in at91emac_phy_init()
230 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
237 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
246 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
257 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
259 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
273 int at91emac_UpdateLinkSpeed(at91_emac_t *emac) in at91emac_UpdateLinkSpeed() argument
277 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, MII_BMSR, &stat1); in at91emac_UpdateLinkSpeed()
284 writel(readl(&emac->cfg) | in at91emac_UpdateLinkSpeed()
286 &emac->cfg); in at91emac_UpdateLinkSpeed()
292 writel((readl(&emac->cfg) & in at91emac_UpdateLinkSpeed()
295 &emac->cfg); in at91emac_UpdateLinkSpeed()
301 writel((readl(&emac->cfg) & in at91emac_UpdateLinkSpeed()
304 &emac->cfg); in at91emac_UpdateLinkSpeed()
310 writel((readl(&emac->cfg) & in at91emac_UpdateLinkSpeed()
312 &emac->cfg); in at91emac_UpdateLinkSpeed()
323 at91_emac_t *emac; in at91emac_init() local
326 emac = (at91_emac_t *) netdev->iobase; in at91emac_init()
352 writel(readl(&emac->ctl) | AT91_EMAC_CTL_CSR, &emac->ctl); in at91emac_init()
361 writel((u32) &(dev->rbfdt[0]), &emac->rbqp); in at91emac_init()
363 writel(readl(&emac->rsr) & in at91emac_init()
365 &emac->rsr); in at91emac_init()
372 writel(value, &emac->cfg); in at91emac_init()
374 writel(readl(&emac->ctl) | AT91_EMAC_CTL_TE | AT91_EMAC_CTL_RE, in at91emac_init()
375 &emac->ctl); in at91emac_init()
378 at91emac_UpdateLinkSpeed(emac); in at91emac_init()
386 at91_emac_t *emac; in at91emac_halt() local
388 emac = (at91_emac_t *) netdev->iobase; in at91emac_halt()
389 writel(readl(&emac->ctl) & ~(AT91_EMAC_CTL_TE | AT91_EMAC_CTL_RE), in at91emac_halt()
390 &emac->ctl); in at91emac_halt()
396 at91_emac_t *emac; in at91emac_send() local
398 emac = (at91_emac_t *) netdev->iobase; in at91emac_send()
400 while (!(readl(&emac->tsr) & AT91_EMAC_TSR_BNQ)) in at91emac_send()
402 writel((u32) packet, &emac->tar); in at91emac_send()
403 writel(AT91_EMAC_TCR_LEN(length), &emac->tcr); in at91emac_send()
404 while (AT91_EMAC_TCR_LEN(readl(&emac->tcr))) in at91emac_send()
407 writel(readl(&emac->tsr) | AT91_EMAC_TSR_COMP, &emac->tsr); in at91emac_send()
414 at91_emac_t *emac; in at91emac_recv() local
418 emac = (at91_emac_t *) netdev->iobase; in at91emac_recv()
438 writel(readl(&emac->rsr) | AT91_EMAC_RSR_REC, in at91emac_recv()
439 &emac->rsr); in at91emac_recv()
442 if (readl(&emac->isr) & AT91_EMAC_IxR_RBNA) { in at91emac_recv()
444 writel(readl(&emac->ctl) & ~AT91_EMAC_CTL_RE, &emac->ctl); in at91emac_recv()
445 writel(readl(&emac->ctl) | AT91_EMAC_CTL_RE, &emac->ctl); in at91emac_recv()
455 at91_emac_t *emac; in at91emac_write_hwaddr() local
456 emac = (at91_emac_t *) netdev->iobase; in at91emac_write_hwaddr()
466 &emac->sa2l); in at91emac_write_hwaddr()
467 writel((netdev->enetaddr[4] | netdev->enetaddr[5] << 8), &emac->sa2h); in at91emac_write_hwaddr()
469 readl(&emac->sa2h), readl(&emac->sa2l)); in at91emac_write_hwaddr()
475 emac_device *emac; in at91emac_register() local
481 emac = malloc(sizeof(*emac)+512); in at91emac_register()
482 if (emac == NULL) in at91emac_register()
486 free(emac); in at91emac_register()
490 emacfix = (emac_device *) (((unsigned long) emac + 0x1ff) & 0xFFFFFE00); in at91emac_register()