timer: pass platform timer structure in to all platform timer calls.

Make sure we pass in our timer structure. In preparation for 64bit timers.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
This commit is contained in:
Liam Girdwood 2017-09-13 23:13:00 +01:00
parent 5416229b18
commit 45984c98d3
6 changed files with 9 additions and 12 deletions

View File

@ -505,7 +505,7 @@ static int ipc_pm_context_save(uint32_t header)
/* TODO: clear any outstanding platform IRQs - TODO refine */
/* TODO: stop ALL timers */
platform_timer_stop(0);
platform_timer_stop(platform_timer);
/* TODO: disable SSP and DMA HW */

View File

@ -84,7 +84,7 @@ static inline struct task *edf_get_next(void)
return NULL;
/* get the current time */
current = platform_timer_get(NULL);
current = platform_timer_get(platform_timer);
/* check every queued or running task in list */
list_for_item(clist, &sch->list) {
@ -174,7 +174,7 @@ void schedule_task(struct task *task, uint32_t deadline, uint16_t priority,
}
/* get the current time */
current = platform_timer_get(NULL);
current = platform_timer_get(platform_timer);
/* calculate deadline - TODO: include MIPS */
ticks = clock_us_to_ticks(sch->clock, deadline);

View File

@ -56,7 +56,7 @@ void _trace_event(uint32_t event)
/* write timestamp and event to trace buffer */
t =(volatile uint32_t*)(MAILBOX_TRACE_BASE + trace.pos);
t[0] = platform_timer_get(0);
t[0] = platform_timer_get(platform_timer);
t[1] = event;
/* writeback trace data */

View File

@ -240,8 +240,7 @@ uint32_t clock_time_elapsed(int clock, uint32_t previous, uint32_t *current)
_current = arch_timer_get_system(NULL);
break;
case CLK_SSP:
// TODO: fix timer ID
_current = platform_timer_get(NULL);
_current = platform_timer_get(platform_timer);
break;
default:
return 0;

View File

@ -49,6 +49,7 @@
struct comp_dev;
struct sof_ipc_stream_posn;
extern struct timer *platform_timer;
void platform_timer_set(struct timer *timer, uint32_t ticks);
void platform_timer_clear(struct timer *timer);
uint32_t platform_timer_get(struct timer *timer);

View File

@ -83,6 +83,8 @@ static struct work_queue_timesource platform_generic_queue = {
.timer_get = platform_timer_get,
};
struct timer *platform_timer = &platform_generic_queue.timer;
int platform_boot_complete(uint32_t boot_message)
{
uint64_t outbox = MAILBOX_HOST_OFFSET >> 3;
@ -138,11 +140,6 @@ void platform_interrupt_unmask(uint32_t irq, uint32_t mask)
}
static struct timer platform_ext_timer = {
.id = TIMER3,
.irq = IRQ_NUM_EXT_TIMER,
};
int platform_init(struct reef *reef)
{
#if defined CONFIG_BAYTRAIL
@ -176,7 +173,7 @@ int platform_init(struct reef *reef)
/* init work queues and clocks */
trace_point(TRACE_BOOT_PLATFORM_TIMER);
platform_timer_start(&platform_ext_timer);
platform_timer_start(platform_timer);
trace_point(TRACE_BOOT_PLATFORM_CLOCK);
init_platform_clocks();