diff --git a/plat/juno/aarch64/plat_common.c b/plat/juno/aarch64/plat_common.c index 0011cb7..a3ecb00 100644 --- a/plat/juno/aarch64/plat_common.c +++ b/plat/juno/aarch64/plat_common.c @@ -31,7 +31,7 @@ #include #include #include - +#include unsigned char platform_normal_stacks[PLATFORM_STACK_SIZE][PLATFORM_CORE_COUNT] __attribute__ ((aligned(PLATFORM_CACHE_LINE_SIZE), @@ -133,3 +133,16 @@ { return NS_IMAGE_OFFSET; } + +uint64_t plat_get_syscnt_freq(void) +{ + uint64_t counter_base_frequency; + + /* 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); + + return counter_base_frequency; +} diff --git a/plat/juno/bl1_plat_setup.c b/plat/juno/bl1_plat_setup.c index 7fe96f2..91c0caf 100644 --- a/plat/juno/bl1_plat_setup.c +++ b/plat/juno/bl1_plat_setup.c @@ -208,7 +208,7 @@ io_setup(); /* Enable and initialize the System level generic timer */ - mmio_write_32(SYS_CNTCTL_BASE + CNTCR_OFF, CNTCR_EN); + mmio_write_32(SYS_CNTCTL_BASE + CNTCR_OFF, CNTCR_FCREQ(0) | CNTCR_EN); } diff --git a/plat/juno/platform.h b/plat/juno/platform.h index dfcffff..fcf63b7 100644 --- a/plat/juno/platform.h +++ b/plat/juno/platform.h @@ -335,6 +335,7 @@ extern void plat_report_exception(unsigned long); extern unsigned long plat_get_ns_image_entrypoint(void); extern unsigned long platform_get_stack(unsigned long mpidr); +extern uint64_t plat_get_syscnt_freq(void); /* Declarations for fvp_gic.c */ extern void gic_cpuif_deactivate(unsigned int);