Lines Matching full: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()
369 void __iomem *mmio = lp->mmio; in amd8111e_set_coalesce() local
383 writel(VAL0|STINTEN, mmio+INTEN0); in amd8111e_set_coalesce()
385 mmio+DLY_INT_A); in amd8111e_set_coalesce()
397 writel(VAL0|STINTEN,mmio+INTEN0); in amd8111e_set_coalesce()
399 mmio+DLY_INT_B); in amd8111e_set_coalesce()
403 writel(0,mmio+STVAL); in amd8111e_set_coalesce()
404 writel(STINTEN, mmio+INTEN0); in amd8111e_set_coalesce()
405 writel(0, mmio +DLY_INT_B); in amd8111e_set_coalesce()
406 writel(0, mmio+DLY_INT_A); in amd8111e_set_coalesce()
410 writel((u32)SOFT_TIMER_FREQ, mmio+STVAL); /* 0.5 sec */ in amd8111e_set_coalesce()
411 writel(VAL0|STINTEN, mmio+INTEN0); in amd8111e_set_coalesce()
425 void __iomem *mmio = lp->mmio; in amd8111e_restart() local
429 writel(RUN, mmio + CMD0); in amd8111e_restart()
435 writel((u32) VAL1|EN_PMGR, mmio + CMD3 ); in amd8111e_restart()
436 writel((u32)XPHYANE|XPHYRST , mmio + CTRL2); in amd8111e_restart()
441 reg_val = readl(mmio + CTRL1); in amd8111e_restart()
443 writel( reg_val| XMTSP_128 | CACHE_ALIGN, mmio + CTRL1 ); in amd8111e_restart()
448 SPNDINTEN | MPINTEN | SINTEN | STINTEN, mmio + INTEN0); in amd8111e_restart()
450 writel(VAL3 | LCINTEN | VAL1 | TINTEN0 | VAL0 | RINTEN0, mmio + INTEN0); in amd8111e_restart()
453 writel((u32)lp->tx_ring_dma_addr,mmio + XMT_RING_BASE_ADDR0); in amd8111e_restart()
454 writel((u32)lp->rx_ring_dma_addr,mmio+ RCV_RING_BASE_ADDR0); in amd8111e_restart()
456 writew((u32)NUM_TX_RING_DR, mmio + XMT_RING_LEN0); in amd8111e_restart()
457 writew((u16)NUM_RX_RING_DR, mmio + RCV_RING_LEN0); in amd8111e_restart()
460 writew((u32)DEFAULT_IPG,mmio+IPG); in amd8111e_restart()
461 writew((u32)(DEFAULT_IPG-IFS1_DELTA), mmio + IFS1); in amd8111e_restart()
464 writel((u32)VAL2|JUMBO, mmio + CMD3); in amd8111e_restart()
466 writel( REX_UFLO, mmio + CMD2); in amd8111e_restart()
468 writel( VAL0 | APAD_XMT|REX_RTRY , mmio + CMD2); in amd8111e_restart()
470 writel( VAL0 | APAD_XMT | REX_RTRY|REX_UFLO, mmio + CMD2); in amd8111e_restart()
471 writel((u32)JUMBO, mmio + CMD3); in amd8111e_restart()
475 writel((u32) VAL2|VSIZE|VL_TAG_DEL, mmio + CMD3); in amd8111e_restart()
477 writel( VAL0 | APAD_XMT | REX_RTRY, mmio + CMD2 ); in amd8111e_restart()
481 writeb( dev->dev_addr[i], mmio + PADR + i ); in amd8111e_restart()
490 writel(VAL2 | RDMD0, mmio + CMD0); in amd8111e_restart()
491 writel(VAL0 | INTREN | RUN, mmio + CMD0); in amd8111e_restart()
494 readl(mmio+CMD0); in amd8111e_restart()
503 void __iomem *mmio = lp->mmio; in amd8111e_init_hw_default() local
507 writel(RUN, mmio + CMD0); in amd8111e_init_hw_default()
510 writew( 0x8100 | lp->ext_phy_addr, mmio + AUTOPOLL0); in amd8111e_init_hw_default()
513 writel(0, mmio + RCV_RING_BASE_ADDR0); in amd8111e_init_hw_default()
516 writel(0, mmio + XMT_RING_BASE_ADDR0); in amd8111e_init_hw_default()
517 writel(0, mmio + XMT_RING_BASE_ADDR1); in amd8111e_init_hw_default()
518 writel(0, mmio + XMT_RING_BASE_ADDR2); in amd8111e_init_hw_default()
519 writel(0, mmio + XMT_RING_BASE_ADDR3); in amd8111e_init_hw_default()
522 writel(CMD0_CLEAR,mmio + CMD0); in amd8111e_init_hw_default()
525 writel(CMD2_CLEAR, mmio +CMD2); in amd8111e_init_hw_default()
528 writel(CMD7_CLEAR , mmio + CMD7); in amd8111e_init_hw_default()
531 writel(0x0, mmio + DLY_INT_A); in amd8111e_init_hw_default()
532 writel(0x0, mmio + DLY_INT_B); in amd8111e_init_hw_default()
535 writel(0x0, mmio + FLOW_CONTROL); in amd8111e_init_hw_default()
538 reg_val = readl(mmio + INT0); in amd8111e_init_hw_default()
539 writel(reg_val, mmio + INT0); in amd8111e_init_hw_default()
542 writel(0x0, mmio + STVAL); in amd8111e_init_hw_default()
545 writel( INTEN0_CLEAR, mmio + INTEN0); in amd8111e_init_hw_default()
548 writel(0x0 , mmio + LADRF); in amd8111e_init_hw_default()
551 writel( 0x80010,mmio + SRAM_SIZE); in amd8111e_init_hw_default()
554 writel(0x0, mmio + RCV_RING_LEN0); in amd8111e_init_hw_default()
557 writel(0x0, mmio + XMT_RING_LEN0); in amd8111e_init_hw_default()
558 writel(0x0, mmio + XMT_RING_LEN1); in amd8111e_init_hw_default()
559 writel(0x0, mmio + XMT_RING_LEN2); in amd8111e_init_hw_default()
560 writel(0x0, mmio + XMT_RING_LEN3); in amd8111e_init_hw_default()
563 writel(0x0, mmio + XMT_RING_LIMIT); in amd8111e_init_hw_default()
566 writew(MIB_CLEAR, mmio + MIB_ADDR); in amd8111e_init_hw_default()
569 amd8111e_writeq(*(u64 *)logic_filter, mmio + LADRF); in amd8111e_init_hw_default()
572 reg_val = readl(mmio + SRAM_SIZE); in amd8111e_init_hw_default()
575 writel( VAL2|JUMBO, mmio + CMD3); in amd8111e_init_hw_default()
577 writel(VAL2|VSIZE|VL_TAG_DEL, mmio + CMD3 ); in amd8111e_init_hw_default()
580 writel(CTRL1_DEFAULT, mmio + CTRL1); in amd8111e_init_hw_default()
583 readl(mmio + CMD2); in amd8111e_init_hw_default()
595 writel(INTREN, lp->mmio + CMD0); in amd8111e_disable_interrupt()
598 intr0 = readl(lp->mmio + INT0); in amd8111e_disable_interrupt()
599 writel(intr0, lp->mmio + INT0); in amd8111e_disable_interrupt()
602 readl(lp->mmio + INT0); in amd8111e_disable_interrupt()
609 writel(RUN, lp->mmio + CMD0); in amd8111e_stop_chip()
612 readl(lp->mmio + CMD0); in amd8111e_stop_chip()
687 void __iomem *mmio = lp->mmio; in amd8111e_rx_poll() local
784 writel(VAL0|RINTEN0, mmio + INTEN0); in amd8111e_rx_poll()
785 writel(VAL2 | RDMD0, mmio + CMD0); in amd8111e_rx_poll()
799 status0 = readl(lp->mmio + STAT0); in amd8111e_link_change()
837 static int amd8111e_read_mib(void __iomem *mmio, u8 MIB_COUNTER) in amd8111e_read_mib() argument
843 writew( MIB_RD_CMD | MIB_COUNTER, mmio + MIB_ADDR); in amd8111e_read_mib()
845 status = readw(mmio + MIB_ADDR); in amd8111e_read_mib()
850 data = readl(mmio + MIB_DATA); in amd8111e_read_mib()
860 void __iomem *mmio = lp->mmio; in amd8111e_get_stats() local
869 new_stats->rx_packets = amd8111e_read_mib(mmio, rcv_broadcast_pkts)+ in amd8111e_get_stats()
870 amd8111e_read_mib(mmio, rcv_multicast_pkts)+ in amd8111e_get_stats()
871 amd8111e_read_mib(mmio, rcv_unicast_pkts); in amd8111e_get_stats()
874 new_stats->tx_packets = amd8111e_read_mib(mmio, xmt_packets); in amd8111e_get_stats()
877 new_stats->rx_bytes = amd8111e_read_mib(mmio, rcv_octets); in amd8111e_get_stats()
880 new_stats->tx_bytes = amd8111e_read_mib(mmio, xmt_octets); in amd8111e_get_stats()
884 new_stats->rx_errors = amd8111e_read_mib(mmio, rcv_undersize_pkts)+ in amd8111e_get_stats()
885 amd8111e_read_mib(mmio, rcv_fragments)+ in amd8111e_get_stats()
886 amd8111e_read_mib(mmio, rcv_jabbers)+ in amd8111e_get_stats()
887 amd8111e_read_mib(mmio, rcv_alignment_errors)+ in amd8111e_get_stats()
888 amd8111e_read_mib(mmio, rcv_fcs_errors)+ in amd8111e_get_stats()
889 amd8111e_read_mib(mmio, rcv_miss_pkts)+ in amd8111e_get_stats()
893 new_stats->tx_errors = amd8111e_read_mib(mmio, xmt_underrun_pkts); in amd8111e_get_stats()
896 new_stats->rx_dropped = amd8111e_read_mib(mmio, rcv_miss_pkts); in amd8111e_get_stats()
899 new_stats->tx_dropped = amd8111e_read_mib(mmio, xmt_underrun_pkts); in amd8111e_get_stats()
902 new_stats->multicast = amd8111e_read_mib(mmio, rcv_multicast_pkts); in amd8111e_get_stats()
905 new_stats->collisions = amd8111e_read_mib(mmio, xmt_collisions); in amd8111e_get_stats()
909 amd8111e_read_mib(mmio, rcv_undersize_pkts)+ in amd8111e_get_stats()
910 amd8111e_read_mib(mmio, rcv_oversize_pkts); in amd8111e_get_stats()
913 new_stats->rx_over_errors = amd8111e_read_mib(mmio, rcv_miss_pkts); in amd8111e_get_stats()
916 new_stats->rx_crc_errors = amd8111e_read_mib(mmio, rcv_fcs_errors); in amd8111e_get_stats()
920 amd8111e_read_mib(mmio, rcv_alignment_errors); in amd8111e_get_stats()
923 new_stats->rx_fifo_errors = amd8111e_read_mib(mmio, rcv_miss_pkts); in amd8111e_get_stats()
926 new_stats->rx_missed_errors = amd8111e_read_mib(mmio, rcv_miss_pkts); in amd8111e_get_stats()
930 amd8111e_read_mib(mmio, xmt_excessive_collision); in amd8111e_get_stats()
934 amd8111e_read_mib(mmio, xmt_loss_carrier); in amd8111e_get_stats()
937 new_stats->tx_fifo_errors = amd8111e_read_mib(mmio, xmt_underrun_pkts); in amd8111e_get_stats()
941 amd8111e_read_mib(mmio, xmt_late_collision); in amd8111e_get_stats()
944 /* writew(MIB_CLEAR, mmio + MIB_ADDR);*/ in amd8111e_get_stats()
1090 void __iomem *mmio = lp->mmio; in amd8111e_interrupt() local
1100 writel(INTREN, mmio + CMD0); in amd8111e_interrupt()
1103 intr0 = readl(mmio + INT0); in amd8111e_interrupt()
1104 intren0 = readl(mmio + INTEN0); in amd8111e_interrupt()
1114 writel(intr0, mmio + INT0); in amd8111e_interrupt()
1120 writel(RINTEN0, mmio + INTEN0); in amd8111e_interrupt()
1126 writel(RINTEN0, mmio + INTEN0); in amd8111e_interrupt()
1143 writel( VAL0 | INTREN,mmio + CMD0); in amd8111e_interrupt()
1292 writel( VAL1 | TDMD0, lp->mmio + CMD0); in amd8111e_start_xmit()
1293 writel( VAL2 | RDMD0,lp->mmio + CMD0); in amd8111e_start_xmit()
1304 void __iomem *mmio = lp->mmio; in amd8111e_read_regs() local
1306 buf[0] = readl(mmio + XMT_RING_BASE_ADDR0); in amd8111e_read_regs()
1307 buf[1] = readl(mmio + XMT_RING_LEN0); in amd8111e_read_regs()
1308 buf[2] = readl(mmio + RCV_RING_BASE_ADDR0); in amd8111e_read_regs()
1309 buf[3] = readl(mmio + RCV_RING_LEN0); in amd8111e_read_regs()
1310 buf[4] = readl(mmio + CMD0); in amd8111e_read_regs()
1311 buf[5] = readl(mmio + CMD2); in amd8111e_read_regs()
1312 buf[6] = readl(mmio + CMD3); in amd8111e_read_regs()
1313 buf[7] = readl(mmio + CMD7); in amd8111e_read_regs()
1314 buf[8] = readl(mmio + INT0); in amd8111e_read_regs()
1315 buf[9] = readl(mmio + INTEN0); in amd8111e_read_regs()
1316 buf[10] = readl(mmio + LADRF); in amd8111e_read_regs()
1317 buf[11] = readl(mmio + LADRF+4); in amd8111e_read_regs()
1318 buf[12] = readl(mmio + STAT0); in amd8111e_read_regs()
1333 writel( VAL2 | PROM, lp->mmio + CMD2); in amd8111e_set_multicast_list()
1337 writel( PROM, lp->mmio + CMD2); in amd8111e_set_multicast_list()
1343 amd8111e_writeq(*(u64 *)mc_filter, lp->mmio + LADRF); in amd8111e_set_multicast_list()
1350 amd8111e_writeq(*(u64 *)mc_filter, lp->mmio + LADRF); in amd8111e_set_multicast_list()
1352 writel(PROM, lp->mmio + CMD2); in amd8111e_set_multicast_list()
1362 amd8111e_writeq(*(u64 *)mc_filter, lp->mmio + LADRF); in amd8111e_set_multicast_list()
1365 readl(lp->mmio + CMD2); in amd8111e_set_multicast_list()
1514 writeb( dev->dev_addr[i], lp->mmio + PADR + i ); in amd8111e_set_mac_address()
1540 writel(RUN, lp->mmio + CMD0); in amd8111e_change_mtu()
1553 writel( VAL1|MPPLBA, lp->mmio + CMD3); in amd8111e_enable_magicpkt()
1554 writel( VAL0|MPEN_SW, lp->mmio + CMD7); in amd8111e_enable_magicpkt()
1557 readl(lp->mmio + CMD7); in amd8111e_enable_magicpkt()
1565 writel(VAL0|LCMODE_SW,lp->mmio + CMD7); in amd8111e_enable_link_change()
1568 readl(lp->mmio + CMD7); in amd8111e_enable_link_change()
1655 void __iomem *mmio = lp->mmio; in amd8111e_config_ipg() local
1684 amd8111e_read_mib(mmio, xmt_collisions); in amd8111e_config_ipg()
1703 writew((u32)tmp_ipg, mmio + IPG); in amd8111e_config_ipg()
1704 writew((u32)(tmp_ipg - IFS1_DELTA), mmio + IFS1); in amd8111e_config_ipg()
1811 lp->mmio = devm_ioremap(&pdev->dev, reg_addr, reg_len); in amd8111e_probe_one()
1812 if (!lp->mmio) { in amd8111e_probe_one()
1820 dev->dev_addr[i] = readb(lp->mmio + PADR + i); in amd8111e_probe_one()
1873 chip_version = (readl(lp->mmio + CHIPID) & 0xf0000000)>>28; in amd8111e_probe_one()