Lines Matching refs:bregs
129 static void bigmac_tx_reset(void __iomem *bregs) in bigmac_tx_reset() argument
133 sbus_writel(0, bregs + BMAC_TXCFG); in bigmac_tx_reset()
138 while ((sbus_readl(bregs + BMAC_TXCFG) & ~(BIGMAC_TXCFG_FIFO)) != 0 && in bigmac_tx_reset()
145 sbus_readl(bregs + BMAC_TXCFG)); in bigmac_tx_reset()
149 static void bigmac_rx_reset(void __iomem *bregs) in bigmac_rx_reset() argument
153 sbus_writel(0, bregs + BMAC_RXCFG); in bigmac_rx_reset()
154 while (sbus_readl(bregs + BMAC_RXCFG) && --tries) in bigmac_rx_reset()
160 sbus_readl(bregs + BMAC_RXCFG)); in bigmac_rx_reset()
167 bigmac_tx_reset(bp->bregs); in bigmac_stop()
168 bigmac_rx_reset(bp->bregs); in bigmac_stop()
171 static void bigmac_get_counters(struct bigmac *bp, void __iomem *bregs) in bigmac_get_counters() argument
175 stats->rx_crc_errors += sbus_readl(bregs + BMAC_RCRCECTR); in bigmac_get_counters()
176 sbus_writel(0, bregs + BMAC_RCRCECTR); in bigmac_get_counters()
178 stats->rx_frame_errors += sbus_readl(bregs + BMAC_UNALECTR); in bigmac_get_counters()
179 sbus_writel(0, bregs + BMAC_UNALECTR); in bigmac_get_counters()
181 stats->rx_length_errors += sbus_readl(bregs + BMAC_GLECTR); in bigmac_get_counters()
182 sbus_writel(0, bregs + BMAC_GLECTR); in bigmac_get_counters()
184 stats->tx_aborted_errors += sbus_readl(bregs + BMAC_EXCTR); in bigmac_get_counters()
187 (sbus_readl(bregs + BMAC_EXCTR) + in bigmac_get_counters()
188 sbus_readl(bregs + BMAC_LTCTR)); in bigmac_get_counters()
189 sbus_writel(0, bregs + BMAC_EXCTR); in bigmac_get_counters()
190 sbus_writel(0, bregs + BMAC_LTCTR); in bigmac_get_counters()
624 void __iomem *bregs = bp->bregs; in bigmac_init_hw() local
629 bigmac_get_counters(bp, bregs); in bigmac_init_hw()
647 sbus_writel(((e[4] << 8) | e[5]), bregs + BMAC_MACADDR2); in bigmac_init_hw()
648 sbus_writel(((e[2] << 8) | e[3]), bregs + BMAC_MACADDR1); in bigmac_init_hw()
649 sbus_writel(((e[0] << 8) | e[1]), bregs + BMAC_MACADDR0); in bigmac_init_hw()
652 sbus_writel(0, bregs + BMAC_HTABLE3); in bigmac_init_hw()
653 sbus_writel(0, bregs + BMAC_HTABLE2); in bigmac_init_hw()
654 sbus_writel(0, bregs + BMAC_HTABLE1); in bigmac_init_hw()
655 sbus_writel(0, bregs + BMAC_HTABLE0); in bigmac_init_hw()
659 bregs + BMAC_RXCFG); in bigmac_init_hw()
663 sbus_writel(BIGMAC_TXCFG_FIFO, bregs + BMAC_TXCFG); in bigmac_init_hw()
667 bregs + BMAC_RSEED); in bigmac_init_hw()
671 bregs + BMAC_XIFCFG); in bigmac_init_hw()
689 bregs + BMAC_IMASK); in bigmac_init_hw()
698 sbus_writel(DEFAULT_JAMSIZE, bregs + BMAC_JSIZE); in bigmac_init_hw()
704 sbus_writel(sbus_readl(bregs + BMAC_TXCFG) | BIGMAC_TXCFG_ENABLE, in bigmac_init_hw()
705 bregs + BMAC_TXCFG); in bigmac_init_hw()
706 sbus_writel(sbus_readl(bregs + BMAC_RXCFG) | BIGMAC_RXCFG_ENABLE, in bigmac_init_hw()
707 bregs + BMAC_RXCFG); in bigmac_init_hw()
989 bigmac_get_counters(bp, bp->bregs); in bigmac_get_stats()
996 void __iomem *bregs = bp->bregs; in bigmac_set_multicast() local
1003 tmp = sbus_readl(bregs + BMAC_RXCFG); in bigmac_set_multicast()
1005 sbus_writel(tmp, bregs + BMAC_RXCFG); in bigmac_set_multicast()
1006 while ((sbus_readl(bregs + BMAC_RXCFG) & BIGMAC_RXCFG_ENABLE) != 0) in bigmac_set_multicast()
1010 sbus_writel(0xffff, bregs + BMAC_HTABLE0); in bigmac_set_multicast()
1011 sbus_writel(0xffff, bregs + BMAC_HTABLE1); in bigmac_set_multicast()
1012 sbus_writel(0xffff, bregs + BMAC_HTABLE2); in bigmac_set_multicast()
1013 sbus_writel(0xffff, bregs + BMAC_HTABLE3); in bigmac_set_multicast()
1015 tmp = sbus_readl(bregs + BMAC_RXCFG); in bigmac_set_multicast()
1017 sbus_writel(tmp, bregs + BMAC_RXCFG); in bigmac_set_multicast()
1026 sbus_writel(hash_table[0], bregs + BMAC_HTABLE0); in bigmac_set_multicast()
1027 sbus_writel(hash_table[1], bregs + BMAC_HTABLE1); in bigmac_set_multicast()
1028 sbus_writel(hash_table[2], bregs + BMAC_HTABLE2); in bigmac_set_multicast()
1029 sbus_writel(hash_table[3], bregs + BMAC_HTABLE3); in bigmac_set_multicast()
1033 tmp = sbus_readl(bregs + BMAC_RXCFG); in bigmac_set_multicast()
1035 sbus_writel(tmp, bregs + BMAC_RXCFG); in bigmac_set_multicast()
1141 bp->bregs = of_ioremap(&op->resource[1], 0, in bigmac_ether_init()
1143 if (!bp->bregs) { in bigmac_ether_init()
1208 if (bp->bregs) in bigmac_ether_init()
1209 of_iounmap(&op->resource[1], bp->bregs, BMAC_REG_SIZE); in bigmac_ether_init()
1250 of_iounmap(&op->resource[1], bp->bregs, BMAC_REG_SIZE); in bigmac_sbus_remove()