]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
tegra2: Add arch_cpu_init() to fire up Cortex-A9
authorSimon Glass <sjg@chromium.org>
Sat, 5 Nov 2011 03:56:49 +0000 (03:56 +0000)
committerAlbert ARIBAUD <albert.u.boot@aribaud.net>
Fri, 9 Dec 2011 16:30:08 +0000 (17:30 +0100)
We want to move away from a special Tegra2 start-up, and just use
arch_cpu_init() instead. However, if we run board_init_f() from boot
we need to build it for ARMv4T, since the Tegra's AVP start-up CPU
does not support ARMv7.

The effect of this is to do the AVP init earlier, and in
arch_cpu_init(), rather that board_early_init_f().

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Tom Warren <twarren@nvidia.com>
arch/arm/cpu/armv7/tegra2/board.c
arch/arm/cpu/armv7/tegra2/config.mk
board/nvidia/common/board.c
board/nvidia/common/board.h
include/configs/tegra2-common.h

index 751102d180806023dce64718d5888d2030013873..4530194bf7ecaa76e1457d4bbb03ae90167ba796 100644 (file)
@@ -23,6 +23,7 @@
 
 #include <common.h>
 #include <asm/io.h>
+#include "ap20.h"
 #include <asm/arch/sys_proto.h>
 #include <asm/arch/tegra2.h>
 #include <asm/arch/pmc.h>
@@ -86,3 +87,17 @@ int checkboard(void)
        return 0;
 }
 #endif /* CONFIG_DISPLAY_BOARDINFO */
+
+#ifdef CONFIG_ARCH_CPU_INIT
+/*
+ * Note this function is executed by the ARM7TDMI AVP. It does not return
+ * in this case. It is also called once the A9 starts up, but does nothing in
+ * that case.
+ */
+int arch_cpu_init(void)
+{
+       /* Fire up the Cortex A9 */
+       tegra2_start();
+       return 0;
+}
+#endif
index 96c07955aa7658919203da4b6ddde53513949db0..f84fdc8f943d87a735245a1d5b5337d9df4b6cfc 100644 (file)
@@ -26,3 +26,9 @@
 
 # Use ARMv4 for Tegra2 - initial code runs on the AVP, which is an ARM7TDI.
 PLATFORM_CPPFLAGS += -march=armv4
+
+# Tegra has an ARMv4T CPU which runs board_init_f(), so we must build this
+# file with compatible flags
+ifdef CONFIG_TEGRA2
+CFLAGS_arch/arm/lib/board.o += -march=armv4t
+endif
index 0f12de2097a2d87def7e5d2b80ca1d0c64aea8f7..56850cc8b5e0a48b01d832a5f23d79ef0777d294 100644 (file)
@@ -125,9 +125,6 @@ int board_early_init_f(void)
 
        /* Initialize periph GPIOs */
        gpio_config_uart();
-
-       /* Init UART, scratch regs, and start CPU */
-       tegra2_start();
        return 0;
 }
 #endif /* EARLY_INIT */
index 35acbca82bb1884a79c183d1af3406240a68e16f..1f57086602408044b7c5fd1c9667fd4ba8e58a3f 100644 (file)
@@ -24,7 +24,6 @@
 #ifndef _BOARD_H_
 #define _BOARD_H_
 
-void tegra2_start(void);
 void gpio_config_uart(void);
 int tegra2_mmc_init(int dev_index, int bus_width, int pwr_gpio, int cd_gpio);
 
index 9c3b9fa3e947f56d4063ac176d0769c52a113eb1..16debf62577c4ced966791358eeb2af546758eba 100644 (file)
@@ -35,6 +35,7 @@
 
 #define CONFIG_SYS_CACHELINE_SIZE      32
 
+#define CONFIG_ARCH_CPU_INIT           /* Fire up the A9 core */
 #define CONFIG_ENABLE_CORTEXA9         /* enable CPU (A9 complex) */
 
 #include <asm/arch/tegra2.h>           /* get chip and board defs */