Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
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
5931fdac
Commit
5931fdac
authored
6 years ago
by
Sumit Garg
Browse files
Options
Download
Email Patches
Plain Diff
synquacer: Enable System level Generic timer
Signed-off-by:
Sumit Garg
<
sumit.garg@linaro.org
>
parent
b529799f
master
v2.5
v2.5-rc1
v2.5-rc0
v2.4
v2.4-rc2
v2.4-rc1
v2.4-rc0
v2.3
v2.3-rc2
v2.3-rc1
v2.3-rc0
v2.2
v2.2-rc2
v2.2-rc1
v2.2-rc0
v2.1
v2.1-rc1
v2.1-rc0
v2.0
v2.0-rc0
v1.6
v1.6-rc1
v1.6-rc0
arm_cca_v0.2
arm_cca_v0.1
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
plat/socionext/synquacer/include/platform_def.h
+5
-0
plat/socionext/synquacer/include/platform_def.h
plat/socionext/synquacer/sq_bl31_setup.c
+36
-0
plat/socionext/synquacer/sq_bl31_setup.c
with
41 additions
and
0 deletions
+41
-0
plat/socionext/synquacer/include/platform_def.h
View file @
5931fdac
...
...
@@ -44,6 +44,11 @@
#define PLAT_SQ_BOOT_UART_CLK_IN_HZ 62500000
#define SQ_CONSOLE_BAUDRATE 115200
#define SQ_SYS_CNTCTL_BASE 0x2a430000
#define SQ_SYS_TIMCTL_BASE 0x2a810000
#define PLAT_SQ_NSTIMER_FRAME_ID 0
#define SQ_BOOT_CFG_ADDR 0x45410000
#define PLAT_SQ_PRIMARY_CPU_SHIFT 8
#define PLAT_SQ_PRIMARY_CPU_BIT_WIDTH 6
...
...
This diff is collapsed.
Click to expand it.
plat/socionext/synquacer/sq_bl31_setup.c
View file @
5931fdac
...
...
@@ -11,6 +11,7 @@
#include <bl_common.h>
#include <pl011.h>
#include <debug.h>
#include <mmio.h>
#include <sq_common.h>
static
console_pl011_t
console
;
...
...
@@ -94,6 +95,20 @@ void bl31_early_platform_setup(bl31_params_t *from_bl2,
SET_SECURITY_STATE
(
bl33_image_ep_info
.
h
.
attr
,
NON_SECURE
);
}
static
void
sq_configure_sys_timer
(
void
)
{
unsigned
int
reg_val
;
reg_val
=
(
1
<<
CNTACR_RPCT_SHIFT
)
|
(
1
<<
CNTACR_RVCT_SHIFT
);
reg_val
|=
(
1
<<
CNTACR_RFRQ_SHIFT
)
|
(
1
<<
CNTACR_RVOFF_SHIFT
);
reg_val
|=
(
1
<<
CNTACR_RWVT_SHIFT
)
|
(
1
<<
CNTACR_RWPT_SHIFT
);
mmio_write_32
(
SQ_SYS_TIMCTL_BASE
+
CNTACR_BASE
(
PLAT_SQ_NSTIMER_FRAME_ID
),
reg_val
);
reg_val
=
(
1
<<
CNTNSAR_NS_SHIFT
(
PLAT_SQ_NSTIMER_FRAME_ID
));
mmio_write_32
(
SQ_SYS_TIMCTL_BASE
+
CNTNSAR
,
reg_val
);
}
void
bl31_platform_setup
(
void
)
{
/* Initialize the CCN interconnect */
...
...
@@ -103,6 +118,13 @@ void bl31_platform_setup(void)
/* Initialize the GIC driver, cpu and distributor interfaces */
sq_gic_driver_init
();
sq_gic_init
();
/* Enable and initialize the System level generic timer */
mmio_write_32
(
SQ_SYS_CNTCTL_BASE
+
CNTCR_OFF
,
CNTCR_FCREQ
(
0
)
|
CNTCR_EN
);
/* Allow access to the System counter timer module */
sq_configure_sys_timer
();
}
void
bl31_plat_runtime_setup
(
void
)
...
...
@@ -112,3 +134,17 @@ void bl31_plat_runtime_setup(void)
void
bl31_plat_arch_setup
(
void
)
{
}
unsigned
int
plat_get_syscnt_freq2
(
void
)
{
unsigned
int
counter_base_frequency
;
/* Read the frequency from Frequency modes table */
counter_base_frequency
=
mmio_read_32
(
SQ_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
;
}
This diff is collapsed.
Click to expand it.
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
Menu
Projects
Groups
Snippets
Help