Lines Matching refs:fec

60 	struct mpc52xx_fec __iomem *fec;  member
105 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_set_paddr() local
107 out_be32(&fec->paddr1, *(u32 *)(&mac[0])); in mpc52xx_fec_set_paddr()
108 out_be32(&fec->paddr2, (*(u16 *)(&mac[4]) << 16) | FEC_PADDR2_TYPE); in mpc52xx_fec_set_paddr()
172 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_adjust_link() local
179 rcntrl = in_be32(&fec->r_cntrl); in mpc52xx_fec_adjust_link()
180 tcntrl = in_be32(&fec->x_cntrl); in mpc52xx_fec_adjust_link()
189 out_be32(&fec->r_cntrl, rcntrl); in mpc52xx_fec_adjust_link()
190 out_be32(&fec->x_cntrl, tcntrl); in mpc52xx_fec_adjust_link()
445 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_interrupt() local
448 ievent = in_be32(&fec->ievent); in mpc52xx_fec_interrupt()
454 out_be32(&fec->ievent, ievent); /* clear pending events */ in mpc52xx_fec_interrupt()
485 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_get_stats() local
487 stats->rx_bytes = in_be32(&fec->rmon_r_octets); in mpc52xx_fec_get_stats()
488 stats->rx_packets = in_be32(&fec->rmon_r_packets); in mpc52xx_fec_get_stats()
489 stats->rx_errors = in_be32(&fec->rmon_r_crc_align) + in mpc52xx_fec_get_stats()
490 in_be32(&fec->rmon_r_undersize) + in mpc52xx_fec_get_stats()
491 in_be32(&fec->rmon_r_oversize) + in mpc52xx_fec_get_stats()
492 in_be32(&fec->rmon_r_frag) + in mpc52xx_fec_get_stats()
493 in_be32(&fec->rmon_r_jab); in mpc52xx_fec_get_stats()
495 stats->tx_bytes = in_be32(&fec->rmon_t_octets); in mpc52xx_fec_get_stats()
496 stats->tx_packets = in_be32(&fec->rmon_t_packets); in mpc52xx_fec_get_stats()
497 stats->tx_errors = in_be32(&fec->rmon_t_crc_align) + in mpc52xx_fec_get_stats()
498 in_be32(&fec->rmon_t_undersize) + in mpc52xx_fec_get_stats()
499 in_be32(&fec->rmon_t_oversize) + in mpc52xx_fec_get_stats()
500 in_be32(&fec->rmon_t_frag) + in mpc52xx_fec_get_stats()
501 in_be32(&fec->rmon_t_jab); in mpc52xx_fec_get_stats()
503 stats->multicast = in_be32(&fec->rmon_r_mc_pkt); in mpc52xx_fec_get_stats()
504 stats->collisions = in_be32(&fec->rmon_t_col); in mpc52xx_fec_get_stats()
507 stats->rx_length_errors = in_be32(&fec->rmon_r_undersize) in mpc52xx_fec_get_stats()
508 + in_be32(&fec->rmon_r_oversize) in mpc52xx_fec_get_stats()
509 + in_be32(&fec->rmon_r_frag) in mpc52xx_fec_get_stats()
510 + in_be32(&fec->rmon_r_jab); in mpc52xx_fec_get_stats()
511 stats->rx_over_errors = in_be32(&fec->r_macerr); in mpc52xx_fec_get_stats()
512 stats->rx_crc_errors = in_be32(&fec->ieee_r_crc); in mpc52xx_fec_get_stats()
513 stats->rx_frame_errors = in_be32(&fec->ieee_r_align); in mpc52xx_fec_get_stats()
514 stats->rx_fifo_errors = in_be32(&fec->rmon_r_drop); in mpc52xx_fec_get_stats()
515 stats->rx_missed_errors = in_be32(&fec->rmon_r_drop); in mpc52xx_fec_get_stats()
519 stats->tx_carrier_errors = in_be32(&fec->ieee_t_cserr); in mpc52xx_fec_get_stats()
520 stats->tx_fifo_errors = in_be32(&fec->rmon_t_drop); in mpc52xx_fec_get_stats()
521 stats->tx_heartbeat_errors = in_be32(&fec->ieee_t_sqe); in mpc52xx_fec_get_stats()
522 stats->tx_window_errors = in_be32(&fec->ieee_t_lcol); in mpc52xx_fec_get_stats()
534 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_reset_stats() local
536 out_be32(&fec->mib_control, FEC_MIB_DISABLE); in mpc52xx_fec_reset_stats()
537 memset_io(&fec->rmon_t_drop, 0, in mpc52xx_fec_reset_stats()
540 out_be32(&fec->mib_control, 0); in mpc52xx_fec_reset_stats()
551 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_set_multicast_list() local
554 rx_control = in_be32(&fec->r_cntrl); in mpc52xx_fec_set_multicast_list()
558 out_be32(&fec->r_cntrl, rx_control); in mpc52xx_fec_set_multicast_list()
561 out_be32(&fec->r_cntrl, rx_control); in mpc52xx_fec_set_multicast_list()
564 out_be32(&fec->gaddr1, 0xffffffff); in mpc52xx_fec_set_multicast_list()
565 out_be32(&fec->gaddr2, 0xffffffff); in mpc52xx_fec_set_multicast_list()
579 out_be32(&fec->gaddr1, gaddr1); in mpc52xx_fec_set_multicast_list()
580 out_be32(&fec->gaddr2, gaddr2); in mpc52xx_fec_set_multicast_list()
594 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_hw_init() local
598 out_be32(&fec->ecntrl, FEC_ECNTRL_RESET); in mpc52xx_fec_hw_init()
600 if ((in_be32(&fec->ecntrl) & FEC_ECNTRL_RESET) == 0) in mpc52xx_fec_hw_init()
608 out_be32(&fec->op_pause, FEC_OP_PAUSE_OPCODE | 0x20); in mpc52xx_fec_hw_init()
613 out_be32(&fec->rfifo_cntrl, FEC_FIFO_CNTRL_FRAME | FEC_FIFO_CNTRL_LTG_7); in mpc52xx_fec_hw_init()
614 out_be32(&fec->tfifo_cntrl, FEC_FIFO_CNTRL_FRAME | FEC_FIFO_CNTRL_LTG_7); in mpc52xx_fec_hw_init()
617 out_be32(&fec->rfifo_alarm, 0x0000030c); in mpc52xx_fec_hw_init()
618 out_be32(&fec->tfifo_alarm, 0x00000100); in mpc52xx_fec_hw_init()
621 out_be32(&fec->x_wmrk, FEC_FIFO_WMRK_256B); in mpc52xx_fec_hw_init()
624 out_be32(&fec->xmit_fsm, FEC_XMIT_FSM_APPEND_CRC | FEC_XMIT_FSM_ENABLE_CRC); in mpc52xx_fec_hw_init()
625 out_be32(&fec->iaddr1, 0x00000000); /* No individual filter */ in mpc52xx_fec_hw_init()
626 out_be32(&fec->iaddr2, 0x00000000); /* No individual filter */ in mpc52xx_fec_hw_init()
631 out_be32(&fec->mii_speed, priv->mdio_speed); in mpc52xx_fec_hw_init()
645 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_start() local
652 out_be32(&fec->rfifo_status, in_be32(&fec->rfifo_status) & tmp); in mpc52xx_fec_start()
653 out_be32(&fec->tfifo_status, in_be32(&fec->tfifo_status) & tmp); in mpc52xx_fec_start()
656 out_be32(&fec->reset_cntrl, FEC_RESET_CNTRL_ENABLE_IS_RESET); in mpc52xx_fec_start()
676 out_be32(&fec->r_cntrl, rcntrl); in mpc52xx_fec_start()
677 out_be32(&fec->x_cntrl, tcntrl); in mpc52xx_fec_start()
680 out_be32(&fec->ievent, 0xffffffff); in mpc52xx_fec_start()
683 out_be32(&fec->imask, FEC_IMASK_ENABLE); in mpc52xx_fec_start()
686 out_be32(&fec->ecntrl, FEC_ECNTRL_ETHER_EN); in mpc52xx_fec_start()
687 out_be32(&fec->r_des_active, 0x01000000); in mpc52xx_fec_start()
699 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_stop() local
703 out_be32(&fec->imask, 0); in mpc52xx_fec_stop()
732 out_be32(&fec->ecntrl, in_be32(&fec->ecntrl) & ~FEC_ECNTRL_ETHER_EN); in mpc52xx_fec_stop()
739 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_reset() local
743 out_be32(&fec->rfifo_status, in_be32(&fec->rfifo_status)); in mpc52xx_fec_reset()
744 out_be32(&fec->reset_cntrl, FEC_RESET_CNTRL_RESET_FIFO); in mpc52xx_fec_reset()
858 priv->fec = ioremap(mem.start, sizeof(struct mpc52xx_fec)); in mpc52xx_fec_probe()
860 if (!priv->fec) { in mpc52xx_fec_probe()
895 struct mpc52xx_fec __iomem *fec = priv->fec; in mpc52xx_fec_probe() local
901 *(u32 *)(&ndev->dev_addr[0]) = in_be32(&fec->paddr1); in mpc52xx_fec_probe()
902 *(u16 *)(&ndev->dev_addr[4]) = in_be32(&fec->paddr2) >> 16; in mpc52xx_fec_probe()
964 iounmap(priv->fec); in mpc52xx_fec_probe()
992 iounmap(priv->fec); in mpc52xx_fec_remove()