From patchwork Thu Oct 13 21:05:55 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Simon Glass X-Patchwork-Id: 119615 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 2F02EB71CA for ; Fri, 14 Oct 2011 08:07:38 +1100 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id DD20F28BCB; Thu, 13 Oct 2011 23:07:36 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pEiDEvNtbsSc; Thu, 13 Oct 2011 23:07:36 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 37E6528BB3; Thu, 13 Oct 2011 23:07:23 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id AFB6128BA5 for ; Thu, 13 Oct 2011 23:07:20 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at theia.denx.de Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lN70-geNAhjU for ; Thu, 13 Oct 2011 23:07:19 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from smtp-out.google.com (smtp-out.google.com [74.125.121.67]) by theia.denx.de (Postfix) with ESMTPS id 568A928B93 for ; Thu, 13 Oct 2011 23:07:13 +0200 (CEST) Received: from hpaq13.eem.corp.google.com (hpaq13.eem.corp.google.com [172.25.149.13]) by smtp-out.google.com with ESMTP id p9DL77Lb017001; Thu, 13 Oct 2011 14:07:07 -0700 Received: from sglass.mtv.corp.google.com (sglass.mtv.corp.google.com [172.22.72.144]) by hpaq13.eem.corp.google.com with ESMTP id p9DL75AF007353; Thu, 13 Oct 2011 14:07:06 -0700 Received: by sglass.mtv.corp.google.com (Postfix, from userid 121222) id A2E8C140F39; Thu, 13 Oct 2011 14:07:05 -0700 (PDT) From: Simon Glass To: U-Boot Mailing List Date: Thu, 13 Oct 2011 14:05:55 -0700 Message-Id: <1318539963-3329-2-git-send-email-sjg@chromium.org> X-Mailer: git-send-email 1.7.3.1 In-Reply-To: <1318539963-3329-1-git-send-email-sjg@chromium.org> References: <1318539963-3329-1-git-send-email-sjg@chromium.org> X-System-Of-Record: true Cc: Tom Warren Subject: [U-Boot] [PATCH 1/9] tegra2: Add arch_cpu_init() to fire up Cortex-A9 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.9 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: u-boot-bounces@lists.denx.de Errors-To: u-boot-bounces@lists.denx.de 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 --- arch/arm/cpu/armv7/tegra2/board.c | 15 +++++++++++++++ arch/arm/lib/Makefile | 6 ++++++ board/nvidia/common/board.c | 3 --- board/nvidia/common/board.h | 1 - include/configs/tegra2-common.h | 2 +- 5 files changed, 22 insertions(+), 5 deletions(-) diff --git a/arch/arm/cpu/armv7/tegra2/board.c b/arch/arm/cpu/armv7/tegra2/board.c index 9061d18..e725134 100644 --- a/arch/arm/cpu/armv7/tegra2/board.c +++ b/arch/arm/cpu/armv7/tegra2/board.c @@ -23,6 +23,7 @@ #include #include +#include "ap20.h" #include #include #include @@ -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 diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile index 300c8fa..3341d11 100644 --- a/arch/arm/lib/Makefile +++ b/arch/arm/lib/Makefile @@ -23,6 +23,12 @@ include $(TOPDIR)/config.mk +# 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 + LIB = $(obj)lib$(ARCH).o LIBGCC = $(obj)libgcc.o diff --git a/board/nvidia/common/board.c b/board/nvidia/common/board.c index d13537d..6af317b 100644 --- a/board/nvidia/common/board.c +++ b/board/nvidia/common/board.c @@ -188,9 +188,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 */ diff --git a/board/nvidia/common/board.h b/board/nvidia/common/board.h index 344e702..5a6b323 100644 --- a/board/nvidia/common/board.h +++ b/board/nvidia/common/board.h @@ -24,7 +24,6 @@ #ifndef _BOARD_H_ #define _BOARD_H_ -void tegra2_start(void); void gpio_config_uart(void); void gpio_config_mmc(void); int tegra2_mmc_init(int dev_index, int bus_width); diff --git a/include/configs/tegra2-common.h b/include/configs/tegra2-common.h index 73e0f05..3454689 100644 --- a/include/configs/tegra2-common.h +++ b/include/configs/tegra2-common.h @@ -32,7 +32,7 @@ #define CONFIG_TEGRA2 /* in a NVidia Tegra2 core */ #define CONFIG_MACH_TEGRA_GENERIC /* which is a Tegra generic machine */ #define CONFIG_SYS_L2CACHE_OFF /* No L2 cache */ - +#define CONFIG_ARCH_CPU_INIT /* Fire up the A9 core */ #define CONFIG_ENABLE_CORTEXA9 /* enable CPU (A9 complex) */ #include /* get chip and board defs */