Commit ab36ee07 authored by Alessandro Rubini's avatar Alessandro Rubini

timer: use timer_delay_ms where it's milliseconds

This also removes an unsed function, that I found because it used
timer_delay().
Signed-off-by: Alessandro Rubini's avatarAlessandro Rubini <rubini@gnudd.com>
parent 9216288c
...@@ -114,7 +114,7 @@ int ep_enable(int enabled, int autoneg) ...@@ -114,7 +114,7 @@ int ep_enable(int enabled, int autoneg)
/* Reset the GTP Transceiver - it's important to do the GTP phase alignment every time /* Reset the GTP Transceiver - it's important to do the GTP phase alignment every time
we start up the software, otherwise the calibration RX/TX deltas may not be correct */ we start up the software, otherwise the calibration RX/TX deltas may not be correct */
pcs_write(MDIO_REG_MCR, MDIO_MCR_PDOWN); /* reset the PHY */ pcs_write(MDIO_REG_MCR, MDIO_MCR_PDOWN); /* reset the PHY */
timer_delay(200); timer_delay_ms(200);
pcs_write(MDIO_REG_MCR, MDIO_MCR_RESET); /* reset the PHY */ pcs_write(MDIO_REG_MCR, MDIO_MCR_RESET); /* reset the PHY */
pcs_write(MDIO_REG_MCR, 0); /* reset the PHY */ pcs_write(MDIO_REG_MCR, 0); /* reset the PHY */
...@@ -190,6 +190,6 @@ int ep_cal_pattern_disable() ...@@ -190,6 +190,6 @@ int ep_cal_pattern_disable()
int ep_timestamper_cal_pulse() int ep_timestamper_cal_pulse()
{ {
EP->TSCR |= EP_TSCR_RX_CAL_START; EP->TSCR |= EP_TSCR_RX_CAL_START;
timer_delay(1); timer_delay_ms(1);
return EP->TSCR & EP_TSCR_RX_CAL_RESULT ? 1 : 0; return EP->TSCR & EP_TSCR_RX_CAL_RESULT ? 1 : 0;
} }
...@@ -324,7 +324,7 @@ int minic_tx_frame(uint8_t * hdr, uint8_t * payload, uint32_t size, ...@@ -324,7 +324,7 @@ int minic_tx_frame(uint8_t * hdr, uint8_t * payload, uint32_t size,
for (i = 0; i < 1000; ++i) { for (i = 0; i < 1000; ++i) {
mcr = minic_readl(MINIC_REG_MCR); mcr = minic_readl(MINIC_REG_MCR);
if ((mcr & MINIC_MCR_TX_IDLE) != 0) break; if ((mcr & MINIC_MCR_TX_IDLE) != 0) break;
timer_delay(1); timer_delay_ms(1);
} }
if (i == 1000) if (i == 1000)
...@@ -341,7 +341,7 @@ int minic_tx_frame(uint8_t * hdr, uint8_t * payload, uint32_t size, ...@@ -341,7 +341,7 @@ int minic_tx_frame(uint8_t * hdr, uint8_t * payload, uint32_t size,
for (i = 0; i < 100; ++i) { for (i = 0; i < 100; ++i) {
mcr = minic_readl(MINIC_REG_MCR); mcr = minic_readl(MINIC_REG_MCR);
if ((mcr & MINIC_MCR_TX_TS_READY) != 0) break; if ((mcr & MINIC_MCR_TX_TS_READY) != 0) break;
timer_delay(1); timer_delay_ms(1);
} }
ts_valid = 1; ts_valid = 1;
......
...@@ -193,12 +193,12 @@ int measure_t24p(uint32_t *value) ...@@ -193,12 +193,12 @@ int measure_t24p(uint32_t *value)
int rv; int rv;
pp_printf("Waiting for link...\n"); pp_printf("Waiting for link...\n");
while (!ep_link_up(NULL)) while (!ep_link_up(NULL))
timer_delay(100); timer_delay_ms(100);
spll_init(SPLL_MODE_SLAVE, 0, 1); spll_init(SPLL_MODE_SLAVE, 0, 1);
pp_printf("Locking PLL...\n"); pp_printf("Locking PLL...\n");
while (!spll_check_lock(0)) while (!spll_check_lock(0))
timer_delay(100); timer_delay_ms(100);
pp_printf("\n"); pp_printf("\n");
pp_printf("Calibrating RX timestamper...\n"); pp_printf("Calibrating RX timestamper...\n");
......
...@@ -283,13 +283,6 @@ void _irq_entry() ...@@ -283,13 +283,6 @@ void _irq_entry()
clear_irq(); clear_irq();
} }
void spll_clear_dacs()
{
SPLL->DAC_HPLL = 0;
SPLL->DAC_MAIN = 0;
timer_delay(100);
}
void spll_init(int mode, int slave_ref_channel, int align_pps) void spll_init(int mode, int slave_ref_channel, int align_pps)
{ {
static const char *modes[] = { "", "grandmaster", "freemaster", "slave", "disabled" }; static const char *modes[] = { "", "grandmaster", "freemaster", "slave", "disabled" };
......
...@@ -166,7 +166,7 @@ static void check_stack(void) ...@@ -166,7 +166,7 @@ static void check_stack(void)
{ {
while (_endram != ENDRAM_MAGIC) { while (_endram != ENDRAM_MAGIC) {
mprintf("Stack overflow!\n"); mprintf("Stack overflow!\n");
timer_delay(1000); timer_delay_ms(1000);
} }
} }
...@@ -209,7 +209,7 @@ static void check_reset(void) ...@@ -209,7 +209,7 @@ static void check_reset(void)
save += 4; save += 4;
} }
pp_printf("Rebooting in 1 second\n\n\n"); pp_printf("Rebooting in 1 second\n\n\n");
timer_delay(1000); timer_delay_ms(1000);
/* Zero the stack and start over (so we dump correctly next time) */ /* Zero the stack and start over (so we dump correctly next time) */
for (p = &_endram; p < &_fstack; p++) for (p = &_endram; p < &_fstack; p++)
......
...@@ -126,7 +126,7 @@ int wrc_ptp_set_mode(int mode) ...@@ -126,7 +126,7 @@ int wrc_ptp_set_mode(int mode)
shw_pps_gen_enable_output(0); shw_pps_gen_enable_output(0);
while (!spll_check_lock(0) && lock_timeout) { while (!spll_check_lock(0) && lock_timeout) {
timer_delay(TICS_PER_SECOND); timer_delay_ms(1000);
mprintf("."); mprintf(".");
if (timer_get_tics() - start_tics > lock_timeout) { if (timer_get_tics() - start_tics > lock_timeout) {
mprintf("\nLock timeout.\n"); mprintf("\nLock timeout.\n");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment