From 77d3e039db7252d6c889f3efdddfbdcfaa9bdb7d Mon Sep 17 00:00:00 2001 From: Guennadi Liakhovetski Date: Tue, 25 Aug 2020 14:40:08 +0200 Subject: [PATCH] byt: use an internal timer for "cpu_timer" Using the same hardware timer for both "cpu_timer" and "platform_timer" doesn't work, switch the "cpu_timer" to use TIMER1 on Baytrail. This also fixes performance counters on the platform. Signed-off-by: Guennadi Liakhovetski --- src/platform/baytrail/platform.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/platform/baytrail/platform.c b/src/platform/baytrail/platform.c index 1f9c2a1ad17b..2fe97f7f5e1e 100644 --- a/src/platform/baytrail/platform.c +++ b/src/platform/baytrail/platform.c @@ -139,11 +139,16 @@ EXT_MAN_PORT( }, )); -SHARED_DATA struct timer timer = { +static SHARED_DATA struct timer timer = { .id = TIMER3, /* external timer */ .irq = IRQ_NUM_EXT_TIMER, }; +static SHARED_DATA struct timer arch_timer = { + .id = TIMER1, /* internal timer */ + .irq = IRQ_NUM_TIMER1, +}; + int platform_boot_complete(uint32_t boot_message) { uint32_t mb_offset = 0; @@ -200,7 +205,7 @@ int platform_init(struct sof *sof) int ret; sof->platform_timer = &timer; - sof->cpu_timers = &timer; + sof->cpu_timers = &arch_timer; /* clear mailbox for early trace and debug */ trace_point(TRACE_BOOT_PLATFORM_MBOX);