diff options
author | Simon Glass <sjg@chromium.org> | 2011-08-10 15:17:22 -0700 |
---|---|---|
committer | Simon Glass <sjg@chromium.org> | 2011-08-29 10:59:29 -0700 |
commit | 8a6096728551c0d3c051fe915341a766d18a2511 (patch) | |
tree | 8b47c004bbbcb26c5f81763564db11b495d6d4f8 /arch/arm/cpu/armv7 | |
parent | e8165fe783b8aa5451ce4f905c8fbe4e949332a9 (diff) |
tegra2: Move cpu_arch_init() into arch/arm/cpu/armv7
This function belongs with the CPU code, not the board code.
BUG=chromium-os:19004
TEST=build and boot on Aebl
Change-Id: I065a945c053261d115e987a0bfc08386ed4a1043
Reviewed-on: http://gerrit.chromium.org/gerrit/5778
Reviewed-by: Anton Staaf <robotboy@chromium.org>
Tested-by: Simon Glass <sjg@chromium.org>
Diffstat (limited to 'arch/arm/cpu/armv7')
-rw-r--r-- | arch/arm/cpu/armv7/tegra2/ap20.c | 5 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/tegra2/ap20.h | 6 | ||||
-rw-r--r-- | arch/arm/cpu/armv7/tegra2/board.c | 15 |
3 files changed, 23 insertions, 3 deletions
diff --git a/arch/arm/cpu/armv7/tegra2/ap20.c b/arch/arm/cpu/armv7/tegra2/ap20.c index 6d589143281..f304bd32a09 100644 --- a/arch/arm/cpu/armv7/tegra2/ap20.c +++ b/arch/arm/cpu/armv7/tegra2/ap20.c @@ -64,8 +64,7 @@ static struct clk_pll_table tegra_pll_x_table[TEGRA_SOC_COUNT] }, }; -/* Returns 1 if the current CPU executing is a Cortex-A9, else 0 */ -static int ap20_cpu_is_cortexa9(void) +int ap20_cpu_is_cortexa9(void) { u32 id = readb(NV_PA_PG_UP_BASE + PG_UP_TAG_0); return id == (PG_UP_TAG_0_PID_CPU & 0xff); @@ -351,7 +350,7 @@ void init_pmc_scratch(void) #endif } -void tegra2_start(void) +void tegra_start(void) { struct pmux_tri_ctlr *pmt = (struct pmux_tri_ctlr *)NV_PA_APB_MISC_BASE; diff --git a/arch/arm/cpu/armv7/tegra2/ap20.h b/arch/arm/cpu/armv7/tegra2/ap20.h index 4a194076719..a2df207e27d 100644 --- a/arch/arm/cpu/armv7/tegra2/ap20.h +++ b/arch/arm/cpu/armv7/tegra2/ap20.h @@ -94,3 +94,9 @@ #define HALT_COP_EVENT_JTAG (1 << 28) #define HALT_COP_EVENT_IRQ_1 (1 << 11) #define HALT_COP_EVENT_FIQ_1 (1 << 9) + +/* Called by the ARM7 to start up the Cortex-A9, and by the A9 to do init */ +void tegra_start(void); + +/* Returns 1 if the current CPU executing is a Cortex-A9, else 0 */ +int ap20_cpu_is_cortexa9(void); diff --git a/arch/arm/cpu/armv7/tegra2/board.c b/arch/arm/cpu/armv7/tegra2/board.c index 8d3ee8df77e..7f8e21f3b74 100644 --- a/arch/arm/cpu/armv7/tegra2/board.c +++ b/arch/arm/cpu/armv7/tegra2/board.c @@ -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> @@ -83,3 +84,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 */ + tegra_start(); + return 0; +} +#endif |