[U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries for SPL

Daniel Schwierzeck
2011-07-15T14:43:45Z

Hi Simon,

On Fri, Jul 15, 2011 at 2:41 PM, Aneesh V <aneesh@ti.com> wrote:
> Hi Simon,
>
> On Friday 15 July 2011 06:01 PM, Simon Schwarz wrote:
>>
>> Hi Daniel,
>>
>> at the moment I'am playing a bit with your patch.
>>
>> I stumbled over this:
>>>
>>> diff --git a/arch/arm/lib/Makefile b/arch/arm/lib/Makefile
>>> index d31321a..300c8fa 100644
>>> --- a/arch/arm/lib/Makefile
>>> +++ b/arch/arm/lib/Makefile
>>> @@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
>>> ?LIB ? ?= $(obj)lib$(ARCH).o
>>> ?LIBGCC = $(obj)libgcc.o
>>>
>>> +ifndef CONFIG_SPL_BUILD
>>> ?GLSOBJS ? ? ? ?+= _ashldi3.o
>>> ?GLSOBJS ? ? ? ?+= _ashrdi3.o
>>> ?GLSOBJS ? ? ? ?+= _divsi3.o
>>> @@ -45,6 +46,7 @@ COBJS-y ? ? ? += interrupts.o
>>> ?COBJS-y ? ? ? ?+= reset.o
>>> ?SOBJS-$(CONFIG_USE_ARCH_MEMSET) += memset.o
>>> ?SOBJS-$(CONFIG_USE_ARCH_MEMCPY) += memcpy.o
>>> +endif
>>
>> Is it really your intention here to exclude board.c from the SPL? Or
>> do i misinterpret something? Also cache.c I would include to a
>> standard SPL.
>
> Yes, it's intentional. At the moment OMAP spl doesn't need anything
> from this directory other than the eabi_comapt.o. In the future if
> somebody needs contents from another file for SPL they may have to
> bring it out of the '#ifndef CONFIG_SPL_BUILD' block.
>
> In all likelihood board.c will always remain out of SPL because board.c
> defines board_init_f() and board_init_r() that are re-defined for SPL.
> In the event some SPL has to reuse some content from this file, we may
> have to make these functions weakly linked in this file. But I don't
> think that will be ever needed.
>

I can only speak for MIPS but the regular board.c is too heavy for SPL.
Either you insert a lot of #ifdef CONFIG_SPL_BUILD (ugly) or you create a
simplified board_spl.c. Maybe a common version for ARM, your SoC or your
board only.

Best regards,
Daniel