arm: provide __cpu_early_init hook
Only call if WITH_CPU_EARLY_INIT is set.
Move the OMAP3 specific init to use this mechanism.
diff --git a/arch/arm/crt0.S b/arch/arm/crt0.S
index 759f11a..9196d10 100644
--- a/arch/arm/crt0.S
+++ b/arch/arm/crt0.S
@@ -45,10 +45,9 @@
mcr p15, 0, r0, c1, c0, 0
#endif
-#if PLATFORM_OMAP3
- /* do an omap3 specific setup of the L2 */
- mov r12, #1
- .word 0xe1600070
+#if WITH_CPU_EARLY_INIT
+ /* call platform/arch/etc specific init code */
+ bl __cpu_early_init
#endif
/* see if we need to relocate */
diff --git a/platform/omap3/cpu_early_init.S b/platform/omap3/cpu_early_init.S
new file mode 100644
index 0000000..ca026bc
--- /dev/null
+++ b/platform/omap3/cpu_early_init.S
@@ -0,0 +1,30 @@
+/*
+ * Copyright (c) 2008 Travis Geiselbrecht
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be
+ * included in all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+ * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+ * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+ */
+.text
+.globl __cpu_early_init
+
+__cpu_early_init:
+ /* do an omap3 specific setup of the L2 */
+ mov r12, #1
+ .word 0xe1600070
+ bx lr
\ No newline at end of file
diff --git a/platform/omap3/rules.mk b/platform/omap3/rules.mk
index 41da8e6..316a362 100644
--- a/platform/omap3/rules.mk
+++ b/platform/omap3/rules.mk
@@ -8,6 +8,7 @@
-I$(LOCAL_DIR)/include
OBJS += \
+ $(LOCAL_DIR)/cpu_early_init.Ao \
$(LOCAL_DIR)/debug.o \
$(LOCAL_DIR)/interrupts.o \
$(LOCAL_DIR)/platform.o \
@@ -16,7 +17,8 @@
MEMBASE := 0x80000000
-DEFINES += MEMBASE=$(MEMBASE)
+DEFINES += MEMBASE=$(MEMBASE) \
+ WITH_CPU_EARLY_INIT=1
LINKER_SCRIPT += \
$(BUILDDIR)/system-onesegment.ld