From 5e10f58e8bd4e45cfa22bd7a7b0621052bfea489 Mon Sep 17 00:00:00 2001 From: Gurjant Kalsi Date: Thu, 14 Jul 2016 12:37:26 -0700 Subject: [PATCH] [rpi3][bcm28xx][timer] Fix BCM2837 timer runing too fast. RPi3/BCM2837 timer was previously running too fast due to an improper multiplier in arm_generic_timer_init(...). Fixed by setting the multiplier to 0 and allowing the ARM generic timer code to determine the frequency and compute the appropriate multiplier. --- platform/bcm28xx/platform.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/bcm28xx/platform.c b/platform/bcm28xx/platform.c index 1b63500c..eb81d085 100644 --- a/platform/bcm28xx/platform.c +++ b/platform/bcm28xx/platform.c @@ -128,9 +128,9 @@ void platform_early_init(void) intc_init(); - arm_generic_timer_init(INTERRUPT_ARM_LOCAL_CNTPNSIRQ, 1000000); - #if BCM2837 + arm_generic_timer_init(INTERRUPT_ARM_LOCAL_CNTPNSIRQ, 0); + /* look for a flattened device tree just before the kernel */ const void *fdt = (void *)KERNEL_BASE; int err = fdt_check_header(fdt); @@ -173,6 +173,10 @@ void platform_early_init(void) } } +#elif BCM2836 + arm_generic_timer_init(INTERRUPT_ARM_LOCAL_CNTPNSIRQ, 1000000); +#else +#error Unknown BCM28XX Variant #endif /* add the main memory arena */