Lines Matching full:emac

26 #error AT91 EMAC supports max 1024 RX buffers. \
164 at91_emac_t *emac; in at91emac_mii_read() local
166 emac = get_emacbase_by_name(bus->name); in at91emac_mii_read()
167 at91emac_read(emac , addr, reg, &value); in at91emac_mii_read()
175 at91_emac_t *emac; in at91emac_mii_write() local
177 emac = get_emacbase_by_name(bus->name); in at91emac_mii_write()
178 at91emac_write(emac, addr, reg, value); in at91emac_mii_write()
188 at91_emac_t *emac; in at91emac_phy_reset() local
190 emac = (at91_emac_t *) netdev->iobase; in at91emac_phy_reset()
193 at91emac_write(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_reset()
196 at91emac_write(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, MII_BMCR, in at91emac_phy_reset()
200 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_reset()
223 at91_emac_t *emac; in at91emac_phy_init() local
225 emac = (at91_emac_t *) netdev->iobase; in at91emac_phy_init()
228 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
235 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
244 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
255 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
257 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, in at91emac_phy_init()
271 int at91emac_UpdateLinkSpeed(at91_emac_t *emac) in at91emac_UpdateLinkSpeed() argument
275 at91emac_read(emac, CONFIG_DRIVER_AT91EMAC_PHYADDR, MII_BMSR, &stat1); in at91emac_UpdateLinkSpeed()
281 /*set Emac for 100BaseTX and Full Duplex */ in at91emac_UpdateLinkSpeed()
282 writel(readl(&emac->cfg) | in at91emac_UpdateLinkSpeed()
284 &emac->cfg); in at91emac_UpdateLinkSpeed()
290 writel((readl(&emac->cfg) & in at91emac_UpdateLinkSpeed()
293 &emac->cfg); in at91emac_UpdateLinkSpeed()
299 writel((readl(&emac->cfg) & in at91emac_UpdateLinkSpeed()
302 &emac->cfg); in at91emac_UpdateLinkSpeed()
308 writel((readl(&emac->cfg) & in at91emac_UpdateLinkSpeed()
310 &emac->cfg); in at91emac_UpdateLinkSpeed()
321 at91_emac_t *emac; in at91emac_init() local
324 emac = (at91_emac_t *) netdev->iobase; in at91emac_init()
350 writel(readl(&emac->ctl) | AT91_EMAC_CTL_CSR, &emac->ctl); in at91emac_init()
359 writel((u32) &(dev->rbfdt[0]), &emac->rbqp); in at91emac_init()
361 writel(readl(&emac->rsr) & in at91emac_init()
363 &emac->rsr); in at91emac_init()
370 writel(value, &emac->cfg); in at91emac_init()
372 writel(readl(&emac->ctl) | AT91_EMAC_CTL_TE | AT91_EMAC_CTL_RE, in at91emac_init()
373 &emac->ctl); in at91emac_init()
376 at91emac_UpdateLinkSpeed(emac); in at91emac_init()
384 at91_emac_t *emac; in at91emac_halt() local
386 emac = (at91_emac_t *) netdev->iobase; in at91emac_halt()
387 writel(readl(&emac->ctl) & ~(AT91_EMAC_CTL_TE | AT91_EMAC_CTL_RE), in at91emac_halt()
388 &emac->ctl); in at91emac_halt()
394 at91_emac_t *emac; in at91emac_send() local
396 emac = (at91_emac_t *) netdev->iobase; in at91emac_send()
398 while (!(readl(&emac->tsr) & AT91_EMAC_TSR_BNQ)) in at91emac_send()
400 writel((u32) packet, &emac->tar); in at91emac_send()
401 writel(AT91_EMAC_TCR_LEN(length), &emac->tcr); in at91emac_send()
402 while (AT91_EMAC_TCR_LEN(readl(&emac->tcr))) in at91emac_send()
405 writel(readl(&emac->tsr) | AT91_EMAC_TSR_COMP, &emac->tsr); in at91emac_send()
412 at91_emac_t *emac; in at91emac_recv() local
416 emac = (at91_emac_t *) netdev->iobase; in at91emac_recv()
436 writel(readl(&emac->rsr) | AT91_EMAC_RSR_REC, in at91emac_recv()
437 &emac->rsr); in at91emac_recv()
440 if (readl(&emac->isr) & AT91_EMAC_IxR_RBNA) { in at91emac_recv()
441 /* EMAC silicon bug 41.3.1 workaround 1 */ in at91emac_recv()
442 writel(readl(&emac->ctl) & ~AT91_EMAC_CTL_RE, &emac->ctl); in at91emac_recv()
443 writel(readl(&emac->ctl) | AT91_EMAC_CTL_RE, &emac->ctl); in at91emac_recv()
445 printf("%s: reset receiver (EMAC dead lock bug)\n", in at91emac_recv()
453 at91_emac_t *emac; in at91emac_write_hwaddr() local
454 emac = (at91_emac_t *) netdev->iobase; in at91emac_write_hwaddr()
464 &emac->sa2l); in at91emac_write_hwaddr()
465 writel((netdev->enetaddr[4] | netdev->enetaddr[5] << 8), &emac->sa2h); in at91emac_write_hwaddr()
467 readl(&emac->sa2h), readl(&emac->sa2l)); in at91emac_write_hwaddr()
473 emac_device *emac; in at91emac_register() local
479 emac = malloc(sizeof(*emac)+512); in at91emac_register()
480 if (emac == NULL) in at91emac_register()
484 free(emac); in at91emac_register()
488 emacfix = (emac_device *) (((unsigned long) emac + 0x1ff) & 0xFFFFFE00); in at91emac_register()
492 strcpy(dev->name, "emac"); in at91emac_register()