From patchwork Mon Jul 9 09:20:38 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 169728 X-Patchwork-Delegate: monstr@monstr.eu 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 DB0622C0205 for ; Mon, 9 Jul 2012 19:22:24 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 6E5E728182; Mon, 9 Jul 2012 11:21:55 +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 nqrCQULztJpZ; Mon, 9 Jul 2012 11:21:55 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id EB46E28150; Mon, 9 Jul 2012 11:21:26 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 5DD512814A for ; Mon, 9 Jul 2012 11:21: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 kAfsp3O90W37 for ; Mon, 9 Jul 2012 11:21:20 +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 mail-bk0-f44.google.com (mail-bk0-f44.google.com [209.85.214.44]) by theia.denx.de (Postfix) with ESMTPS id 66E6F28160 for ; Mon, 9 Jul 2012 11:21:14 +0200 (CEST) Received: by mail-bk0-f44.google.com with SMTP id y7so2470849bkt.3 for ; Mon, 09 Jul 2012 02:21:14 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references :x-gm-message-state; bh=iLWmvpn9EVA3ypnz7BMwJ+XJTI+/eKcYvdG8vKCIBPk=; b=cWDOy5H1cLD+y54lpO4HFjwxuwfcTdJpWFNhpe4VSkAfVbwLnO4Hw92cpvZUOh8Ez3 xHvrZzuCqmtjRRcGBUmgh4nPuf2/kqRSWRFs3sCdcqNouV3Bp7ZWq0hgqyq9f1U+r2RX ATPMn5KCt+EidlWipnA3Fbc6SKKT05ICD1tq0odB0t3fjxdeEcK3lX9UFwuXaQWBxK4I +84cIyawxkBL/L1fAyabpa2TluSv3ZICK9igA6ARfG8/KWu7YOHAdltH8QS90vUstRDN ZggzGslNwkq7vtm+bWGdjPNwS4sPoL7W8LktJ8XdqLNRJFzUlI3Z1a3n8oxAx0z0OeCW AlsQ== Received: by 10.204.148.83 with SMTP id o19mr19087570bkv.96.1341825674124; Mon, 09 Jul 2012 02:21:14 -0700 (PDT) Received: from localhost (11.161.broadband5.iol.cz. [88.100.161.11]) by mx.google.com with ESMTPS id y20sm3044605bkv.11.2012.07.09.02.21.12 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 09 Jul 2012 02:21:13 -0700 (PDT) From: Michal Simek To: u-boot@lists.denx.de Date: Mon, 9 Jul 2012 11:20:38 +0200 Message-Id: <1341825639-23475-11-git-send-email-monstr@monstr.eu> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <1341825639-23475-1-git-send-email-monstr@monstr.eu> References: <1341825639-23475-1-git-send-email-monstr@monstr.eu> X-Gm-Message-State: ALoCoQnMLWLdpf8FoFBFJwsolycUvX4DXf+LZ9uHYMKqd1oN/K0ZMIzl+uZArg9QpluLFOoLere/ Cc: linz@li-pro.net Subject: [U-Boot] [PATCH 11/12] microblaze: Clean microblaze initialization X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.11 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 Move board specific function to board_init function in board/ folder Remove externs from generic board.c Use board_init_f function in board.c file. Signed-off-by: Michal Simek --- arch/microblaze/cpu/start.S | 2 +- arch/microblaze/lib/board.c | 17 +++-------------- .../xilinx/microblaze-generic/microblaze-generic.c | 10 ++++++++++ 3 files changed, 14 insertions(+), 15 deletions(-) diff --git a/arch/microblaze/cpu/start.S b/arch/microblaze/cpu/start.S index 8a2f634..8564c4e 100644 --- a/arch/microblaze/cpu/start.S +++ b/arch/microblaze/cpu/start.S @@ -149,7 +149,7 @@ clear_bss: cmp r6, r5, r4 /* check if we have reach the end */ bnei r6, 2b 3: /* jumping to board_init */ - brai board_init + brai board_init_f 1: bri 1b /* diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c index 37ec665..1dee830 100644 --- a/arch/microblaze/lib/board.c +++ b/arch/microblaze/lib/board.c @@ -38,13 +38,6 @@ DECLARE_GLOBAL_DATA_PTR; -#ifdef CONFIG_SYS_GPIO_0 -extern int gpio_init (void); -#endif -#ifdef CONFIG_SYS_FSL_2 -extern void fsl_init2 (void); -#endif - /* * All attempts to come up with a "common" initialization sequence * that works for all boards and architectures failed: some of the @@ -66,20 +59,14 @@ init_fnc_t *init_sequence[] = { #endif serial_init, console_init_f, -#ifdef CONFIG_SYS_GPIO_0 - gpio_init, -#endif interrupts_init, timer_init, -#ifdef CONFIG_SYS_FSL_2 - fsl_init2, -#endif NULL, }; unsigned long monitor_flash_len; -void board_init (void) +void board_init_f(ulong not_used) { bd_t *bd; init_fnc_t **init_fnc_ptr; @@ -189,6 +176,8 @@ void board_init (void) /* Initialize the console (after the relocation and devices init) */ console_init_r(); + board_init(); + /* Initialize from environment */ load_addr = getenv_ulong("loadaddr", 16, load_addr); diff --git a/board/xilinx/microblaze-generic/microblaze-generic.c b/board/xilinx/microblaze-generic/microblaze-generic.c index 4a719ba..608fb20 100644 --- a/board/xilinx/microblaze-generic/microblaze-generic.c +++ b/board/xilinx/microblaze-generic/microblaze-generic.c @@ -31,6 +31,8 @@ #include #include +DECLARE_GLOBAL_DATA_PTR; + int do_reset(cmd_tbl_t *cmdtp, int flag, int argc, char * const argv[]) { #ifdef CONFIG_SYS_GPIO_0 @@ -69,6 +71,14 @@ int fsl_init2 (void) { } #endif +void board_init(void) +{ + gpio_init(); +#ifdef CONFIG_SYS_FSL_2 + fsl_init2(); +#endif +} + int board_eth_init(bd_t *bis) { int ret = 0;