diff options
author | Jon Medhurst <tixy@linaro.org> | 2014-03-10 15:23:09 +0000 |
---|---|---|
committer | Sandrine Bailleux <sandrine.bailleux@arm.com> | 2014-03-12 14:04:53 +0000 |
commit | 305680329ce04ed0a47a4368727cf7a74a7ef5dd (patch) | |
tree | 27d62b050d29d422eef44b608521cb4c9e4a47e5 | |
parent | b86295169ea06c354eade1b3cb787f98da12f9a5 (diff) |
juno: Initialise architected timer in BL3-1
-rw-r--r-- | plat/juno/bl31_plat_setup.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/plat/juno/bl31_plat_setup.c b/plat/juno/bl31_plat_setup.c index ffdfdd4..c2c7ff8 100644 --- a/plat/juno/bl31_plat_setup.c +++ b/plat/juno/bl31_plat_setup.c @@ -29,6 +29,8 @@ */ #include <platform.h> +#include <assert.h> +#include <arch_helpers.h> /******************************************************************************* * Declarations of linker defined symbols which will help us find the layout @@ -120,9 +122,19 @@ void bl31_early_platform_setup(bl31_args *from_bl2, ******************************************************************************/ void bl31_platform_setup() { + unsigned int counter_base_frequency; /* Initialize the gic cpu and distributor interfaces */ gic_setup(); + /* Read the frequency from Frequency modes table */ + counter_base_frequency = mmio_read_32(SYS_CNTCTL_BASE + CNTFID_OFF); + + /* The first entry of the frequency modes table must not be 0 */ + assert(counter_base_frequency != 0); + + /* Program the counter frequency */ + write_cntfrq_el0(counter_base_frequency); + /* Topologies are best known to the platform. */ plat_setup_topology(); } |