Commit 8d538f3d authored by Masahiro Yamada's avatar Masahiro Yamada
Browse files

uniphier: make counter control base address configurable



The register base will be changed in the next SoC. Make it
configurable.

Change-Id: I4a7cf85fe50e4d71db58a3372a71774e43193bd3
Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
parent 4511322f
...@@ -58,10 +58,16 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1, ...@@ -58,10 +58,16 @@ void bl31_early_platform_setup2(u_register_t arg0, u_register_t arg1,
panic(); panic();
} }
#define UNIPHIER_SYS_CNTCTL_BASE 0x60E00000 static const uintptr_t uniphier_cntctl_base[] = {
[UNIPHIER_SOC_LD11] = 0x60e00000,
[UNIPHIER_SOC_LD20] = 0x60e00000,
[UNIPHIER_SOC_PXS3] = 0x60e00000,
};
void bl31_platform_setup(void) void bl31_platform_setup(void)
{ {
uintptr_t cntctl_base;
uniphier_cci_init(uniphier_soc); uniphier_cci_init(uniphier_soc);
uniphier_cci_enable(); uniphier_cci_enable();
...@@ -69,9 +75,11 @@ void bl31_platform_setup(void) ...@@ -69,9 +75,11 @@ void bl31_platform_setup(void)
uniphier_gic_driver_init(uniphier_soc); uniphier_gic_driver_init(uniphier_soc);
uniphier_gic_init(); uniphier_gic_init();
assert(uniphier_soc < ARRAY_SIZE(uniphier_cntctl_base));
cntctl_base = uniphier_cntctl_base[uniphier_soc];
/* Enable and initialize the System level generic timer */ /* Enable and initialize the System level generic timer */
mmio_write_32(UNIPHIER_SYS_CNTCTL_BASE + CNTCR_OFF, mmio_write_32(cntctl_base + CNTCR_OFF, CNTCR_FCREQ(0U) | CNTCR_EN);
CNTCR_FCREQ(0U) | CNTCR_EN);
} }
void bl31_plat_arch_setup(void) void bl31_plat_arch_setup(void)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment