public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 2/3 V3] Make board_init_f under nand_boot.c a weak function
@ 2010-10-26 17:57 Sughosh Ganu
  2010-10-26 19:07 ` Scott Wood
  0 siblings, 1 reply; 3+ messages in thread
From: Sughosh Ganu @ 2010-10-26 17:57 UTC (permalink / raw)
  To: u-boot

 Enable board_init_f to be overridden with a board
 specific function.

Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
---
Changes since V2:
  * Fix the checkpatch warnings

 nand_spl/nand_boot.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)

diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c
index ccd0af2..01ff3e3 100644
--- a/nand_spl/nand_boot.c
+++ b/nand_spl/nand_boot.c
@@ -222,11 +222,13 @@ static int nand_load(struct mtd_info *mtd, unsigned int offs,
 }
 
 #if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
-void board_init_f (ulong bootflag)
+void __board_init_f(ulong bootflag)
 {
-	relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
-		       CONFIG_SYS_TEXT_BASE);
+	relocate_code(CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
+			CONFIG_SYS_TEXT_BASE);
 }
+void board_init_f(ulong bootflag)__attribute__((weak,
+						 alias("__board_init_f")));
 #endif
 
 /*
-- 
1.7.0.4

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 2/3 V3] Make board_init_f under nand_boot.c a weak function
  2010-10-26 17:57 [U-Boot] [PATCH 2/3 V3] Make board_init_f under nand_boot.c a weak function Sughosh Ganu
@ 2010-10-26 19:07 ` Scott Wood
  2010-10-27  5:58   ` Sughosh Ganu
  0 siblings, 1 reply; 3+ messages in thread
From: Scott Wood @ 2010-10-26 19:07 UTC (permalink / raw)
  To: u-boot

On Tue, 26 Oct 2010 23:27:44 +0530
Sughosh Ganu <urwithsughosh@gmail.com> wrote:

> 
>  Enable board_init_f to be overridden with a board
>  specific function.
> 
> Signed-off-by: Sughosh Ganu <urwithsughosh@gmail.com>
> ---
> Changes since V2:
>   * Fix the checkpatch warnings
> 
>  nand_spl/nand_boot.c |    8 +++++---
>  1 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/nand_spl/nand_boot.c b/nand_spl/nand_boot.c
> index ccd0af2..01ff3e3 100644
> --- a/nand_spl/nand_boot.c
> +++ b/nand_spl/nand_boot.c
> @@ -222,11 +222,13 @@ static int nand_load(struct mtd_info *mtd, unsigned int offs,
>  }
>  
>  #if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
> -void board_init_f (ulong bootflag)
> +void __board_init_f(ulong bootflag)
>  {
> -	relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
> -		       CONFIG_SYS_TEXT_BASE);
> +	relocate_code(CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
> +			CONFIG_SYS_TEXT_BASE);
>  }
> +void board_init_f(ulong bootflag)__attribute__((weak,
> +						 alias("__board_init_f")));
>  #endif
>  
>  /*

ACK for now, but given space constraints we probably don't want to
carry around __board_init_f just to have it be overridden (will an
overridden weak alias allow the function to be optimized away by the
linker if function-sections/gc-sections is used?)

Eventually all boards should just provide their own board_init_f,
which could just consist of a call to a common board init helper
function.  Or possibly a preprocessor define could be used to indicate
that the common function should be used.

-Scott

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [U-Boot] [PATCH 2/3 V3] Make board_init_f under nand_boot.c a weak function
  2010-10-26 19:07 ` Scott Wood
@ 2010-10-27  5:58   ` Sughosh Ganu
  0 siblings, 0 replies; 3+ messages in thread
From: Sughosh Ganu @ 2010-10-27  5:58 UTC (permalink / raw)
  To: u-boot

hi Scott,

On Tue Oct 26, 2010 at 02:07:06PM -0500, Scott Wood wrote:
> On Tue, 26 Oct 2010 23:27:44 +0530
> Sughosh Ganu <urwithsughosh@gmail.com> wrote:
> 
> >  
> >  #if defined(CONFIG_ARM) && !defined(CONFIG_SYS_ARM_WITHOUT_RELOC)
> > -void board_init_f (ulong bootflag)
> > +void __board_init_f(ulong bootflag)
> >  {
> > -	relocate_code (CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
> > -		       CONFIG_SYS_TEXT_BASE);
> > +	relocate_code(CONFIG_SYS_TEXT_BASE - TOTAL_MALLOC_LEN, NULL,
> > +			CONFIG_SYS_TEXT_BASE);
> >  }
> > +void board_init_f(ulong bootflag)__attribute__((weak,
> > +						 alias("__board_init_f")));
> >  #endif
> >  
> >  /*
> 
> Eventually all boards should just provide their own board_init_f,
> which could just consist of a call to a common board init helper
> function.  Or possibly a preprocessor define could be used to indicate
> that the common function should be used.


  I had prososed that in my previous mail. I see that smdk6400 is the
  only arm board using this. I think we can make this change to move
  the board_init_f to the respective board directory right away. The
  change should not impact any other boards. If fine with you, i will
  respin my patch accordingly.

-sughosh

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2010-10-27  5:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-10-26 17:57 [U-Boot] [PATCH 2/3 V3] Make board_init_f under nand_boot.c a weak function Sughosh Ganu
2010-10-26 19:07 ` Scott Wood
2010-10-27  5:58   ` Sughosh Ganu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox