replace tickdelay with micro_delay to be quantum-agnostic
Change-Id: Ie449d797389a178372035d797c84b02d636788cd
This commit is contained in:
parent
3e2c6c9674
commit
d4dd6511b9
@ -26,7 +26,6 @@ extern u32_t system_hz;
|
|||||||
|
|
||||||
static void el2_init(dpeth_t *dep);
|
static void el2_init(dpeth_t *dep);
|
||||||
static void el2_stop(dpeth_t *dep);
|
static void el2_stop(dpeth_t *dep);
|
||||||
static void milli_delay(unsigned long millis);
|
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* el2_init *
|
* el2_init *
|
||||||
@ -154,9 +153,9 @@ dpeth_t * dep;
|
|||||||
|
|
||||||
/* Resets board */
|
/* Resets board */
|
||||||
outb_el2(dep, EL2_CNTR, ECNTR_RESET | thin);
|
outb_el2(dep, EL2_CNTR, ECNTR_RESET | thin);
|
||||||
milli_delay(1);
|
micro_delay(1000);
|
||||||
outb_el2(dep, EL2_CNTR, thin);
|
outb_el2(dep, EL2_CNTR, thin);
|
||||||
milli_delay(5);
|
micro_delay(5000);
|
||||||
|
|
||||||
/* Map the address PROM to lower I/O address range */
|
/* Map the address PROM to lower I/O address range */
|
||||||
outb_el2(dep, EL2_CNTR, ECNTR_SAPROM | thin);
|
outb_el2(dep, EL2_CNTR, ECNTR_SAPROM | thin);
|
||||||
@ -184,11 +183,6 @@ dpeth_t * dep;
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void milli_delay(unsigned long millis)
|
|
||||||
{
|
|
||||||
tickdelay(MILLIS_TO_TICKS(millis));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ENABLE_3C503 */
|
#endif /* ENABLE_3C503 */
|
||||||
|
|
||||||
/** 3c503.c **/
|
/** 3c503.c **/
|
||||||
|
@ -32,7 +32,6 @@ static u8_t pat3[]= { 0x96, 0x69, 0x5A, 0xA5 };
|
|||||||
static int test_8(dpeth_t *dep, int pos, u8_t *pat);
|
static int test_8(dpeth_t *dep, int pos, u8_t *pat);
|
||||||
static int test_16(dpeth_t *dep, int pos, u8_t *pat);
|
static int test_16(dpeth_t *dep, int pos, u8_t *pat);
|
||||||
static void ne_stop(dpeth_t *dep);
|
static void ne_stop(dpeth_t *dep);
|
||||||
static void milli_delay(unsigned long millis);
|
|
||||||
|
|
||||||
/*===========================================================================*
|
/*===========================================================================*
|
||||||
* ne_probe *
|
* ne_probe *
|
||||||
@ -56,9 +55,9 @@ int ne_probe(dpeth_t *dep)
|
|||||||
{
|
{
|
||||||
/* Reset the ethernet card */
|
/* Reset the ethernet card */
|
||||||
byte= inb_ne(dep, NE_RESET);
|
byte= inb_ne(dep, NE_RESET);
|
||||||
milli_delay(2);
|
micro_delay(2000);
|
||||||
outb_ne(dep, NE_RESET, byte);
|
outb_ne(dep, NE_RESET, byte);
|
||||||
milli_delay(2);
|
micro_delay(2000);
|
||||||
|
|
||||||
/* Reset the dp8390 */
|
/* Reset the dp8390 */
|
||||||
outb_reg0(dep, DP_CR, CR_STP | CR_DM_ABORT);
|
outb_reg0(dep, DP_CR, CR_STP | CR_DM_ABORT);
|
||||||
@ -310,15 +309,10 @@ dpeth_t *dep;
|
|||||||
|
|
||||||
/* Reset the ethernet card */
|
/* Reset the ethernet card */
|
||||||
byte= inb_ne(dep, NE_RESET);
|
byte= inb_ne(dep, NE_RESET);
|
||||||
milli_delay(2);
|
micro_delay(2000);
|
||||||
outb_ne(dep, NE_RESET, byte);
|
outb_ne(dep, NE_RESET, byte);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void milli_delay(unsigned long millis)
|
|
||||||
{
|
|
||||||
tickdelay(MILLIS_TO_TICKS(millis));
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ENABLE_NE2000 */
|
#endif /* ENABLE_NE2000 */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -239,7 +239,7 @@ e1000_reset_hw(e1000_t * e)
|
|||||||
e1000_reg_set(e, E1000_REG_CTRL, E1000_REG_CTRL_RST);
|
e1000_reg_set(e, E1000_REG_CTRL, E1000_REG_CTRL_RST);
|
||||||
|
|
||||||
/* Wait one microsecond. */
|
/* Wait one microsecond. */
|
||||||
tickdelay(1);
|
micro_delay(16000);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -792,7 +792,7 @@ eeprom_ich_init(e1000_t * e)
|
|||||||
ret_val = 0;
|
ret_val = 0;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tickdelay(1);
|
micro_delay(16000);
|
||||||
}
|
}
|
||||||
if (ret_val == 0) {
|
if (ret_val == 0) {
|
||||||
/*
|
/*
|
||||||
@ -834,7 +834,7 @@ eeprom_ich_cycle(e1000_t * e, u32_t timeout)
|
|||||||
hsfsts.regval = E1000_READ_FLASH_REG16(e, ICH_FLASH_HSFSTS);
|
hsfsts.regval = E1000_READ_FLASH_REG16(e, ICH_FLASH_HSFSTS);
|
||||||
if (hsfsts.hsf_status.flcdone == 1)
|
if (hsfsts.hsf_status.flcdone == 1)
|
||||||
break;
|
break;
|
||||||
tickdelay(1);
|
micro_delay(16000);
|
||||||
} while (i++ < timeout);
|
} while (i++ < timeout);
|
||||||
|
|
||||||
if (hsfsts.hsf_status.flcdone == 1 && hsfsts.hsf_status.flcerr == 0)
|
if (hsfsts.hsf_status.flcdone == 1 && hsfsts.hsf_status.flcerr == 0)
|
||||||
@ -867,7 +867,7 @@ eeprom_ich(e1000_t * e, int reg)
|
|||||||
e->flash_base_addr;
|
e->flash_base_addr;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
tickdelay(1);
|
micro_delay(16000);
|
||||||
|
|
||||||
/* Steps */
|
/* Steps */
|
||||||
ret_val = eeprom_ich_init(e);
|
ret_val = eeprom_ich_init(e);
|
||||||
|
@ -607,7 +607,7 @@ fxp_t *fp;
|
|||||||
|
|
||||||
/* Reset device */
|
/* Reset device */
|
||||||
fxp_outl(port, CSR_PORT, CP_CMD_SOFT_RESET);
|
fxp_outl(port, CSR_PORT, CP_CMD_SOFT_RESET);
|
||||||
tickdelay(micros_to_ticks(CSR_PORT_RESET_DELAY));
|
micro_delay(CSR_PORT_RESET_DELAY);
|
||||||
|
|
||||||
/* Disable interrupts */
|
/* Disable interrupts */
|
||||||
fxp_outb(port, SCB_INT_MASK, SIM_M);
|
fxp_outb(port, SCB_INT_MASK, SIM_M);
|
||||||
|
@ -655,7 +655,7 @@ lan8710a_init_hw(netdriver_addr_t * addr, unsigned int instance)
|
|||||||
LAN8710A_DEBUG_PRINT(("Autonegotiation failed"));
|
LAN8710A_DEBUG_PRINT(("Autonegotiation failed"));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
tickdelay(100);
|
micro_delay(1666666);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* GMII RX and TX release from reset. */
|
/* GMII RX and TX release from reset. */
|
||||||
|
Loading…
x
Reference in New Issue
Block a user