public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Stephan Linz <linz@li-pro.net>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 6/7] microblaze: Clean microblaze initialization
Date: Tue, 07 Aug 2012 22:10:39 +0200	[thread overview]
Message-ID: <1344370240.29456.91.camel@keto> (raw)
In-Reply-To: <1344239199-11445-6-git-send-email-monstr@monstr.eu>

Am Montag, den 06.08.2012, 09:46 +0200 schrieb Michal Simek: 
> 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 <monstr@monstr.eu>
> 

Acked-by: Stephan Linz <linz@li-pro.net>

Tested with AXI systems on Avnet S6LX150T and S6LX9 micro-evaluation.

> ---
> v2: Remove global pointer
>     Define board_init function in header
> ---
>  arch/microblaze/cpu/start.S                        |    2 +-
>  arch/microblaze/include/asm/processor.h            |    3 +++
>  arch/microblaze/lib/board.c                        |   17 +++--------------
>  .../xilinx/microblaze-generic/microblaze-generic.c |    9 +++++++++
>  4 files changed, 16 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/include/asm/processor.h b/arch/microblaze/include/asm/processor.h
> index 2295d0a..2c4d5ff 100644
> --- a/arch/microblaze/include/asm/processor.h
> +++ b/arch/microblaze/include/asm/processor.h
> @@ -28,4 +28,7 @@
>  extern char __end[];
>  extern char __text_start[];
>  
> +/* Microblaze board initialization function */
> +void board_init(void);
> +
>  #endif /* __ASM_MICROBLAZE_PROCESSOR_H */
> diff --git a/arch/microblaze/lib/board.c b/arch/microblaze/lib/board.c
> index fde109f..b450367 100644
> --- a/arch/microblaze/lib/board.c
> +++ b/arch/microblaze/lib/board.c
> @@ -39,13 +39,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
> @@ -67,20 +60,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 a1e2bfe..b75e62c 100644
> --- a/board/xilinx/microblaze-generic/microblaze-generic.c
> +++ b/board/xilinx/microblaze-generic/microblaze-generic.c
> @@ -28,6 +28,7 @@
>  #include <common.h>
>  #include <config.h>
>  #include <netdev.h>
> +#include <asm/processor.h>
>  #include <asm/microblaze_intc.h>
>  #include <asm/asm.h>
>  
> @@ -69,6 +70,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;

-- 
Viele Gr??e,
Stephan Linz
______________________________________________________________________________
MB-Ref: http://www.li-pro.de/xilinx_mb:mbref:start
OpenDCC: http://www.li-pro.net/opendcc.phtml
PC/M: http://www.li-pro.net/pcm.phtml
Sourceforge: http://sourceforge.net/users/slz
Gitorious: https://gitorious.org/~slz

  reply	other threads:[~2012-08-07 20:10 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-06  7:46 [U-Boot] [PATCH v2 1/7] microblaze: Add support for device tree driven board configuration Michal Simek
2012-08-06  7:46 ` [U-Boot] [PATCH v2 2/7] microblaze: board: Remove compilation warning Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-06  7:46 ` [U-Boot] [PATCH v2 3/7] microblaze: intc: Registering interrupt should return value Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-08  8:27     ` Michal Simek
2012-08-08 17:47       ` Stephan Linz
2012-08-06  7:46 ` [U-Boot] [PATCH v2 4/7] microblaze: intc: Coding style cleanup Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-06  7:46 ` [U-Boot] [PATCH v2 5/7] microblaze: timer: Prepare for device-tree initialization Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-08  8:27     ` Michal Simek
2012-08-06  7:46 ` [U-Boot] [PATCH v2 6/7] microblaze: Clean microblaze initialization Michal Simek
2012-08-07 20:10   ` Stephan Linz [this message]
2012-08-06  7:46 ` [U-Boot] [PATCH v2 7/7] microblaze: board: Use bi_flashstart instead of CONFIG_SYS_FLASH_BASE Michal Simek
2012-08-07 20:10   ` Stephan Linz
2012-08-07 20:10 ` [U-Boot] [PATCH v2 1/7] microblaze: Add support for device tree driven board configuration Stephan Linz
2012-08-10  7:16   ` Michal Simek

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1344370240.29456.91.camel@keto \
    --to=linz@li-pro.net \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox