summaryrefslogtreecommitdiff
path: root/arch/arm/cpu
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2011-10-03 13:39:43 -0700
committerSimon Glass <sjg@chromium.org>2011-10-06 19:26:18 -0700
commit24f284448bc27727c291c0840e67003aa45cb450 (patch)
tree4344be5d338a8fb4c9c436bf6e1b0b5bc77bcc13 /arch/arm/cpu
parente1b85b5716a5ce3c81755f2320b9a884080b4fb8 (diff)
tegra: Move architecture init code into common
We will want arch_cpu_init() for both T20 and T30, so move it into the common area. BUG=chromium-os:19004 TEST=build and boot on seaboard Change-Id: I5d3a1d59da9f8f2300ddce46469fe55caf27b482 Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-on: http://gerrit.chromium.org/gerrit/8691
Diffstat (limited to 'arch/arm/cpu')
-rw-r--r--arch/arm/cpu/armv7/tegra-common/board.c47
-rw-r--r--arch/arm/cpu/armv7/tegra2/board.c45
2 files changed, 46 insertions, 46 deletions
diff --git a/arch/arm/cpu/armv7/tegra-common/board.c b/arch/arm/cpu/armv7/tegra-common/board.c
index fff8a4f0917..e40da9af9b1 100644
--- a/arch/arm/cpu/armv7/tegra-common/board.c
+++ b/arch/arm/cpu/armv7/tegra-common/board.c
@@ -23,10 +23,13 @@
#include <common.h>
#include <asm/io.h>
-#include <asm/arch/tegra.h>
+#include <asm/arch-tegra/ap20.h>
#include <asm/arch-tegra/pmc.h>
+#include <asm/arch/tegra.h>
#include <fdt_decode.h>
+DECLARE_GLOBAL_DATA_PTR;
+
/*
* Boot ROM initializes the odmdata in APBDEV_PMC_SCRATCH20_0,
* so we are using this value to identify memory size.
@@ -51,3 +54,45 @@ unsigned int board_query_sdram_size(void)
return 0x40000000; /* 1GB */
}
}
+
+#if defined(CONFIG_DISPLAY_BOARDINFO) || defined(CONFIG_DISPLAY_BOARDINFO_LATE)
+int checkboard(void)
+{
+ const char *board_name;
+#ifdef CONFIG_OF_CONTROL
+ board_name = fdt_decode_get_model(gd->blob);
+#else
+ board_name = sysinfo.board_string;
+#endif
+ printf("Board: %s\n", board_name);
+ 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 */
+ if (ap20_cpu_is_cortexa9())
+ bootstage_mark(BOOTSTAGE_MAIN_CPU_AWAKE, "arch_cpu_init A9");
+ else
+ bootstage_mark(BOOTSTAGE_CPU_AWAKE, "arch_cpu_init AVP");
+ tegra_start();
+ /* If tegra_start() returns, we are running on the A9 */
+
+ /* We didn't do this init in start.S, so do it now */
+ cpu_init_crit();
+ bootstage_mark(BOOTSTAGE_MAIN_CPU_READY, "arch_cpu_init done");
+ return 0;
+}
+#endif
+
+void arch_full_speed(void)
+{
+ ap20_init_pllx(0);
+}
diff --git a/arch/arm/cpu/armv7/tegra2/board.c b/arch/arm/cpu/armv7/tegra2/board.c
index ba50661ce67..780328d11df 100644
--- a/arch/arm/cpu/armv7/tegra2/board.c
+++ b/arch/arm/cpu/armv7/tegra2/board.c
@@ -23,12 +23,9 @@
#include <common.h>
#include <asm/io.h>
-#include <asm/arch-tegra/ap20.h>
#include <asm/arch/sys_proto.h>
#include <asm/arch/tegra.h>
#include <asm/arch-tegra/board.h>
-#include <asm/arch-tegra/pmc.h>
-#include <fdt_decode.h>
DECLARE_GLOBAL_DATA_PTR;
@@ -38,45 +35,3 @@ int dram_init(void)
gd->ram_size = board_query_sdram_size();
return 0;
}
-
-#if defined(CONFIG_DISPLAY_BOARDINFO) || defined(CONFIG_DISPLAY_BOARDINFO_LATE)
-int checkboard(void)
-{
- const char* board_name;
-#ifdef CONFIG_OF_CONTROL
- board_name = fdt_decode_get_model(gd->blob);
-#else
- board_name = sysinfo.board_string;
-#endif
- printf("Board: %s\n", board_name);
- 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 */
- if (ap20_cpu_is_cortexa9())
- bootstage_mark(BOOTSTAGE_MAIN_CPU_AWAKE, "arch_cpu_init A9");
- else
- bootstage_mark(BOOTSTAGE_CPU_AWAKE, "arch_cpu_init AVP");
- tegra_start();
- /* If tegra_start() returns, we are running on the A9 */
-
- /* We didn't do this init in start.S, so do it now */
- cpu_init_crit();
- bootstage_mark(BOOTSTAGE_MAIN_CPU_READY, "arch_cpu_init done");
- return 0;
-}
-#endif
-
-void arch_full_speed(void)
-{
- ap20_init_pllx(0);
-}