[U-Boot] A bit about board.c, board.c

Albert ARIBAUD albert.u.boot at aribaud.net
Sat Oct 22 09:17:17 CEST 2011


Le 22/10/2011 07:11, Simon Glass a écrit :
> Hi,
>
> Each architecture has its own board.c but they are mostly quite similar.
>
> New features such as fdt, boot timing, trace, profiling, etc. must be
> done separately for each arch, even if there are no
> architecture-specific bits.
>
> What would you say to adding something like lib/board.c which is a
> simplified cleaned-up copy of one of the existing board.c files, and a
> CONFIG_ARCH_GENERIC_BOARD option to select that in preference to the
> architecture-specific one. Then perhaps people could try it out and we
> could slowly move to it over time...

I'd say anything that factorizes ARM code is a good thing. :)

However I'm not in favor of a CONFIG option that would force the board 
code to provide some functions just in odrer to override one, not if 
weak definitions can do a finer job. I am looking into that already for 
cache management function specialization, and it seems like there is the 
same kind of possibility here, with lib functions defined weak and the 
board code overriding the ones it deems necessary to.

I will look into it a bit more this morning.

Amicalement,
-- 
Albert.


More information about the U-Boot mailing list