mirror of
https://github.com/Stichting-MINIX-Research-Foundation/u-boot.git
synced 2025-09-11 05:02:26 -04:00
ColdFire:Update the timer_init since it was unified.
Signed-off-by: Jason Jin <Jason.jin@freescale.com>
This commit is contained in:
parent
6c0bf27d74
commit
444ddfc751
@ -72,7 +72,7 @@ void dtimer_interrupt(void *not_used)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void timer_init(void)
|
int timer_init(void)
|
||||||
{
|
{
|
||||||
volatile slt_t *timerp = (slt_t *) (CONFIG_SYS_TMR_BASE);
|
volatile slt_t *timerp = (slt_t *) (CONFIG_SYS_TMR_BASE);
|
||||||
|
|
||||||
@ -93,6 +93,7 @@ void timer_init(void)
|
|||||||
/* set a period of 1us, set timer mode to restart and
|
/* set a period of 1us, set timer mode to restart and
|
||||||
enable timer and interrupt */
|
enable timer and interrupt */
|
||||||
timerp->cr = SLT_CR_RUN | SLT_CR_IEN | SLT_CR_TEN;
|
timerp->cr = SLT_CR_RUN | SLT_CR_IEN | SLT_CR_TEN;
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong get_timer(ulong base)
|
ulong get_timer(ulong base)
|
||||||
|
@ -78,8 +78,6 @@ static char *failed = "*** failed ***\n";
|
|||||||
extern ulong __init_end;
|
extern ulong __init_end;
|
||||||
extern ulong __bss_end__;
|
extern ulong __bss_end__;
|
||||||
|
|
||||||
extern void timer_init(void);
|
|
||||||
|
|
||||||
#if defined(CONFIG_WATCHDOG)
|
#if defined(CONFIG_WATCHDOG)
|
||||||
# define INIT_FUNC_WATCHDOG_INIT watchdog_init,
|
# define INIT_FUNC_WATCHDOG_INIT watchdog_init,
|
||||||
# define WATCHDOG_DISABLE watchdog_disable
|
# define WATCHDOG_DISABLE watchdog_disable
|
||||||
|
@ -91,7 +91,7 @@ void dtimer_interrupt(void *not_used)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void timer_init(void)
|
int timer_init(void)
|
||||||
{
|
{
|
||||||
volatile dtmr_t *timerp = (dtmr_t *) (CONFIG_SYS_TMR_BASE);
|
volatile dtmr_t *timerp = (dtmr_t *) (CONFIG_SYS_TMR_BASE);
|
||||||
|
|
||||||
@ -114,6 +114,8 @@ void timer_init(void)
|
|||||||
/* set a period of 1us, set timer mode to restart and enable timer and interrupt */
|
/* set a period of 1us, set timer mode to restart and enable timer and interrupt */
|
||||||
timerp->tmr = CONFIG_SYS_TIMER_PRESCALER | DTIM_DTMR_CLK_DIV1 |
|
timerp->tmr = CONFIG_SYS_TIMER_PRESCALER | DTIM_DTMR_CLK_DIV1 |
|
||||||
DTIM_DTMR_FRR | DTIM_DTMR_ORRI | DTIM_DTMR_RST_EN;
|
DTIM_DTMR_FRR | DTIM_DTMR_ORRI | DTIM_DTMR_RST_EN;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong get_timer(ulong base)
|
ulong get_timer(ulong base)
|
||||||
@ -162,6 +164,8 @@ void timer_init(void)
|
|||||||
timerp->pcsr = PIT_PCSR_OVW;
|
timerp->pcsr = PIT_PCSR_OVW;
|
||||||
timerp->pmr = lastinc = 0;
|
timerp->pmr = lastinc = 0;
|
||||||
timerp->pcsr |= PIT_PCSR_PRE(CONFIG_SYS_PIT_PRESCALE) | PIT_PCSR_EN;
|
timerp->pcsr |= PIT_PCSR_PRE(CONFIG_SYS_PIT_PRESCALE) | PIT_PCSR_EN;
|
||||||
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
ulong get_timer(ulong base)
|
ulong get_timer(ulong base)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user