summaryrefslogtreecommitdiff
path: root/src/arch/arm64/c_entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/arch/arm64/c_entry.c')
-rw-r--r--src/arch/arm64/c_entry.c32
1 files changed, 30 insertions, 2 deletions
diff --git a/src/arch/arm64/c_entry.c b/src/arch/arm64/c_entry.c
index 3e9d44e4af..869518785b 100644
--- a/src/arch/arm64/c_entry.c
+++ b/src/arch/arm64/c_entry.c
@@ -17,9 +17,11 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#include <arch/stages.h>
+#include <arch/cache.h>
#include <arch/cpu.h>
-
+#include <arch/exception.h>
+#include <arch/mmu.h>
+#include <arch/stages.h>
/*
* This variable holds entry point for CPUs starting up. Before the other
@@ -33,6 +35,11 @@ void __attribute__((weak)) arm64_soc_init(void)
/* Default weak implementation does nothing. */
}
+void __attribute__((weak)) soc_secondary_cpu_init(void)
+{
+ /* Default weak implementation does nothing. */
+}
+
static void seed_stack(void)
{
char *stack_begin;
@@ -57,3 +64,24 @@ void arm64_init(void)
arm64_soc_init();
main();
}
+
+static void secondary_cpu_start(void)
+{
+ mmu_enable();
+ exception_hwinit();
+ soc_secondary_cpu_init();
+ /*
+ * TODO(adurbin): need a proper place to park the CPUs. Currently
+ * assuming SoC code does the appropriate thing.
+ */
+ while (1);
+}
+
+extern void arm64_cpu_startup(void);
+void *prepare_secondary_cpu_startup(void)
+{
+ c_entry = &secondary_cpu_start;
+ dcache_clean_invalidate_by_mva(c_entry, sizeof(c_entry));
+
+ return &arm64_cpu_startup;
+}