summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanh-arm <dan.handley@arm.com>2015-03-17 14:23:46 +0000
committerdanh-arm <dan.handley@arm.com>2015-03-17 14:23:46 +0000
commit27bc0106665eddf3e6f84101e73e27b823867bef (patch)
tree951f6ed4e9e9b1fd0bc157719246471ba48f83af
parent09c731ebd62348f7acd9ab94be033f0ae176a87f (diff)
parent12e7c4ab0bbc9d9d4e950bdbda5a86f61c13bc1a (diff)
downloadarm-trusted-firmware-27bc0106665eddf3e6f84101e73e27b823867bef.tar.gz
Merge pull request #268 from vikramkanigiri/vk/move_init_cpu_ops
Initialise cpu ops after enabling data cache
-rw-r--r--bl31/aarch64/bl31_arch_setup.c4
-rw-r--r--bl31/aarch64/bl31_entrypoint.S6
-rw-r--r--include/bl31/cpu_data.h1
-rw-r--r--lib/cpus/aarch64/cpu_helpers.S15
-rw-r--r--services/std_svc/psci/psci_entry.S6
5 files changed, 7 insertions, 25 deletions
diff --git a/bl31/aarch64/bl31_arch_setup.c b/bl31/aarch64/bl31_arch_setup.c
index a88b029ea..edf10188d 100644
--- a/bl31/aarch64/bl31_arch_setup.c
+++ b/bl31/aarch64/bl31_arch_setup.c
@@ -33,6 +33,7 @@
#include <assert.h>
#include <bl_common.h>
#include <bl31.h>
+#include <cpu_data.h>
#include <platform.h>
/*******************************************************************************
@@ -47,4 +48,7 @@ void bl31_arch_setup(void)
/* Program the counter frequency */
write_cntfrq_el0(plat_get_syscnt_freq());
+
+ /* Initialize the cpu_ops pointer. */
+ init_cpu_ops();
}
diff --git a/bl31/aarch64/bl31_entrypoint.S b/bl31/aarch64/bl31_entrypoint.S
index 01d7a7f53..186b1cbc2 100644
--- a/bl31/aarch64/bl31_entrypoint.S
+++ b/bl31/aarch64/bl31_entrypoint.S
@@ -162,12 +162,6 @@ func bl31_entrypoint
#endif
/* ---------------------------------------------
- * Initialize the cpu_ops pointer.
- * ---------------------------------------------
- */
- bl init_cpu_ops
-
- /* ---------------------------------------------
* Use SP_EL0 for the C runtime stack.
* ---------------------------------------------
*/
diff --git a/include/bl31/cpu_data.h b/include/bl31/cpu_data.h
index 1926e292a..50f509bbd 100644
--- a/include/bl31/cpu_data.h
+++ b/include/bl31/cpu_data.h
@@ -117,6 +117,7 @@ static inline struct cpu_data *_cpu_data(void)
*************************************************************************/
void init_cpu_data_ptr(void);
+void init_cpu_ops(void);
#define get_cpu_data(_m) _cpu_data()->_m
#define set_cpu_data(_m, _v) _cpu_data()->_m = _v
diff --git a/lib/cpus/aarch64/cpu_helpers.S b/lib/cpus/aarch64/cpu_helpers.S
index bebe7c0a5..24c283ab0 100644
--- a/lib/cpus/aarch64/cpu_helpers.S
+++ b/lib/cpus/aarch64/cpu_helpers.S
@@ -110,7 +110,8 @@ func prepare_cluster_pwr_dwn
/*
* Initializes the cpu_ops_ptr if not already initialized
- * in cpu_data. This can be called without a runtime stack.
+ * in cpu_data. This can be called without a runtime stack, but may
+ * only be called after the MMU is enabled.
* clobbers: x0 - x6, x10
*/
.globl init_cpu_ops
@@ -125,18 +126,6 @@ func init_cpu_ops
ASM_ASSERT(ne)
#endif
str x0, [x6, #CPU_DATA_CPU_OPS_PTR]!
-
- /*
- * Make sure that any pre-fetched cache copies are invalidated.
- * Ensure that we are running with cache disable else we
- * invalidate our own update.
- */
-#if ASM_ASSERTION
- mrs x1, sctlr_el3
- tst x1, #SCTLR_C_BIT
- ASM_ASSERT(eq)
-#endif
- dc ivac, x6
mov x30, x10
1:
ret
diff --git a/services/std_svc/psci/psci_entry.S b/services/std_svc/psci/psci_entry.S
index 3e67d3449..fb3f00761 100644
--- a/services/std_svc/psci/psci_entry.S
+++ b/services/std_svc/psci/psci_entry.S
@@ -87,12 +87,6 @@ psci_aff_common_finish_entry:
bl init_cpu_data_ptr
/* ---------------------------------------------
- * Initialize the cpu_ops pointer.
- * ---------------------------------------------
- */
- bl init_cpu_ops
-
- /* ---------------------------------------------
* Set the exception vectors
* ---------------------------------------------
*/