/* smc911x_init - get the MAC/EEPROM up and ready for use  */
static int smc911x_init(struct eth_device *dev)
/* smc911x_init - get the MAC/EEPROM up and ready for use  */
static int smc911x_init(struct eth_device *dev)
{
	if (smc911x_detect_chip(dev))
		return 1;
	smc911x_reset(dev);
	if (smc911x_reg_read(dev, GPIO_CFG) & GPIO_CFG_EEPR_EN) {
		while (smc911x_reg_read(dev, E2P_CMD) & E2P_CMD_EPC_BUSY)
			if (smsc_ctrlc()) {
				printf("init: timeout (E2P_CMD = 0x%08x)\n",
					smc911x_reg_read(dev, E2P_CMD));
				return 1;
			}
		smc911x_reg_write(dev, GPIO_CFG,
			smc911x_reg_read(dev, GPIO_CFG) & ~GPIO_CFG_EEPR_EN);
	}
	return 0;
}