Lines Matching refs:mmio
101 void __iomem *mmio = lp->mmio; in amd8111e_read_phy() local
105 reg_val = readl(mmio + PHY_ACCESS); in amd8111e_read_phy()
107 reg_val = readl(mmio + PHY_ACCESS); in amd8111e_read_phy()
110 ((reg & 0x1f) << 16), mmio + PHY_ACCESS); in amd8111e_read_phy()
112 reg_val = readl(mmio + PHY_ACCESS); in amd8111e_read_phy()
131 void __iomem *mmio = lp->mmio; in amd8111e_write_phy() local
134 reg_val = readl(mmio + PHY_ACCESS); in amd8111e_write_phy()
136 reg_val = readl(mmio + PHY_ACCESS); in amd8111e_write_phy()
139 ((reg & 0x1f) << 16)|val, mmio + PHY_ACCESS); in amd8111e_write_phy()
142 reg_val = readl(mmio + PHY_ACCESS); in amd8111e_write_phy()
368 void __iomem *mmio = lp->mmio; in amd8111e_set_coalesce() local
382 writel(VAL0|STINTEN, mmio+INTEN0); in amd8111e_set_coalesce()
384 timeout, mmio + DLY_INT_A); in amd8111e_set_coalesce()
396 writel(VAL0 | STINTEN, mmio + INTEN0); in amd8111e_set_coalesce()
398 timeout, mmio + DLY_INT_B); in amd8111e_set_coalesce()
402 writel(0, mmio + STVAL); in amd8111e_set_coalesce()
403 writel(STINTEN, mmio + INTEN0); in amd8111e_set_coalesce()
404 writel(0, mmio + DLY_INT_B); in amd8111e_set_coalesce()
405 writel(0, mmio + DLY_INT_A); in amd8111e_set_coalesce()
409 writel((u32)SOFT_TIMER_FREQ, mmio + STVAL); /* 0.5 sec */ in amd8111e_set_coalesce()
410 writel(VAL0 | STINTEN, mmio + INTEN0); in amd8111e_set_coalesce()
424 void __iomem *mmio = lp->mmio; in amd8111e_restart() local
428 writel(RUN, mmio + CMD0); in amd8111e_restart()
434 writel((u32)VAL1 | EN_PMGR, mmio + CMD3); in amd8111e_restart()
435 writel((u32)XPHYANE | XPHYRST, mmio + CTRL2); in amd8111e_restart()
440 reg_val = readl(mmio + CTRL1); in amd8111e_restart()
442 writel(reg_val | XMTSP_128 | CACHE_ALIGN, mmio + CTRL1); in amd8111e_restart()
447 SPNDINTEN | MPINTEN | SINTEN | STINTEN, mmio + INTEN0); in amd8111e_restart()
449 writel(VAL3 | LCINTEN | VAL1 | TINTEN0 | VAL0 | RINTEN0, mmio + INTEN0); in amd8111e_restart()
452 writel((u32)lp->tx_ring_dma_addr, mmio + XMT_RING_BASE_ADDR0); in amd8111e_restart()
453 writel((u32)lp->rx_ring_dma_addr, mmio + RCV_RING_BASE_ADDR0); in amd8111e_restart()
455 writew((u32)NUM_TX_RING_DR, mmio + XMT_RING_LEN0); in amd8111e_restart()
456 writew((u16)NUM_RX_RING_DR, mmio + RCV_RING_LEN0); in amd8111e_restart()
459 writew((u32)DEFAULT_IPG, mmio + IPG); in amd8111e_restart()
460 writew((u32)(DEFAULT_IPG-IFS1_DELTA), mmio + IFS1); in amd8111e_restart()
463 writel((u32)VAL2|JUMBO, mmio + CMD3); in amd8111e_restart()
465 writel(REX_UFLO, mmio + CMD2); in amd8111e_restart()
467 writel(VAL0 | APAD_XMT | REX_RTRY, mmio + CMD2); in amd8111e_restart()
469 writel(VAL0 | APAD_XMT | REX_RTRY | REX_UFLO, mmio + CMD2); in amd8111e_restart()
470 writel((u32)JUMBO, mmio + CMD3); in amd8111e_restart()
474 writel((u32)VAL2 | VSIZE | VL_TAG_DEL, mmio + CMD3); in amd8111e_restart()
476 writel(VAL0 | APAD_XMT | REX_RTRY, mmio + CMD2); in amd8111e_restart()
480 writeb(dev->dev_addr[i], mmio + PADR + i); in amd8111e_restart()
489 writel(VAL2 | RDMD0, mmio + CMD0); in amd8111e_restart()
490 writel(VAL0 | INTREN | RUN, mmio + CMD0); in amd8111e_restart()
493 readl(mmio+CMD0); in amd8111e_restart()
502 void __iomem *mmio = lp->mmio; in amd8111e_init_hw_default() local
506 writel(RUN, mmio + CMD0); in amd8111e_init_hw_default()
509 writew( 0x8100 | lp->ext_phy_addr, mmio + AUTOPOLL0); in amd8111e_init_hw_default()
512 writel(0, mmio + RCV_RING_BASE_ADDR0); in amd8111e_init_hw_default()
515 writel(0, mmio + XMT_RING_BASE_ADDR0); in amd8111e_init_hw_default()
516 writel(0, mmio + XMT_RING_BASE_ADDR1); in amd8111e_init_hw_default()
517 writel(0, mmio + XMT_RING_BASE_ADDR2); in amd8111e_init_hw_default()
518 writel(0, mmio + XMT_RING_BASE_ADDR3); in amd8111e_init_hw_default()
521 writel(CMD0_CLEAR, mmio + CMD0); in amd8111e_init_hw_default()
524 writel(CMD2_CLEAR, mmio + CMD2); in amd8111e_init_hw_default()
527 writel(CMD7_CLEAR, mmio + CMD7); in amd8111e_init_hw_default()
530 writel(0x0, mmio + DLY_INT_A); in amd8111e_init_hw_default()
531 writel(0x0, mmio + DLY_INT_B); in amd8111e_init_hw_default()
534 writel(0x0, mmio + FLOW_CONTROL); in amd8111e_init_hw_default()
537 reg_val = readl(mmio + INT0); in amd8111e_init_hw_default()
538 writel(reg_val, mmio + INT0); in amd8111e_init_hw_default()
541 writel(0x0, mmio + STVAL); in amd8111e_init_hw_default()
544 writel(INTEN0_CLEAR, mmio + INTEN0); in amd8111e_init_hw_default()
547 writel(0x0, mmio + LADRF); in amd8111e_init_hw_default()
550 writel(0x80010, mmio + SRAM_SIZE); in amd8111e_init_hw_default()
553 writel(0x0, mmio + RCV_RING_LEN0); in amd8111e_init_hw_default()
556 writel(0x0, mmio + XMT_RING_LEN0); in amd8111e_init_hw_default()
557 writel(0x0, mmio + XMT_RING_LEN1); in amd8111e_init_hw_default()
558 writel(0x0, mmio + XMT_RING_LEN2); in amd8111e_init_hw_default()
559 writel(0x0, mmio + XMT_RING_LEN3); in amd8111e_init_hw_default()
562 writel(0x0, mmio + XMT_RING_LIMIT); in amd8111e_init_hw_default()
565 writew(MIB_CLEAR, mmio + MIB_ADDR); in amd8111e_init_hw_default()
568 amd8111e_writeq(*(u64 *)logic_filter, mmio + LADRF); in amd8111e_init_hw_default()
571 reg_val = readl(mmio + SRAM_SIZE); in amd8111e_init_hw_default()
574 writel(VAL2 | JUMBO, mmio + CMD3); in amd8111e_init_hw_default()
576 writel(VAL2 | VSIZE | VL_TAG_DEL, mmio + CMD3); in amd8111e_init_hw_default()
579 writel(CTRL1_DEFAULT, mmio + CTRL1); in amd8111e_init_hw_default()
582 readl(mmio + CMD2); in amd8111e_init_hw_default()
594 writel(INTREN, lp->mmio + CMD0); in amd8111e_disable_interrupt()
597 intr0 = readl(lp->mmio + INT0); in amd8111e_disable_interrupt()
598 writel(intr0, lp->mmio + INT0); in amd8111e_disable_interrupt()
601 readl(lp->mmio + INT0); in amd8111e_disable_interrupt()
608 writel(RUN, lp->mmio + CMD0); in amd8111e_stop_chip()
611 readl(lp->mmio + CMD0); in amd8111e_stop_chip()
686 void __iomem *mmio = lp->mmio; in amd8111e_rx_poll() local
783 writel(VAL0|RINTEN0, mmio + INTEN0); in amd8111e_rx_poll()
784 writel(VAL2 | RDMD0, mmio + CMD0); in amd8111e_rx_poll()
798 status0 = readl(lp->mmio + STAT0); in amd8111e_link_change()
835 static int amd8111e_read_mib(void __iomem *mmio, u8 MIB_COUNTER) in amd8111e_read_mib() argument
841 writew(MIB_RD_CMD | MIB_COUNTER, mmio + MIB_ADDR); in amd8111e_read_mib()
843 status = readw(mmio + MIB_ADDR); in amd8111e_read_mib()
848 data = readl(mmio + MIB_DATA); in amd8111e_read_mib()
858 void __iomem *mmio = lp->mmio; in amd8111e_get_stats() local
867 new_stats->rx_packets = amd8111e_read_mib(mmio, rcv_broadcast_pkts)+ in amd8111e_get_stats()
868 amd8111e_read_mib(mmio, rcv_multicast_pkts)+ in amd8111e_get_stats()
869 amd8111e_read_mib(mmio, rcv_unicast_pkts); in amd8111e_get_stats()
872 new_stats->tx_packets = amd8111e_read_mib(mmio, xmt_packets); in amd8111e_get_stats()
875 new_stats->rx_bytes = amd8111e_read_mib(mmio, rcv_octets); in amd8111e_get_stats()
878 new_stats->tx_bytes = amd8111e_read_mib(mmio, xmt_octets); in amd8111e_get_stats()
882 new_stats->rx_errors = amd8111e_read_mib(mmio, rcv_undersize_pkts)+ in amd8111e_get_stats()
883 amd8111e_read_mib(mmio, rcv_fragments)+ in amd8111e_get_stats()
884 amd8111e_read_mib(mmio, rcv_jabbers)+ in amd8111e_get_stats()
885 amd8111e_read_mib(mmio, rcv_alignment_errors)+ in amd8111e_get_stats()
886 amd8111e_read_mib(mmio, rcv_fcs_errors)+ in amd8111e_get_stats()
887 amd8111e_read_mib(mmio, rcv_miss_pkts)+ in amd8111e_get_stats()
891 new_stats->tx_errors = amd8111e_read_mib(mmio, xmt_underrun_pkts); in amd8111e_get_stats()
894 new_stats->rx_dropped = amd8111e_read_mib(mmio, rcv_miss_pkts); in amd8111e_get_stats()
897 new_stats->tx_dropped = amd8111e_read_mib(mmio, xmt_underrun_pkts); in amd8111e_get_stats()
900 new_stats->multicast = amd8111e_read_mib(mmio, rcv_multicast_pkts); in amd8111e_get_stats()
903 new_stats->collisions = amd8111e_read_mib(mmio, xmt_collisions); in amd8111e_get_stats()
907 amd8111e_read_mib(mmio, rcv_undersize_pkts)+ in amd8111e_get_stats()
908 amd8111e_read_mib(mmio, rcv_oversize_pkts); in amd8111e_get_stats()
911 new_stats->rx_over_errors = amd8111e_read_mib(mmio, rcv_miss_pkts); in amd8111e_get_stats()
914 new_stats->rx_crc_errors = amd8111e_read_mib(mmio, rcv_fcs_errors); in amd8111e_get_stats()
918 amd8111e_read_mib(mmio, rcv_alignment_errors); in amd8111e_get_stats()
921 new_stats->rx_fifo_errors = amd8111e_read_mib(mmio, rcv_miss_pkts); in amd8111e_get_stats()
924 new_stats->rx_missed_errors = amd8111e_read_mib(mmio, rcv_miss_pkts); in amd8111e_get_stats()
928 amd8111e_read_mib(mmio, xmt_excessive_collision); in amd8111e_get_stats()
932 amd8111e_read_mib(mmio, xmt_loss_carrier); in amd8111e_get_stats()
935 new_stats->tx_fifo_errors = amd8111e_read_mib(mmio, xmt_underrun_pkts); in amd8111e_get_stats()
939 amd8111e_read_mib(mmio, xmt_late_collision); in amd8111e_get_stats()
1082 void __iomem *mmio = lp->mmio; in amd8111e_interrupt() local
1092 writel(INTREN, mmio + CMD0); in amd8111e_interrupt()
1095 intr0 = readl(mmio + INT0); in amd8111e_interrupt()
1096 intren0 = readl(mmio + INTEN0); in amd8111e_interrupt()
1106 writel(intr0, mmio + INT0); in amd8111e_interrupt()
1112 writel(RINTEN0, mmio + INTEN0); in amd8111e_interrupt()
1118 writel(RINTEN0, mmio + INTEN0); in amd8111e_interrupt()
1135 writel(VAL0 | INTREN, mmio + CMD0); in amd8111e_interrupt()
1284 writel(VAL1 | TDMD0, lp->mmio + CMD0); in amd8111e_start_xmit()
1285 writel(VAL2 | RDMD0, lp->mmio + CMD0); in amd8111e_start_xmit()
1296 void __iomem *mmio = lp->mmio; in amd8111e_read_regs() local
1298 buf[0] = readl(mmio + XMT_RING_BASE_ADDR0); in amd8111e_read_regs()
1299 buf[1] = readl(mmio + XMT_RING_LEN0); in amd8111e_read_regs()
1300 buf[2] = readl(mmio + RCV_RING_BASE_ADDR0); in amd8111e_read_regs()
1301 buf[3] = readl(mmio + RCV_RING_LEN0); in amd8111e_read_regs()
1302 buf[4] = readl(mmio + CMD0); in amd8111e_read_regs()
1303 buf[5] = readl(mmio + CMD2); in amd8111e_read_regs()
1304 buf[6] = readl(mmio + CMD3); in amd8111e_read_regs()
1305 buf[7] = readl(mmio + CMD7); in amd8111e_read_regs()
1306 buf[8] = readl(mmio + INT0); in amd8111e_read_regs()
1307 buf[9] = readl(mmio + INTEN0); in amd8111e_read_regs()
1308 buf[10] = readl(mmio + LADRF); in amd8111e_read_regs()
1309 buf[11] = readl(mmio + LADRF+4); in amd8111e_read_regs()
1310 buf[12] = readl(mmio + STAT0); in amd8111e_read_regs()
1325 writel(VAL2 | PROM, lp->mmio + CMD2); in amd8111e_set_multicast_list()
1329 writel(PROM, lp->mmio + CMD2); in amd8111e_set_multicast_list()
1335 amd8111e_writeq(*(u64 *)mc_filter, lp->mmio + LADRF); in amd8111e_set_multicast_list()
1342 amd8111e_writeq(*(u64 *)mc_filter, lp->mmio + LADRF); in amd8111e_set_multicast_list()
1344 writel(PROM, lp->mmio + CMD2); in amd8111e_set_multicast_list()
1354 amd8111e_writeq(*(u64 *)mc_filter, lp->mmio + LADRF); in amd8111e_set_multicast_list()
1357 readl(lp->mmio + CMD2); in amd8111e_set_multicast_list()
1506 writeb(dev->dev_addr[i], lp->mmio + PADR + i); in amd8111e_set_mac_address()
1532 writel(RUN, lp->mmio + CMD0); in amd8111e_change_mtu()
1545 writel(VAL1 | MPPLBA, lp->mmio + CMD3); in amd8111e_enable_magicpkt()
1546 writel(VAL0 | MPEN_SW, lp->mmio + CMD7); in amd8111e_enable_magicpkt()
1549 readl(lp->mmio + CMD7); in amd8111e_enable_magicpkt()
1557 writel(VAL0 | LCMODE_SW, lp->mmio + CMD7); in amd8111e_enable_link_change()
1560 readl(lp->mmio + CMD7); in amd8111e_enable_link_change()
1646 void __iomem *mmio = lp->mmio; in amd8111e_config_ipg() local
1675 amd8111e_read_mib(mmio, xmt_collisions); in amd8111e_config_ipg()
1694 writew((u32)tmp_ipg, mmio + IPG); in amd8111e_config_ipg()
1695 writew((u32)(tmp_ipg - IFS1_DELTA), mmio + IFS1); in amd8111e_config_ipg()
1803 lp->mmio = devm_ioremap(&pdev->dev, reg_addr, reg_len); in amd8111e_probe_one()
1804 if (!lp->mmio) { in amd8111e_probe_one()
1812 addr[i] = readb(lp->mmio + PADR + i); in amd8111e_probe_one()
1863 chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000) >> 28; in amd8111e_probe_one()