Lines Matching refs:reg_val
105 unsigned int reg_val; in emac_update_speed() local
108 reg_val = readl(db->membase + EMAC_MAC_SUPP_REG); in emac_update_speed()
109 reg_val &= ~EMAC_MAC_SUPP_100M; in emac_update_speed()
111 reg_val |= EMAC_MAC_SUPP_100M; in emac_update_speed()
112 writel(reg_val, db->membase + EMAC_MAC_SUPP_REG); in emac_update_speed()
118 unsigned int reg_val; in emac_update_duplex() local
121 reg_val = readl(db->membase + EMAC_MAC_CTL1_REG); in emac_update_duplex()
122 reg_val &= ~EMAC_MAC_CTL1_DUPLEX_EN; in emac_update_duplex()
124 reg_val |= EMAC_MAC_CTL1_DUPLEX_EN; in emac_update_duplex()
125 writel(reg_val, db->membase + EMAC_MAC_CTL1_REG); in emac_update_duplex()
250 u32 reg_val; in emac_dma_done_callback() local
261 reg_val = readl(db->membase + EMAC_RX_CTL_REG); in emac_dma_done_callback()
262 reg_val &= ~EMAC_RX_CTL_DMA_EN; in emac_dma_done_callback()
263 writel(reg_val, db->membase + EMAC_RX_CTL_REG); in emac_dma_done_callback()
266 reg_val = readl(db->membase + EMAC_INT_CTL_REG); in emac_dma_done_callback()
267 reg_val |= EMAC_INT_CTL_RX_EN; in emac_dma_done_callback()
268 writel(reg_val, db->membase + EMAC_INT_CTL_REG); in emac_dma_done_callback()
364 unsigned int reg_val; in emac_setup() local
367 reg_val = readl(db->membase + EMAC_TX_MODE_REG); in emac_setup()
369 writel(reg_val | EMAC_TX_MODE_ABORTED_FRAME_EN, in emac_setup()
374 reg_val = readl(db->membase + EMAC_MAC_CTL0_REG); in emac_setup()
375 writel(reg_val | EMAC_MAC_CTL0_RX_FLOW_CTL_EN | in emac_setup()
380 reg_val = readl(db->membase + EMAC_MAC_CTL1_REG); in emac_setup()
381 reg_val |= EMAC_MAC_CTL1_LEN_CHECK_EN; in emac_setup()
382 reg_val |= EMAC_MAC_CTL1_CRC_EN; in emac_setup()
383 reg_val |= EMAC_MAC_CTL1_PAD_EN; in emac_setup()
384 writel(reg_val, db->membase + EMAC_MAC_CTL1_REG); in emac_setup()
407 unsigned int reg_val; in emac_set_rx_mode() local
410 reg_val = readl(db->membase + EMAC_RX_CTL_REG); in emac_set_rx_mode()
413 reg_val |= EMAC_RX_CTL_PASS_ALL_EN; in emac_set_rx_mode()
415 reg_val &= ~EMAC_RX_CTL_PASS_ALL_EN; in emac_set_rx_mode()
417 writel(reg_val | EMAC_RX_CTL_PASS_LEN_OOR_EN | in emac_set_rx_mode()
427 unsigned int reg_val; in emac_powerup() local
431 reg_val = readl(db->membase + EMAC_RX_CTL_REG); in emac_powerup()
432 reg_val |= EMAC_RX_CTL_FLUSH_FIFO; in emac_powerup()
433 writel(reg_val, db->membase + EMAC_RX_CTL_REG); in emac_powerup()
438 reg_val = readl(db->membase + EMAC_MAC_CTL0_REG); in emac_powerup()
439 reg_val &= ~EMAC_MAC_CTL0_SOFT_RESET; in emac_powerup()
440 writel(reg_val, db->membase + EMAC_MAC_CTL0_REG); in emac_powerup()
443 reg_val = readl(db->membase + EMAC_MAC_MCFG_REG); in emac_powerup()
444 reg_val &= ~EMAC_MAC_MCFG_MII_CLKD_MASK; in emac_powerup()
445 reg_val |= EMAC_MAC_MCFG_MII_CLKD_72; in emac_powerup()
446 writel(reg_val, db->membase + EMAC_MAC_MCFG_REG); in emac_powerup()
453 reg_val = readl(db->membase + EMAC_INT_STA_REG); in emac_powerup()
454 writel(reg_val, db->membase + EMAC_INT_STA_REG); in emac_powerup()
495 unsigned int reg_val; in emac_init_device() local
503 reg_val = readl(db->membase + EMAC_CTL_REG); in emac_init_device()
504 writel(reg_val | EMAC_CTL_RESET | EMAC_CTL_TX_EN | EMAC_CTL_RX_EN, in emac_init_device()
508 reg_val = readl(db->membase + EMAC_INT_CTL_REG); in emac_init_device()
509 reg_val |= (EMAC_INT_CTL_TX_EN | EMAC_INT_CTL_TX_ABRT_EN | EMAC_INT_CTL_RX_EN); in emac_init_device()
510 writel(reg_val, db->membase + EMAC_INT_CTL_REG); in emac_init_device()
623 unsigned int reg_val; in emac_rx() local
639 reg_val = readl(db->membase + EMAC_INT_CTL_REG); in emac_rx()
640 reg_val |= (EMAC_INT_CTL_TX_EN | in emac_rx()
643 writel(reg_val, db->membase + EMAC_INT_CTL_REG); in emac_rx()
651 reg_val = readl(db->membase + EMAC_RX_IO_DATA_REG); in emac_rx()
653 dev_dbg(db->dev, "receive header: %x\n", reg_val); in emac_rx()
654 if (reg_val != EMAC_UNDOCUMENTED_MAGIC) { in emac_rx()
656 reg_val = readl(db->membase + EMAC_CTL_REG); in emac_rx()
657 writel(reg_val & ~EMAC_CTL_RX_EN, in emac_rx()
661 reg_val = readl(db->membase + EMAC_RX_CTL_REG); in emac_rx()
662 writel(reg_val | (1 << 3), in emac_rx()
666 reg_val = readl(db->membase + EMAC_RX_CTL_REG); in emac_rx()
667 } while (reg_val & (1 << 3)); in emac_rx()
670 reg_val = readl(db->membase + EMAC_CTL_REG); in emac_rx()
671 writel(reg_val | EMAC_CTL_RX_EN, in emac_rx()
673 reg_val = readl(db->membase + EMAC_INT_CTL_REG); in emac_rx()
674 reg_val |= (EMAC_INT_CTL_TX_EN | in emac_rx()
677 writel(reg_val, db->membase + EMAC_INT_CTL_REG); in emac_rx()
735 reg_val = readl(db->membase + EMAC_RX_CTL_REG); in emac_rx()
736 reg_val |= EMAC_RX_CTL_DMA_EN; in emac_rx()
737 writel(reg_val, db->membase + EMAC_RX_CTL_REG); in emac_rx()
742 reg_val = readl(db->membase + EMAC_RX_CTL_REG); in emac_rx()
743 reg_val &= ~EMAC_RX_CTL_DMA_EN; in emac_rx()
744 writel(reg_val, db->membase + EMAC_RX_CTL_REG); in emac_rx()
764 unsigned int reg_val; in emac_interrupt() local
798 reg_val = readl(db->membase + EMAC_INT_CTL_REG); in emac_interrupt()
799 reg_val |= (EMAC_INT_CTL_TX_EN | EMAC_INT_CTL_TX_ABRT_EN | EMAC_INT_CTL_RX_EN); in emac_interrupt()
800 writel(reg_val, db->membase + EMAC_INT_CTL_REG); in emac_interrupt()
802 reg_val = readl(db->membase + EMAC_INT_CTL_REG); in emac_interrupt()
803 reg_val |= (EMAC_INT_CTL_TX_EN | EMAC_INT_CTL_TX_ABRT_EN); in emac_interrupt()
804 writel(reg_val, db->membase + EMAC_INT_CTL_REG); in emac_interrupt()
857 unsigned int reg_val; in emac_shutdown() local
864 reg_val = readl(db->membase + EMAC_INT_STA_REG); in emac_shutdown()
865 writel(reg_val, db->membase + EMAC_INT_STA_REG); in emac_shutdown()
868 reg_val = readl(db->membase + EMAC_CTL_REG); in emac_shutdown()
869 reg_val &= ~(EMAC_CTL_TX_EN | EMAC_CTL_RX_EN | EMAC_CTL_RESET); in emac_shutdown()
870 writel(reg_val, db->membase + EMAC_CTL_REG); in emac_shutdown()