Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Arm Trusted Firmware
Commits
749ade45
Commit
749ade45
authored
Apr 25, 2016
by
danh-arm
Browse files
Merge pull request #603 from yatharth-arm/yk/sys_counter
Move `plat_get_syscnt_freq()` to arm_common.c
parents
7607204c
c073fda1
Changes
9
Hide whitespace changes
Inline
Side-by-side
include/plat/common/platform.h
View file @
749ade45
...
@@ -56,7 +56,7 @@ struct image_desc;
...
@@ -56,7 +56,7 @@ struct image_desc;
/*******************************************************************************
/*******************************************************************************
* Mandatory common functions
* Mandatory common functions
******************************************************************************/
******************************************************************************/
u
int64_t
plat_get_syscnt_freq
(
void
);
u
nsigned
long
long
plat_get_syscnt_freq
(
void
);
int
plat_get_image_source
(
unsigned
int
image_id
,
int
plat_get_image_source
(
unsigned
int
image_id
,
uintptr_t
*
dev_handle
,
uintptr_t
*
dev_handle
,
uintptr_t
*
image_spec
);
uintptr_t
*
image_spec
);
...
...
plat/arm/common/aarch64/arm_common.c
View file @
749ade45
...
@@ -29,6 +29,7 @@
...
@@ -29,6 +29,7 @@
*/
*/
#include <arch.h>
#include <arch.h>
#include <arch_helpers.h>
#include <arch_helpers.h>
#include <debug.h>
#include <mmio.h>
#include <mmio.h>
#include <plat_arm.h>
#include <plat_arm.h>
#include <platform_def.h>
#include <platform_def.h>
...
@@ -39,7 +40,7 @@ extern const mmap_region_t plat_arm_mmap[];
...
@@ -39,7 +40,7 @@ extern const mmap_region_t plat_arm_mmap[];
/* Weak definitions may be overridden in specific ARM standard platform */
/* Weak definitions may be overridden in specific ARM standard platform */
#pragma weak plat_get_ns_image_entrypoint
#pragma weak plat_get_ns_image_entrypoint
#pragma weak plat_arm_get_mmap
#pragma weak plat_arm_get_mmap
#pragma weak plat_get_syscnt_freq
/*******************************************************************************
/*******************************************************************************
* Macro generating the code for the function setting up the pagetables as per
* Macro generating the code for the function setting up the pagetables as per
...
@@ -161,3 +162,17 @@ const mmap_region_t *plat_arm_get_mmap(void)
...
@@ -161,3 +162,17 @@ const mmap_region_t *plat_arm_get_mmap(void)
{
{
return
plat_arm_mmap
;
return
plat_arm_mmap
;
}
}
unsigned
long
long
plat_get_syscnt_freq
(
void
)
{
unsigned
long
long
counter_base_frequency
;
/* Read the frequency from Frequency modes table */
counter_base_frequency
=
mmio_read_32
(
ARM_SYS_CNTCTL_BASE
+
CNTFID_OFF
);
/* The first entry of the frequency modes table must not be 0 */
if
(
counter_base_frequency
==
0
)
panic
();
return
counter_base_frequency
;
}
plat/arm/common/arm_bl31_setup.c
View file @
749ade45
...
@@ -34,7 +34,6 @@
...
@@ -34,7 +34,6 @@
#include <assert.h>
#include <assert.h>
#include <bl_common.h>
#include <bl_common.h>
#include <console.h>
#include <console.h>
#include <debug.h>
#include <mmio.h>
#include <mmio.h>
#include <plat_arm.h>
#include <plat_arm.h>
#include <platform.h>
#include <platform.h>
...
@@ -76,7 +75,6 @@ static entry_point_info_t bl33_image_ep_info;
...
@@ -76,7 +75,6 @@ static entry_point_info_t bl33_image_ep_info;
#pragma weak bl31_platform_setup
#pragma weak bl31_platform_setup
#pragma weak bl31_plat_arch_setup
#pragma weak bl31_plat_arch_setup
#pragma weak bl31_plat_get_next_image_ep_info
#pragma weak bl31_plat_get_next_image_ep_info
#pragma weak plat_get_syscnt_freq
/*******************************************************************************
/*******************************************************************************
...
@@ -268,17 +266,3 @@ void bl31_plat_arch_setup(void)
...
@@ -268,17 +266,3 @@ void bl31_plat_arch_setup(void)
{
{
arm_bl31_plat_arch_setup
();
arm_bl31_plat_arch_setup
();
}
}
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
(
ARM_SYS_CNTCTL_BASE
+
CNTFID_OFF
);
/* The first entry of the frequency modes table must not be 0 */
if
(
counter_base_frequency
==
0
)
panic
();
return
counter_base_frequency
;
}
plat/mediatek/mt8173/aarch64/platform_common.c
View file @
749ade45
...
@@ -84,7 +84,7 @@ const mmap_region_t plat_mmap[] = {
...
@@ -84,7 +84,7 @@ const mmap_region_t plat_mmap[] = {
/* Define EL3 variants of the function initialising the MMU */
/* Define EL3 variants of the function initialising the MMU */
DEFINE_CONFIGURE_MMU_EL
(
3
)
DEFINE_CONFIGURE_MMU_EL
(
3
)
u
int64_t
plat_get_syscnt_freq
(
void
)
u
nsigned
long
long
plat_get_syscnt_freq
(
void
)
{
{
return
SYS_COUNTER_FREQ_IN_TICKS
;
return
SYS_COUNTER_FREQ_IN_TICKS
;
}
}
...
...
plat/nvidia/tegra/include/tegra_private.h
View file @
749ade45
...
@@ -52,7 +52,7 @@ int32_t tegra_soc_validate_power_state(unsigned int power_state,
...
@@ -52,7 +52,7 @@ int32_t tegra_soc_validate_power_state(unsigned int power_state,
/* Declarations for plat_setup.c */
/* Declarations for plat_setup.c */
const
mmap_region_t
*
plat_get_mmio_map
(
void
);
const
mmap_region_t
*
plat_get_mmio_map
(
void
);
u
int64_t
plat_get_syscnt_freq
(
void
);
u
nsigned
long
long
plat_get_syscnt_freq
(
void
);
/* Declarations for plat_secondary.c */
/* Declarations for plat_secondary.c */
void
plat_secondary_setup
(
void
);
void
plat_secondary_setup
(
void
);
...
...
plat/nvidia/tegra/soc/t132/plat_setup.c
View file @
749ade45
...
@@ -74,7 +74,7 @@ const mmap_region_t *plat_get_mmio_map(void)
...
@@ -74,7 +74,7 @@ const mmap_region_t *plat_get_mmio_map(void)
return
tegra_mmap
;
return
tegra_mmap
;
}
}
u
int64_t
plat_get_syscnt_freq
(
void
)
u
nsigned
long
long
plat_get_syscnt_freq
(
void
)
{
{
return
12000000
;
return
12000000
;
}
}
plat/nvidia/tegra/soc/t210/plat_setup.c
View file @
749ade45
...
@@ -80,7 +80,7 @@ const mmap_region_t *plat_get_mmio_map(void)
...
@@ -80,7 +80,7 @@ const mmap_region_t *plat_get_mmio_map(void)
/*******************************************************************************
/*******************************************************************************
* Handler to get the System Counter Frequency
* Handler to get the System Counter Frequency
******************************************************************************/
******************************************************************************/
u
int64_t
plat_get_syscnt_freq
(
void
)
u
nsigned
long
long
plat_get_syscnt_freq
(
void
)
{
{
return
19200000
;
return
19200000
;
}
}
plat/rockchip/common/aarch64/platform_common.c
View file @
749ade45
...
@@ -75,7 +75,7 @@ static const int cci_map[] = {
...
@@ -75,7 +75,7 @@ static const int cci_map[] = {
/* Define EL3 variants of the function initialising the MMU */
/* Define EL3 variants of the function initialising the MMU */
DEFINE_CONFIGURE_MMU_EL
(
3
)
DEFINE_CONFIGURE_MMU_EL
(
3
)
u
int64_t
plat_get_syscnt_freq
(
void
)
u
nsigned
long
long
plat_get_syscnt_freq
(
void
)
{
{
return
SYS_COUNTER_FREQ_IN_TICKS
;
return
SYS_COUNTER_FREQ_IN_TICKS
;
}
}
...
...
plat/xilinx/zynqmp/aarch64/zynqmp_common.c
View file @
749ade45
...
@@ -297,9 +297,9 @@ void zynqmp_config_setup(void)
...
@@ -297,9 +297,9 @@ void zynqmp_config_setup(void)
mmio_write_32
(
IOU_SCNTRS_CONTROL
,
IOU_SCNTRS_CONTROL_EN
);
mmio_write_32
(
IOU_SCNTRS_CONTROL
,
IOU_SCNTRS_CONTROL_EN
);
}
}
u
int64_t
plat_get_syscnt_freq
(
void
)
u
nsigned
long
long
plat_get_syscnt_freq
(
void
)
{
{
u
int64_t
counter_base_frequency
;
u
nsigned
long
long
counter_base_frequency
;
/* FIXME: Read the frequency from Frequency modes table */
/* FIXME: Read the frequency from Frequency modes table */
counter_base_frequency
=
zynqmp_get_system_timer_freq
();
counter_base_frequency
=
zynqmp_get_system_timer_freq
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment