[U-Boot] [PATCH v2 08/22] omap: add spl support

Aneesh V
2011-06-15T10:53:57Z

Dear Wolfgang,

On Wednesday 15 June 2011 03:43 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4DDE5AFE.9000404@ti.com> you wrote:
>>
>> I do not have any issue in having media specific files in their
>> respective directories. However, I would like to see the 'Makefile's
>> coming from the same directory tree irrespective of the media. So, how
>> about something like this:
>>
>> spl/
>> mmc/
>> nand/
>> one-nand/
>> board/<vendor>/<board>/Makefile
>
> Actually that would be
>
> board/[<vendor>/]<board>/
>
>> The idea is to have the board level Makefile in 'spl/board/<vendor>
>> /<board>/' no matter what the SPL type is. This will help in better
>> consolidation of SPLs.
>
> OK.
>
>> I see 3 SPL use-cases in general:
>> 1. A single SPL that supports multiple media(suitable for SoCs with
>> large internal RAM)
>> 2. A single SPL supporting a single media(the board supports only one
>> media)
>
> 1. and 2. are actually the same (2. being the special case of N=1)
>
>> 3. Multiple SPLs for the same board each supporting a different
>> memory device(maybe preferred over 1 to keep the foot-print of each
>> small).
>>
>> Supporting (1) and (2) is straight forward with the above directory
>> structure.
>>
>> To support (3) the board level Makefile should conditionally
>> include the respective image file in the target 'all' based on CONFIG
>> options. For instance 'all' may include 'onenand-ipl-2k.bin' if
>> CONFIG_ONENAND_U_BOOT is defined and so on.
>
> I don't get this. Why don't we just pass the required make target
> from the top level Makefile? If we want to build "onenand-ipl-2k.bin"
> then this would result in running "make onenand-ipl-2k.bin" in the
> respective directory - this is then also independent of whether this
> image contains support for one specific boot device or for any set of
> different devices.

Then you will have to deal with many such images in the top-level
Makefile(u-boot/Makefile). Instead why not have just one rule like the
below in the top-level Makefile for all the different spl's:

SPL :$(TIMESTAMP_FILE) $(VERSION_FILE) depend tools
$(MAKE) -C spl/board/$(BOARDDIR) all

And leave the rest to the board level Makefiles

Of course, this is assuming the existing Makefile structure. With the
new Makefile structure you are suggesting this may not hold good.