From patchwork Fri Sep 4 12:22:17 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Chou X-Patchwork-Id: 514411 X-Patchwork-Delegate: thomas@wytron.com.tw 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 9157C1402A3 for ; Fri, 4 Sep 2015 22:23:09 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id BB1AB4B7F4; Fri, 4 Sep 2015 14:23:02 +0200 (CEST) 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 AzsWkV4a1EY4; Fri, 4 Sep 2015 14:23:02 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 10DD74B7C9; Fri, 4 Sep 2015 14:22:48 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7F3CD4B70B for ; Fri, 4 Sep 2015 14:22:37 +0200 (CEST) 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 E1NnHwoTKFru for ; Fri, 4 Sep 2015 14:22:37 +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 www.wytron.com.tw (220-134-43-68.HINET-IP.hinet.net [220.134.43.68]) by theia.denx.de (Postfix) with ESMTP id 132424B748 for ; Fri, 4 Sep 2015 14:22:33 +0200 (CEST) Received: from localhost.localdomain (unknown [192.168.1.250]) by www.wytron.com.tw (Postfix) with ESMTP id 1B043D00306; Fri, 4 Sep 2015 20:22:30 +0800 (CST) From: Thomas Chou To: u-boot@lists.denx.de Date: Fri, 4 Sep 2015 20:22:17 +0800 Message-Id: <1441369343-4638-3-git-send-email-thomas@wytron.com.tw> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441369343-4638-1-git-send-email-thomas@wytron.com.tw> References: <1441336526-23505-1-git-send-email-thomas@wytron.com.tw> <1441369343-4638-1-git-send-email-thomas@wytron.com.tw> Cc: Marek Vasut Subject: [U-Boot] [PATCH v2 2/8] nios2: move altera_pio_init to board_early_init_r X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" As altera_pio_init() uses BSS, it should be moved to board_early_init_r(). Signed-off-by: Thomas Chou --- board/altera/nios2-generic/nios2-generic.c | 13 +++++++++---- include/configs/nios2-generic.h | 1 + 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/board/altera/nios2-generic/nios2-generic.c b/board/altera/nios2-generic/nios2-generic.c index 834cbeb..384fee9 100644 --- a/board/altera/nios2-generic/nios2-generic.c +++ b/board/altera/nios2-generic/nios2-generic.c @@ -28,6 +28,15 @@ void early_flash_cmd_reset(void) int board_early_init_f(void) { +#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \ + defined(CONFIG_CFI_FLASH_MTD) + early_flash_cmd_reset(); +#endif + return 0; +} + +int board_early_init_r(void) +{ #ifdef CONFIG_ALTERA_PIO #ifdef LED_PIO_BASE altera_pio_init(LED_PIO_BASE, LED_PIO_WIDTH, 'o', @@ -35,10 +44,6 @@ int board_early_init_f(void) "led"); #endif #endif -#if defined(CONFIG_ENV_IS_IN_FLASH) && defined(CONFIG_ENV_ADDR) && \ - defined(CONFIG_CFI_FLASH_MTD) - early_flash_cmd_reset(); -#endif return 0; } diff --git a/include/configs/nios2-generic.h b/include/configs/nios2-generic.h index 5bb7768..293acae 100644 --- a/include/configs/nios2-generic.h +++ b/include/configs/nios2-generic.h @@ -15,6 +15,7 @@ #include "../board/altera/nios2-generic/custom_fpga.h" /* fpga parameters */ #define CONFIG_BOARD_NAME "nios2-generic" /* custom board name */ #define CONFIG_BOARD_EARLY_INIT_F /* enable early board-spec. init */ +#define CONFIG_BOARD_EARLY_INIT_R #define CONFIG_DISPLAY_CPUINFO #define CONFIG_DISPLAY_BOARDINFO #define CONFIG_SYS_NIOS_SYSID_BASE CONFIG_SYS_SYSID_BASE