static int sh_eth_reset(struct sh_eth_dev *eth) { int port = eth->port; #if defined(CONFIG_CPU_SH7763) int ret = 0, i; /* Start e-dmac transmitter and receiver */ outl(EDSR_ENALL, EDSR(port)); /* Perform a software reset and wait for it to complete */ outl(EDMR_SRST, EDMR(port)); for (i = 0; i < TIMEOUT_CNT ; i++) { if (!(inl(EDMR(port)) & EDMR_SRST)) break; udelay(1000); } if (i == TIMEOUT_CNT) { printf(SHETHER_NAME ": Software reset timeout\n"); ret = -EIO; } return ret; #else outl(inl(EDMR(port)) | EDMR_SRST, EDMR(port)); udelay(3000); outl(inl(EDMR(port)) & ~EDMR_SRST, EDMR(port)); return 0; #endif }
static int sh_eth_reset(struct sh_eth_dev *eth) { int port = eth->port; int ret = 0, i; /* Start e-dmac transmitter and receiver */ outl(EDSR_ENALL, EDSR(port)); /* Perform a software reset and wait for it to complete */ outl(EDMR_SRST, EDMR(port)); for (i = 0; i < EDMR_INIT_CNT; i++) { if (!(inl(EDMR(port)) & EDMR_SRST)) break; udelay(1000); } if (i == EDMR_INIT_CNT) { printf(SHETHER_NAME ": Software reset timeout\n"); ret = -EIO; } return ret; }