All of lore.kernel.org
 help / color / mirror / Atom feed
* [U-Boot] SPL framework re-design
@ 2011-06-16  8:08 Aneesh V
  2011-06-16 10:47 ` Wolfgang Denk
                   ` (3 more replies)
  0 siblings, 4 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-16  8:08 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

This is in continuation of our discussion in the following threads:

http://article.gmane.org/gmane.comp.boot-loaders.u-boot/99795
http://article.gmane.org/gmane.comp.boot-loaders.u-boot/99785

I think this discussion now needs a dedicated thread.

To make sure I understand your new proposals, let me consolidate them
here. Please correct me if I am wrong. Also, in the end I have some
questions about your new proposal. Some of the questions are getting
into the details. But I need the details to re-work my patches
according to the new proposal.

Current Design:
* Currently a single board level Makefile determines what gets built
into SPL.
* This Makefile chooses all the files to be built. Makes symbolic links
to them in the board level SPL directory and builds and links them to
create the SPL image.
* This structure is duplicated for different types of SPLs, nand_spl,
onenand_ipl, mmc_spl etc.
* Directory structure is something like:
nand_spl/board/<vendor>/<board>/


New Design Proposed by Wolfgang:
* Have a top-level Makefile in the SPL root-directory - for instance
'nand_spl/Makefile'
* nand_spl/Makefile builds a generic library with the generic source
files at this level.
* It then descends into sub-directories(SoC, board etc) to make the
respective libraries at those levels.
* These libraries are finally linked together by nand_spl/Makefile to
build the SPL image.


Open questions about the new proposal:
1. We may need more layers than just generic, SoC and board. For
instance all SPLs typically use start.S from the CPU directory. Also,
a lot of SoC code is typically SoC family generic. How about something
like this for the directory structure:

nand_spl/<cpu>/
	      <soc-family>/
	      <soc1>/<board>/
	      <soc2>/<board>/
Maybe, <arch> needs to be added too.

2. How do we handle the type of SPLs that handle different media. For
instance omap3 spl will support mmc and NAND. Can we have a directory
tree starting with 'spl/'? If so, how does this tree share generic code
available in media specific directories such as nand_spl/ and mmc_spl/.
Symbolic links?

3. Customizability - In the existing scheme what gets built into the
SPL for a given board was completely customizable by the board level
Makefile. That's no longer the case with the proposed scheme. Source
files and Makefiles in the generic and CPU directory are shared by many
boards. How do we allow customizability for individual boards. using
CONFIG_ flags? This may be needed for the boards to make the right
trade-offs based SRAM budget/requirements etc. Maybe, --gc-sections and
-ffunction-sections help in dealing with this?

4. How do we handle the case where a given SoC doesn't need any board
level code for the SPL(This is the case with OMAP4). Is this handled by
just not have any <board> directories?

5. If so, how does the top-level SPL Makefile handle this? By checking
for the existence of <board> directory before descending into it? How
does it handle the link step where the board level library is not
available?

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-16  8:08 [U-Boot] SPL framework re-design Aneesh V
@ 2011-06-16 10:47 ` Wolfgang Denk
  2011-06-16 11:50   ` Aneesh V
                     ` (2 more replies)
  2011-06-16 16:45 ` Scott Wood
                   ` (2 subsequent siblings)
  3 siblings, 3 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-16 10:47 UTC (permalink / raw)
  To: u-boot

Dear Aneesh,

In message <4DF9B9E0.8020206@ti.com> you wrote:
> 
> To make sure I understand your new proposals, let me consolidate them
> here. Please correct me if I am wrong. Also, in the end I have some
> questions about your new proposal. Some of the questions are getting
> into the details. But I need the details to re-work my patches
> according to the new proposal.

Thanks for going into this!

> Current Design:
> * Currently a single board level Makefile determines what gets built
> into SPL.

And as we have learned so far, these board level Makefiles contain a
large lot of duplicated code, especially when dealing with several
boards based on the same or similar Soc(s).

> * This Makefile chooses all the files to be built. Makes symbolic links
> to them in the board level SPL directory and builds and links them to
> create the SPL image.
> * This structure is duplicated for different types of SPLs, nand_spl,
> onenand_ipl, mmc_spl etc.
> * Directory structure is something like:
> nand_spl/board/<vendor>/<board>/

All correct so far.

> New Design Proposed by Wolfgang:
> * Have a top-level Makefile in the SPL root-directory - for instance
> 'nand_spl/Makefile'

The longer I think about this the more I feel we should even take this
one step further.  Looking at what we have so far:

	mmc_spl/
	nand_spl/
	onenand_ipl/

we are also duplicating the structure across different boot media. I
think we should re-organize this as follows:

	spl/
	spl/common/
	spl/mmc/
	spl/nand/
	spl/onenand/

This can probably done in an initial step which is more or less
plain renaming and without any functional changes.

We would then have

	spl/Makefile
	...
	spl/common/Makefile
	...
	spl/nand/Makefile
	...

> * nand_spl/Makefile builds a generic library with the generic source
> files at this level.

...this changes to: "spl/Makefile, spl/common/Makefile and
spl/<bootdevice>/Makefile build libraries with the generic object
files at their respective level (assuming these exist).

> * It then descends into sub-directories(SoC, board etc) to make the
> respective libraries at those levels.

...again with the addition that these may or may not exist - depending
if any board specific code is needed or not.

> * These libraries are finally linked together by nand_spl/Makefile to
> build the SPL image.

...together by spl/Makefile ...

> Open questions about the new proposal:
> 1. We may need more layers than just generic, SoC and board. For
> instance all SPLs typically use start.S from the CPU directory. Also,
> a lot of SoC code is typically SoC family generic. How about something
> like this for the directory structure:
> 
> nand_spl/<cpu>/
> 	      <soc-family>/
> 	      <soc1>/<board>/
> 	      <soc2>/<board>/
> Maybe, <arch> needs to be added too.

If this seems necessary, we may do this. But I would like to avoid to
copying basicly the whole source tree (either as verbatim copies or
as symlinks).

We should try to get rid of the need to create symbolic links. If we
use the same source files as for the "normal", then we should also
use the normal object files.

> 2. How do we handle the type of SPLs that handle different media. For
> instance omap3 spl will support mmc and NAND. Can we have a directory
> tree starting with 'spl/'? If so, how does this tree share generic code

Yes, this makes a lot of sense to me - see above.

> available in media specific directories such as nand_spl/ and mmc_spl/.
> Symbolic links?

No.  Let's put this stuff into  spl/common/

> 3. Customizability - In the existing scheme what gets built into the
> SPL for a given board was completely customizable by the board level
> Makefile. That's no longer the case with the proposed scheme. Source
> files and Makefiles in the generic and CPU directory are shared by many
> boards. How do we allow customizability for individual boards. using
> CONFIG_ flags? This may be needed for the boards to make the right
> trade-offs based SRAM budget/requirements etc. Maybe, --gc-sections and
> -ffunction-sections help in dealing with this?

As far as building is concerned, the files to be built should always
(unless truly common) be selected based on CONFIG_ settings in the
Makefiles.

As far as linking is concerned, we can do the same for most cases
(keep in mind that all linker scripts are run through the C
preprocessor, so we can do a lot of things).  For those cases where
even more flexibility is needed, we can use custom linker scripts in
the board directories.

> 4. How do we handle the case where a given SoC doesn't need any board
> level code for the SPL(This is the case with OMAP4). Is this handled by
> just not have any <board> directories?

Right.  Or, if a board directory exists for other reasons, by just
building an empty board library.

> 5. If so, how does the top-level SPL Makefile handle this? By checking
> for the existence of <board> directory before descending into it? How

Yes.

> does it handle the link step where the board level library is not
> available?

In the same way: we test if the <board> directory exists, and only if
this is the case it gets added to the list of directories to descend
into for building, and to the list of libraries to be linked together.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"A fractal is by definition a set for which the Hausdorff Besicovitch
dimension strictly exceeds the topological dimension."
- Mandelbrot, _The Fractal Geometry of Nature_

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

* [U-Boot] SPL framework re-design
  2011-06-16 10:47 ` Wolfgang Denk
@ 2011-06-16 11:50   ` Aneesh V
  2011-06-16 12:15     ` Wolfgang Denk
  2011-06-16 12:55   ` Daniel Schwierzeck
  2011-06-17 16:48   ` [U-Boot] SPL framework re-design Aneesh V
  2 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-06-16 11:50 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Thursday 16 June 2011 04:17 PM, Wolfgang Denk wrote:
> Dear Aneesh,
>
> In message<4DF9B9E0.8020206@ti.com>  you wrote:
>>
>> To make sure I understand your new proposals, let me consolidate them
>> here. Please correct me if I am wrong. Also, in the end I have some
>> questions about your new proposal. Some of the questions are getting
>> into the details. But I need the details to re-work my patches
>> according to the new proposal.
>
> Thanks for going into this!
>
>> Current Design:
>> * Currently a single board level Makefile determines what gets built
>> into SPL.
>
> And as we have learned so far, these board level Makefiles contain a
> large lot of duplicated code, especially when dealing with several
> boards based on the same or similar Soc(s).
>
>> * This Makefile chooses all the files to be built. Makes symbolic links
>> to them in the board level SPL directory and builds and links them to
>> create the SPL image.
>> * This structure is duplicated for different types of SPLs, nand_spl,
>> onenand_ipl, mmc_spl etc.
>> * Directory structure is something like:
>> nand_spl/board/<vendor>/<board>/
>
> All correct so far.
>
>> New Design Proposed by Wolfgang:
>> * Have a top-level Makefile in the SPL root-directory - for instance
>> 'nand_spl/Makefile'
>
> The longer I think about this the more I feel we should even take this
> one step further.  Looking at what we have so far:
>
> 	mmc_spl/
> 	nand_spl/
> 	onenand_ipl/
>
> we are also duplicating the structure across different boot media. I
> think we should re-organize this as follows:
>
> 	spl/
> 	spl/common/
> 	spl/mmc/
> 	spl/nand/
> 	spl/onenand/

Can you please extend this to show the SoC/board directories etc. I
guess they will go under spl/ and not under each media.

>
> This can probably done in an initial step which is more or less
> plain renaming and without any functional changes.
>
> We would then have
>
> 	spl/Makefile
> 	...
> 	spl/common/Makefile
> 	...
> 	spl/nand/Makefile
> 	...
>
>> * nand_spl/Makefile builds a generic library with the generic source
>> files at this level.
>
> ...this changes to: "spl/Makefile, spl/common/Makefile and
> spl/<bootdevice>/Makefile build libraries with the generic object
> files at their respective level (assuming these exist).

What's the distinction between spl/Makefile and spl/common/Makefile?
I guess we won't have any source files at spl/ level?

>
>> * It then descends into sub-directories(SoC, board etc) to make the
>> respective libraries at those levels.
>
> ...again with the addition that these may or may not exist - depending
> if any board specific code is needed or not.
>
>> * These libraries are finally linked together by nand_spl/Makefile to
>> build the SPL image.
>
> ...together by spl/Makefile ...
>
>> Open questions about the new proposal:
>> 1. We may need more layers than just generic, SoC and board. For
>> instance all SPLs typically use start.S from the CPU directory. Also,
>> a lot of SoC code is typically SoC family generic. How about something
>> like this for the directory structure:
>>
>> nand_spl/<cpu>/
>> 	<soc-family>/
>> 	<soc1>/<board>/
>> 	<soc2>/<board>/
>> Maybe,<arch>  needs to be added too.
>
> If this seems necessary, we may do this. But I would like to avoid to
> copying basicly the whole source tree (either as verbatim copies or
> as symlinks).
>
> We should try to get rid of the need to create symbolic links. If we
> use the same source files as for the "normal", then we should also
> use the normal object files.

You mean you will re-use *.o files with normal u-boot? If so, do you
want to create symbolic links to them in the SPL directories or use
them in-place?

Whether you reuse the source code or the object files we still need
directories for all the levels for the respective Makefiles, right?

Also, at least some files will have to be built separately for SPL
because they have conditional compilation with CONFIG_PRELOADER kind of
flags.
>
>> 2. How do we handle the type of SPLs that handle different media. For
>> instance omap3 spl will support mmc and NAND. Can we have a directory
>> tree starting with 'spl/'? If so, how does this tree share generic code
>
> Yes, this makes a lot of sense to me - see above.
>
>> available in media specific directories such as nand_spl/ and mmc_spl/.
>> Symbolic links?
>
> No.  Let's put this stuff into  spl/common/

I meant code that is media specific, such as MMC support, NAND support
etc. I think these should still go in spl/mmc, spl/nand etc right?

A multi-device SPL will have to use 2 or more such libraries.

>
>> 3. Customizability - In the existing scheme what gets built into the
>> SPL for a given board was completely customizable by the board level
>> Makefile. That's no longer the case with the proposed scheme. Source
>> files and Makefiles in the generic and CPU directory are shared by many
>> boards. How do we allow customizability for individual boards. using
>> CONFIG_ flags? This may be needed for the boards to make the right
>> trade-offs based SRAM budget/requirements etc. Maybe, --gc-sections and
>> -ffunction-sections help in dealing with this?
>
> As far as building is concerned, the files to be built should always
> (unless truly common) be selected based on CONFIG_ settings in the
> Makefiles.
>
> As far as linking is concerned, we can do the same for most cases
> (keep in mind that all linker scripts are run through the C
> preprocessor, so we can do a lot of things).  For those cases where
> even more flexibility is needed, we can use custom linker scripts in
> the board directories.

So, is the logic like this: If there is a linker script in the board
directory use it, else look for a linker script in SoC directory?

BTW, my question was more about the contents of final image than the
memory map. But, I think this can be handled with appropriate use of
--gc-sections, -ffunction-sections, and -fdata-sections. The two main
entry points board_init_f() and board_init_r() are typically
implemented in the SoC layer or board layer of an SPL. This along with
the use of above compiler switches will help SoCs/boards to link in
only what they need, right?

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-16 11:50   ` Aneesh V
@ 2011-06-16 12:15     ` Wolfgang Denk
  2011-06-16 13:38       ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-16 12:15 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4DF9EE03.8010105@ti.com> you wrote:
> 
> > we are also duplicating the structure across different boot media. I
> > think we should re-organize this as follows:
> >
> > 	spl/
> > 	spl/common/
> > 	spl/mmc/
> > 	spl/nand/
> > 	spl/onenand/
> 
> Can you please extend this to show the SoC/board directories etc. I
> guess they will go under spl/ and not under each media.

Correct, i. e. please add for example:

	spl/board/freescale/mx31pdk/
	spl/board/freescale/mx31pdk/Makefile
	...

> > ...this changes to: "spl/Makefile, spl/common/Makefile and
> > spl/<bootdevice>/Makefile build libraries with the generic object
> > files at their respective level (assuming these exist).
> 
> What's the distinction between spl/Makefile and spl/common/Makefile?
> I guess we won't have any source files at spl/ level?

I think we can implement the logic to decide which directories need to
be entered and built into spl/Makefile, so we can keep this out of the
top level Makefile.

spl/common/Makefile is responsible for building the common code in the
spl/common/ directory.

Correct, I do not see need for any sources in spl/

> > We should try to get rid of the need to create symbolic links. If we
> > use the same source files as for the "normal", then we should also
> > use the normal object files.
> 
> You mean you will re-use *.o files with normal u-boot? If so, do you
> want to create symbolic links to them in the SPL directories or use
> them in-place?

We should use them in-place. Using --gc-sections and
-ffunction-sections we have enough granularity to select only what we
really need.

> Whether you reuse the source code or the object files we still need
> directories for all the levels for the respective Makefiles, right?

Can we not use the objects that get normally built, with the existing
Makefiles?

> Also, at least some files will have to be built separately for SPL
> because they have conditional compilation with CONFIG_PRELOADER kind of
> flags.

Please let's check where this is needed, and how we can handle this.
I'd really like to get rid of this symlinking.

> I meant code that is media specific, such as MMC support, NAND support
> etc. I think these should still go in spl/mmc, spl/nand etc right?
> 
> A multi-device SPL will have to use 2 or more such libraries.

Right.

> So, is the logic like this: If there is a linker script in the board
> directory use it, else look for a linker script in SoC directory?

We should use the same logic as in config.mk, i. e.
CONFIG_SYS_LDSCRIPT has hioghest priority, then search in the standard
locations.

> BTW, my question was more about the contents of final image than the
> memory map. But, I think this can be handled with appropriate use of
> --gc-sections, -ffunction-sections, and -fdata-sections. The two main
> entry points board_init_f() and board_init_r() are typically
> implemented in the SoC layer or board layer of an SPL. This along with
> the use of above compiler switches will help SoCs/boards to link in
> only what they need, right?

This is my understanding, too.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
2000 pounds of chinese soup                               = 1 Won Ton

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

* [U-Boot] SPL framework re-design
  2011-06-16 10:47 ` Wolfgang Denk
  2011-06-16 11:50   ` Aneesh V
@ 2011-06-16 12:55   ` Daniel Schwierzeck
  2011-06-16 13:10     ` Andreas Bießmann
                       ` (10 more replies)
  2011-06-17 16:48   ` [U-Boot] SPL framework re-design Aneesh V
  2 siblings, 11 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-06-16 12:55 UTC (permalink / raw)
  To: u-boot

Hi all,

for my MIPS based boards I tested a approach similar to Wolfgang's one
in the last weeks.
My goal was to create a SPL image, that is able to boot from a SPI flash.

The basic idea is to have a spl directory that is used as remote build
directory for all object files
needed for the SPL image. It contains only the Makefile and nothing
else. This Makefile is
a strongly simplified version of the TOPDIR/Makefile, uses
TOPDIR/config.mk and creates
a u-boot-spl.bin. The SPL build can be enabled by defining
CONFIG_UBOOT_SPL in the board config file.

If the spl/Makefiles becomes active, an additional variable name
CONFIG_UBOOT_SPL_BUILD wiil be
exported in the make environment. Additionally
-DCONFIG_UBOOT_SPL_BUILD will be added
to the CFLAGS (similar to -DCONFIG_PRELOADER). This allows us to reuse
almost of the arch, SoC and
board code.

The board_init_f function could be implemented in
arch/ARCH/lib/board_spl.c to allow arch-specific code.
The relocate_code and board_init_r functions must not be compiled,
they are not needed anyway. This
can be simply controlled with -DCONFIG_UBOOT_SPL_BUILD.

With this approach I can create a SPL image, that reuses all of the
minimal needed MIPS CPU code,
mySoC code, my board lowlevel_init, my SPI driver and some parts of
the generic SPI flash driver.

Some further comments below

On Thu, Jun 16, 2011 at 12:47 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Aneesh,
[snip]
>
> The longer I think about this the more I feel we should even take this
> one step further. ?Looking at what we have so far:
>
> ? ? ? ?mmc_spl/
> ? ? ? ?nand_spl/
> ? ? ? ?onenand_ipl/
>
> we are also duplicating the structure across different boot media. I
> think we should re-organize this as follows:
>
> ? ? ? ?spl/
> ? ? ? ?spl/common/
> ? ? ? ?spl/mmc/
> ? ? ? ?spl/nand/
> ? ? ? ?spl/onenand/
>
> This can probably done in an initial step which is more or less
> plain renaming and without any functional changes.
>
> We would then have
>
> ? ? ? ?spl/Makefile
> ? ? ? ?...
> ? ? ? ?spl/common/Makefile
> ? ? ? ?...
> ? ? ? ?spl/nand/Makefile
> ? ? ? ?...
>
>> * nand_spl/Makefile builds a generic library with the generic source
>> files at this level.
>
> ...this changes to: "spl/Makefile, spl/common/Makefile and
> spl/<bootdevice>/Makefile build libraries with the generic object
> files at their respective level (assuming these exist).
>
>> * It then descends into sub-directories(SoC, board etc) to make the
>> respective libraries at those levels.
>
> ...again with the addition that these may or may not exist - depending
> if any board specific code is needed or not.
>
>> * These libraries are finally linked together by nand_spl/Makefile to
>> build the SPL image.
>
> ...together by spl/Makefile ...
>
>> Open questions about the new proposal:
>> 1. We may need more layers than just generic, SoC and board. For
>> instance all SPLs typically use start.S from the CPU directory. Also,
>> a lot of SoC code is typically SoC family generic. How about something
>> like this for the directory structure:
>>
>> nand_spl/<cpu>/
>> ? ? ? ? ? ? <soc-family>/
>> ? ? ? ? ? ? <soc1>/<board>/
>> ? ? ? ? ? ? <soc2>/<board>/
>> Maybe, <arch> needs to be added too.
>
> If this seems necessary, we may do this. But I would like to avoid to
> copying basicly the whole source tree (either as verbatim copies or
> as symlinks).
>
> We should try to get rid of the need to create symbolic links. If we
> use the same source files as for the "normal", then we should also
> use the normal object files.

By using something like CONFIG_UBOOT_SPL_BUILD in the make environment
and as CFLAG all code can be reused without symlinking or copying.
You need only a separate directory for putting the object files in.

>
>> 2. How do we handle the type of SPLs that handle different media. For
>> instance omap3 spl will support mmc and NAND. Can we have a directory
>> tree starting with 'spl/'? If so, how does this tree share generic code
>
> Yes, this makes a lot of sense to me - see above.
>
>> available in media specific directories such as nand_spl/ and mmc_spl/.
>> Symbolic links?
>
> No. ?Let's put this stuff into ?spl/common/

To use the spl directory as remote build directory, the obj and src variables
must be tweaked a little. To keep this changes minimal, it is not possible to
have further source files and directories inside the spl directory. I suggest to
put common spl code in TOPDIR/lib/spl/common, TOPDIR/lib/spl/nand and so on.

>
>> 3. Customizability - In the existing scheme what gets built into the
>> SPL for a given board was completely customizable by the board level
>> Makefile. That's no longer the case with the proposed scheme. Source
>> files and Makefiles in the generic and CPU directory are shared by many
>> boards. How do we allow customizability for individual boards. using
>> CONFIG_ flags? This may be needed for the boards to make the right
>> trade-offs based SRAM budget/requirements etc. Maybe, --gc-sections and
>> -ffunction-sections help in dealing with this?
>
> As far as building is concerned, the files to be built should always
> (unless truly common) be selected based on CONFIG_ settings in the
> Makefiles.
>
> As far as linking is concerned, we can do the same for most cases
> (keep in mind that all linker scripts are run through the C
> preprocessor, so we can do a lot of things). ?For those cases where
> even more flexibility is needed, we can use custom linker scripts in
> the board directories.
>
>> 4. How do we handle the case where a given SoC doesn't need any board
>> level code for the SPL(This is the case with OMAP4). Is this handled by
>> just not have any <board> directories?
>
> Right. ?Or, if a board directory exists for other reasons, by just
> building an empty board library.
>
>> 5. If so, how does the top-level SPL Makefile handle this? By checking
>> for the existence of <board> directory before descending into it? How
>
> Yes.
>
>> does it handle the link step where the board level library is not
>> available?
>
> In the same way: we test if the <board> directory exists, and only if
> this is the case it gets added to the list of directories to descend
> into for building, and to the list of libraries to be linked together.
>
> Best regards,
>
> Wolfgang Denk
>

Best regards
Daniel

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

* [U-Boot] SPL framework re-design
  2011-06-16 12:55   ` Daniel Schwierzeck
@ 2011-06-16 13:10     ` Andreas Bießmann
  2011-06-26 23:17       ` Ilya Yanok
  2011-06-16 13:57     ` Aneesh V
                       ` (9 subsequent siblings)
  10 siblings, 1 reply; 172+ messages in thread
From: Andreas Bießmann @ 2011-06-16 13:10 UTC (permalink / raw)
  To: u-boot

Dear all,

Am 16.06.2011 14:55, schrieb Daniel Schwierzeck:

<snip>

> On Thu, Jun 16, 2011 at 12:47 PM, Wolfgang Denk <wd@denx.de> wrote:
>> Dear Aneesh,

<snip>

>> We should try to get rid of the need to create symbolic links. If we
>> use the same source files as for the "normal", then we should also
>> use the normal object files.
> 
> By using something like CONFIG_UBOOT_SPL_BUILD in the make environment
> and as CFLAG all code can be reused without symlinking or copying.
> You need only a separate directory for putting the object files in.

+1 for reusing existing stuff but changing it a little bit to be able to
work as spl(driver) where this is necessary

>>> 2. How do we handle the type of SPLs that handle different media. For
>>> instance omap3 spl will support mmc and NAND. Can we have a directory
>>> tree starting with 'spl/'? If so, how does this tree share generic code
>>
>> Yes, this makes a lot of sense to me - see above.
>>
>>> available in media specific directories such as nand_spl/ and mmc_spl/.
>>> Symbolic links?
>>
>> No.  Let's put this stuff into  spl/common/
> 
> To use the spl directory as remote build directory, the obj and src variables
> must be tweaked a little. To keep this changes minimal, it is not possible to
> have further source files and directories inside the spl directory. I suggest to
> put common spl code in TOPDIR/lib/spl/common, TOPDIR/lib/spl/nand and so on.

sounds better to me than having a complete new tree under /spl

regards

Andreas Bie?mann

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

* [U-Boot] SPL framework re-design
  2011-06-16 12:15     ` Wolfgang Denk
@ 2011-06-16 13:38       ` Aneesh V
  2011-06-16 21:52         ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-06-16 13:38 UTC (permalink / raw)
  To: u-boot

On Thursday 16 June 2011 05:45 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4DF9EE03.8010105@ti.com>  you wrote:
>>
>>> we are also duplicating the structure across different boot media. I
>>> think we should re-organize this as follows:
>>>
>>> 	spl/
>>> 	spl/common/
>>> 	spl/mmc/
>>> 	spl/nand/
>>> 	spl/onenand/
>>
>> Can you please extend this to show the SoC/board directories etc. I
>> guess they will go under spl/ and not under each media.
>
> Correct, i. e. please add for example:
>
> 	spl/board/freescale/mx31pdk/
> 	spl/board/freescale/mx31pdk/Makefile
> 	...

I thought we were going to have cpu directory SoC directory etc in this
directory structure.

>
>>> ...this changes to: "spl/Makefile, spl/common/Makefile and
>>> spl/<bootdevice>/Makefile build libraries with the generic object
>>> files at their respective level (assuming these exist).
>>
>> What's the distinction between spl/Makefile and spl/common/Makefile?
>> I guess we won't have any source files at spl/ level?
>
> I think we can implement the logic to decide which directories need to
> be entered and built into spl/Makefile, so we can keep this out of the
> top level Makefile.
>
> spl/common/Makefile is responsible for building the common code in the
> spl/common/ directory.
>
> Correct, I do not see need for any sources in spl/
>
>>> We should try to get rid of the need to create symbolic links. If we
>>> use the same source files as for the "normal", then we should also
>>> use the normal object files.
>>
>> You mean you will re-use *.o files with normal u-boot? If so, do you
>> want to create symbolic links to them in the SPL directories or use
>> them in-place?
>
> We should use them in-place. Using --gc-sections and
> -ffunction-sections we have enough granularity to select only what we
> really need.
>
>> Whether you reuse the source code or the object files we still need
>> directories for all the levels for the respective Makefiles, right?
>
> Can we not use the objects that get normally built, with the existing
> Makefiles?

But where do you add the reference to SoC level and CPU level object
files? Which library do you make them part of? I thought the board
level Makefile was meant only to build the board specific library.

For example, let's say we have board 'a' and 'b' of same SoC(soc).
Unless we have a SoC directory we may have to do something like this.

spl/board/<vendor>/a/Makefile:
OBJS := soc_1.o
OBJS += soc_2.o
OBJS += a.o

spl/board/<vendor>/b/Makefile:
OBJS := soc_1.o
OBJS += soc_2.o
OBJS += b.o

Please note that soc_1.o and soc_2.o are duplicated in the two
Makefiles. We are back to square one, right? Or did you have
something else in mind?

>
>> Also, at least some files will have to be built separately for SPL
>> because they have conditional compilation with CONFIG_PRELOADER kind of
>> flags.
>
> Please let's check where this is needed, and how we can handle this.
> I'd really like to get rid of this symlinking.

One case is start.S. We need a simplified start.S for SPL(no
relocation, no interrupt handling etc).

There are places where CONFIG_PRELOADER is used today. But maybe, these
could be avoided it we try.

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-16 12:55   ` Daniel Schwierzeck
  2011-06-16 13:10     ` Andreas Bießmann
@ 2011-06-16 13:57     ` Aneesh V
  2011-06-16 14:27       ` Daniel Schwierzeck
  2011-06-16 21:55       ` Wolfgang Denk
  2011-06-16 21:47     ` Wolfgang Denk
                       ` (8 subsequent siblings)
  10 siblings, 2 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-16 13:57 UTC (permalink / raw)
  To: u-boot

Hi Daniel,

This looks like an interesting alternative.

On Thursday 16 June 2011 06:25 PM, Daniel Schwierzeck wrote:
> Hi all,
>
> for my MIPS based boards I tested a approach similar to Wolfgang's one
> in the last weeks.
> My goal was to create a SPL image, that is able to boot from a SPI flash.
>
> The basic idea is to have a spl directory that is used as remote build
> directory for all object files
> needed for the SPL image. It contains only the Makefile and nothing
> else. This Makefile is
> a strongly simplified version of the TOPDIR/Makefile, uses
> TOPDIR/config.mk and creates
> a u-boot-spl.bin. The SPL build can be enabled by defining
> CONFIG_UBOOT_SPL in the board config file.

In the last few mails Wolfgang was suggesting re-use of object files
themselves, not the source files. In this respect his approach may be
different from yours. But I think his objective was to avoid the
symbolic link business, which this approach achieves.

>
> If the spl/Makefiles becomes active, an additional variable name
> CONFIG_UBOOT_SPL_BUILD wiil be
> exported in the make environment. Additionally
> -DCONFIG_UBOOT_SPL_BUILD will be added
> to the CFLAGS (similar to -DCONFIG_PRELOADER). This allows us to reuse
> almost of the arch, SoC and
> board code.

So, you are essentially re-using the make infrastructure of normal
U-Boot with a different top-level Makefile and the additional flags,
right?

With this scheme can you build two different SPLs for a given board,
let's say a NAND spl and another MMC spl. I don't know if this is a
valid case, but just wondering. I guess you have a unique u-boot-
spl.bin much like you have single u-boot.bin, right?

Will you be sending your patches to the list?

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-16 13:57     ` Aneesh V
@ 2011-06-16 14:27       ` Daniel Schwierzeck
  2011-06-16 21:55       ` Wolfgang Denk
  1 sibling, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-06-16 14:27 UTC (permalink / raw)
  To: u-boot

On Thu, Jun 16, 2011 at 3:57 PM, Aneesh V <aneesh@ti.com> wrote:
> Hi Daniel,
>
> This looks like an interesting alternative.
>
> On Thursday 16 June 2011 06:25 PM, Daniel Schwierzeck wrote:
>>
>> Hi all,
>>
>> for my MIPS based boards I tested a approach similar to Wolfgang's one
>> in the last weeks.
>> My goal was to create a SPL image, that is able to boot from a SPI flash.
>>
>> The basic idea is to have a spl directory that is used as remote build
>> directory for all object files
>> needed for the SPL image. It contains only the Makefile and nothing
>> else. This Makefile is
>> a strongly simplified version of the TOPDIR/Makefile, uses
>> TOPDIR/config.mk and creates
>> a u-boot-spl.bin. The SPL build can be enabled by defining
>> CONFIG_UBOOT_SPL in the board config file.
>
> In the last few mails Wolfgang was suggesting re-use of object files
> themselves, not the source files. In this respect his approach may be
> different from yours. But I think his objective was to avoid the
> symbolic link business, which this approach achieves.

I guess this requires more changes in the build system. But I wanted
to keep the diff as minimal as possible. And some files like start.S
must be recompiled with different flags. If running from SRAM you need
another monitor base address, stack pointer offset and you must disable
the relocate_code stuff. To reduce the SPL footprint you have to
disable the whole printf and console stuff, so maybe you must
recompile some drivers too.

>
>>
>> If the spl/Makefiles becomes active, an additional variable name
>> CONFIG_UBOOT_SPL_BUILD wiil be
>> exported in the make environment. Additionally
>> -DCONFIG_UBOOT_SPL_BUILD will be added
>> to the CFLAGS (similar to -DCONFIG_PRELOADER). This allows us to reuse
>> almost of the arch, SoC and
>> board code.
>
> So, you are essentially re-using the make infrastructure of normal
> U-Boot with a different top-level Makefile and the additional flags,
> right?

yes, but mainly the config.mk

>
> With this scheme can you build two different SPLs for a given board,
> let's say a NAND spl and another MMC spl. I don't know if this is a
> valid case, but just wondering. I guess you have a unique u-boot-
> spl.bin much like you have single u-boot.bin, right?

I have a single u-boot.bin and a single u-boot-spl.bin. To create
images for different boot media, I use different board configs.
For example BOARDNAME_nor or BOARDNAME_sf to boot
from NOR flash or SPI flash. The NOR image currently builds
without SPL. But there is a use case to combine a SPL image and a
compressed U-Boot image to reduce the overall flash footprint.

>
> Will you be sending your patches to the list?
>

I've pushed some sample code to
https://github.com/danielschwierzeck/u-boot-spl/commits/spl

Best regards,
Daniel

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

* [U-Boot] SPL framework re-design
  2011-06-16  8:08 [U-Boot] SPL framework re-design Aneesh V
  2011-06-16 10:47 ` Wolfgang Denk
@ 2011-06-16 16:45 ` Scott Wood
  2011-06-16 22:09   ` Wolfgang Denk
  2011-06-17  7:00   ` Aneesh V
  2011-06-28  0:55 ` Graeme Russ
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
  3 siblings, 2 replies; 172+ messages in thread
From: Scott Wood @ 2011-06-16 16:45 UTC (permalink / raw)
  To: u-boot

On Thu, 16 Jun 2011 13:38:00 +0530
Aneesh V <aneesh@ti.com> wrote:

> New Design Proposed by Wolfgang:
> * Have a top-level Makefile in the SPL root-directory - for instance
> 'nand_spl/Makefile'
> * nand_spl/Makefile builds a generic library with the generic source
> files at this level.

What is a "generic SPL library", or even a "generic NAND SPL library"?

There is no code that is shared by all NAND SPLs.  The files directly under
"nand_spl/" are alternatives that the board makefile can choose.

Counterproposal: keep the basic structure the same, but refactor the
makefiles so that they use a common template but supply their own policy.

That is, the board makefile would just set some variables to be lists of
objects it's interested in (and any other relevant tunables, or special
rules), and then include the common SPL makefile that will do all the
symlinking and building.

And no, I don't think we can get rid of building the objects separately,
and I don't want a situation where #ifdef NAND_SPL is honored in some files
but not others.

We could perhaps get rid of the symlinking and have the SPL makefile build
directly from the source into a different object location, though whether
we should depends on whether it actually makes things simpler.

> 3. Customizability - In the existing scheme what gets built into the
> SPL for a given board was completely customizable by the board level
> Makefile.

This is a critical feature for a situation where we need to fit in a tiny
space and target a variety of different hardware.

> That's no longer the case with the proposed scheme. Source
> files and Makefiles in the generic and CPU directory are shared by many
> boards. How do we allow customizability for individual boards. using
> CONFIG_ flags? This may be needed for the boards to make the right
> trade-offs based SRAM budget/requirements etc. Maybe, --gc-sections and
> -ffunction-sections help in dealing with this?

What about when code depends on #defines that are not present for a given
target, because that target isn't going to select that file?  What about
when alternative files have the same function names?

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-16 12:55   ` Daniel Schwierzeck
  2011-06-16 13:10     ` Andreas Bießmann
  2011-06-16 13:57     ` Aneesh V
@ 2011-06-16 21:47     ` Wolfgang Denk
  2011-06-17 18:45       ` Daniel Schwierzeck
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 0/7] spl framework prototype Aneesh V
                       ` (7 subsequent siblings)
  10 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-16 21:47 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <BANLkTim9AE2aszKLiDH53vd+Hjpz7GVoNA@mail.gmail.com> you wrote:
> 
> The relocate_code and board_init_r functions must not be compiled,
> they are not needed anyway. This
> can be simply controlled with -DCONFIG_UBOOT_SPL_BUILD.

This is very much wrong.  In the general case, you still need
relocation (because the final start address of the U-Boot code canonly
be determined at runtime), and you definitely need the code in
board_init_r().


> >> available in media specific directories such as nand_spl/ and mmc_spl/.
> >> Symbolic links?
> >
> > No.  Let's put this stuff into  spl/common/
>
> To use the spl directory as remote build directory, the obj and src variables
> must be tweaked a little. To keep this changes minimal, it is not possible to
> have further source files and directories inside the spl directory. I suggest to
> put common spl code in TOPDIR/lib/spl/common, TOPDIR/lib/spl/nand and so on.

No.  All SPL related stuff should go into spl/


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
There is nothing in this world constant but inconstancy.      - Swift

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

* [U-Boot] SPL framework re-design
  2011-06-16 13:38       ` Aneesh V
@ 2011-06-16 21:52         ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-16 21:52 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4DFA0759.2060606@ti.com> you wrote:
>
> >> Can you please extend this to show the SoC/board directories etc. I
> >> guess they will go under spl/ and not under each media.
> >
> > Correct, i. e. please add for example:
> >
> > 	spl/board/freescale/mx31pdk/
> > 	spl/board/freescale/mx31pdk/Makefile
> > 	...
> 
> I thought we were going to have cpu directory SoC directory etc in this
> directory structure.

If needed, yes.  This example showed a board directory.

> > Can we not use the objects that get normally built, with the existing
> > Makefiles?
> 
> But where do you add the reference to SoC level and CPU level object
> files? Which library do you make them part of? I thought the board
> level Makefile was meant only to build the board specific library.

Sorry, I don;t understand your questions (because I don't understand
which problem you see).

Yes, the board directories will contain only board specific stuff.

> For example, let's say we have board 'a' and 'b' of same SoC(soc).
> Unless we have a SoC directory we may have to do something like this.

Why should we not have a SoC dir?

> >> Also, at least some files will have to be built separately for SPL
> >> because they have conditional compilation with CONFIG_PRELOADER kind of
> >> flags.
> >
> > Please let's check where this is needed, and how we can handle this.
> > I'd really like to get rid of this symlinking.
> 
> One case is start.S. We need a simplified start.S for SPL(no
> relocation, no interrupt handling etc).

OK.

> There are places where CONFIG_PRELOADER is used today. But maybe, these
> could be avoided it we try.

We should carefully check these.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
To live is always desirable.
	-- Eleen the Capellan, "Friday's Child", stardate 3498.9

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

* [U-Boot] SPL framework re-design
  2011-06-16 13:57     ` Aneesh V
  2011-06-16 14:27       ` Daniel Schwierzeck
@ 2011-06-16 21:55       ` Wolfgang Denk
  1 sibling, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-16 21:55 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4DFA0BE1.4060608@ti.com> you wrote:
> 
> In the last few mails Wolfgang was suggesting re-use of object files
> themselves, not the source files. In this respect his approach may be
> different from yours. But I think his objective was to avoid the
> symbolic link business, which this approach achieves.

We may do both.  Such files that will compile the same (i. e. where no
specific code changes are done depending on CONFIG_PRELOADER or other
settings) should re-use the existing object files. Allothers need to
be rebuild, obviously.

But this is optimization already, which should be done in a second
stage. I will not complain when we start with rebuilding all needed
objects.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Never underestimate the bandwidth of a station wagon full of tapes.
                                -- Dr. Warren Jackson, Director, UTCS

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

* [U-Boot] SPL framework re-design
  2011-06-16 16:45 ` Scott Wood
@ 2011-06-16 22:09   ` Wolfgang Denk
  2011-06-16 22:22     ` Scott Wood
  2011-06-17  7:02     ` Aneesh V
  2011-06-17  7:00   ` Aneesh V
  1 sibling, 2 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-16 22:09 UTC (permalink / raw)
  To: u-boot

Dear Scott Wood,

In message <20110616114556.7d3c2a78@schlenkerla.am.freescale.net> you wrote:
>
> What is a "generic SPL library", or even a "generic NAND SPL library"?
> 
> There is no code that is shared by all NAND SPLs.  The files directly under
> "nand_spl/" are alternatives that the board makefile can choose.

I think there is tons of duplicated code that could and should be
extraced into common directories.

> Counterproposal: keep the basic structure the same, but refactor the
> makefiles so that they use a common template but supply their own policy.
> 
> That is, the board makefile would just set some variables to be lists of
> objects it's interested in (and any other relevant tunables, or special
> rules), and then include the common SPL makefile that will do all the
> symlinking and building.

Or put this from the head on it's feet and use a board specific
config.mk which gets included by the SPL makefile?

> We could perhaps get rid of the symlinking and have the SPL makefile build
> directly from the source into a different object location, though whether
> we should depends on whether it actually makes things simpler.

Agreed.

> > That's no longer the case with the proposed scheme. Source
> > files and Makefiles in the generic and CPU directory are shared by many
> > boards. How do we allow customizability for individual boards. using
> > CONFIG_ flags? This may be needed for the boards to make the right
> > trade-offs based SRAM budget/requirements etc. Maybe, --gc-sections and
> > -ffunction-sections help in dealing with this?
> 
> What about when code depends on #defines that are not present for a given
> target, because that target isn't going to select that file?  What about
> when alternative files have the same function names?

What do you mean?  When a target does not select (and thus build) a
file, then it does not matter which #defines are in there or not -
they don't get build anyway.  If files which export the same funcktion
names get linked together we have an error somewhere that needs to be
fixed - but this is not a new issue, this situation is the same now
already.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I dislike companies that have a we-are-the-high-priests-of-hardware-
so-you'll-like-what-we-give-you attitude. I like commodity markets in
which iron-and-silicon hawkers know that they exist to  provide  fast
toys for software types like me to play with..."    - Eric S. Raymond

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

* [U-Boot] SPL framework re-design
  2011-06-16 22:09   ` Wolfgang Denk
@ 2011-06-16 22:22     ` Scott Wood
  2011-06-17  7:02     ` Aneesh V
  1 sibling, 0 replies; 172+ messages in thread
From: Scott Wood @ 2011-06-16 22:22 UTC (permalink / raw)
  To: u-boot

On Fri, 17 Jun 2011 00:09:00 +0200
Wolfgang Denk <wd@denx.de> wrote:

> Dear Scott Wood,
> 
> In message <20110616114556.7d3c2a78@schlenkerla.am.freescale.net> you wrote:
> >
> > What is a "generic SPL library", or even a "generic NAND SPL library"?
> > 
> > There is no code that is shared by all NAND SPLs.  The files directly under
> > "nand_spl/" are alternatives that the board makefile can choose.
> 
> I think there is tons of duplicated code that could and should be
> extraced into common directories.

There's some, but really not that much that I can see.  A handful of lines
for putc/puts.  Some similar but not identical board init code within a
board family.

Extracting duplicated code into files in the common directories, which
can be picked up by the targets that want them, can be done without
significant changes to the makefile structure.

> > Counterproposal: keep the basic structure the same, but refactor the
> > makefiles so that they use a common template but supply their own policy.
> > 
> > That is, the board makefile would just set some variables to be lists of
> > objects it's interested in (and any other relevant tunables, or special
> > rules), and then include the common SPL makefile that will do all the
> > symlinking and building.
> 
> Or put this from the head on it's feet and use a board specific
> config.mk which gets included by the SPL makefile?

That's a little less flexible, but probably OK.

> > > That's no longer the case with the proposed scheme. Source
> > > files and Makefiles in the generic and CPU directory are shared by many
> > > boards. How do we allow customizability for individual boards. using
> > > CONFIG_ flags? This may be needed for the boards to make the right
> > > trade-offs based SRAM budget/requirements etc. Maybe, --gc-sections and
> > > -ffunction-sections help in dealing with this?
> > 
> > What about when code depends on #defines that are not present for a given
> > target, because that target isn't going to select that file?  What about
> > when alternative files have the same function names?
> 
> What do you mean?  When a target does not select (and thus build) a
> file, then it does not matter which #defines are in there or not -
> they don't get build anyway.

That's currently how it works, but it appeared that a suggestion was being
made to build certain code as a library before getting to what the target
wants.

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-16 16:45 ` Scott Wood
  2011-06-16 22:09   ` Wolfgang Denk
@ 2011-06-17  7:00   ` Aneesh V
  1 sibling, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-17  7:00 UTC (permalink / raw)
  To: u-boot

On Thursday 16 June 2011 10:15 PM, Scott Wood wrote:
> On Thu, 16 Jun 2011 13:38:00 +0530
> Aneesh V<aneesh@ti.com>  wrote:
>
>> New Design Proposed by Wolfgang:
>> * Have a top-level Makefile in the SPL root-directory - for instance
>> 'nand_spl/Makefile'
>> * nand_spl/Makefile builds a generic library with the generic source
>> files at this level.
>
> What is a "generic SPL library", or even a "generic NAND SPL library"?
>
> There is no code that is shared by all NAND SPLs.  The files directly under
> "nand_spl/" are alternatives that the board makefile can choose.
>
> Counterproposal: keep the basic structure the same, but refactor the
> makefiles so that they use a common template but supply their own policy.
>
> That is, the board makefile would just set some variables to be lists of
> objects it's interested in (and any other relevant tunables, or special
> rules), and then include the common SPL makefile that will do all the
> symlinking and building.

A crude form of this is what I had done in my patch-set. OMAP4 SDP and
OMAP4 Panda Makefiles were identical because there was no board
specific content. So, I moved them into an omap4.mk and rules.mk and
included these two files from the board level Makefiles. But Wolfgang
apparently didn't like this because I was having board level Makefile
despite not having any board specific content.

I still believe that extending this to more granular re-usable
components such as mmc.mk, nand.mk, console.mk, fat.mk etc may be a
less disruptive but effective solution.

>
> And no, I don't think we can get rid of building the objects separately,
> and I don't want a situation where #ifdef NAND_SPL is honored in some files
> but not others.

Agree.

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-16 22:09   ` Wolfgang Denk
  2011-06-16 22:22     ` Scott Wood
@ 2011-06-17  7:02     ` Aneesh V
  1 sibling, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-17  7:02 UTC (permalink / raw)
  To: u-boot

On Friday 17 June 2011 03:39 AM, Wolfgang Denk wrote:
> Dear Scott Wood,
>
> In message<20110616114556.7d3c2a78@schlenkerla.am.freescale.net>  you wrote:
>>
>> What is a "generic SPL library", or even a "generic NAND SPL library"?
>>
>> There is no code that is shared by all NAND SPLs.  The files directly under
>> "nand_spl/" are alternatives that the board makefile can choose.
>
> I think there is tons of duplicated code that could and should be
> extraced into common directories.
>
>> Counterproposal: keep the basic structure the same, but refactor the
>> makefiles so that they use a common template but supply their own policy.
>>
>> That is, the board makefile would just set some variables to be lists of
>> objects it's interested in (and any other relevant tunables, or special
>> rules), and then include the common SPL makefile that will do all the
>> symlinking and building.
>
> Or put this from the head on it's feet and use a board specific
> config.mk which gets included by the SPL makefile?

And also 'config.mk's that are SoC specific, CPU specific etc?
Otherwise the board specific config.mk will still duplicate SoC and CPU
content.

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-16 10:47 ` Wolfgang Denk
  2011-06-16 11:50   ` Aneesh V
  2011-06-16 12:55   ` Daniel Schwierzeck
@ 2011-06-17 16:48   ` Aneesh V
  2011-06-17 22:28     ` Scott Wood
  2011-06-21 10:59     ` Aneesh V
  2 siblings, 2 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-17 16:48 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

Here is a crude implementation of the top-down approach you had been
suggesting (or my interpretation of it). This is not complete yet and
serves only as a material for further discussions on this topic.

This work borrows from the work of Daniel Schwierzeck
staged here:
https://github.com/danielschwierzeck/u-boot-spl/commits/spl

However the approach is quite different from that of Daniel's.

Appreciate everybody's feedback about this approach.

---
  Makefile                        |    7 +++
  include/configs/omap4_sdp4430.h |    1 +
  spl/Makefile                    |   95 
+++++++++++++++++++++++++++++++++++++++
  spl/mmc/Makefile                |   55 ++++++++++++++++++++++
  4 files changed, 158 insertions(+), 0 deletions(-)
  create mode 100644 spl/Makefile
  create mode 100644 spl/mmc/Makefile

diff --git a/Makefile b/Makefile
index dcf5d93..4a2cb58 100644
--- a/Makefile
+++ b/Makefile
@@ -311,6 +311,7 @@ BOARD_SIZE_CHECK =
  endif

  # Always append ALL so that arch config.mk's can add custom ones
+ALL += spl
  ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map

  ifeq ($(CONFIG_NAND_U_BOOT),y)
@@ -326,6 +327,7 @@ ifeq ($(CONFIG_MMC_U_BOOT),y)
  ALL += $(obj)mmc_spl/u-boot-mmc-spl.bin
  endif

+
  all:		$(ALL)

  $(obj)u-boot.hex:	$(obj)u-boot
@@ -420,6 +422,9 @@ $(obj)u-boot-onenand.bin:	onenand_ipl $(obj)u-boot.bin
  mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
  		$(MAKE) -C mmc_spl/board/$(BOARDDIR) all

+spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
+	$(MAKE) -C spl/ all
+
  $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl

  $(VERSION_FILE):
@@ -1133,6 +1138,7 @@ clean:
  	@rm -f $(obj)nand_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,System.map}
  	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
  	@rm -f 
$(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
+	@rm -f 
$(obj)spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
  	@rm -f $(ONENAND_BIN)
  	@rm -f $(obj)onenand_ipl/u-boot.lds
  	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
@@ -1158,6 +1164,7 @@ clobber:	clean
  	@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l 
-print | xargs rm -f
  	@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type 
l -print | xargs rm -f
  	@[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l 
-print | xargs rm -f
+	@[ ! -d $(obj)spl ] || find $(obj)mmc_spl -name "*" -type l -print | 
xargs rm -f

  ifeq ($(OBJTREE),$(SRCTREE))
  mrproper \
diff --git a/include/configs/omap4_sdp4430.h 
b/include/configs/omap4_sdp4430.h
index 68ffa87..3122d1c 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -243,4 +243,5 @@
  #define CONFIG_SYS_PL310_BASE	0x48242000
  #endif

+#define CONFIG_SYS_SPL_MMC_SUPPORT
  #endif /* __CONFIG_H */
diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 0000000..8dc6e88
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,95 @@
+#
+# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for 
details.
+#
+
+include $(TOPDIR)/config.mk
+LIBS-$(CONFIG_SYS_SPL_MMC_SUPPORT) = mmc/libmmc.o
+# The following commented for the time-being, but will be enabled in
+# real implementation
+LIBS-$(CONFIG_SYS_SPL_FAT_SUPPORT) += fat/libfat.o
+LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += mmc/libnand.o
+LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += mmc/libonenand.o
+LIBS += $(shell if [ -f $(ARCH)/Makefile ]; then echo \
+	"$(ARCH)/lib$(ARCH).o"; fi)
+LIBS += $(shell if [ -f $(ARCH)/$(CPU)/Makefile ]; then echo \
+	"$(ARCH)/$(CPU)/lib$(CPU).o"; fi)
+LIBS += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/Makefile ]; then echo \
+	"$(ARCH)/$(CPU)/$(SOC)/lib$(SOC).o"; fi)
+LIBS += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/$(BOARD)/Makefile ]; then 
echo \
+	"$(ARCH)/$(CPU)/$(SOC)/$(BOARD)/lib$(BOARD).o"; fi)
+
+LIBS-y := $(addprefix $(obj),$(sort $(LIBS-y)))
+
+__LIBS := $(subst $(obj),,$(LIBS-y))
+
+ifndef SPL_LDSCRIPT
+	ifdef CONFIG_SYS_SPL_LDSCRIPT
+		# need to strip off double quotes
+		SPL_LDSCRIPT := $(subst ",,$(CONFIG_SYS_SPL_LDSCRIPT))
+	endif
+endif
+
+ifndef SPL_LDSCRIPT
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+		SPL_LDSCRIPT := 
$(TOPDIR)/spl/$(ARCH)/$(CPU)/$(SOC)/$(BOARDDIR)/u-boot-spl.lds
+	endif
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+		SPL_LDSCRIPT := $(TOPDIR)/spl/$(ARCH)/$(CPU)/$(SOC)/u-boot-spl.lds
+	endif
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+		SPL_LDSCRIPT := $(TOPDIR)/spl/$(ARCH)/$(CPU)/u-boot-spl.lds
+	endif
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+$(error could not find linker script)
+	endif
+endif
+LNDIR		:= $(OBJTREE)/spl
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+	$(shell $(LD) --version | \
+	  sed -ne 's/GNU ld version 
\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+ALL	= $(obj)u-boot-spl.bin
+
+all:	$(ALL)
+
+$(obj)u-boot-spl.bin:	$(obj)u-boot-spl
+	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS-y) | \
+	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+	cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM \
+		--start-group $(__LIBS) --end-group \
+		-Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl: 	depend $(LIBS-y) $(SPL_LDSCRIPT) $(obj)u-boot-spl.lds
+	$(GEN_UBOOT)
+
+$(OBJS):	depend
+		$(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+
+$(LIBS-y):	depend
+		$(MAKE) -C $(dir $(subst $(obj),,$@)) all
+
+$(SPL_LDSCRIPT): depend
+	$(MAKE) -C $(dir $@) $(notdir $@)
+
+$(obj)u-boot-spl.lds: $(SPL_LDSCRIPT)
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:	$(obj).depend
+.PHONY: depend
+
+clean:
+	# TODO: implement clean to support in-tree builds
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
diff --git a/spl/mmc/Makefile b/spl/mmc/Makefile
new file mode 100644
index 0000000..b4f7efd
--- /dev/null
+++ b/spl/mmc/Makefile
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)libmmc.o
+
+$(obj)mmc.c:
+	@rm -f $@
+	@ln -s $(TOPDIR)/drivers/mmc/mmc.c $@
+
+$(obj)omap_hsmmc.c:
+	@rm -f $@
+	@ln -s $(TOPDIR)/drivers/mmc/omap_hsmmc.c $@
+
+
+COBJS			:= mmc.o
+COBJS			+= omap_hsmmc.o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
-- 
1.7.0.4

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

* [U-Boot] SPL framework re-design
  2011-06-16 21:47     ` Wolfgang Denk
@ 2011-06-17 18:45       ` Daniel Schwierzeck
  2011-06-17 18:51         ` Scott Wood
  0 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-06-17 18:45 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Thu, Jun 16, 2011 at 11:47 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Daniel Schwierzeck,
>
> In message <BANLkTim9AE2aszKLiDH53vd+Hjpz7GVoNA@mail.gmail.com> you wrote:
>>
>> The relocate_code and board_init_r functions must not be compiled,
>> they are not needed anyway. This
>> can be simply controlled with -DCONFIG_UBOOT_SPL_BUILD.
>
> This is very much wrong. ?In the general case, you still need
> relocation (because the final start address of the U-Boot code canonly
> be determined at runtime), and you definitely need the code in
> board_init_r().

I guess we are talking about different kinds of SPL. In my understanding a SPL
runs inside an internal SRAM, initializes any external RAM and loads
U-Boot from
any kind of memory or flash device into that RAM at a fixed load address and
then jumps to that address. In this case no relocation is needed.  Some kind
of SoC specific booting mechanism like a NAND-IPL or hard-wired Boot-ROM
loads the SPL initially into SRAM and jumps to it.

>
>
>> >> available in media specific directories such as nand_spl/ and mmc_spl/.
>> >> Symbolic links?
>> >
>> > No. ?Let's put this stuff into ?spl/common/
>>
>> To use the spl directory as remote build directory, the obj and src variables
>> must be tweaked a little. To keep this changes minimal, it is not possible to
>> have further source files and directories inside the spl directory. I suggest to
>> put common spl code in TOPDIR/lib/spl/common, TOPDIR/lib/spl/nand and so on.
>
> No. ?All SPL related stuff should go into spl/

ok

Best regards,
Daniel

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

* [U-Boot] SPL framework re-design
  2011-06-17 18:45       ` Daniel Schwierzeck
@ 2011-06-17 18:51         ` Scott Wood
  0 siblings, 0 replies; 172+ messages in thread
From: Scott Wood @ 2011-06-17 18:51 UTC (permalink / raw)
  To: u-boot

On Fri, 17 Jun 2011 20:45:19 +0200
Daniel Schwierzeck <daniel.schwierzeck@googlemail.com> wrote:

> Dear Wolfgang,
> 
> On Thu, Jun 16, 2011 at 11:47 PM, Wolfgang Denk <wd@denx.de> wrote:
> > Dear Daniel Schwierzeck,
> >
> > In message <BANLkTim9AE2aszKLiDH53vd+Hjpz7GVoNA@mail.gmail.com> you wrote:
> >>
> >> The relocate_code and board_init_r functions must not be compiled,
> >> they are not needed anyway. This
> >> can be simply controlled with -DCONFIG_UBOOT_SPL_BUILD.
> >
> > This is very much wrong. ?In the general case, you still need
> > relocation (because the final start address of the U-Boot code canonly
> > be determined at runtime), and you definitely need the code in
> > board_init_r().
> 
> I guess we are talking about different kinds of SPL. In my understanding a SPL
> runs inside an internal SRAM, initializes any external RAM and loads
> U-Boot from
> any kind of memory or flash device into that RAM at a fixed load address and
> then jumps to that address. In this case no relocation is needed.  Some kind
> of SoC specific booting mechanism like a NAND-IPL or hard-wired Boot-ROM
> loads the SPL initially into SRAM and jumps to it.

It starts from an SRAM, but often relocates to RAM before loading the final
image.  In some cases the SRAM is also used by hardware as the I/O buffer,
so we need to vacate it before any further NAND operations.

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-17 16:48   ` [U-Boot] SPL framework re-design Aneesh V
@ 2011-06-17 22:28     ` Scott Wood
  2011-06-19 10:22       ` V, Aneesh
  2011-06-21 10:59     ` Aneesh V
  1 sibling, 1 reply; 172+ messages in thread
From: Scott Wood @ 2011-06-17 22:28 UTC (permalink / raw)
  To: u-boot

On Fri, 17 Jun 2011 22:18:57 +0530
Aneesh V <aneesh@ti.com> wrote:

> @@ -1158,6 +1164,7 @@ clobber:	clean
>   	@[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l 
> -print | xargs rm -f
>   	@[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type 
> l -print | xargs rm -f
>   	@[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l 
> -print | xargs rm -f
> +	@[ ! -d $(obj)spl ] || find $(obj)mmc_spl -name "*" -type l -print | 
> xargs rm -f

That last mmc_spl should just be spl.

> +LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += mmc/libnand.o
> +LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += mmc/libonenand.o

Why are these in mmc?

What is it you propose would be in these files?

> +$(LIBS-y):	depend
> +		$(MAKE) -C $(dir $(subst $(obj),,$@)) all

If no libraries are selected, this will produce a rule with an empty
target, which is undefined behavior.

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-17 22:28     ` Scott Wood
@ 2011-06-19 10:22       ` V, Aneesh
  2011-06-20 16:19         ` Scott Wood
  0 siblings, 1 reply; 172+ messages in thread
From: V, Aneesh @ 2011-06-19 10:22 UTC (permalink / raw)
  To: u-boot

On Sat, Jun 18, 2011 at 3:58 AM, Scott Wood <scottwood@freescale.com> wrote:
> On Fri, 17 Jun 2011 22:18:57 +0530
> Aneesh V <aneesh@ti.com> wrote:
>
>> @@ -1158,6 +1164,7 @@ clobber: ? ? ? ?clean
>> ? ? ? @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l
>> -print | xargs rm -f
>> ? ? ? @[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type
>> l -print | xargs rm -f
>> ? ? ? @[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l
>> -print | xargs rm -f
>> + ? ? @[ ! -d $(obj)spl ] || find $(obj)mmc_spl -name "*" -type l -print |
>> xargs rm -f
>
> That last mmc_spl should just be spl.
>
>> +LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += mmc/libnand.o
>> +LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += mmc/libonenand.o

Oops!! That was a copy paste error. It was intended to be:
+LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += nand/libnand.o
+LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += onenand/libonenand.o

>
> Why are these in mmc?
>
> What is it you propose would be in these files?
>
>> +$(LIBS-y): ? depend
>> + ? ? ? ? ? ? $(MAKE) -C $(dir $(subst $(obj),,$@)) all
>
> If no libraries are selected, this will produce a rule with an empty
> target, which is undefined behavior.

The top-level Makefile doesn't include any source files by itself.
All SPL content comes from one or more of libraries. So, there
will be at least one library defined, I believe(unless there
is an error, of course).

>
> -Scott
>
>

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

* [U-Boot] SPL framework re-design
  2011-06-19 10:22       ` V, Aneesh
@ 2011-06-20 16:19         ` Scott Wood
  2011-06-21  3:22           ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Scott Wood @ 2011-06-20 16:19 UTC (permalink / raw)
  To: u-boot

On Sun, 19 Jun 2011 15:52:29 +0530
"V, Aneesh" <aneesh@ti.com> wrote:

> On Sat, Jun 18, 2011 at 3:58 AM, Scott Wood <scottwood@freescale.com> wrote:
> > On Fri, 17 Jun 2011 22:18:57 +0530
> > Aneesh V <aneesh@ti.com> wrote:
> >
> >> @@ -1158,6 +1164,7 @@ clobber: ? ? ? ?clean
> >> ? ? ? @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l
> >> -print | xargs rm -f
> >> ? ? ? @[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type
> >> l -print | xargs rm -f
> >> ? ? ? @[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l
> >> -print | xargs rm -f
> >> + ? ? @[ ! -d $(obj)spl ] || find $(obj)mmc_spl -name "*" -type l -print |
> >> xargs rm -f
> >
> > That last mmc_spl should just be spl.
> >
> >> +LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += mmc/libnand.o
> >> +LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += mmc/libonenand.o
> 
> Oops!! That was a copy paste error. It was intended to be:
> +LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += nand/libnand.o
> +LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += onenand/libonenand.o

Still, what would go in those files?

It'd have to be something more specific, like:

LIBS-$(CONFIG_SYS_SPL_NAND_SIMPLE) += nand/nand_boot.o
LIBS-$(CONFIG_SYS_SPL_NAND_FSL_ELBC) += nand/nand_boot_fsl_elbc.o
...

Hmm, I guess you'd stick this in a recursive makefile.  Seems like overkill.

> The top-level Makefile doesn't include any source files by itself.
> All SPL content comes from one or more of libraries. So, there
> will be at least one library defined, I believe(unless there
> is an error, of course).

Couldn't there be only OBJS?

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-20 16:19         ` Scott Wood
@ 2011-06-21  3:22           ` Aneesh V
  0 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-21  3:22 UTC (permalink / raw)
  To: u-boot

On Monday 20 June 2011 09:49 PM, Scott Wood wrote:
> On Sun, 19 Jun 2011 15:52:29 +0530
> "V, Aneesh"<aneesh@ti.com>  wrote:
>
>> On Sat, Jun 18, 2011 at 3:58 AM, Scott Wood<scottwood@freescale.com>  wrote:
>>> On Fri, 17 Jun 2011 22:18:57 +0530
>>> Aneesh V<aneesh@ti.com>  wrote:
>>>
>>>> @@ -1158,6 +1164,7 @@ clobber:        clean
>>>>        @[ ! -d $(obj)nand_spl ] || find $(obj)nand_spl -name "*" -type l
>>>> -print | xargs rm -f
>>>>        @[ ! -d $(obj)onenand_ipl ] || find $(obj)onenand_ipl -name "*" -type
>>>> l -print | xargs rm -f
>>>>        @[ ! -d $(obj)mmc_spl ] || find $(obj)mmc_spl -name "*" -type l
>>>> -print | xargs rm -f
>>>> +     @[ ! -d $(obj)spl ] || find $(obj)mmc_spl -name "*" -type l -print |
>>>> xargs rm -f
>>>
>>> That last mmc_spl should just be spl.
>>>
>>>> +LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += mmc/libnand.o
>>>> +LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += mmc/libonenand.o
>>
>> Oops!! That was a copy paste error. It was intended to be:
>> +LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += nand/libnand.o
>> +LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += onenand/libonenand.o
>
> Still, what would go in those files?

That's actually one rule per sub-directory in the directory structure.
What goes in there can be decided by the respective Makefile in the
sub-directory. It can have more fine-grained selection like what you
have mentioned below.

>
> It'd have to be something more specific, like:
>
> LIBS-$(CONFIG_SYS_SPL_NAND_SIMPLE) += nand/nand_boot.o
> LIBS-$(CONFIG_SYS_SPL_NAND_FSL_ELBC) += nand/nand_boot_fsl_elbc.o
> ...
>
> Hmm, I guess you'd stick this in a recursive makefile.  Seems like overkill.
>
>> The top-level Makefile doesn't include any source files by itself.
>> All SPL content comes from one or more of libraries. So, there
>> will be at least one library defined, I believe(unless there
>> is an error, of course).
>
> Couldn't there be only OBJS?

It looks to me at the moment that the root directory for SPL, 'spl/',
need not have any source files. We will have an spl/common directory
for such needs(I forgot to add this in the list of libraries)

If this framework looks reasonable I shall go ahead an convert the
OMAP4 spl to this framework, so that we can thrash out some more
details.

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-17 16:48   ` [U-Boot] SPL framework re-design Aneesh V
  2011-06-17 22:28     ` Scott Wood
@ 2011-06-21 10:59     ` Aneesh V
  2011-06-25  8:06       ` Aneesh V
  2011-06-25 12:10       ` Wolfgang Denk
  1 sibling, 2 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-21 10:59 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Friday 17 June 2011 10:18 PM, Aneesh V wrote:
> Dear Wolfgang,
>
> Here is a crude implementation of the top-down approach you had been
> suggesting (or my interpretation of it). This is not complete yet and
> serves only as a material for further discussions on this topic.

Here is an updated version of my prototype implementation with fixes
for some issues pointed out by Scott. Please let me know your views
about this.

---
  Makefile                        |    5 ++
  include/configs/omap4_sdp4430.h |    1 +
  spl/Makefile                    |   94 
+++++++++++++++++++++++++++++++++++++++
  spl/mmc/Makefile                |   55 +++++++++++++++++++++++
  4 files changed, 155 insertions(+), 0 deletions(-)
  create mode 100644 spl/Makefile
  create mode 100644 spl/mmc/Makefile

diff --git a/Makefile b/Makefile
index 8540e39..0321634 100644
--- a/Makefile
+++ b/Makefile
@@ -316,6 +316,7 @@ BOARD_SIZE_CHECK =
  endif

  # Always append ALL so that arch config.mk's can add custom ones
+ALL += spl
  ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map

  ifeq ($(CONFIG_NAND_U_BOOT),y)
@@ -428,6 +429,9 @@ $(obj)u-boot-onenand.bin:	onenand_ipl $(obj)u-boot.bin
  mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
  		$(MAKE) -C mmc_spl/board/$(BOARDDIR) all

+spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
+	$(MAKE) -C spl/ all
+
  $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl

  $(VERSION_FILE):
@@ -1142,6 +1146,7 @@ clean:
  	@rm -f $(obj)spl/{u-boot-spl-generated.lds,u-boot-spl,u-boot-spl.map}
  	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
  	@rm -f 
$(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
+	@rm -f 
$(obj)spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
  	@rm -f $(ONENAND_BIN)
  	@rm -f $(obj)onenand_ipl/u-boot.lds
  	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
diff --git a/include/configs/omap4_sdp4430.h 
b/include/configs/omap4_sdp4430.h
index c424951..c9adc3c 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -257,4 +257,5 @@
  /* 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM */
  #define CONFIG_SYS_TEXT_BASE		0x80100000

+#define CONFIG_SYS_SPL_MMC_SUPPORT
  #endif /* __CONFIG_H */
diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 0000000..9e3a5b1
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,94 @@
+#
+# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for 
details.
+#
+
+include $(TOPDIR)/config.mk
+LIBS-$(CONFIG_SYS_SPL_MMC_SUPPORT) = mmc/libmmc.o
+LIBS-$(CONFIG_SYS_SPL_FAT_SUPPORT) += fat/libfat.o
+LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += nand/libnand.o
+LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += onenand/libonenand.o
+
+LIBS-y += $(shell if [ -f $(ARCH)/Makefile ]; then echo \
+	"$(ARCH)/lib$(ARCH).o"; fi)
+LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/Makefile ]; then echo \
+	"$(ARCH)/$(CPU)/lib$(CPU).o"; fi)
+LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/Makefile ]; then echo \
+	"$(ARCH)/$(CPU)/$(SOC)/lib$(SOC).o"; fi)
+LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/$(BOARD)/Makefile ]; 
then echo \
+	"$(ARCH)/$(CPU)/$(SOC)/$(BOARD)/lib$(BOARD).o"; fi)
+
+LIBS-y := $(addprefix $(obj),$(sort $(LIBS-y)))
+
+__LIBS := $(subst $(obj),,$(LIBS-y))
+
+ifndef SPL_LDSCRIPT
+	ifdef CONFIG_SYS_SPL_LDSCRIPT
+		# need to strip off double quotes
+		SPL_LDSCRIPT := $(subst ",,$(CONFIG_SYS_SPL_LDSCRIPT))
+	endif
+endif
+
+ifndef SPL_LDSCRIPT
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+		SPL_LDSCRIPT := 
$(TOPDIR)/spl/$(ARCH)/$(CPU)/$(SOC)/$(BOARDDIR)/u-boot-spl.lds
+	endif
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+		SPL_LDSCRIPT := $(TOPDIR)/spl/$(ARCH)/$(CPU)/$(SOC)/u-boot-spl.lds
+	endif
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+		SPL_LDSCRIPT := $(TOPDIR)/spl/$(ARCH)/$(CPU)/u-boot-spl.lds
+	endif
+	ifeq ($(wildcard $(SPL_LDSCRIPT)),)
+$(error could not find linker script)
+	endif
+endif
+LNDIR		:= $(OBJTREE)/spl
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+	$(shell $(LD) --version | \
+	  sed -ne 's/GNU ld version 
\([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+ALL	= $(obj)u-boot-spl.bin
+
+all:	$(ALL)
+
+$(obj)u-boot-spl.bin:	$(obj)u-boot-spl
+	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS-y) | \
+	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+	cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM \
+		--start-group $(__LIBS) --end-group \
+		-Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl: 	depend $(LIBS-y) $(SPL_LDSCRIPT) $(obj)u-boot-spl.lds
+	$(GEN_UBOOT)
+
+$(OBJS):	depend
+		$(MAKE) -C $(CPUDIR) $(if $(REMOTE_BUILD),$@,$(notdir $@))
+
+$(LIBS-y):	depend
+		$(MAKE) -C $(dir $(subst $(obj),,$@)) all
+
+$(SPL_LDSCRIPT): depend
+	$(MAKE) -C $(dir $@) $(notdir $@)
+
+$(obj)u-boot-spl.lds: $(SPL_LDSCRIPT)
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:	$(obj).depend
+.PHONY: depend
+
+clean:
+	# TODO: implement clean to support in-tree builds
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
diff --git a/spl/mmc/Makefile b/spl/mmc/Makefile
new file mode 100644
index 0000000..b4f7efd
--- /dev/null
+++ b/spl/mmc/Makefile
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# See file CREDITS for list of people who contributed to this
+# project.
+#
+# This program is free software; you can redistribute it and/or
+# modify it under the terms of the GNU General Public License as
+# published by the Free Software Foundation; either version 2 of
+# the License, or (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+# MA 02111-1307 USA
+#
+
+include $(TOPDIR)/config.mk
+
+LIB	= $(obj)libmmc.o
+
+$(obj)mmc.c:
+	@rm -f $@
+	@ln -s $(TOPDIR)/drivers/mmc/mmc.c $@
+
+$(obj)omap_hsmmc.c:
+	@rm -f $@
+	@ln -s $(TOPDIR)/drivers/mmc/omap_hsmmc.c $@
+
+
+COBJS			:= mmc.o
+COBJS			+= omap_hsmmc.o
+
+SRCS	:= $(COBJS:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS))
+
+all:	$(obj).depend $(LIB)
+
+$(LIB):	$(OBJS)
+	$(call cmd_link_o_target, $(OBJS))
+
+#########################################################################
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
+sinclude $(obj).depend
+
+#########################################################################
-- 
1.7.0.4

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

* [U-Boot] SPL framework re-design
  2011-06-21 10:59     ` Aneesh V
@ 2011-06-25  8:06       ` Aneesh V
  2011-06-25 12:10       ` Wolfgang Denk
  1 sibling, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-25  8:06 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Tuesday 21 June 2011 04:29 PM, Aneesh V wrote:
> Dear Wolfgang,
>
> On Friday 17 June 2011 10:18 PM, Aneesh V wrote:
>> Dear Wolfgang,
>>
>> Here is a crude implementation of the top-down approach you had been
>> suggesting (or my interpretation of it). This is not complete yet and
>> serves only as a material for further discussions on this topic.
>
> Here is an updated version of my prototype implementation with fixes
> for some issues pointed out by Scott. Please let me know your views
> about this.

I guess you are busy with the release. When will you get a chance to
look at this so that I can continue with the work once we are aligned
on the design.

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-21 10:59     ` Aneesh V
  2011-06-25  8:06       ` Aneesh V
@ 2011-06-25 12:10       ` Wolfgang Denk
  2011-06-25 16:11         ` Daniel Schwierzeck
  2011-06-27  4:19         ` Aneesh V
  1 sibling, 2 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-25 12:10 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4E00799A.5040302@ti.com> you wrote:
>
> > Here is a crude implementation of the top-down approach you had been
> > suggesting (or my interpretation of it). This is not complete yet and
> > serves only as a material for further discussions on this topic.
> 
> Here is an updated version of my prototype implementation with fixes
> for some issues pointed out by Scott. Please let me know your views
> about this.
> 
> ---
>   Makefile                        |    5 ++
>   include/configs/omap4_sdp4430.h |    1 +
>   spl/Makefile                    |   94 
> +++++++++++++++++++++++++++++++++++++++
>   spl/mmc/Makefile                |   55 +++++++++++++++++++++++
>   4 files changed, 155 insertions(+), 0 deletions(-)
>   create mode 100644 spl/Makefile
>   create mode 100644 spl/mmc/Makefile
> 
> diff --git a/Makefile b/Makefile
> index 8540e39..0321634 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -316,6 +316,7 @@ BOARD_SIZE_CHECK =
>   endif
> 
>   # Always append ALL so that arch config.mk's can add custom ones
> +ALL += spl
>   ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map

This patch seems strangely white-space corrupted.

>   ifeq ($(CONFIG_NAND_U_BOOT),y)
> @@ -428,6 +429,9 @@ $(obj)u-boot-onenand.bin:	onenand_ipl $(obj)u-boot.bin
>   mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
>   		$(MAKE) -C mmc_spl/board/$(BOARDDIR) all
> 
> +spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
> +	$(MAKE) -C spl/ all
> +
>   $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl

The mmc_spl/ is suppoed to be moved into spl/, isn't it?

>   $(VERSION_FILE):
> @@ -1142,6 +1146,7 @@ clean:
>   	@rm -f $(obj)spl/{u-boot-spl-generated.lds,u-boot-spl,u-boot-spl.map}
>   	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}

Dito here for onenand_ipl/ ?

>   	@rm -f 
> $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}

...also line-wrapped.

> +	@rm -f 
> $(obj)spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}

Make this:

	@rm -f $(obj)spl/u-boot{.lds,-spl,-spl.map,-spl.bin,-mmc-spl.bin}

instead.

>   	@rm -f $(ONENAND_BIN)
>   	@rm -f $(obj)onenand_ipl/u-boot.lds

Goes away?

> --- /dev/null
> +++ b/spl/Makefile
> @@ -0,0 +1,94 @@
> +#
> +# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.

Really???

> +# This file is released under the terms of GPL v2 and any later version.
> +# See the file COPYING in the root directory of the source tree for 
> details.
> +#
> +
> +include $(TOPDIR)/config.mk
> +LIBS-$(CONFIG_SYS_SPL_MMC_SUPPORT) = mmc/libmmc.o
> +LIBS-$(CONFIG_SYS_SPL_FAT_SUPPORT) += fat/libfat.o
> +LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += nand/libnand.o
> +LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += onenand/libonenand.o

As Mike mentioned, we can eventually directly include the OBJSs here
and omit the building of libraries?

> +LIBS-y += $(shell if [ -f $(ARCH)/Makefile ]; then echo \
> +	"$(ARCH)/lib$(ARCH).o"; fi)
> +LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/Makefile ]; then echo \
> +	"$(ARCH)/$(CPU)/lib$(CPU).o"; fi)
> +LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/Makefile ]; then echo \
> +	"$(ARCH)/$(CPU)/$(SOC)/lib$(SOC).o"; fi)
> +LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/$(BOARD)/Makefile ]; 
> then echo \
> +	"$(ARCH)/$(CPU)/$(SOC)/$(BOARD)/lib$(BOARD).o"; fi)

We should probably use /$(BOARDDIR)? here instead of /$(BOARD)/ to
allow for vendor directories (where "BOARDDIR = $(VENDOR)/$(BOARD)").

> +ALL	= $(obj)u-boot-spl.bin
> +
> +all:	$(ALL)

Do we need ALL then at all?

...
> diff --git a/spl/mmc/Makefile b/spl/mmc/Makefile
> new file mode 100644
> index 0000000..b4f7efd
> --- /dev/null
> +++ b/spl/mmc/Makefile
> @@ -0,0 +1,55 @@
> +#
> +# (C) Copyright 2000-2003
> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.

Really???

> +$(obj)mmc.c:
> +	@rm -f $@
> +	@ln -s $(TOPDIR)/drivers/mmc/mmc.c $@
> +
> +$(obj)omap_hsmmc.c:
> +	@rm -f $@
> +	@ln -s $(TOPDIR)/drivers/mmc/omap_hsmmc.c $@

Hm... can we try to do without the symlinks?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The whole problem with the world is  that  fools  and  fanatics  are
always so certain of themselves, but wiser people so full of doubts."
- Bertrand Russell

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

* [U-Boot] SPL framework re-design
  2011-06-25 12:10       ` Wolfgang Denk
@ 2011-06-25 16:11         ` Daniel Schwierzeck
  2011-06-27  4:19         ` Aneesh V
  1 sibling, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-06-25 16:11 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On 06/25/2011 02:10 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4E00799A.5040302@ti.com>  you wrote:
>>
>>> Here is a crude implementation of the top-down approach you had been
>>> suggesting (or my interpretation of it). This is not complete yet and
>>> serves only as a material for further discussions on this topic.
>>
>> Here is an updated version of my prototype implementation with fixes
>> for some issues pointed out by Scott. Please let me know your views
>> about this.
>>
>> ---
>>    Makefile                        |    5 ++
>>    include/configs/omap4_sdp4430.h |    1 +
>>    spl/Makefile                    |   94
>> +++++++++++++++++++++++++++++++++++++++
>>    spl/mmc/Makefile                |   55 +++++++++++++++++++++++
>>    4 files changed, 155 insertions(+), 0 deletions(-)
>>    create mode 100644 spl/Makefile
>>    create mode 100644 spl/mmc/Makefile
>>
>> diff --git a/Makefile b/Makefile
>> index 8540e39..0321634 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -316,6 +316,7 @@ BOARD_SIZE_CHECK =
>>    endif
>>
>>    # Always append ALL so that arch config.mk's can add custom ones
>> +ALL += spl
>>    ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
>
> This patch seems strangely white-space corrupted.
>
>>    ifeq ($(CONFIG_NAND_U_BOOT),y)
>> @@ -428,6 +429,9 @@ $(obj)u-boot-onenand.bin:	onenand_ipl $(obj)u-boot.bin
>>    mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
>>    		$(MAKE) -C mmc_spl/board/$(BOARDDIR) all
>>
>> +spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
>> +	$(MAKE) -C spl/ all
>> +
>>    $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
>
> The mmc_spl/ is suppoed to be moved into spl/, isn't it?
>
>>    $(VERSION_FILE):
>> @@ -1142,6 +1146,7 @@ clean:
>>    	@rm -f $(obj)spl/{u-boot-spl-generated.lds,u-boot-spl,u-boot-spl.map}
>>    	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
>
> Dito here for onenand_ipl/ ?
>
>>    	@rm -f
>> $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
>
> ...also line-wrapped.
>
>> +	@rm -f
>> $(obj)spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
>
> Make this:
>
> 	@rm -f $(obj)spl/u-boot{.lds,-spl,-spl.map,-spl.bin,-mmc-spl.bin}
>
> instead.
>
>>    	@rm -f $(ONENAND_BIN)
>>    	@rm -f $(obj)onenand_ipl/u-boot.lds
>
> Goes away?
>
>> --- /dev/null
>> +++ b/spl/Makefile
>> @@ -0,0 +1,94 @@
>> +#
>> +# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
>
> Really???

That is only because Aneesh used my experimental Makefile that I 
published for discussion and to show one possible solution for
the top-down design.

>
>> +# This file is released under the terms of GPL v2 and any later version.
>> +# See the file COPYING in the root directory of the source tree for
>> details.
>> +#
>> +
>> +include $(TOPDIR)/config.mk
>> +LIBS-$(CONFIG_SYS_SPL_MMC_SUPPORT) = mmc/libmmc.o
>> +LIBS-$(CONFIG_SYS_SPL_FAT_SUPPORT) += fat/libfat.o
>> +LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += nand/libnand.o
>> +LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += onenand/libonenand.o
>
> As Mike mentioned, we can eventually directly include the OBJSs here
> and omit the building of libraries?

What about files which need to recompiled with a different configuration?
For example I have a use case (MIPS based) that reuses parts of the CPU 
and board lowlevel init code. This SPL runs in a SoC internal SRAM,
initializes the memory controller, needs no relocation, have a different
stack offset and copies the real U-Boot from SPI flash to RAM.
At least I have to recompile start.S without relocate_code() and
a different stack pointer initialization.

>
>> +LIBS-y += $(shell if [ -f $(ARCH)/Makefile ]; then echo \
>> +	"$(ARCH)/lib$(ARCH).o"; fi)
>> +LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/Makefile ]; then echo \
>> +	"$(ARCH)/$(CPU)/lib$(CPU).o"; fi)
>> +LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/Makefile ]; then echo \
>> +	"$(ARCH)/$(CPU)/$(SOC)/lib$(SOC).o"; fi)
>> +LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/$(BOARD)/Makefile ];
>> then echo \
>> +	"$(ARCH)/$(CPU)/$(SOC)/$(BOARD)/lib$(BOARD).o"; fi)
>
> We should probably use /$(BOARDDIR)? here instead of /$(BOARD)/ to
> allow for vendor directories (where "BOARDDIR = $(VENDOR)/$(BOARD)").
>
>> +ALL	= $(obj)u-boot-spl.bin
>> +
>> +all:	$(ALL)
>
> Do we need ALL then at all?

actually not. The original spl/Makefile is only a strongly simplified 
version of the top-level Makefile.

>
> ...
>> diff --git a/spl/mmc/Makefile b/spl/mmc/Makefile
>> new file mode 100644
>> index 0000000..b4f7efd
>> --- /dev/null
>> +++ b/spl/mmc/Makefile
>> @@ -0,0 +1,55 @@
>> +#
>> +# (C) Copyright 2000-2003
>> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
>
> Really???
>
>> +$(obj)mmc.c:
>> +	@rm -f $@
>> +	@ln -s $(TOPDIR)/drivers/mmc/mmc.c $@
>> +
>> +$(obj)omap_hsmmc.c:
>> +	@rm -f $@
>> +	@ln -s $(TOPDIR)/drivers/mmc/omap_hsmmc.c $@
>
> Hm... can we try to do without the symlinks?

that is possible with if you play a little with the src and obj 
variables in config.mk

Best regards,
Daniel

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

* [U-Boot] SPL framework re-design
  2011-06-16 13:10     ` Andreas Bießmann
@ 2011-06-26 23:17       ` Ilya Yanok
  2011-06-27  4:29         ` Aneesh V
  2011-06-27  9:27         ` Wolfgang Denk
  0 siblings, 2 replies; 172+ messages in thread
From: Ilya Yanok @ 2011-06-26 23:17 UTC (permalink / raw)
  To: u-boot

Hello everybody,

I've read the whole thread and I really like what Daniel suggests but I just
want to speak it in a little bit different words.

I wonder why do we need this whole spl thing in the first place (well,
surely I know what they are used for but why do we need a separate entity
for this)? Isn't it just the same U-Boot in, well, very special configuration
(minimal set of drivers, no shell, etc)? Why do we need a whole shadow tree
at spl/ instead of just providing the _configuration_?

Am I missing something?

Aneesh, what's the state of your patches? I'm especially interrested in
OMAP3 (AM3517) support. Maybe I will be able to help you.

Regards, Ilya.

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

* [U-Boot] SPL framework re-design
  2011-06-25 12:10       ` Wolfgang Denk
  2011-06-25 16:11         ` Daniel Schwierzeck
@ 2011-06-27  4:19         ` Aneesh V
  2011-06-27  9:27           ` Wolfgang Denk
  1 sibling, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-06-27  4:19 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Saturday 25 June 2011 05:40 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4E00799A.5040302@ti.com>  you wrote:
>>
>>> Here is a crude implementation of the top-down approach you had been
>>> suggesting (or my interpretation of it). This is not complete yet and
>>> serves only as a material for further discussions on this topic.
>>
>> Here is an updated version of my prototype implementation with fixes
>> for some issues pointed out by Scott. Please let me know your views
>> about this.
>>
>> ---
>>    Makefile                        |    5 ++
>>    include/configs/omap4_sdp4430.h |    1 +
>>    spl/Makefile                    |   94
>> +++++++++++++++++++++++++++++++++++++++
>>    spl/mmc/Makefile                |   55 +++++++++++++++++++++++
>>    4 files changed, 155 insertions(+), 0 deletions(-)
>>    create mode 100644 spl/Makefile
>>    create mode 100644 spl/mmc/Makefile
>>
>> diff --git a/Makefile b/Makefile
>> index 8540e39..0321634 100644
>> --- a/Makefile
>> +++ b/Makefile
>> @@ -316,6 +316,7 @@ BOARD_SIZE_CHECK =
>>    endif
>>
>>    # Always append ALL so that arch config.mk's can add custom ones
>> +ALL += spl
>>    ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
>
> This patch seems strangely white-space corrupted.

Maybe, because I copy-pasted in Thunderbird instead of git-send-mail.

>
>>    ifeq ($(CONFIG_NAND_U_BOOT),y)
>> @@ -428,6 +429,9 @@ $(obj)u-boot-onenand.bin:	onenand_ipl $(obj)u-boot.bin
>>    mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
>>    		$(MAKE) -C mmc_spl/board/$(BOARDDIR) all
>>
>> +spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
>> +	$(MAKE) -C spl/ all
>> +
>>    $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
>
> The mmc_spl/ is suppoed to be moved into spl/, isn't it?

This patch was intended only as a prototype for the new directory
structure. I didn't bother to touch the existing stuff.

>
>>    $(VERSION_FILE):
>> @@ -1142,6 +1146,7 @@ clean:
>>    	@rm -f $(obj)spl/{u-boot-spl-generated.lds,u-boot-spl,u-boot-spl.map}
>>    	@rm -f $(obj)onenand_ipl/onenand-{ipl,ipl.bin,ipl.map}
>
> Dito here for onenand_ipl/ ?
>
>>    	@rm -f
>> $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
>
> ...also line-wrapped.
>
>> +	@rm -f
>> $(obj)spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
>
> Make this:
>
> 	@rm -f $(obj)spl/u-boot{.lds,-spl,-spl.map,-spl.bin,-mmc-spl.bin}
>
> instead.

ok.

>
>>    	@rm -f $(ONENAND_BIN)
>>    	@rm -f $(obj)onenand_ipl/u-boot.lds
>
> Goes away?

I am yet to think about the migration of existing code. If it's mere
movement of code I should be able to do it for all. But if it is about
re-factoring the code of other SoCs, I will not be able to do it. Hope
respective maintainers will take care of that.

>
>> --- /dev/null
>> +++ b/spl/Makefile
>> @@ -0,0 +1,94 @@
>> +#
>> +# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
>
> Really???

I copied Daniel's Makefile and started from there.

>
>> +# This file is released under the terms of GPL v2 and any later version.
>> +# See the file COPYING in the root directory of the source tree for
>> details.
>> +#
>> +
>> +include $(TOPDIR)/config.mk
>> +LIBS-$(CONFIG_SYS_SPL_MMC_SUPPORT) = mmc/libmmc.o
>> +LIBS-$(CONFIG_SYS_SPL_FAT_SUPPORT) += fat/libfat.o
>> +LIBS-$(CONFIG_SYS_SPL_NAND_SUPPORT) += nand/libnand.o
>> +LIBS-$(CONFIG_SYS_SPL_ONENAND_SUPPORT) += onenand/libonenand.o
>
> As Mike mentioned, we can eventually directly include the OBJSs here
> and omit the building of libraries?

I can't seem to find a mail from Mike on this thread. Did I miss any
mail?

Do you mean re-using equivalent libraries from the normal U-Boot
without re-compiling them?

>
>> +LIBS-y += $(shell if [ -f $(ARCH)/Makefile ]; then echo \
>> +	"$(ARCH)/lib$(ARCH).o"; fi)
>> +LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/Makefile ]; then echo \
>> +	"$(ARCH)/$(CPU)/lib$(CPU).o"; fi)
>> +LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/Makefile ]; then echo \
>> +	"$(ARCH)/$(CPU)/$(SOC)/lib$(SOC).o"; fi)
>> +LIBS-y += $(shell if [ -f $(ARCH)/$(CPU)/$(SOC)/$(BOARD)/Makefile ];
>> then echo \
>> +	"$(ARCH)/$(CPU)/$(SOC)/$(BOARD)/lib$(BOARD).o"; fi)
>
> We should probably use /$(BOARDDIR)? here instead of /$(BOARD)/ to
> allow for vendor directories (where "BOARDDIR = $(VENDOR)/$(BOARD)").

I didn't want to make the directory structure any longer than required.
But I can add this if required.

>
>> +ALL	= $(obj)u-boot-spl.bin
>> +
>> +all:	$(ALL)
>
> Do we need ALL then at all?

ok. I will remove it.
>
> ...
>> diff --git a/spl/mmc/Makefile b/spl/mmc/Makefile
>> new file mode 100644
>> index 0000000..b4f7efd
>> --- /dev/null
>> +++ b/spl/mmc/Makefile
>> @@ -0,0 +1,55 @@
>> +#
>> +# (C) Copyright 2000-2003
>> +# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
>
> Really???

Again I copied the Makefile from arch/arm/cpu/armv7/Makefile as a
template.

>
>> +$(obj)mmc.c:
>> +	@rm -f $@
>> +	@ln -s $(TOPDIR)/drivers/mmc/mmc.c $@
>> +
>> +$(obj)omap_hsmmc.c:
>> +	@rm -f $@
>> +	@ln -s $(TOPDIR)/drivers/mmc/omap_hsmmc.c $@
>
> Hm... can we try to do without the symlinks?

Well. I think it's difficult. Most of my hardware initialization such
as clock init, SDRAM init etc need to know under what context it
is getting executed. The context can be:
1. SPL
2. Regular U-Boot executing from NOR flash
3. Regular U-Boot executing from SDRAM
etc.

Based on the context, the level of initialization will differ, but most
of the code could still be shared between these different contexts.

While the identification between a NOR boot and SDRAM boot is
determined run-time the distinction between SPL and normal U-Boot is
made based on CONFIG_PRELOADER.

Also, as mentioned by Daniel, start.S needs some customization for SPL.

Also, I agree with Scott's opinion that re-compiling some files while
re-using the binary of some other files won't be a good idea. In this
case, CONFIG_PRELOADER will be honored in some files but not in other
files. That will be a source of confusion for developers.

If you want to do away with symlinks, I would propose going with
Daniel's approach. This uses /spl as a remote building directory, but
do not create any symlinks.

Daniel,
You mentioned that /spl can not be used for source files. Isn't there a
way to workaround this problem?

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-26 23:17       ` Ilya Yanok
@ 2011-06-27  4:29         ` Aneesh V
  2011-06-27  8:24           ` Ilya Yanok
                             ` (2 more replies)
  2011-06-27  9:27         ` Wolfgang Denk
  1 sibling, 3 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-27  4:29 UTC (permalink / raw)
  To: u-boot

Hi Ilya,

On Monday 27 June 2011 04:47 AM, Ilya Yanok wrote:
> Hello everybody,
>
> I've read the whole thread and I really like what Daniel suggests but I just
> want to speak it in a little bit different words.
>
> I wonder why do we need this whole spl thing in the first place (well,
> surely I know what they are used for but why do we need a separate entity
> for this)? Isn't it just the same U-Boot in, well, very special configuration
> (minimal set of drivers, no shell, etc)? Why do we need a whole shadow tree
> at spl/ instead of just providing the _configuration_?
>
> Am I missing something?

The reason is that the regular U-Boot is not configurable enough to
build the extremely small images that should fit in internal RAM. The
last time I attempted, I ended up getting an ~60KB image for
OMAP4(that too without any of the hardware initialization I am adding
in my SPL work).

>
> Aneesh, what's the state of your patches? I'm especially interrested in
> OMAP3 (AM3517) support. Maybe I will be able to help you.

I should be able to send out an updated revision of my series once we
finalize on the new framework for SPL.

BTW, John Rigby had sent out a series sometime back for OMAP3 NAND SPL.
That can be integrated with my work and we will get an SPL that
supports both MMC and NAND. I guess Simon Schwarz is also doing some
work lately on OMAP3.

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-27  4:29         ` Aneesh V
@ 2011-06-27  8:24           ` Ilya Yanok
  2011-06-27  9:08             ` Aneesh V
  2011-06-27  8:42           ` Simon Schwarz
  2011-06-27  9:36           ` Wolfgang Denk
  2 siblings, 1 reply; 172+ messages in thread
From: Ilya Yanok @ 2011-06-27  8:24 UTC (permalink / raw)
  To: u-boot

Hi Aneesh,

On 27.06.2011 08:29, Aneesh V wrote:
>> I wonder why do we need this whole spl thing in the first place (well,
>> surely I know what they are used for but why do we need a separate entity
>> for this)? Isn't it just the same U-Boot in, well, very special
>> configuration
>> (minimal set of drivers, no shell, etc)? Why do we need a whole shadow
>> tree
>> at spl/ instead of just providing the _configuration_?
>>
>> Am I missing something?
> 
> The reason is that the regular U-Boot is not configurable enough to
> build the extremely small images that should fit in internal RAM. The
> last time I attempted, I ended up getting an ~60KB image for
> OMAP4(that too without any of the hardware initialization I am adding
> in my SPL work).

Yes, surely I understand that currently U-Boot is not configurable
enough to meet hard SPL constraints. But why don't we add the required
configuration options instead of implementing the SPL thing separately?
Again, maybe I'm missing something but it looks like not very difficult
task to add the required configuration options and this approach seems
to be more straight to me...

>> Aneesh, what's the state of your patches? I'm especially interrested in
>> OMAP3 (AM3517) support. Maybe I will be able to help you.
> 
> I should be able to send out an updated revision of my series once we
> finalize on the new framework for SPL.
> 
> BTW, John Rigby had sent out a series sometime back for OMAP3 NAND SPL.
> That can be integrated with my work and we will get an SPL that
> supports both MMC and NAND. I guess Simon Schwarz is also doing some
> work lately on OMAP3.

Thanks for the pointers, I will take a look.

Regards, Ilya.

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

* [U-Boot] SPL framework re-design
  2011-06-27  4:29         ` Aneesh V
  2011-06-27  8:24           ` Ilya Yanok
@ 2011-06-27  8:42           ` Simon Schwarz
  2011-06-27  9:36           ` Wolfgang Denk
  2 siblings, 0 replies; 172+ messages in thread
From: Simon Schwarz @ 2011-06-27  8:42 UTC (permalink / raw)
  To: u-boot

Hi,

> You mentioned that /spl can not be used for source files. Isn't there a
> way to workaround this problem?
Why should we have source files in a SPL directory? I would prefer to
have spl specific sources right where the rest ist - maybe marked with
something like _spl or excluded by some #define-test. If we have a SPL
specific directory we have to copy most of the tree (arch/cpu etc.)
which in my eyes is totally unnecessary if we don't do the symlinking
stuff...

> Also, I agree with Scott's opinion that re-compiling some files while
> re-using the binary of some other files won't be a good idea. In this
> case, CONFIG_PRELOADER will be honored in some files but not in other
> files. That will be a source of confusion for developers.
I also see this as the biggest problem with reusing the object-files.
It will add more complexity than a simple re-run with different flags
like suggested by Daniel.

> BTW, John Rigby had sent out a series sometime back for OMAP3 NAND SPL.
> That can be integrated with my work and we will get an SPL that
> supports both MMC and NAND. I guess Simon Schwarz is also doing some
> work lately on OMAP3.
I am working on OMAP3 (on devkit8000). If this discussion comes to a
conclusion soon I would prefer sending the patches with the new SPL
format.

Regards
Simon

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

* [U-Boot] SPL framework re-design
  2011-06-27  8:24           ` Ilya Yanok
@ 2011-06-27  9:08             ` Aneesh V
  0 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-27  9:08 UTC (permalink / raw)
  To: u-boot

Hi Ilya,

On Monday 27 June 2011 01:54 PM, Ilya Yanok wrote:
> Hi Aneesh,
>
> On 27.06.2011 08:29, Aneesh V wrote:
>>> I wonder why do we need this whole spl thing in the first place (well,
>>> surely I know what they are used for but why do we need a separate entity
>>> for this)? Isn't it just the same U-Boot in, well, very special
>>> configuration
>>> (minimal set of drivers, no shell, etc)? Why do we need a whole shadow
>>> tree
>>> at spl/ instead of just providing the _configuration_?
>>>
>>> Am I missing something?
>>
>> The reason is that the regular U-Boot is not configurable enough to
>> build the extremely small images that should fit in internal RAM. The
>> last time I attempted, I ended up getting an ~60KB image for
>> OMAP4(that too without any of the hardware initialization I am adding
>> in my SPL work).
>
> Yes, surely I understand that currently U-Boot is not configurable
> enough to meet hard SPL constraints. But why don't we add the required
> configuration options instead of implementing the SPL thing separately?
> Again, maybe I'm missing something but it looks like not very difficult
> task to add the required configuration options and this approach seems
> to be more straight to me...
>

I agree. SPL, as I understand, was an easy workaround for this problem.
But if we are spending a lot of time on SPL framework, we may rather
solve the real problem(Oh no, I am not volunteering:-)) Honestly,
I have no idea how much effort that will be.

Actually, I had raised this point sometime back. But that was more in
favor of keeping SPL the way it is now and not adding anymore
complexity.

http://news.gmane.org/find-root.php?group=gmane.comp.boot-loaders.u-boot&article=100550

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-27  4:19         ` Aneesh V
@ 2011-06-27  9:27           ` Wolfgang Denk
  2011-06-27 14:56             ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-27  9:27 UTC (permalink / raw)
  To: u-boot

Dear Aneesh,

In message <4E0804DC.8090805@ti.com> you wrote:
>
> >> +spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
> >> +	$(MAKE) -C spl/ all
> >> +
> >>    $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
> >
> > The mmc_spl/ is suppoed to be moved into spl/, isn't it?
> 
> This patch was intended only as a prototype for the new directory
> structure. I didn't bother to touch the existing stuff.

I see.

> >> --- /dev/null
> >> +++ b/spl/Makefile
> >> @@ -0,0 +1,94 @@
> >> +#
> >> +# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
> >
> > Really???
> 
> I copied Daniel's Makefile and started from there.

I guess the only real part that was left from the old file is the GPL
header...

> > As Mike mentioned, we can eventually directly include the OBJSs here
> > and omit the building of libraries?
> 
> I can't seem to find a mail from Mike on this thread. Did I miss any
> mail?

I can find it either.  I don't know what I had in mind then.

> Do you mean re-using equivalent libraries from the normal U-Boot
> without re-compiling them?

There are actually two different topics here:

- The first is how to link all the objects in the spl/ tree together.
  As I understand, you proposal was to link all objects in each of the
  subdirectories into a library, and then link all the libraries
  together.

  Instead of doing this, we could as well just maintain a list of
  objects and then link all these together directly, without creating
  libraries first.

- The other topic is if to build new object files, and where.  At the
  moment we have two situations:

  * Some files are built with special options such that unneeded code
    gets commented out using respecive #ifdef's / #ifndef's.  We can
    probably get rid of (most of ?) these #ifdef's / #ifndef's when
    properly using -ffunction-sections / --gc-sections

    Why should we then recompile the code?

  * Some files (start.S) really need different code.  Here the
    questions is more how and where to recompile using proper options.
    I would be glad if we could get rid of the symlinking.  Maybe we
    can add respective build rules to the original Makefiles (see also
    proposal by Ilya,
    http://article.gmane.org/gmane.comp.boot-loaders.u-boot/102033 ),
    eventually just using a different suffix, say ".splo" instead of
    ".o"?

> > allow for vendor directories (where "BOARDDIR = $(VENDOR)/$(BOARD)").
> 
> I didn't want to make the directory structure any longer than required.
> But I can add this if required.

It will be needed.

> > Hm... can we try to do without the symlinks?
> 
> Well. I think it's difficult. Most of my hardware initialization such
> as clock init, SDRAM init etc need to know under what context it
> is getting executed. The context can be:
> 1. SPL
> 2. Regular U-Boot executing from NOR flash
> 3. Regular U-Boot executing from SDRAM
> etc.

Agreed - we need another, independent set of object files.  But cannot
we create these in the existent source tree?

> If you want to do away with symlinks, I would propose going with
> Daniel's approach. This uses /spl as a remote building directory, but
> do not create any symlinks.

Yes, this is an improvement over the current situation - but Ilya's
question is a good one: why do we need the pl/ subtree in the first
place?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"You shouldn't make my toaster angry." - Household security explained
in "Johnny Quest"

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

* [U-Boot] SPL framework re-design
  2011-06-26 23:17       ` Ilya Yanok
  2011-06-27  4:29         ` Aneesh V
@ 2011-06-27  9:27         ` Wolfgang Denk
  2011-06-27 13:42           ` Daniel Schwierzeck
  2011-06-27 18:34           ` Scott Wood
  1 sibling, 2 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-27  9:27 UTC (permalink / raw)
  To: u-boot

Dear Ilya,

In message <loom.20110627T010402-587@post.gmane.org> you wrote:
> 
> I wonder why do we need this whole spl thing in the first place (well,
> surely I know what they are used for but why do we need a separate entity
> for this)? Isn't it just the same U-Boot in, well, very special configuration
> (minimal set of drivers, no shell, etc)? Why do we need a whole shadow tree
> at spl/ instead of just providing the _configuration_?

Good point.  Eventually we can  just add additional build rules for
new object files (say, ".splo" instead of ".o") ?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Have you lived in this village all your life?"        "No, not yet."

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

* [U-Boot] SPL framework re-design
  2011-06-27  4:29         ` Aneesh V
  2011-06-27  8:24           ` Ilya Yanok
  2011-06-27  8:42           ` Simon Schwarz
@ 2011-06-27  9:36           ` Wolfgang Denk
  2011-06-27 18:42             ` Scott Wood
  2 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-27  9:36 UTC (permalink / raw)
  To: u-boot

Dear Aneesh,

In message <4E080733.2030001@ti.com> you wrote:
> 
> > I wonder why do we need this whole spl thing in the first place (well,
> > surely I know what they are used for but why do we need a separate entity
> > for this)? Isn't it just the same U-Boot in, well, very special configuration
> > (minimal set of drivers, no shell, etc)? Why do we need a whole shadow tree
> > at spl/ instead of just providing the _configuration_?
> >
> > Am I missing something?
> 
> The reason is that the regular U-Boot is not configurable enough to
> build the extremely small images that should fit in internal RAM. The
> last time I attempted, I ended up getting an ~60KB image for
> OMAP4(that too without any of the hardware initialization I am adding
> in my SPL work).

This statement does not make much sense to me.  If we can do it in the
spl/ directory, we should be able to do it in any other directory as
well.  The worst to happen is that we have to keep two setsof object
files separated, but chosing a different suffix should be sufficient.


> BTW, John Rigby had sent out a series sometime back for OMAP3 NAND SPL.

Yes, but AFAIR he never followed up to the requested changes.

> That can be integrated with my work and we will get an SPL that
> supports both MMC and NAND. I guess Simon Schwarz is also doing some
> work lately on OMAP3.

OK, so we have all the more reason to do this thorougly now.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Applying computer technology is simply finding the  right  wrench  to
pound in the correct screw.

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

* [U-Boot] SPL framework re-design
  2011-06-27  9:27         ` Wolfgang Denk
@ 2011-06-27 13:42           ` Daniel Schwierzeck
  2011-06-27 20:48             ` Wolfgang Denk
  2011-06-27 18:34           ` Scott Wood
  1 sibling, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-06-27 13:42 UTC (permalink / raw)
  To: u-boot

Hi,

On Mon, Jun 27, 2011 at 11:27 AM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Ilya,
>
> In message <loom.20110627T010402-587@post.gmane.org> you wrote:
>>
>> I wonder why do we need this whole spl thing in the first place (well,
>> surely I know what they are used for but why do we need a separate entity
>> for this)? Isn't it just the same U-Boot in, well, very special configuration
>> (minimal set of drivers, no shell, etc)? Why do we need a whole shadow tree
>> at spl/ instead of just providing the _configuration_?

I guess that is because the discussion started with several
directories (nand_spl, mmc_spl etc.)
which should be merged into a single spl directory.

>
> Good point. ?Eventually we can ?just add additional build rules for
> new object files (say, ".splo" instead of ".o") ?

I agree this approach seems to be the best one.
But then we have to create SPL-specific libraries too, right?
(e.g. lib$(ARCH).splo, lib$(CPU).splo)


Best regards,
Daniel

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

* [U-Boot] SPL framework re-design
  2011-06-27  9:27           ` Wolfgang Denk
@ 2011-06-27 14:56             ` Aneesh V
  2011-06-27 20:49               ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-06-27 14:56 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Monday 27 June 2011 02:57 PM, Wolfgang Denk wrote:
> Dear Aneesh,
>
> In message<4E0804DC.8090805@ti.com>  you wrote:
>>
>>>> +spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
>>>> +	$(MAKE) -C spl/ all
>>>> +
>>>>     $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
>>>
>>> The mmc_spl/ is suppoed to be moved into spl/, isn't it?
>>
>> This patch was intended only as a prototype for the new directory
>> structure. I didn't bother to touch the existing stuff.
>
> I see.
>
>>>> --- /dev/null
>>>> +++ b/spl/Makefile
>>>> @@ -0,0 +1,94 @@
>>>> +#
>>>> +# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
>>>
>>> Really???
>>
>> I copied Daniel's Makefile and started from there.
>
> I guess the only real part that was left from the old file is the GPL
> header...
>
>>> As Mike mentioned, we can eventually directly include the OBJSs here
>>> and omit the building of libraries?
>>
>> I can't seem to find a mail from Mike on this thread. Did I miss any
>> mail?
>
> I can find it either.  I don't know what I had in mind then.
>
>> Do you mean re-using equivalent libraries from the normal U-Boot
>> without re-compiling them?
>
> There are actually two different topics here:
>
> - The first is how to link all the objects in the spl/ tree together.
>    As I understand, you proposal was to link all objects in each of the
>    subdirectories into a library, and then link all the libraries
>    together.
>
>    Instead of doing this, we could as well just maintain a list of
>    objects and then link all these together directly, without creating
>    libraries first.
>

Is this like a make variable that keeps accumulating objects
from sub-directories? If so, is that through a *.mk at each level and
including all these *.mk at the top level Makefile. Or is there some 
other idea?

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-27  9:27         ` Wolfgang Denk
  2011-06-27 13:42           ` Daniel Schwierzeck
@ 2011-06-27 18:34           ` Scott Wood
  2011-06-27 20:50             ` Wolfgang Denk
  1 sibling, 1 reply; 172+ messages in thread
From: Scott Wood @ 2011-06-27 18:34 UTC (permalink / raw)
  To: u-boot

On Mon, 27 Jun 2011 11:27:31 +0200
Wolfgang Denk <wd@denx.de> wrote:

> Dear Ilya,
> 
> In message <loom.20110627T010402-587@post.gmane.org> you wrote:
> > 
> > I wonder why do we need this whole spl thing in the first place (well,
> > surely I know what they are used for but why do we need a separate entity
> > for this)? Isn't it just the same U-Boot in, well, very special configuration
> > (minimal set of drivers, no shell, etc)? Why do we need a whole shadow tree
> > at spl/ instead of just providing the _configuration_?
> 
> Good point.  Eventually we can  just add additional build rules for
> new object files (say, ".splo" instead of ".o") ?

No need for new extensions -- we should be able to use the target
directory to influence rule selection.

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-27  9:36           ` Wolfgang Denk
@ 2011-06-27 18:42             ` Scott Wood
  2011-06-27 20:54               ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Scott Wood @ 2011-06-27 18:42 UTC (permalink / raw)
  To: u-boot

On Mon, 27 Jun 2011 11:36:33 +0200
Wolfgang Denk <wd@denx.de> wrote:

> Dear Aneesh,
> 
> In message <4E080733.2030001@ti.com> you wrote:
> > 
> > > I wonder why do we need this whole spl thing in the first place (well,
> > > surely I know what they are used for but why do we need a separate entity
> > > for this)? Isn't it just the same U-Boot in, well, very special configuration
> > > (minimal set of drivers, no shell, etc)? Why do we need a whole shadow tree
> > > at spl/ instead of just providing the _configuration_?
> > >
> > > Am I missing something?
> > 
> > The reason is that the regular U-Boot is not configurable enough to
> > build the extremely small images that should fit in internal RAM. The
> > last time I attempted, I ended up getting an ~60KB image for
> > OMAP4(that too without any of the hardware initialization I am adding
> > in my SPL work).
> 
> This statement does not make much sense to me.  If we can do it in the
> spl/ directory, we should be able to do it in any other directory as
> well.  The worst to happen is that we have to keep two setsof object
> files separated, but chosing a different suffix should be sufficient.

We do it in the spl/ directory by bypassing the normal makefile
config system, specifying a board-and-spl-specific list of objects instead.

It could of course be done with the standard config system, but it will
require that every bit of code in U-Boot be enabled only with a particular
config option -- no "always on" code.  This would be a good thing anyway,
but it will take some work to do it cleanly.  A first step would probably
be a global "finegrained/small" flag that configs use to opt into the
new system, but eventually all bits of functionality should have
appropriate individual config symbols.

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-27 13:42           ` Daniel Schwierzeck
@ 2011-06-27 20:48             ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-27 20:48 UTC (permalink / raw)
  To: u-boot

Dear Daniel,

In message <BANLkTin-s=wZnPTu8eJ7s_GZ9HRRV-PAXA@mail.gmail.com> you wrote:
> 
> > Good point.   Eventually we can   just add additional build rules for
> > new object files (say, ".splo" instead of ".o") ?
>
> I agree this approach seems to be the best one.
> But then we have to create SPL-specific libraries too, right?
> (e.g. lib$(ARCH).splo, lib$(CPU).splo)

Not necessarily.  We might instead just link the object files we
build.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"This is a test of the Emergency Broadcast System. If this had been an
actual emergency, do you really think we'd stick around to tell you?"

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

* [U-Boot] SPL framework re-design
  2011-06-27 14:56             ` Aneesh V
@ 2011-06-27 20:49               ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-27 20:49 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4E089A25.4050009@ti.com> you wrote:
> 
> >    Instead of doing this, we could as well just maintain a list of
> >    objects and then link all these together directly, without creating
> >    libraries first.
> 
> Is this like a make variable that keeps accumulating objects
> from sub-directories? If so, is that through a *.mk at each level and
> including all these *.mk at the top level Makefile. Or is there some 
> other idea?

Well, if we do it right and build only such objects we actually need
for the target binary, we might not need any explicit rules at all and
instead just use file globbing to link all objects we find.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I express preference for a chronological  sequence  of  events  which
precludes a violence.   - Terry Pratchett, _The Dark Side of the Sun_

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

* [U-Boot] SPL framework re-design
  2011-06-27 18:34           ` Scott Wood
@ 2011-06-27 20:50             ` Wolfgang Denk
  2011-06-27 20:55               ` Scott Wood
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-27 20:50 UTC (permalink / raw)
  To: u-boot

Dear Scott Wood,

In message <20110627133435.31cd3271@schlenkerla.am.freescale.net> you wrote:
>
> > Good point.  Eventually we can  just add additional build rules for
> > new object files (say, ".splo" instead of ".o") ?
> 
> No need for new extensions -- we should be able to use the target
> directory to influence rule selection.

But if we do not create a new hierarchy of target directories we will
have the "normal" and the "spl" objects in parallel (and I don't want
to delete one when building the other).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Karl's version of Parkinson's Law: Work expands to  exceed  the  time
alloted it.

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

* [U-Boot] SPL framework re-design
  2011-06-27 18:42             ` Scott Wood
@ 2011-06-27 20:54               ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-27 20:54 UTC (permalink / raw)
  To: u-boot

Dear Scott Wood,

In message <20110627134205.021af180@schlenkerla.am.freescale.net> you wrote:
>
> > This statement does not make much sense to me.  If we can do it in the
> > spl/ directory, we should be able to do it in any other directory as
> > well.  The worst to happen is that we have to keep two setsof object
> > files separated, but chosing a different suffix should be sufficient.
> 
> We do it in the spl/ directory by bypassing the normal makefile
> config system, specifying a board-and-spl-specific list of objects instead.

We can provide such a "board-and-spl-specific list of objects" for the
spl code in the normal Makefiles as well.

> It could of course be done with the standard config system, but it will
> require that every bit of code in U-Boot be enabled only with a particular
> config option -- no "always on" code.  This would be a good thing anyway,
> but it will take some work to do it cleanly.  A first step would probably
> be a global "finegrained/small" flag that configs use to opt into the
> new system, but eventually all bits of functionality should have
> appropriate individual config symbols.

If we do it right, we will only build such objects in spl
configuration that are needed for the spl linking.  So we can start
with this finer control for spl initially, and then (later) extend it
for "normal" builds as well.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The only way to get rid of a temptation is to yield to it.
                                                        - Oscar Wilde

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

* [U-Boot] SPL framework re-design
  2011-06-27 20:50             ` Wolfgang Denk
@ 2011-06-27 20:55               ` Scott Wood
  2011-06-27 21:10                 ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Scott Wood @ 2011-06-27 20:55 UTC (permalink / raw)
  To: u-boot

On Mon, 27 Jun 2011 22:50:46 +0200
Wolfgang Denk <wd@denx.de> wrote:

> Dear Scott Wood,
> 
> In message <20110627133435.31cd3271@schlenkerla.am.freescale.net> you wrote:
> >
> > > Good point.  Eventually we can  just add additional build rules for
> > > new object files (say, ".splo" instead of ".o") ?
> > 
> > No need for new extensions -- we should be able to use the target
> > directory to influence rule selection.
> 
> But if we do not create a new hierarchy of target directories we will
> have the "normal" and the "spl" objects in parallel (and I don't want
> to delete one when building the other).

What's wrong with creating a new hierarchy of target directories?  It
would be like specifying a different output directory.

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-27 20:55               ` Scott Wood
@ 2011-06-27 21:10                 ` Wolfgang Denk
  2011-06-27 21:18                   ` Scott Wood
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-27 21:10 UTC (permalink / raw)
  To: u-boot

Dear Scott Wood,

In message <20110627155535.4217b15b@schlenkerla.am.freescale.net> you wrote:
>
> > But if we do not create a new hierarchy of target directories we will
> > have the "normal" and the "spl" objects in parallel (and I don't want
> > to delete one when building the other).
> 
> What's wrong with creating a new hierarchy of target directories?  It
> would be like specifying a different output directory.

The question came up what we need it for.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"I haven't lost my mind - it's backed up on tape somewhere."

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

* [U-Boot] SPL framework re-design
  2011-06-27 21:10                 ` Wolfgang Denk
@ 2011-06-27 21:18                   ` Scott Wood
  2011-06-27 21:22                     ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Scott Wood @ 2011-06-27 21:18 UTC (permalink / raw)
  To: u-boot

On Mon, 27 Jun 2011 23:10:33 +0200
Wolfgang Denk <wd@denx.de> wrote:

> Dear Scott Wood,
> 
> In message <20110627155535.4217b15b@schlenkerla.am.freescale.net> you wrote:
> >
> > > But if we do not create a new hierarchy of target directories we will
> > > have the "normal" and the "spl" objects in parallel (and I don't want
> > > to delete one when building the other).
> > 
> > What's wrong with creating a new hierarchy of target directories?  It
> > would be like specifying a different output directory.
> 
> The question came up what we need it for.

Just seems cleaner to me than jamming it into the file extension.  If we're
treating it as a separate build, it should go into a separate place.  It's
not really a different type of file.

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-27 21:18                   ` Scott Wood
@ 2011-06-27 21:22                     ` Wolfgang Denk
  2011-06-28  6:54                       ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-27 21:22 UTC (permalink / raw)
  To: u-boot

Dear Scott Wood,

In message <20110627161803.16783c48@schlenkerla.am.freescale.net> you wrote:
>
> > > > But if we do not create a new hierarchy of target directories we will
> > > > have the "normal" and the "spl" objects in parallel (and I don't want
> > > > to delete one when building the other).
> > > 
> > > What's wrong with creating a new hierarchy of target directories?  It
> > > would be like specifying a different output directory.
> > 
> > The question came up what we need it for.
> 
> Just seems cleaner to me than jamming it into the file extension.  If we're
> treating it as a separate build, it should go into a separate place.  It's
> not really a different type of file.

I'm fine with that as well.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A modem is a baudy house.

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

* [U-Boot] SPL framework re-design
  2011-06-16  8:08 [U-Boot] SPL framework re-design Aneesh V
  2011-06-16 10:47 ` Wolfgang Denk
  2011-06-16 16:45 ` Scott Wood
@ 2011-06-28  0:55 ` Graeme Russ
  2011-06-28  4:10   ` Wolfgang Denk
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
  3 siblings, 1 reply; 172+ messages in thread
From: Graeme Russ @ 2011-06-28  0:55 UTC (permalink / raw)
  To: u-boot

Hi All,

Just thought I'd throw in a left-field idea...

Could we make the loading of U-Boot into a generic multi-stage framework
with each stage bootstrapping the next stage? OK, I know this is how IPL,
SPL etc work already, but I'm thinking something more formal and arch
independent.

I can think of three disctinct phases which are relatively commong across
most arch's (especially NAND Flash arches)

1) An intial page (say 256 bytes for example) which loads a second stage
   into the CPU's cache
2) A second phase running in the CPU cache which initialises SDRAM and
   loads the remainder into main memory (performs relocations etc)
3) A final phase which is U-Boot proper, running at the final target
   address in SDRAM

Now what I'm thinking is that if we formalise these loader stages, we
could actually add a little more flexibility by, say, allowing the final
U-Boot binary to reside on a file-system. And even break the final binary
up into smaller 'run-once-and-discard' chunks. For example, a lot of the
low level init is only ever done once, but it stays in SDRAM as a
permanent piece of the U-Boot image - What if the second stage loader
could instead load an low-level init blob and run it before loading the
final U-Boot blob?

This then opens the door for all sort of options - What if U-Boot commands
were build into stand-alone binary blobs and only loaded when needed. Same
with device drivers

So a lot of what is now build-time configuration could be reduced to
run-time configuration

Just a few wild ideas...

Regards,

Graeme

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

* [U-Boot] SPL framework re-design
  2011-06-28  0:55 ` Graeme Russ
@ 2011-06-28  4:10   ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-06-28  4:10 UTC (permalink / raw)
  To: u-boot

Dear Graeme Russ,

In message <BANLkTinAPvRprePfnsOyPJERTu6hZGA-Pg@mail.gmail.com> you wrote:
> 
> I can think of three disctinct phases which are relatively commong across
> most arch's (especially NAND Flash arches)
> 
> 1) An intial page (say 256 bytes for example) which loads a second stage
>    into the CPU's cache
> 2) A second phase running in the CPU cache which initialises SDRAM and
>    loads the remainder into main memory (performs relocations etc)
> 3) A final phase which is U-Boot proper, running at the final target
>    address in SDRAM

The thing is that we have many different architectures, and NAND
booting systems are just one configuration out of many.

Depending on your architecture, the initialization of the RAM may be
semi-automatic (with just very few parameters needed), or data-driven
(you have to provide some magic data blob that gets interpreted by
some ROM code), or completely manual (where you have to pay close
attentian to insert the correct N microseconds delay here and there in
your code, as required by the RAM data sheet).

If you look back at the trouble reports from people who ported U-Boot
(and Linux) to their platforms you can see that RAM initialization
problems have always been a major problem area.

This experience, collected over many years, has led to the design we
have now:
http://www.denx.de/wiki/view/U-Boot/DesignPrinciples#6_Keep_it_Debuggable

Having debug output on the console as soon as possible is a pretty
important design goal; if technically possible, we do want to have
debug output long before initializing the RAM.  Unfortunately, this
pulls in a lot of dependencies: bigger parts of the code like printf()
and friends, access to the environment (to read the baudrate settings,
etc.)

> Now what I'm thinking is that if we formalise these loader stages, we
> could actually add a little more flexibility by, say, allowing the final
> U-Boot binary to reside on a file-system. And even break the final binary
> up into smaller 'run-once-and-discard' chunks. For example, a lot of the
> low level init is only ever done once, but it stays in SDRAM as a
> permanent piece of the U-Boot image - What if the second stage loader
> could instead load an low-level init blob and run it before loading the
> final U-Boot blob?

You would most probably lose the capability to have early debug
messages.

> This then opens the door for all sort of options - What if U-Boot commands
> were build into stand-alone binary blobs and only loaded when needed. Same
> with device drivers

Device drivers clearly need a rework.  But I'm not sure if dynamic
loading is as easy as you imagine it - we have a large number of
architectures here, and you need some support (drivers, file system
[or other structured storage space]) to koads objects from external
storage.

> So a lot of what is now build-time configuration could be reduced to
> run-time configuration

It sounds like a nice idea, but I fear there are a lots of devils in
the details.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A memorandum is written not to inform the reader, but to protect  the
writer.                                               -- Dean Acheson

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

* [U-Boot] SPL framework re-design
  2011-06-27 21:22                     ` Wolfgang Denk
@ 2011-06-28  6:54                       ` Aneesh V
  2011-06-28 16:18                         ` Scott Wood
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-06-28  6:54 UTC (permalink / raw)
  To: u-boot

On Tuesday 28 June 2011 02:52 AM, Wolfgang Denk wrote:
> Dear Scott Wood,
>
> In message<20110627161803.16783c48@schlenkerla.am.freescale.net>  you wrote:
>>
>>>>> But if we do not create a new hierarchy of target directories we will
>>>>> have the "normal" and the "spl" objects in parallel (and I don't want
>>>>> to delete one when building the other).
>>>>
>>>> What's wrong with creating a new hierarchy of target directories?  It
>>>> would be like specifying a different output directory.
>>>
>>> The question came up what we need it for.
>>
>> Just seems cleaner to me than jamming it into the file extension.  If we're
>> treating it as a separate build, it should go into a separate place.  It's
>> not really a different type of file.
>
> I'm fine with that as well.

I too think this approach is cleaner. This is essentially Daniel's
approach. So, we can use some of his code. There are couple of open 
points though:

1. If there are SPL customized generic files like the
nand_spl/nand_boot.c where do we keep them? I suggest that we keep them
in spl/nand, spl/onenand etc. And for the object file hierarchy let's
have something like spl/obj. How about that?

3. I hope partially linked libraries is fine. Or do you want to link
all object files in a single stage? Is there any advantage in doing
that?

Shall I re-work my series using this framework?

best regards,
Aneesh

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

* [U-Boot] SPL framework re-design
  2011-06-28  6:54                       ` Aneesh V
@ 2011-06-28 16:18                         ` Scott Wood
  2011-06-29  7:27                           ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Scott Wood @ 2011-06-28 16:18 UTC (permalink / raw)
  To: u-boot

On Tue, 28 Jun 2011 12:24:11 +0530
Aneesh V <aneesh@ti.com> wrote:

> 1. If there are SPL customized generic files like the
> nand_spl/nand_boot.c where do we keep them? I suggest that we keep them
> in spl/nand, spl/onenand etc. And for the object file hierarchy let's
> have something like spl/obj. How about that?

How about drivers/nand/generic_spl.c, drivers/nand/fsl_elbc_spl.c, etc.?

-Scott

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

* [U-Boot] SPL framework re-design
  2011-06-28 16:18                         ` Scott Wood
@ 2011-06-29  7:27                           ` Aneesh V
  0 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-29  7:27 UTC (permalink / raw)
  To: u-boot

On Tuesday 28 June 2011 09:48 PM, Scott Wood wrote:
> On Tue, 28 Jun 2011 12:24:11 +0530
> Aneesh V<aneesh@ti.com>  wrote:
>
>> 1. If there are SPL customized generic files like the
>> nand_spl/nand_boot.c where do we keep them? I suggest that we keep them
>> in spl/nand, spl/onenand etc. And for the object file hierarchy let's
>> have something like spl/obj. How about that?
>
> How about drivers/nand/generic_spl.c, drivers/nand/fsl_elbc_spl.c, etc.?

Wolfgang,

How about this suggestion from Scott?

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

* [U-Boot] [RFC PATCH 0/7] spl framework prototype
  2011-06-16 12:55   ` Daniel Schwierzeck
                       ` (2 preceding siblings ...)
  2011-06-16 21:47     ` Wolfgang Denk
@ 2011-06-29 13:09     ` Aneesh V
  2011-07-01  5:20       ` Aneesh V
  2011-07-05 16:26       ` [U-Boot] [RFC PATCH 0/4] " Daniel Schwierzeck
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile Aneesh V
                       ` (6 subsequent siblings)
  10 siblings, 2 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-29 13:09 UTC (permalink / raw)
  To: u-boot

This is an extention of Daniel Schwierzeck's work [1]
on a new SPL framework and is intented only as a prototype to
facilitate further discussion.

Please refer [2] for an overview of this approach:

I have extended his work to make it a little more generic, did
some minor modifications and adapted it for OMAP4 as a prototype.

Appreciate your feedback. 

[1] https://github.com/danielschwierzeck/u-boot-spl/commits/spl
[2] http://marc.info/?l=u-boot&m=130823112116502&w=2

Aneesh V (3):
  armv7: adapt Makefile for spl building
  omap: common spl support for OMAP3/4
  omap4: adapt Makefile for spl building

Daniel Schwierzeck (4):
  Adapt config.mk for usage in spl/Makefile
  Use ALL-y style instead of ifeq blocks for better readability and
    upgradeability
  Add new folder and build system for SPL
  Hook spl directory into main Makefile

 Makefile                                |   26 ++++----
 arch/arm/cpu/armv7/Makefile             |    9 ++-
 arch/arm/cpu/armv7/omap-common/Makefile |    9 ++-
 arch/arm/cpu/armv7/omap-common/spl.c    |   56 ++++++++++++++++
 arch/arm/cpu/armv7/omap-common/spl.lds  |   62 ++++++++++++++++++
 arch/arm/cpu/armv7/omap4/Makefile       |   12 ++--
 config.mk                               |   32 ++++++++--
 include/configs/omap4_sdp4430.h         |    8 +++
 spl/Makefile                            |  105 +++++++++++++++++++++++++++++++
 9 files changed, 287 insertions(+), 32 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
 create mode 100644 spl/Makefile

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

* [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile
  2011-06-16 12:55   ` Daniel Schwierzeck
                       ` (3 preceding siblings ...)
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 0/7] spl framework prototype Aneesh V
@ 2011-06-29 13:09     ` Aneesh V
  2011-06-29 18:52       ` Mike Frysinger
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Aneesh V
                       ` (5 subsequent siblings)
  10 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-06-29 13:09 UTC (permalink / raw)
  To: u-boot

From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>

[aneesh at ti.com:
1. Changed the definition of OBJTREE and the way 'obj' is defined.
2. Defined a flag to identify regular U-Boot build
3. Taking care of autoconf.mk etc for SPL due to changed OBJTREE
]
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 config.mk |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)

diff --git a/config.mk b/config.mk
index 7ce554e..2ad15c6 100644
--- a/config.mk
+++ b/config.mk
@@ -116,8 +116,14 @@ RANLIB	= $(CROSS_COMPILE)RANLIB
 #########################################################################
 
 # Load generated board configuration
+ifdef CONFIG_UBOOT_SPL_BUILD
+# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
+sinclude $(OBJTREE)/../../include/autoconf.mk
+sinclude $(OBJTREE)/../../include/config.mk
+else
 sinclude $(OBJTREE)/include/autoconf.mk
 sinclude $(OBJTREE)/include/config.mk
+endif
 
 # Some architecture config.mk files need to know what CPUDIR is set to,
 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
@@ -194,13 +200,24 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
 endif
 
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
+endif
+
+CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)
+
 ifneq ($(RESET_VECTOR_ADDRESS),)
 CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
 endif
 
 ifneq ($(OBJTREE),$(SRCTREE))
+ifdef CONFIG_UBOOT_SPL_BUILD
+# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
+CPPFLAGS += -I$(OBJTREE)/../../include2 -I$(OBJTREE)/../../include
+else
 CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
 endif
+endif
 
 CPPFLAGS += -I$(TOPDIR)/include
 CPPFLAGS += -fno-builtin -ffreestanding -nostdinc	\
@@ -236,6 +253,11 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
+LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+
 # Location of a usable BFD library, where we define "usable" as
 # "built for ${HOST}, supports ${TARGET}".  Sensible values are
 # - When cross-compiling: the root of the cross-environment
@@ -271,15 +293,15 @@ export	CONFIG_SYS_TEXT_BASE PLATFORM_CPPFLAGS PLATFORM_RELFLAGS CPPFLAGS CFLAGS
 BCURDIR = $(subst $(SRCTREE)/,,$(CURDIR:$(obj)%=%))
 ALL_AFLAGS = $(AFLAGS) $(AFLAGS_$(BCURDIR)/$(@F)) $(AFLAGS_$(BCURDIR))
 ALL_CFLAGS = $(CFLAGS) $(CFLAGS_$(BCURDIR)/$(@F)) $(CFLAGS_$(BCURDIR))
-$(obj)%.s:	%.S
+$(obj)%.s:	$(src)%.S
 	$(CPP) $(ALL_AFLAGS) -o $@ $<
-$(obj)%.o:	%.S
+$(obj)%.o:	$(src)%.S
 	$(CC)  $(ALL_AFLAGS) -o $@ $< -c
-$(obj)%.o:	%.c
+$(obj)%.o:	$(src)%.c
 	$(CC)  $(ALL_CFLAGS) -o $@ $< -c
-$(obj)%.i:	%.c
+$(obj)%.i:	$(src)%.c
 	$(CPP) $(ALL_CFLAGS) -o $@ $< -c
-$(obj)%.s:	%.c
+$(obj)%.s:	$(src)%.c
 	$(CC)  $(ALL_CFLAGS) -o $@ $< -c -S
 
 #########################################################################
-- 
1.7.0.4

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

* [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability
  2011-06-16 12:55   ` Daniel Schwierzeck
                       ` (4 preceding siblings ...)
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile Aneesh V
@ 2011-06-29 13:09     ` Aneesh V
  2011-06-29 18:54       ` Mike Frysinger
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 3/7] Add new folder and build system for SPL Aneesh V
                       ` (4 subsequent siblings)
  10 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-06-29 13:09 UTC (permalink / raw)
  To: u-boot

From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 Makefile |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)

diff --git a/Makefile b/Makefile
index dcf5d93..813b03b 100644
--- a/Makefile
+++ b/Makefile
@@ -311,22 +311,14 @@ BOARD_SIZE_CHECK =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
+ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-ALL += $(obj)u-boot-nand.bin
-endif
-
-ifeq ($(CONFIG_ONENAND_U_BOOT),y)
-ALL += $(obj)u-boot-onenand.bin
+ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
+ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
-endif
-
-ifeq ($(CONFIG_MMC_U_BOOT),y)
-ALL += $(obj)mmc_spl/u-boot-mmc-spl.bin
-endif
+ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
 
-all:		$(ALL)
+all:		$(ALL-y)
 
 $(obj)u-boot.hex:	$(obj)u-boot
 		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
-- 
1.7.0.4

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

* [U-Boot] [RFC PATCH 3/7] Add new folder and build system for SPL
  2011-06-16 12:55   ` Daniel Schwierzeck
                       ` (5 preceding siblings ...)
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Aneesh V
@ 2011-06-29 13:09     ` Aneesh V
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 4/7] Hook spl directory into main Makefile Aneesh V
                       ` (3 subsequent siblings)
  10 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-29 13:09 UTC (permalink / raw)
  To: u-boot

From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>

[aneesh at ti.com:
1. Changed definition of OBJTREE for SPL
2. Added support for linker script from various places
4. $(OBJTREE)/spl/obj for objects
5. Minor cleanup
]
Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 spl/Makefile |  105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 spl/Makefile

diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 0000000..46edf2b
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,105 @@
+#
+# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
+#
+# (C) Copyright 2011
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V <aneesh@ti.com>
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+
+CONFIG_UBOOT_SPL_BUILD = y
+export CONFIG_UBOOT_SPL_BUILD
+
+# create 'spl/obj' within OBJTREE for spl
+OBJTREE := $(OBJTREE)/spl/obj
+LNDIR	:= $(OBJTREE)
+
+include $(TOPDIR)/config.mk
+# We want the final binaries in this directory
+obj	:= $(obj)../
+START	= $(OBJTREE)/$(CPUDIR)/start.o
+
+LIBS-y += $(shell if [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ]; \
+	then echo "board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
+LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
+LIBS-y += $(CPUDIR)/lib$(CPU).o
+ifdef SOC
+LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
+endif
+LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
+LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o
+LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/libspi_flash.o
+LIBS-$(CONFIG_SPL_GPIO_SUPPORT) += drivers/gpio/libgpio.o
+LIBS-$(CONFIG_SPL_NAND_BOOT) += spl/nand/libnand_spl.o
+LIBS-$(CONFIG_SPL_ONENAND_BOOT) += spl/nand/libonenand_spl.o
+
+LIBS = $(addprefix $(OBJTREE)/,$(sort $(LIBS-y)))
+
+__START = $(subst $(OBJTREE)/,,$(START))
+__LIBS = $(subst $(OBJTREE)/,,$(LIBS))
+
+# Linker Script
+ifdef CONFIG_SYS_SPL_LDSCRIPT
+# need to strip off double quotes
+LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SYS_SPL_LDSCRIPT)))
+endif
+
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/$(ARCH)/$(CPU)/$(SOC)/$(BOARDDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/$(ARCH)/$(CPU)/$(SOC)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/$(ARCH)/$(CPU)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+endif
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+	-include $(TOPDIR)/include/config.h \
+	$(shell $(LD) --version | \
+	  sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+ALL	= $(obj)u-boot-spl.bin
+
+all:	$(ALL)
+
+$(obj)u-boot-spl.bin:	$(obj)u-boot-spl
+	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
+	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+	cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__START) \
+		--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
+		-Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl:	depend $(START) $(LIBS) $(obj)u-boot-spl.lds
+	$(GEN_UBOOT)
+
+$(START):	depend
+	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+
+$(LIBS):	depend
+	$(MAKE) -C $(SRCTREE)$(dir $(subst $(OBJTREE),,$@))
+
+$(obj)u-boot-spl.lds: $(LDSCRIPT)
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:	$(obj).depend
+.PHONY: depend
+
+clean:
+	# TODO: implement clean to support in-tree builds
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
-- 
1.7.0.4

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

* [U-Boot] [RFC PATCH 4/7] Hook spl directory into main Makefile
  2011-06-16 12:55   ` Daniel Schwierzeck
                       ` (6 preceding siblings ...)
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 3/7] Add new folder and build system for SPL Aneesh V
@ 2011-06-29 13:09     ` Aneesh V
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 5/7] armv7: adapt Makefile for spl building Aneesh V
                       ` (2 subsequent siblings)
  10 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-29 13:09 UTC (permalink / raw)
  To: u-boot

From: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 Makefile |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 813b03b..ea35b17 100644
--- a/Makefile
+++ b/Makefile
@@ -317,6 +317,7 @@ ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
 ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
+ALL-$(CONFIG_UBOOT_SPL) += spl
 
 all:		$(ALL-y)
 
@@ -414,6 +415,12 @@ mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
 
 $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
 
+spl:		depend
+		$(MAKE) -C spl all
+
+$(obj)u-boot.spl.bin:		spl $(obj)u-boot.img
+		cat $(obj)spl/u-boot-spl.bin $(obj)u-boot.img > $@
+
 $(VERSION_FILE):
 		@( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
 		   printf '#define PLAIN_VERSION "%s%s"\n' \
@@ -1127,6 +1134,7 @@ clean:
 	@rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
 	@rm -f $(ONENAND_BIN)
 	@rm -f $(obj)onenand_ipl/u-boot.lds
+	@$(MAKE) -C spl clean
 	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
 	@find $(OBJTREE) -type f \
 		\( -name 'core' -o -name '*.bak' -o -name '*~' \
-- 
1.7.0.4

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

* [U-Boot] [RFC PATCH 5/7] armv7: adapt Makefile for spl building
  2011-06-16 12:55   ` Daniel Schwierzeck
                       ` (7 preceding siblings ...)
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 4/7] Hook spl directory into main Makefile Aneesh V
@ 2011-06-29 13:09     ` Aneesh V
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4 Aneesh V
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 7/7] omap4: adapt Makefile for spl building Aneesh V
  10 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-29 13:09 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
---
 arch/arm/cpu/armv7/Makefile |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diff --git a/arch/arm/cpu/armv7/Makefile b/arch/arm/cpu/armv7/Makefile
index 8c0e915..549ade6 100644
--- a/arch/arm/cpu/armv7/Makefile
+++ b/arch/arm/cpu/armv7/Makefile
@@ -26,11 +26,12 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)lib$(CPU).o
 
 START	:= start.o
-COBJS	:= cpu.o
-COBJS  += syslib.o
+COBJS-y	:=
+COBJS-$(CONFIG_NORMAL_UBOOT)	+= cpu.o
+COBJS-$(CONFIG_UBOOT_SPL_BUILD)	+= syslib.o
 
-SRCS	:= $(START:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS))
+SRCS	:= $(START:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y))
 START	:= $(addprefix $(obj),$(START))
 
 all:	$(obj).depend $(START) $(LIB)
-- 
1.7.0.4

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-16 12:55   ` Daniel Schwierzeck
                       ` (8 preceding siblings ...)
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 5/7] armv7: adapt Makefile for spl building Aneesh V
@ 2011-06-29 13:09     ` Aneesh V
  2011-06-30  6:01       ` Heiko Schocher
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 7/7] omap4: adapt Makefile for spl building Aneesh V
  10 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-06-29 13:09 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
---
 arch/arm/cpu/armv7/omap-common/Makefile |    9 ++--
 arch/arm/cpu/armv7/omap-common/spl.c    |   56 ++++++++++++++++++++++++++++
 arch/arm/cpu/armv7/omap-common/spl.lds  |   62 +++++++++++++++++++++++++++++++
 3 files changed, 123 insertions(+), 4 deletions(-)
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
 create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds

diff --git a/arch/arm/cpu/armv7/omap-common/Makefile b/arch/arm/cpu/armv7/omap-common/Makefile
index dc01ee5..7931303 100644
--- a/arch/arm/cpu/armv7/omap-common/Makefile
+++ b/arch/arm/cpu/armv7/omap-common/Makefile
@@ -25,12 +25,13 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)libomap-common.o
 
-SOBJS	:= reset.o
+SOBJS-$(CONFIG_NORMAL_UBOOT)	:= reset.o
 
-COBJS	:= timer.o
+COBJS-$(CONFIG_NORMAL_UBOOT)	:= timer.o
+COBJS-$(CONFIG_UBOOT_SPL_BUILD)	:= spl.o
 
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(SOBJS) $(COBJS))
+SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(SOBJS-y) $(COBJS-y))
 
 all:	$(obj).depend $(LIB)
 
diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
new file mode 100644
index 0000000..b5a5f3c
--- /dev/null
+++ b/arch/arm/cpu/armv7/omap-common/spl.c
@@ -0,0 +1,56 @@
+/*
+ *
+ * Clock initialization for OMAP4
+ *
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *
+ * Aneesh V <aneesh@ti.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+#include <common.h>
+#include <asm/u-boot.h>
+#include <asm/arch/sys_proto.h>
+#include <mmc.h>
+#include <fat.h>
+#include <timestamp_autogenerated.h>
+#include <version_autogenerated.h>
+#include <asm/omap_common.h>
+#include <asm/arch/mmc_host_def.h>
+#include <i2c.h>
+
+/* Define global data structure pointer to it*/
+gd_t gdata __attribute__ ((section(".data")));
+bd_t bdata __attribute__ ((section(".data")));
+gd_t *gd = &gdata;
+
+typedef void (*u_boot_entry_t)(void)__attribute__ ((noreturn));
+
+void board_init_f(ulong dummy)
+{
+	debug(">>board_init_f()\n");
+	relocate_code(CONFIG_SYS_SPL_STACK, &gdata, CONFIG_SYS_SPL_TEXT_BASE);
+	debug("<<board_init_f()\n");
+}
+
+void board_init_r(gd_t *id, ulong dummy)
+{
+	/* TODO - loading the 2nd stage payload will happen here */
+}
diff --git a/arch/arm/cpu/armv7/omap-common/spl.lds b/arch/arm/cpu/armv7/omap-common/spl.lds
new file mode 100644
index 0000000..22fd5da
--- /dev/null
+++ b/arch/arm/cpu/armv7/omap-common/spl.lds
@@ -0,0 +1,62 @@
+/*
+ * (C) Copyright 2002
+ * Gary Jennejohn, DENX Software Engineering, <garyj@denx.de>
+ *
+ * (C) Copyright 2010
+ * Texas Instruments, <www.ti.com>
+ *	Aneesh V <aneesh@ti.com>
+ *
+ * See file CREDITS for list of people who contributed to this
+ * project.
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License as
+ * published by the Free Software Foundation; either version 2 of
+ * the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
+ * MA 02111-1307 USA
+ */
+
+MEMORY { .sram : ORIGIN = CONFIG_SYS_SPL_TEXT_BASE,\
+		 LENGTH = CONFIG_SYS_SPL_MAX_SIZE }
+MEMORY { .sdram : ORIGIN = CONFIG_SYS_SPL_BSS_START_ADDR, \
+		  LENGTH = CONFIG_SYS_SPL_BSS_MAX_SIZE }
+
+OUTPUT_FORMAT("elf32-littlearm", "elf32-littlearm", "elf32-littlearm")
+OUTPUT_ARCH(arm)
+ENTRY(_start)
+SECTIONS
+{
+	.text      :
+	{
+	__start = .;
+	  arch/arm/cpu/armv7/start.o	(.text)
+	  *(.text*)
+	} >.sram
+
+	. = ALIGN(4);
+	.rodata : { *(SORT_BY_ALIGNMENT(.rodata*)) } >.sram
+
+	. = ALIGN(4);
+	.data : { *(SORT_BY_ALIGNMENT(.data*)) } >.sram
+	. = ALIGN(4);
+	__image_copy_end = .;
+	__flash_image_end = .;
+
+	.bss :
+	{
+		. = ALIGN(4);
+		__bss_start = .;
+		*(.bss*)
+		. = ALIGN(4);
+		_end = .;
+	} >.sdram
+}
-- 
1.7.0.4

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

* [U-Boot] [RFC PATCH 7/7] omap4: adapt Makefile for spl building
  2011-06-16 12:55   ` Daniel Schwierzeck
                       ` (9 preceding siblings ...)
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4 Aneesh V
@ 2011-06-29 13:09     ` Aneesh V
  10 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-29 13:09 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
---
 arch/arm/cpu/armv7/omap4/Makefile |   12 ++++++------
 include/configs/omap4_sdp4430.h   |    8 ++++++++
 2 files changed, 14 insertions(+), 6 deletions(-)

diff --git a/arch/arm/cpu/armv7/omap4/Makefile b/arch/arm/cpu/armv7/omap4/Makefile
index 987dc9d..f28eb37 100644
--- a/arch/arm/cpu/armv7/omap4/Makefile
+++ b/arch/arm/cpu/armv7/omap4/Makefile
@@ -25,14 +25,14 @@ include $(TOPDIR)/config.mk
 
 LIB	=  $(obj)lib$(SOC).o
 
-SOBJS	+= lowlevel_init.o
+SOBJS-y	+= lowlevel_init.o
 
-COBJS	+= board.o
-COBJS	+= mem.o
-COBJS	+= sys_info.o
+COBJS-y				:= board.o
+COBJS-$(CONFIG_NORMAL_UBOOT)	+= mem.o
+COBJS-$(CONFIG_NORMAL_UBOOT)	+= sys_info.o
 
-SRCS	:= $(SOBJS:.o=.S) $(COBJS:.o=.c)
-OBJS	:= $(addprefix $(obj),$(COBJS) $(SOBJS))
+SRCS	:= $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
+OBJS	:= $(addprefix $(obj),$(COBJS-y) $(SOBJS-y))
 
 all:	 $(obj).depend $(LIB)
 
diff --git a/include/configs/omap4_sdp4430.h b/include/configs/omap4_sdp4430.h
index 584a52b..0af8e45 100644
--- a/include/configs/omap4_sdp4430.h
+++ b/include/configs/omap4_sdp4430.h
@@ -241,4 +241,12 @@
 					 CONFIG_SYS_INIT_RAM_SIZE - \
 					 GENERATED_GBL_DATA_SIZE)
 
+#define CONFIG_UBOOT_SPL
+#define CONFIG_SYS_SPL_LDSCRIPT		"arch/arm/cpu/armv7/omap-common/spl.lds"
+#define CONFIG_SYS_SPL_TEXT_BASE	0x40304350
+#define CONFIG_SYS_SPL_MAX_SIZE		0x7800	/* 30 K */
+#define CONFIG_SYS_SPL_STACK		LOW_LEVEL_SRAM_STACK
+
+#define CONFIG_SYS_SPL_BSS_START_ADDR		0x80000000
+#define CONFIG_SYS_SPL_BSS_MAX_SIZE		0x80000		/* 512 KB */
 #endif /* __CONFIG_H */
-- 
1.7.0.4

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

* [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile Aneesh V
@ 2011-06-29 18:52       ` Mike Frysinger
  2011-06-30  5:12         ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Mike Frysinger @ 2011-06-29 18:52 UTC (permalink / raw)
  To: u-boot

On Wednesday, June 29, 2011 09:09:21 Aneesh V wrote:
> -$(obj)%.s:	%.S
> +$(obj)%.s:	$(src)%.S

why ?  i dont see any explanation for this.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110629/f970f36e/attachment.pgp 

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

* [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Aneesh V
@ 2011-06-29 18:54       ` Mike Frysinger
  2011-06-30  5:14         ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Mike Frysinger @ 2011-06-29 18:54 UTC (permalink / raw)
  To: u-boot

On Wednesday, June 29, 2011 09:09:22 Aneesh V wrote:
>  Makefile |   18 +++++-------------
>  1 files changed, 5 insertions(+), 13 deletions(-)
> 
>  # Always append ALL so that arch config.mk's can add custom ones

as this comment indicates, you forgot to up date arch config.mk's that append 
ALL.  they'll need converting to ALL-y too.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110629/efd853ef/attachment.pgp 

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

* [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile
  2011-06-29 18:52       ` Mike Frysinger
@ 2011-06-30  5:12         ` Aneesh V
  2011-06-30 11:09           ` Daniel Schwierzeck
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-06-30  5:12 UTC (permalink / raw)
  To: u-boot

On Thursday 30 June 2011 12:22 AM, Mike Frysinger wrote:
> On Wednesday, June 29, 2011 09:09:21 Aneesh V wrote:
>> -$(obj)%.s:	%.S
>> +$(obj)%.s:	$(src)%.S

I too didn't understand why that was done. But I noticed it just before
sending the patches so decided to give it a try later. I tried removing
them now and it doesn't harm. Maybe, some of the changes I did to the
definition of OBJTREE obj etc would have rendered it irrelevant?

Daniel,
Can you throw some light on this?

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability
  2011-06-29 18:54       ` Mike Frysinger
@ 2011-06-30  5:14         ` Aneesh V
  0 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-30  5:14 UTC (permalink / raw)
  To: u-boot

On Thursday 30 June 2011 12:24 AM, Mike Frysinger wrote:
> On Wednesday, June 29, 2011 09:09:22 Aneesh V wrote:
>>   Makefile |   18 +++++-------------
>>   1 files changed, 5 insertions(+), 13 deletions(-)
>>
>>   # Always append ALL so that arch config.mk's can add custom ones
>
> as this comment indicates, you forgot to up date arch config.mk's that append
> ALL.  they'll need converting to ALL-y too.
> -mike

Ok. Will correct all config.mk's

br,
Aneesh

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4 Aneesh V
@ 2011-06-30  6:01       ` Heiko Schocher
  2011-06-30  6:12         ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Heiko Schocher @ 2011-06-30  6:01 UTC (permalink / raw)
  To: u-boot

Hello Aneesh,

Aneesh V wrote:
> Signed-off-by: Aneesh V <aneesh@ti.com>
> ---
>  arch/arm/cpu/armv7/omap-common/Makefile |    9 ++--
>  arch/arm/cpu/armv7/omap-common/spl.c    |   56 ++++++++++++++++++++++++++++
>  arch/arm/cpu/armv7/omap-common/spl.lds  |   62 +++++++++++++++++++++++++++++++
>  3 files changed, 123 insertions(+), 4 deletions(-)
>  create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
>  create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
> 
[...]
> diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
> new file mode 100644
> index 0000000..b5a5f3c
> --- /dev/null
> +++ b/arch/arm/cpu/armv7/omap-common/spl.c
[...]
> @@ -0,0 +1,56 @@
> +void board_init_f(ulong dummy)
> +{
> +	debug(">>board_init_f()\n");
> +	relocate_code(CONFIG_SYS_SPL_STACK, &gdata, CONFIG_SYS_SPL_TEXT_BASE);
> +	debug("<<board_init_f()\n");

This debug printf will never occur ;-)

BTW: Do you really need to relocate code? You could just load the 2nd
stage loader to ram from board_init_f, or?

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-30  6:01       ` Heiko Schocher
@ 2011-06-30  6:12         ` Aneesh V
  2011-06-30  7:08           ` Andreas Bießmann
  2011-06-30  7:53           ` Heiko Schocher
  0 siblings, 2 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-30  6:12 UTC (permalink / raw)
  To: u-boot

Hi Heiko,

On Thursday 30 June 2011 11:31 AM, Heiko Schocher wrote:
> Hello Aneesh,
>
> Aneesh V wrote:
>> Signed-off-by: Aneesh V<aneesh@ti.com>
>> ---
>>   arch/arm/cpu/armv7/omap-common/Makefile |    9 ++--
>>   arch/arm/cpu/armv7/omap-common/spl.c    |   56 ++++++++++++++++++++++++++++
>>   arch/arm/cpu/armv7/omap-common/spl.lds  |   62 +++++++++++++++++++++++++++++++
>>   3 files changed, 123 insertions(+), 4 deletions(-)
>>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
>>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
>>
> [...]
>> diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
>> new file mode 100644
>> index 0000000..b5a5f3c
>> --- /dev/null
>> +++ b/arch/arm/cpu/armv7/omap-common/spl.c
> [...]
>> @@ -0,0 +1,56 @@
>> +void board_init_f(ulong dummy)
>> +{
>> +	debug(">>board_init_f()\n");
>> +	relocate_code(CONFIG_SYS_SPL_STACK,&gdata, CONFIG_SYS_SPL_TEXT_BASE);
>> +	debug("<<board_init_f()\n");
>
> This debug printf will never occur ;-)

Indeed. Thanks for pointing out.

>
> BTW: Do you really need to relocate code? You could just load the 2nd
> stage loader to ram from board_init_f, or?

I am passing the same address as I am executing from as the target for
the relocation, so the relocation will not happen, instead BSS will be
initialized. That's what I am calling it for. Initially I had my own
routine for clearing BSS. Then I decided to re-use it from start.S

BTW, this series is not complete as far as SPL support is concerned.
It doesn't even build due to many undefined references. It serves only
as a prototype for the framework part.

br,
Aneesh

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-30  6:12         ` Aneesh V
@ 2011-06-30  7:08           ` Andreas Bießmann
  2011-07-01  9:27             ` Aneesh V
  2011-06-30  7:53           ` Heiko Schocher
  1 sibling, 1 reply; 172+ messages in thread
From: Andreas Bießmann @ 2011-06-30  7:08 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

Am 30.06.2011 um 08:12 schrieb Aneesh V:

> Hi Heiko,
> 
> On Thursday 30 June 2011 11:31 AM, Heiko Schocher wrote:
>> Hello Aneesh,
>> 
>> Aneesh V wrote:
>>> Signed-off-by: Aneesh V<aneesh@ti.com>
>>> ---
>>>  arch/arm/cpu/armv7/omap-common/Makefile |    9 ++--
>>>  arch/arm/cpu/armv7/omap-common/spl.c    |   56 ++++++++++++++++++++++++++++
>>>  arch/arm/cpu/armv7/omap-common/spl.lds  |   62 +++++++++++++++++++++++++++++++
>>>  3 files changed, 123 insertions(+), 4 deletions(-)
>>>  create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
>>>  create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
>>> 
>> [...]
>>> diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
>>> new file mode 100644
>>> index 0000000..b5a5f3c
>>> --- /dev/null
>>> +++ b/arch/arm/cpu/armv7/omap-common/spl.c
>> [...]
>>> @@ -0,0 +1,56 @@
>>> +void board_init_f(ulong dummy)
>>> +{
>>> +	debug(">>board_init_f()\n");
>>> +	relocate_code(CONFIG_SYS_SPL_STACK,&gdata, CONFIG_SYS_SPL_TEXT_BASE);
>>> +	debug("<<board_init_f()\n");
>> 
>> This debug printf will never occur ;-)
> 
> Indeed. Thanks for pointing out.
> 
>> 
>> BTW: Do you really need to relocate code? You could just load the 2nd
>> stage loader to ram from board_init_f, or?
> 
> I am passing the same address as I am executing from as the target for
> the relocation, so the relocation will not happen, instead BSS will be
> initialized. That's what I am calling it for. Initially I had my own
> routine for clearing BSS. Then I decided to re-use it from start.S

So you could just call clear_bss(void) and skip relocate_code. But I think you need to adopt the __bss_start_ofs, __bss_end_ofs markers, cause your linker skript places them in SDRAM.

BTW: I think Simon Schwarz is also working on this, can one comment on his first version of patchset?

regards

Andreas Bie?mann

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-30  6:12         ` Aneesh V
  2011-06-30  7:08           ` Andreas Bießmann
@ 2011-06-30  7:53           ` Heiko Schocher
  2011-06-30  8:21             ` Simon Schwarz
  1 sibling, 1 reply; 172+ messages in thread
From: Heiko Schocher @ 2011-06-30  7:53 UTC (permalink / raw)
  To: u-boot

Hello Aneesh,

Aneesh V wrote:
> On Thursday 30 June 2011 11:31 AM, Heiko Schocher wrote:
>> Hello Aneesh,
>>
>> Aneesh V wrote:
>>> Signed-off-by: Aneesh V<aneesh@ti.com>
>>> ---
>>>   arch/arm/cpu/armv7/omap-common/Makefile |    9 ++--
>>>   arch/arm/cpu/armv7/omap-common/spl.c    |   56
>>> ++++++++++++++++++++++++++++
>>>   arch/arm/cpu/armv7/omap-common/spl.lds  |   62
>>> +++++++++++++++++++++++++++++++
>>>   3 files changed, 123 insertions(+), 4 deletions(-)
>>>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
>>>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
>>>
>> [...]
>>> diff --git a/arch/arm/cpu/armv7/omap-common/spl.c
>>> b/arch/arm/cpu/armv7/omap-common/spl.c
>>> new file mode 100644
>>> index 0000000..b5a5f3c
>>> --- /dev/null
>>> +++ b/arch/arm/cpu/armv7/omap-common/spl.c
>> [...]
[...]
>>
>> BTW: Do you really need to relocate code? You could just load the 2nd
>> stage loader to ram from board_init_f, or?
> 
> I am passing the same address as I am executing from as the target for
> the relocation, so the relocation will not happen, instead BSS will be
> initialized. That's what I am calling it for. Initially I had my own
> routine for clearing BSS. Then I decided to re-use it from start.S

Ah, I see! Maybe you can add a comment here?
Thanks!

Hmm, I actually porting a dm368 based board with nand_spl support
(patches following soon), and there I have an empty bss section,
so I can direct copy the u-boot image from nand to ram in board_init_f().

> BTW, this series is not complete as far as SPL support is concerned.
> It doesn't even build due to many undefined references. It serves only
> as a prototype for the framework part.

Ah, Ok ...

bye,
Heiko
-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-30  7:53           ` Heiko Schocher
@ 2011-06-30  8:21             ` Simon Schwarz
  2011-06-30 10:05               ` Aneesh V
  2011-06-30 11:09               ` Albert ARIBAUD
  0 siblings, 2 replies; 172+ messages in thread
From: Simon Schwarz @ 2011-06-30  8:21 UTC (permalink / raw)
  To: u-boot

Hi,

> Hmm, I actually porting a dm368 based board with nand_spl support
> (patches following soon), and there I have an empty bss section,
> so I can direct copy the u-boot image from nand to ram in board_init_f().

This is what I'am doing with OMAP3 also. IMHO it would be more
readable if relocate_code is not called if there is no relocation and
instead the clear_bss()-function is used as Andreas suggested. (Or to
just not use clear_bss if bss is empty)

Regards
Simon

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-30  8:21             ` Simon Schwarz
@ 2011-06-30 10:05               ` Aneesh V
  2011-06-30 11:09               ` Albert ARIBAUD
  1 sibling, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-30 10:05 UTC (permalink / raw)
  To: u-boot

On Thursday 30 June 2011 01:51 PM, Simon Schwarz wrote:
> Hi,
>
>> Hmm, I actually porting a dm368 based board with nand_spl support
>> (patches following soon), and there I have an empty bss section,
>> so I can direct copy the u-boot image from nand to ram in board_init_f().
>
> This is what I'am doing with OMAP3 also. IMHO it would be more
> readable if relocate_code is not called if there is no relocation and
> instead the clear_bss()-function is used as Andreas suggested. (Or to
> just not use clear_bss if bss is empty)

In my case there is indeed a BSS section, and a huge one at that -
192KB for the FAT driver. You will need it too if your OMAP3 SPL is
going to support MMC FAT boot.

br,
Aneesh

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-30  8:21             ` Simon Schwarz
  2011-06-30 10:05               ` Aneesh V
@ 2011-06-30 11:09               ` Albert ARIBAUD
  2011-06-30 11:18                 ` Aneesh V
  1 sibling, 1 reply; 172+ messages in thread
From: Albert ARIBAUD @ 2011-06-30 11:09 UTC (permalink / raw)
  To: u-boot

Hi Simon,

Le 30/06/2011 10:21, Simon Schwarz a ?crit :
> Hi,
>
>> Hmm, I actually porting a dm368 based board with nand_spl support
>> (patches following soon), and there I have an empty bss section,
>> so I can direct copy the u-boot image from nand to ram in board_init_f().
>
> This is what I'am doing with OMAP3 also. IMHO it would be more
> readable if relocate_code is not called if there is no relocation and
> instead the clear_bss()-function is used as Andreas suggested. (Or to
> just not use clear_bss if bss is empty)

IMO, for the sake of rpbustness, the clear_bss code should handle the 
case where the BSS is empty, and for the sake of simplicity, it should 
be called always.

> Regards
> Simon

Amicalement,
-- 
Albert.

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

* [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile
  2011-06-30  5:12         ` Aneesh V
@ 2011-06-30 11:09           ` Daniel Schwierzeck
  0 siblings, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-06-30 11:09 UTC (permalink / raw)
  To: u-boot

Hi Aneesh,

On Thu, Jun 30, 2011 at 7:12 AM, Aneesh V <aneesh@ti.com> wrote:
> On Thursday 30 June 2011 12:22 AM, Mike Frysinger wrote:
>>
>> On Wednesday, June 29, 2011 09:09:21 Aneesh V wrote:
>>>
>>> -$(obj)%.s: ? ? %.S
>>> +$(obj)%.s: ? ? $(src)%.S
>
> I too didn't understand why that was done. But I noticed it just before
> sending the patches so decided to give it a try later. I tried removing
> them now and it doesn't harm. Maybe, some of the changes I did to the
> definition of OBJTREE obj etc would have rendered it irrelevant?
>
> Daniel,
> Can you throw some light on this?
>

In my original patch I tweaked the src and obj variables to use spl as remote
build directory. As a consequence I had to change the implicite make rules too.

The regular way is:
src = $(TOPDIR)/arch/ARCH/cpu/CPU/start.S
obj = $(TOPDIR)/arch/ARCH/cpu/CPU/start.o (in-tree builds)
obj = $(BUILDDIR)/arch/ARCH/cpu/CPU/start.o (out-of-tree builds)

with spl as build directory:
src = $(TOPDIR)/arch/ARCH/cpu/CPU/start.S
obj = $(TOPDIR)/spl/arch/ARCH/cpu/CPU/start.o (in-tree builds)
obj = $(BUILDDIR)/spl/arch/ARCH/cpu/CPU/start.o (out-of-tree builds)

in the latter case I saw that $(src) got the value
$(TOPDIR)/spl/arch/ARCH/cpu/CPU/start.S
and the implicite make rules did not work anymore.

I'am glad if this works without those changes. I'll try
this for my boards too.

Best regards,
Daniel

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-30 11:09               ` Albert ARIBAUD
@ 2011-06-30 11:18                 ` Aneesh V
  0 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-06-30 11:18 UTC (permalink / raw)
  To: u-boot

On Thursday 30 June 2011 04:39 PM, Albert ARIBAUD wrote:
> Hi Simon,
>
> Le 30/06/2011 10:21, Simon Schwarz a ?crit :
>> Hi,
>>
>>> Hmm, I actually porting a dm368 based board with nand_spl support
>>> (patches following soon), and there I have an empty bss section,
>>> so I can direct copy the u-boot image from nand to ram in board_init_f().
>>
>> This is what I'am doing with OMAP3 also. IMHO it would be more
>> readable if relocate_code is not called if there is no relocation and
>> instead the clear_bss()-function is used as Andreas suggested. (Or to
>> just not use clear_bss if bss is empty)
>
> IMO, for the sake of rpbustness, the clear_bss code should handle the
> case where the BSS is empty, and for the sake of simplicity, it should
> be called always.

I shall check the case when BSS is empty and fix it if needed.

br,
Aneesh

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

* [U-Boot] [RFC PATCH 0/7] spl framework prototype
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 0/7] spl framework prototype Aneesh V
@ 2011-07-01  5:20       ` Aneesh V
  2011-07-05 16:26       ` [U-Boot] [RFC PATCH 0/4] " Daniel Schwierzeck
  1 sibling, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-01  5:20 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

Would you please let us know your thoughts on this prototype
implementation?

best regards,
Aneesh

On Wednesday 29 June 2011 06:39 PM, Aneesh V wrote:
> This is an extention of Daniel Schwierzeck's work [1]
> on a new SPL framework and is intented only as a prototype to
> facilitate further discussion.
>
> Please refer [2] for an overview of this approach:
>
> I have extended his work to make it a little more generic, did
> some minor modifications and adapted it for OMAP4 as a prototype.
>
> Appreciate your feedback.
>
> [1] https://github.com/danielschwierzeck/u-boot-spl/commits/spl
> [2] http://marc.info/?l=u-boot&m=130823112116502&w=2
>
> Aneesh V (3):
>    armv7: adapt Makefile for spl building
>    omap: common spl support for OMAP3/4
>    omap4: adapt Makefile for spl building
>
> Daniel Schwierzeck (4):
>    Adapt config.mk for usage in spl/Makefile
>    Use ALL-y style instead of ifeq blocks for better readability and
>      upgradeability
>    Add new folder and build system for SPL
>    Hook spl directory into main Makefile
>
>   Makefile                                |   26 ++++----
>   arch/arm/cpu/armv7/Makefile             |    9 ++-
>   arch/arm/cpu/armv7/omap-common/Makefile |    9 ++-
>   arch/arm/cpu/armv7/omap-common/spl.c    |   56 ++++++++++++++++
>   arch/arm/cpu/armv7/omap-common/spl.lds  |   62 ++++++++++++++++++
>   arch/arm/cpu/armv7/omap4/Makefile       |   12 ++--
>   config.mk                               |   32 ++++++++--
>   include/configs/omap4_sdp4430.h         |    8 +++
>   spl/Makefile                            |  105 +++++++++++++++++++++++++++++++
>   9 files changed, 287 insertions(+), 32 deletions(-)
>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
>   create mode 100644 spl/Makefile
>

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-06-30  7:08           ` Andreas Bießmann
@ 2011-07-01  9:27             ` Aneesh V
  2011-07-01  9:55               ` Andreas Bießmann
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-01  9:27 UTC (permalink / raw)
  To: u-boot

Dear Andreas,

On Thursday 30 June 2011 12:38 PM, Andreas Bie?mann wrote:
> Dear Aneesh V,
>
> Am 30.06.2011 um 08:12 schrieb Aneesh V:
>
>> Hi Heiko,
>>
>> On Thursday 30 June 2011 11:31 AM, Heiko Schocher wrote:
>>> Hello Aneesh,
>>>
>>> Aneesh V wrote:
>>>> Signed-off-by: Aneesh V<aneesh@ti.com>
>>>> ---
>>>>   arch/arm/cpu/armv7/omap-common/Makefile |    9 ++--
>>>>   arch/arm/cpu/armv7/omap-common/spl.c    |   56 ++++++++++++++++++++++++++++
>>>>   arch/arm/cpu/armv7/omap-common/spl.lds  |   62 +++++++++++++++++++++++++++++++
>>>>   3 files changed, 123 insertions(+), 4 deletions(-)
>>>>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.c
>>>>   create mode 100644 arch/arm/cpu/armv7/omap-common/spl.lds
>>>>
>>> [...]
>>>> diff --git a/arch/arm/cpu/armv7/omap-common/spl.c b/arch/arm/cpu/armv7/omap-common/spl.c
>>>> new file mode 100644
>>>> index 0000000..b5a5f3c
>>>> --- /dev/null
>>>> +++ b/arch/arm/cpu/armv7/omap-common/spl.c
>>> [...]
>>>> @@ -0,0 +1,56 @@
>>>> +void board_init_f(ulong dummy)
>>>> +{
>>>> +	debug(">>board_init_f()\n");
>>>> +	relocate_code(CONFIG_SYS_SPL_STACK,&gdata, CONFIG_SYS_SPL_TEXT_BASE);
>>>> +	debug("<<board_init_f()\n");
>>>
>>> This debug printf will never occur ;-)
>>
>> Indeed. Thanks for pointing out.
>>
>>>
>>> BTW: Do you really need to relocate code? You could just load the 2nd
>>> stage loader to ram from board_init_f, or?
>>
>> I am passing the same address as I am executing from as the target for
>> the relocation, so the relocation will not happen, instead BSS will be
>> initialized. That's what I am calling it for. Initially I had my own
>> routine for clearing BSS. Then I decided to re-use it from start.S
>
> So you could just call clear_bss(void) and skip relocate_code. But I think you need to adopt the __bss_start_ofs, __bss_end_ofs markers, cause your linker skript places them in SDRAM.

Is that really needed, or is it ok to just comment this fact clearly as
Heiko suggested?

>
> BTW: I think Simon Schwarz is also working on this, can one comment on his first version of patchset?

We have decided to co-ordinate our work so that there won't be any
duplication of efforts. As per this plan, these parts will be taken
care in my OMAP4 MMC spl series and then he will extend it for OMAP3
and NAND.

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-07-01  9:27             ` Aneesh V
@ 2011-07-01  9:55               ` Andreas Bießmann
  2011-07-01 11:48                 ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Andreas Bießmann @ 2011-07-01  9:55 UTC (permalink / raw)
  To: u-boot

Dear Aneesh,

Am 01.07.2011 11:27, schrieb Aneesh V:
> Dear Andreas,
> 
> On Thursday 30 June 2011 12:38 PM, Andreas Bie?mann wrote:
>> Dear Aneesh V,
>>
>> Am 30.06.2011 um 08:12 schrieb Aneesh V:
>>
>>> Hi Heiko,
>>>
>>> On Thursday 30 June 2011 11:31 AM, Heiko Schocher wrote:
>>>> Hello Aneesh,
>>>>
>>>> Aneesh V wrote:
>>>>> Signed-off-by: Aneesh V<aneesh@ti.com>

<snip>

>>>>> diff --git a/arch/arm/cpu/armv7/omap-common/spl.c
>>>>> b/arch/arm/cpu/armv7/omap-common/spl.c
>>>>> new file mode 100644
>>>>> index 0000000..b5a5f3c
>>>>> --- /dev/null
>>>>> +++ b/arch/arm/cpu/armv7/omap-common/spl.c
>>>> [...]
>>>>> @@ -0,0 +1,56 @@
>>>>> +void board_init_f(ulong dummy)
>>>>> +{
>>>>> +    debug(">>board_init_f()\n");
>>>>> +    relocate_code(CONFIG_SYS_SPL_STACK,&gdata,
>>>>> CONFIG_SYS_SPL_TEXT_BASE);
>>>>> +    debug("<<board_init_f()\n");

<snip>

>>>> BTW: Do you really need to relocate code? You could just load the 2nd
>>>> stage loader to ram from board_init_f, or?
>>>
>>> I am passing the same address as I am executing from as the target for
>>> the relocation, so the relocation will not happen, instead BSS will be
>>> initialized. That's what I am calling it for. Initially I had my own
>>> routine for clearing BSS. Then I decided to re-use it from start.S
>>
>> So you could just call clear_bss(void) and skip relocate_code. But I
>> think you need to adopt the __bss_start_ofs, __bss_end_ofs markers,
>> cause your linker skript places them in SDRAM.
> 
> Is that really needed, or is it ok to just comment this fact clearly as
> Heiko suggested?

No, it is not needed to call clear_bss() directly. I think commenting
the fact, that passing same source and target address will skip the
relocation stuff would be also OK here.

But the second part is not clear to me. I saw in your linker, that bss
is placed in SDRAM. In start.S the boundaries for clear_bss are
calculated at compile time to

---8<---
_bss_start_ofs:
	.word __bss_start - _start
--->8---

Will that also work with e.g. SDRAM adress space is before SRAM, SDRAM
addressing is far away (> 4GiB) ... So in you special case it may work,
but if this is a blueprint for SPL on arm(v7) we should consider this.

>> BTW: I think Simon Schwarz is also working on this, can one comment on
>> his first version of patchset?
> 
> We have decided to co-ordinate our work so that there won't be any
> duplication of efforts. As per this plan, these parts will be taken
> care in my OMAP4 MMC spl series and then he will extend it for OMAP3
> and NAND.

I'm fine with that. ;)

regards

Andreas Bie?mann

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-07-01  9:55               ` Andreas Bießmann
@ 2011-07-01 11:48                 ` Aneesh V
  2011-07-01 19:51                   ` Albert ARIBAUD
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-01 11:48 UTC (permalink / raw)
  To: u-boot

Dear Andreas,

On Friday 01 July 2011 03:25 PM, Andreas Bie?mann wrote:
> Dear Aneesh,
[snip ..]
> But the second part is not clear to me. I saw in your linker, that bss
> is placed in SDRAM. In start.S the boundaries for clear_bss are
> calculated at compile time to
>
> ---8<---
> _bss_start_ofs:
> 	.word __bss_start - _start
> --->8---
>
> Will that also work with e.g. SDRAM adress space is before SRAM, SDRAM
> addressing is far away (>  4GiB) ... So in you special case it may work,
> but if this is a blueprint for SPL on arm(v7) we should consider this.
>

Nice catch. Actually, in my original OMAP4 series I tried to add
support for disjoint bss to support my case. But now I realize that it
works only for non-relocation case and that too only when the bss is at
higher address compared to .text

Basically disjoint bss is not relocation friendly. So here is what I
propose:

1. Modify existing clear_bss sub-routine in start.S to take absolute
addresses.
2. In regular u-boot, calculate the relocated bss address and pass to
this function.
3. In SPL don't try to calculate the relocated address and directly
pass the absolute address.

If this is fine I will make the necessary changes in start.S in the
next revision.

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-07-01 11:48                 ` Aneesh V
@ 2011-07-01 19:51                   ` Albert ARIBAUD
  2011-07-03  4:47                     ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Albert ARIBAUD @ 2011-07-01 19:51 UTC (permalink / raw)
  To: u-boot

Hi Aneesh,

Le 01/07/2011 13:48, Aneesh V a ?crit :
> Dear Andreas,
>
> On Friday 01 July 2011 03:25 PM, Andreas Bie?mann wrote:
>> Dear Aneesh,
> [snip ..]
>> But the second part is not clear to me. I saw in your linker, that bss
>> is placed in SDRAM. In start.S the boundaries for clear_bss are
>> calculated at compile time to
>>
>> ---8<---
>> _bss_start_ofs:
>> 	.word __bss_start - _start
>> --->8---
>>
>> Will that also work with e.g. SDRAM adress space is before SRAM, SDRAM
>> addressing is far away (>   4GiB) ... So in you special case it may work,
>> but if this is a blueprint for SPL on arm(v7) we should consider this.
>>
>
> Nice catch. Actually, in my original OMAP4 series I tried to add
> support for disjoint bss to support my case. But now I realize that it
> works only for non-relocation case and that too only when the bss is at
> higher address compared to .text
>
> Basically disjoint bss is not relocation friendly. So here is what I
> propose:
>
> 1. Modify existing clear_bss sub-routine in start.S to take absolute
> addresses.
> 2. In regular u-boot, calculate the relocated bss address and pass to
> this function.
> 3. In SPL don't try to calculate the relocated address and directly
> pass the absolute address.
>
> If this is fine I will make the necessary changes in start.S in the
> next revision.

So you would compute the BSS location in board_init_f() and pass that to 
relocate_code()?

> best regards,
> Aneesh

Amicalement,
-- 
Albert.

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-07-01 19:51                   ` Albert ARIBAUD
@ 2011-07-03  4:47                     ` Aneesh V
  2011-07-03  6:56                       ` Albert ARIBAUD
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-03  4:47 UTC (permalink / raw)
  To: u-boot

Hi Albert,

On Saturday 02 July 2011 01:21 AM, Albert ARIBAUD wrote:
> Hi Aneesh,
>
> Le 01/07/2011 13:48, Aneesh V a ?crit :
>> Dear Andreas,
>>
>> On Friday 01 July 2011 03:25 PM, Andreas Bie?mann wrote:
>>> Dear Aneesh,
>> [snip ..]
>>> But the second part is not clear to me. I saw in your linker, that bss
>>> is placed in SDRAM. In start.S the boundaries for clear_bss are
>>> calculated at compile time to
>>>
>>> ---8<---
>>> _bss_start_ofs:
>>> .word __bss_start - _start
>>> --->8---
>>>
>>> Will that also work with e.g. SDRAM adress space is before SRAM, SDRAM
>>> addressing is far away (> 4GiB) ... So in you special case it may work,
>>> but if this is a blueprint for SPL on arm(v7) we should consider this.
>>>
>>
>> Nice catch. Actually, in my original OMAP4 series I tried to add
>> support for disjoint bss to support my case. But now I realize that it
>> works only for non-relocation case and that too only when the bss is at
>> higher address compared to .text
>>
>> Basically disjoint bss is not relocation friendly. So here is what I
>> propose:
>>
>> 1. Modify existing clear_bss sub-routine in start.S to take absolute
>> addresses.
>> 2. In regular u-boot, calculate the relocated bss address and pass to
>> this function.
>> 3. In SPL don't try to calculate the relocated address and directly
>> pass the absolute address.
>>
>> If this is fine I will make the necessary changes in start.S in the
>> next revision.
>
> So you would compute the BSS location in board_init_f() and pass that to
> relocate_code()?

I was thinking of doing that in start.S itself. I haven't looked at
all the details though.

BTW, please note that I am not trying to support disjoint BSS in
regular u-boot. I think it becomes complex with relocation + it doesn't
seem to be worth when all SDRAM is at our disposal.

So:
1.  #ifdef CONFIG_PRELOADER part in start.s will just pass __bss_start
and __bss_end to the clear_bss function(assumes no relocation).
2. #else part of above will assume that bss follows text and data(or at
least that __bss_start > _start), so add relocation offset to
__bss_start and __bss_end, and pass them to the clear_bss()

Does that sound ok?

br,
Aneesh

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-07-03  4:47                     ` Aneesh V
@ 2011-07-03  6:56                       ` Albert ARIBAUD
  2011-07-03  7:31                         ` Andreas Bießmann
  2011-07-03  8:39                         ` Aneesh V
  0 siblings, 2 replies; 172+ messages in thread
From: Albert ARIBAUD @ 2011-07-03  6:56 UTC (permalink / raw)
  To: u-boot

Hi Aneesh,

Le 03/07/2011 06:47, Aneesh V a ?crit :
> Hi Albert,
>
> On Saturday 02 July 2011 01:21 AM, Albert ARIBAUD wrote:
>> Hi Aneesh,
>>
>> Le 01/07/2011 13:48, Aneesh V a ?crit :
>>> Dear Andreas,
>>>
>>> On Friday 01 July 2011 03:25 PM, Andreas Bie?mann wrote:
>>>> Dear Aneesh,
>>> [snip ..]
>>>> But the second part is not clear to me. I saw in your linker, that bss
>>>> is placed in SDRAM. In start.S the boundaries for clear_bss are
>>>> calculated at compile time to
>>>>
>>>> ---8<---
>>>> _bss_start_ofs:
>>>> .word __bss_start - _start
>>>> --->8---
>>>>
>>>> Will that also work with e.g. SDRAM adress space is before SRAM, SDRAM
>>>> addressing is far away (> 4GiB) ... So in you special case it may work,
>>>> but if this is a blueprint for SPL on arm(v7) we should consider this.
>>>>
>>>
>>> Nice catch. Actually, in my original OMAP4 series I tried to add
>>> support for disjoint bss to support my case. But now I realize that it
>>> works only for non-relocation case and that too only when the bss is at
>>> higher address compared to .text
>>>
>>> Basically disjoint bss is not relocation friendly. So here is what I
>>> propose:
>>>
>>> 1. Modify existing clear_bss sub-routine in start.S to take absolute
>>> addresses.
>>> 2. In regular u-boot, calculate the relocated bss address and pass to
>>> this function.
>>> 3. In SPL don't try to calculate the relocated address and directly
>>> pass the absolute address.
>>>
>>> If this is fine I will make the necessary changes in start.S in the
>>> next revision.
>>
>> So you would compute the BSS location in board_init_f() and pass that to
>> relocate_code()?
>
> I was thinking of doing that in start.S itself. I haven't looked at
> all the details though.
>
> BTW, please note that I am not trying to support disjoint BSS in
> regular u-boot. I think it becomes complex with relocation + it doesn't
> seem to be worth when all SDRAM is at our disposal.
>
> So:
> 1. #ifdef CONFIG_PRELOADER part in start.s will just pass __bss_start
> and __bss_end to the clear_bss function(assumes no relocation).
> 2. #else part of above will assume that bss follows text and data(or at
> least that __bss_start > _start), so add relocation offset to
> __bss_start and __bss_end, and pass them to the clear_bss()
>
> Does that sound ok?

(note clear_bss is not a function in arch/arm/cpu/armv7/start.S, it is 
only a label)

So, considering what is already in arch/arm/cpu/armv7/start.S, you would 
just add a conditional variant to the BSS clearing code for the 
preloader case?

If so, and considering that you'll pass an offset of 0, why would you 
need that variant for? With offset=0, the code already does what you 
want, does it not?

> br,
> Aneesh

Amicalement,
-- 
Albert.

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-07-03  6:56                       ` Albert ARIBAUD
@ 2011-07-03  7:31                         ` Andreas Bießmann
  2011-07-03  7:48                           ` Albert ARIBAUD
  2011-07-03  8:39                         ` Aneesh V
  1 sibling, 1 reply; 172+ messages in thread
From: Andreas Bießmann @ 2011-07-03  7:31 UTC (permalink / raw)
  To: u-boot

Dear Albert Aribaud,

Am 03.07.2011 um 08:56 schrieb Albert ARIBAUD:

> Hi Aneesh,
> 
> Le 03/07/2011 06:47, Aneesh V a ?crit :
>> Hi Albert,
>> 
>> On Saturday 02 July 2011 01:21 AM, Albert ARIBAUD wrote:
>>> Hi Aneesh,
>>> 

<snip>

>> I was thinking of doing that in start.S itself. I haven't looked at
>> all the details though.
>> 
>> BTW, please note that I am not trying to support disjoint BSS in
>> regular u-boot. I think it becomes complex with relocation + it doesn't
>> seem to be worth when all SDRAM is at our disposal.
>> 
>> So:
>> 1. #ifdef CONFIG_PRELOADER part in start.s will just pass __bss_start
>> and __bss_end to the clear_bss function(assumes no relocation).
>> 2. #else part of above will assume that bss follows text and data(or at
>> least that __bss_start > _start), so add relocation offset to
>> __bss_start and __bss_end, and pass them to the clear_bss()
>> 
>> Does that sound ok?
> 
> (note clear_bss is not a function in arch/arm/cpu/armv7/start.S, it is only a label)
> 
> So, considering what is already in arch/arm/cpu/armv7/start.S, you would just add a conditional variant to the BSS clearing code for the preloader case?
> 
> If so, and considering that you'll pass an offset of 0, why would you need that variant for? With offset=0, the code already does what you want, does it not?

we are looking forward to have relocate_code(), clear_bss(), a.s.o. implemented in c in future (as I understood the discussion around christmas about relocation).
Wouldn't it be nice to implement now a SPL version of clear_bss(int start, int size)  in c and skip the relocate_code() stuff in start.S completely?

As I see the normal way to boot is:

-> some start vector
 -> lowlevel_init
  -> board_init_f
   -> relocate_code
    -> board_init_r

for SPL we do not need the steps after board_init_f. board_init_f for SPL should implement the generic way to load data from predefined (compile time) source to predefined target address and branch it. Therefore a simple memset() in board_init_f could be sufficient to clear the bss.

regards

Andreas Bie?mann

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-07-03  7:31                         ` Andreas Bießmann
@ 2011-07-03  7:48                           ` Albert ARIBAUD
  0 siblings, 0 replies; 172+ messages in thread
From: Albert ARIBAUD @ 2011-07-03  7:48 UTC (permalink / raw)
  To: u-boot

Le 03/07/2011 09:31, Andreas Bie?mann a ?crit :
> Dear Albert Aribaud,
>
> Am 03.07.2011 um 08:56 schrieb Albert ARIBAUD:
>
>> Hi Aneesh,
>>
>> Le 03/07/2011 06:47, Aneesh V a ?crit :
>>> Hi Albert,
>>>
>>> On Saturday 02 July 2011 01:21 AM, Albert ARIBAUD wrote:
>>>> Hi Aneesh,
>>>>
>
> <snip>
>
>>> I was thinking of doing that in start.S itself. I haven't looked at
>>> all the details though.
>>>
>>> BTW, please note that I am not trying to support disjoint BSS in
>>> regular u-boot. I think it becomes complex with relocation + it doesn't
>>> seem to be worth when all SDRAM is at our disposal.
>>>
>>> So:
>>> 1. #ifdef CONFIG_PRELOADER part in start.s will just pass __bss_start
>>> and __bss_end to the clear_bss function(assumes no relocation).
>>> 2. #else part of above will assume that bss follows text and data(or at
>>> least that __bss_start>  _start), so add relocation offset to
>>> __bss_start and __bss_end, and pass them to the clear_bss()
>>>
>>> Does that sound ok?
>>
>> (note clear_bss is not a function in arch/arm/cpu/armv7/start.S, it is only a label)
>>
>> So, considering what is already in arch/arm/cpu/armv7/start.S, you would just add a conditional variant to the BSS clearing code for the preloader case?
>>
>> If so, and considering that you'll pass an offset of 0, why would you need that variant for? With offset=0, the code already does what you want, does it not?
>
> we are looking forward to have relocate_code(), clear_bss(), a.s.o. implemented in c in future (as I understood the discussion around christmas about relocation).
> Wouldn't it be nice to implement now a SPL version of clear_bss(int start, int size)  in c and skip the relocate_code() stuff in start.S completely?
>
> As I see the normal way to boot is:
>
> ->  some start vector
>   ->  lowlevel_init
>    ->  board_init_f
>     ->  relocate_code
>      ->  board_init_r
>
> for SPL we do not need the steps after board_init_f. board_init_f
> for  SPL should implement the generic way to load data from predefined
> (compile time) source to predefined target address and branch it.
> Therefore a simple memset() in board_init_f could be sufficient to clear
> the bss.

Granted, clear_bss could become a function and should be optimized 
according to the context; however, I don't like the idea of calling a C 
library function at a point where we know the C environment for the 
caller is by definition not really set up yet.

And as a general rule, I think we should not perform changes 'now for 
the future' so yes, it would be nice to have a clear_bss() function, but 
we don't need it right now in U-Boot working as it is now; I'd much 
prefer the separate clear_bss C function to appear within the patch set 
that will bring this future general move of relocation to C.

> regards
>
> Andreas Bie?mann

Amicalement,
-- 
Albert.

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

* [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4
  2011-07-03  6:56                       ` Albert ARIBAUD
  2011-07-03  7:31                         ` Andreas Bießmann
@ 2011-07-03  8:39                         ` Aneesh V
  1 sibling, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-03  8:39 UTC (permalink / raw)
  To: u-boot

Hi Albert,

On Sunday 03 July 2011 12:26 PM, Albert ARIBAUD wrote:
> Hi Aneesh,
>
> Le 03/07/2011 06:47, Aneesh V a ?crit :
>> Hi Albert,
>>
>> On Saturday 02 July 2011 01:21 AM, Albert ARIBAUD wrote:
>>> Hi Aneesh,
>>>
>>> Le 01/07/2011 13:48, Aneesh V a ?crit :
>>>> Dear Andreas,
>>>>
>>>> On Friday 01 July 2011 03:25 PM, Andreas Bie?mann wrote:
>>>>> Dear Aneesh,
>>>> [snip ..]
>>>>> But the second part is not clear to me. I saw in your linker, that bss
>>>>> is placed in SDRAM. In start.S the boundaries for clear_bss are
>>>>> calculated at compile time to
>>>>>
>>>>> ---8<---
>>>>> _bss_start_ofs:
>>>>> .word __bss_start - _start
>>>>> --->8---
>>>>>
>>>>> Will that also work with e.g. SDRAM adress space is before SRAM, SDRAM
>>>>> addressing is far away (> 4GiB) ... So in you special case it may
>>>>> work,
>>>>> but if this is a blueprint for SPL on arm(v7) we should consider this.
>>>>>
>>>>
>>>> Nice catch. Actually, in my original OMAP4 series I tried to add
>>>> support for disjoint bss to support my case. But now I realize that it
>>>> works only for non-relocation case and that too only when the bss is at
>>>> higher address compared to .text
>>>>
>>>> Basically disjoint bss is not relocation friendly. So here is what I
>>>> propose:
>>>>
>>>> 1. Modify existing clear_bss sub-routine in start.S to take absolute
>>>> addresses.
>>>> 2. In regular u-boot, calculate the relocated bss address and pass to
>>>> this function.
>>>> 3. In SPL don't try to calculate the relocated address and directly
>>>> pass the absolute address.
>>>>
>>>> If this is fine I will make the necessary changes in start.S in the
>>>> next revision.
>>>
>>> So you would compute the BSS location in board_init_f() and pass that to
>>> relocate_code()?
>>
>> I was thinking of doing that in start.S itself. I haven't looked at
>> all the details though.
>>
>> BTW, please note that I am not trying to support disjoint BSS in
>> regular u-boot. I think it becomes complex with relocation + it doesn't
>> seem to be worth when all SDRAM is at our disposal.
>>
>> So:
>> 1. #ifdef CONFIG_PRELOADER part in start.s will just pass __bss_start
>> and __bss_end to the clear_bss function(assumes no relocation).
>> 2. #else part of above will assume that bss follows text and data(or at
>> least that __bss_start > _start), so add relocation offset to
>> __bss_start and __bss_end, and pass them to the clear_bss()
>>
>> Does that sound ok?
>
> (note clear_bss is not a function in arch/arm/cpu/armv7/start.S, it is
> only a label)
>
> So, considering what is already in arch/arm/cpu/armv7/start.S, you would
> just add a conditional variant to the BSS clearing code for the
> preloader case?
>
> If so, and considering that you'll pass an offset of 0, why would you
> need that variant for? With offset=0, the code already does what you
> want, does it not?
>

Yes, I think the following is all we need:

  clear_bss:
+#ifdef CONFIG_PRELOADER
+	/* No relocation for SPL */
+	ldr	r0, =__bss_start
+	ldr	r1, =__bss_end__
+#else
  	ldr	r0, _bss_start_ofs
  	ldr	r1, _bss_end_ofs
  	mov	r4, r6			/* reloc addr */
  	add	r0, r0, r4
  	add	r1, r1, r4
+#endif

I haven't tested this though.

br,
Aneesh

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

* [U-Boot] [RFC PATCH 0/4] spl framework prototype
  2011-06-29 13:09     ` [U-Boot] [RFC PATCH 0/7] spl framework prototype Aneesh V
  2011-07-01  5:20       ` Aneesh V
@ 2011-07-05 16:26       ` Daniel Schwierzeck
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile Daniel Schwierzeck
                           ` (4 more replies)
  1 sibling, 5 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-05 16:26 UTC (permalink / raw)
  To: u-boot

Hi Aneesh,

I tested your changes with my boards and it worked well after fixing
some minor issues. Additionally I did some cleanups and included
feedback from Mike Frysinger.

Best regards,
Daniel

Daniel Schwierzeck (4):
  Adapt config.mk for usage in spl/Makefile
  Use ALL-y style instead of ifeq blocks for better readability and
    upgradeability
  Add new folder and build system for SPL
  Hook spl directory into main Makefile

 Makefile                       |   23 ++++-----
 arch/blackfin/config.mk        |    2 +-
 board/pcs440ep/config.mk       |    2 +-
 board/spear/spear300/config.mk |    2 +-
 board/spear/spear310/config.mk |    2 +-
 board/spear/spear320/config.mk |    2 +-
 board/spear/spear600/config.mk |    2 +-
 config.mk                      |   28 +++++++++++
 spl/Makefile                   |   97 ++++++++++++++++++++++++++++++++++++++++
 9 files changed, 141 insertions(+), 19 deletions(-)
 create mode 100644 spl/Makefile

--
1.7.5.4

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-05 16:26       ` [U-Boot] [RFC PATCH 0/4] " Daniel Schwierzeck
@ 2011-07-05 16:26         ` Daniel Schwierzeck
  2011-07-05 17:52           ` Mike Frysinger
                             ` (2 more replies)
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Daniel Schwierzeck
                           ` (3 subsequent siblings)
  4 siblings, 3 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-05 16:26 UTC (permalink / raw)
  To: u-boot

[aneesh at ti.com:
1. Changed the definition of OBJTREE and the way 'obj' is defined.
2. Defined a flag to identify regular U-Boot build
3. Taking care of autoconf.mk etc for SPL due to changed OBJTREE
]

[daniel.schwierzeck at googlemail.com:
1. reverted changes on implicite make rules
2. readded definition of -DCONFIG_UBOOT_SPL_BUILD in CPPFLAGS
]

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 config.mk |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)

diff --git a/config.mk b/config.mk
index 2eb7fa2..a16e761 100644
--- a/config.mk
+++ b/config.mk
@@ -116,8 +116,14 @@ RANLIB	= $(CROSS_COMPILE)RANLIB
 #########################################################################
 
 # Load generated board configuration
+ifdef CONFIG_UBOOT_SPL_BUILD
+# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
+sinclude $(OBJTREE)/../../include/autoconf.mk
+sinclude $(OBJTREE)/../../include/config.mk
+else
 sinclude $(OBJTREE)/include/autoconf.mk
 sinclude $(OBJTREE)/include/config.mk
+endif
 
 # Some architecture config.mk files need to know what CPUDIR is set to,
 # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
@@ -164,13 +170,30 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
 endif
 
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
+endif
+
+# Allow compiling of C and ASM code parts in different way.
+# Serves also as a replacement for CONFIG_PRELOADER.
+ifneq ($(CONFIG_UBOOT_SPL_BUILD),)
+CPPFLAGS += -DCONFIG_UBOOT_SPL_BUILD
+endif
+
+CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)
+
 ifneq ($(RESET_VECTOR_ADDRESS),)
 CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
 endif
 
 ifneq ($(OBJTREE),$(SRCTREE))
+ifdef CONFIG_UBOOT_SPL_BUILD
+# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
+CPPFLAGS += -I$(OBJTREE)/../../include2 -I$(OBJTREE)/../../include
+else
 CPPFLAGS += -I$(OBJTREE)/include2 -I$(OBJTREE)/include
 endif
+endif
 
 CPPFLAGS += -I$(TOPDIR)/include
 CPPFLAGS += -fno-builtin -ffreestanding -nostdinc	\
@@ -206,6 +229,11 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
+LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+
 # Location of a usable BFD library, where we define "usable" as
 # "built for ${HOST}, supports ${TARGET}".  Sensible values are
 # - When cross-compiling: the root of the cross-environment
-- 
1.7.5.4

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

* [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability
  2011-07-05 16:26       ` [U-Boot] [RFC PATCH 0/4] " Daniel Schwierzeck
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile Daniel Schwierzeck
@ 2011-07-05 16:26         ` Daniel Schwierzeck
  2011-07-05 17:53           ` Mike Frysinger
  2011-07-08  9:12           ` Wolfgang Denk
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL Daniel Schwierzeck
                           ` (2 subsequent siblings)
  4 siblings, 2 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-05 16:26 UTC (permalink / raw)
  To: u-boot

[daniel.schwierzeck at googlemail.com:
1. changed all appendings of ALL target in several config.mk files
   as Mike Frysinger suggested
]

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 Makefile                       |   18 +++++-------------
 arch/blackfin/config.mk        |    2 +-
 board/pcs440ep/config.mk       |    2 +-
 board/spear/spear300/config.mk |    2 +-
 board/spear/spear310/config.mk |    2 +-
 board/spear/spear320/config.mk |    2 +-
 board/spear/spear600/config.mk |    2 +-
 7 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/Makefile b/Makefile
index e56fa02..8833f4b 100644
--- a/Makefile
+++ b/Makefile
@@ -341,22 +341,14 @@ BOARD_SIZE_CHECK =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
+ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-ALL += $(obj)u-boot-nand.bin
-endif
-
-ifeq ($(CONFIG_ONENAND_U_BOOT),y)
-ALL += $(obj)u-boot-onenand.bin
+ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
+ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
-endif
-
-ifeq ($(CONFIG_MMC_U_BOOT),y)
-ALL += $(obj)mmc_spl/u-boot-mmc-spl.bin
-endif
+ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
 
-all:		$(ALL)
+all:		$(ALL-y)
 
 $(obj)u-boot.hex:	$(obj)u-boot
 		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index 71fd53f..f9d46de 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -44,7 +44,7 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
 
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
-ALL += $(obj)u-boot.ldr
+ALL-y += $(obj)u-boot.ldr
 endif
 ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
 CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
diff --git a/board/pcs440ep/config.mk b/board/pcs440ep/config.mk
index 23631c5..f560ec6 100644
--- a/board/pcs440ep/config.mk
+++ b/board/pcs440ep/config.mk
@@ -26,7 +26,7 @@
 #
 
 # Check the U-Boot Image with a SHA1 checksum
-ALL += $(obj)u-boot.sha1
+ALL-y += $(obj)u-boot.sha1
 
 PLATFORM_CPPFLAGS += -DCONFIG_440=1
 
diff --git a/board/spear/spear300/config.mk b/board/spear/spear300/config.mk
index 11da2c3..5848ef8 100644
--- a/board/spear/spear300/config.mk
+++ b/board/spear/spear300/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear310/config.mk b/board/spear/spear310/config.mk
index 2b59c39..f8a6bdb 100644
--- a/board/spear/spear310/config.mk
+++ b/board/spear/spear310/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear320/config.mk b/board/spear/spear320/config.mk
index 2b59c39..f8a6bdb 100644
--- a/board/spear/spear320/config.mk
+++ b/board/spear/spear320/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear600/config.mk b/board/spear/spear600/config.mk
index 11da2c3..5848ef8 100644
--- a/board/spear/spear600/config.mk
+++ b/board/spear/spear600/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
-- 
1.7.5.4

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-05 16:26       ` [U-Boot] [RFC PATCH 0/4] " Daniel Schwierzeck
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile Daniel Schwierzeck
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Daniel Schwierzeck
@ 2011-07-05 16:26         ` Daniel Schwierzeck
  2011-07-08  9:17           ` Wolfgang Denk
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 4/4] Hook spl directory into main Makefile Daniel Schwierzeck
  2011-07-08  4:40         ` [U-Boot] [RFC PATCH 0/4] spl framework prototype Aneesh V
  4 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-05 16:26 UTC (permalink / raw)
  To: u-boot

[aneesh at ti.com:
1. Changed definition of OBJTREE for SPL
2. Added support for linker script from various places
4. $(OBJTREE)/spl/obj for objects
5. Minor cleanup
]

[daniel.schwierzeck at googlemail.com:
1. removed ALL and clean targets
2. fixed out-of-tree build error on u-boot-spl.lds generation
3. determine LDSCRIPT variable like top Makefiles does
4. fixed dependency error in target $(obj)u-boot-spl.lds
]

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 spl/Makefile |   97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 97 insertions(+), 0 deletions(-)
 create mode 100644 spl/Makefile

diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 0000000..0521008
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,97 @@
+#
+# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
+#
+# (C) Copyright 2011
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V <aneesh@ti.com>
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+
+CONFIG_UBOOT_SPL_BUILD = y
+export CONFIG_UBOOT_SPL_BUILD
+
+# create 'spl/obj' within OBJTREE for spl
+OBJTREE := $(OBJTREE)/spl/obj
+LNDIR	:= $(OBJTREE)
+
+include $(TOPDIR)/config.mk
+# We want the final binaries in this directory
+obj	:= $(obj)../
+START	= $(OBJTREE)/$(CPUDIR)/start.o
+
+LIBS-y += $(shell if [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ]; \
+	then echo "board/$(VENDOR)/common/lib$(VENDOR).o"; fi)
+LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
+LIBS-y += $(CPUDIR)/lib$(CPU).o
+ifdef SOC
+LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
+endif
+LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
+LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o
+LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/libspi_flash.o
+LIBS-$(CONFIG_SPL_GPIO_SUPPORT) += drivers/gpio/libgpio.o
+LIBS-$(CONFIG_SPL_NAND_BOOT) += spl/nand/libnand_spl.o
+LIBS-$(CONFIG_SPL_ONENAND_BOOT) += spl/nand/libonenand_spl.o
+
+LIBS = $(addprefix $(OBJTREE)/,$(sort $(LIBS-y)))
+
+__START = $(subst $(OBJTREE)/,,$(START))
+__LIBS = $(subst $(OBJTREE)/,,$(LIBS))
+
+# Linker Script
+ifdef CONFIG_SYS_SPL_LDSCRIPT
+# need to strip off double quotes
+LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SYS_SPL_LDSCRIPT)))
+endif
+
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+endif
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+	-include $(OBJTREE)/../../include/config.h \
+	$(shell $(LD) --version | \
+	  sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+all:	$(obj)u-boot-spl.bin
+
+$(obj)u-boot-spl.bin:	$(obj)u-boot-spl
+	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
+	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+	cd $(LNDIR) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__START) \
+		--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
+		-Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl:	depend $(START) $(LIBS) $(obj)u-boot-spl.lds
+	$(GEN_UBOOT)
+
+$(START):	depend
+	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+
+$(LIBS):	depend
+	$(MAKE) -C $(SRCTREE)$(dir $(subst $(OBJTREE),,$@))
+
+$(obj)u-boot-spl.lds: $(LDSCRIPT) depend
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:	$(obj).depend
+.PHONY: depend
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
-- 
1.7.5.4

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

* [U-Boot] [RFC PATCH 4/4] Hook spl directory into main Makefile
  2011-07-05 16:26       ` [U-Boot] [RFC PATCH 0/4] " Daniel Schwierzeck
                           ` (2 preceding siblings ...)
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL Daniel Schwierzeck
@ 2011-07-05 16:26         ` Daniel Schwierzeck
  2011-07-08  9:18           ` Wolfgang Denk
  2011-07-08  4:40         ` [U-Boot] [RFC PATCH 0/4] spl framework prototype Aneesh V
  4 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-05 16:26 UTC (permalink / raw)
  To: u-boot

[daniel.schwierzeck at googlemail.com:
1. fixed clean target for spl directory
2. removed image concatenation of normal U-Boot and SPL image
]

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 8833f4b..d05c2b1 100644
--- a/Makefile
+++ b/Makefile
@@ -347,6 +347,7 @@ ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
 ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
+ALL-$(CONFIG_UBOOT_SPL) += spl
 
 all:		$(ALL-y)
 
@@ -444,6 +445,9 @@ mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
 
 $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
 
+spl:		depend
+		$(MAKE) -C spl all
+
 $(TIMESTAMP_FILE):
 		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
 		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
@@ -1075,6 +1079,7 @@ clean:
 	@rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
 	@rm -f $(ONENAND_BIN)
 	@rm -f $(obj)onenand_ipl/u-boot.lds
+	@rm -f $(obj)spl/obj
 	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
 	@find $(OBJTREE) -type f \
 		\( -name 'core' -o -name '*.bak' -o -name '*~' \
-- 
1.7.5.4

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile Daniel Schwierzeck
@ 2011-07-05 17:52           ` Mike Frysinger
  2011-07-06  8:07           ` Aneesh V
  2011-07-08  9:08           ` Wolfgang Denk
  2 siblings, 0 replies; 172+ messages in thread
From: Mike Frysinger @ 2011-07-05 17:52 UTC (permalink / raw)
  To: u-boot

On Tuesday, July 05, 2011 12:26:19 Daniel Schwierzeck wrote:
> +ifdef CONFIG_UBOOT_SPL_BUILD
> +# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
> +sinclude $(OBJTREE)/../../include/autoconf.mk
> +sinclude $(OBJTREE)/../../include/config.mk
> +else
>  sinclude $(OBJTREE)/include/autoconf.mk
>  sinclude $(OBJTREE)/include/config.mk
> +endif

since all you're doing is adjusting all the paths to get at the top of the 
tree, i wonder if you shouldnt just introduce a new variable for the top and 
then base everything off that.

OBJTREETOP = $(OBJTREE)$(SUBTREE)

and then in the spl subdir, you set SUBTREE to "/../..".  this would avoid 
sprinkling of a specific CONFIG option throughout the build system.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110705/f79cf2eb/attachment.pgp 

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

* [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Daniel Schwierzeck
@ 2011-07-05 17:53           ` Mike Frysinger
  2011-07-08  9:12           ` Wolfgang Denk
  1 sibling, 0 replies; 172+ messages in thread
From: Mike Frysinger @ 2011-07-05 17:53 UTC (permalink / raw)
  To: u-boot

Acked-by: Mike Frysinger <vapier@gentoo.org>
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
Url : http://lists.denx.de/pipermail/u-boot/attachments/20110705/6bbaf0ea/attachment.pgp 

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile Daniel Schwierzeck
  2011-07-05 17:52           ` Mike Frysinger
@ 2011-07-06  8:07           ` Aneesh V
  2011-07-08  9:08           ` Wolfgang Denk
  2 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-06  8:07 UTC (permalink / raw)
  To: u-boot

Hi Daniel,

On Tuesday 05 July 2011 09:56 PM, Daniel Schwierzeck wrote:
> [aneesh at ti.com:
> 1. Changed the definition of OBJTREE and the way 'obj' is defined.
> 2. Defined a flag to identify regular U-Boot build
> 3. Taking care of autoconf.mk etc for SPL due to changed OBJTREE
> ]
>
> [daniel.schwierzeck at googlemail.com:
> 1. reverted changes on implicite make rules
> 2. readded definition of -DCONFIG_UBOOT_SPL_BUILD in CPPFLAGS
> ]
>
> Signed-off-by: Aneesh V<aneesh@ti.com>
> Signed-off-by: Daniel Schwierzeck<daniel.schwierzeck@googlemail.com>
> ---
>   config.mk |   28 ++++++++++++++++++++++++++++
>   1 files changed, 28 insertions(+), 0 deletions(-)
>
> diff --git a/config.mk b/config.mk
> index 2eb7fa2..a16e761 100644
> --- a/config.mk
> +++ b/config.mk
> @@ -116,8 +116,14 @@ RANLIB	= $(CROSS_COMPILE)RANLIB
>   #########################################################################
>
>   # Load generated board configuration
> +ifdef CONFIG_UBOOT_SPL_BUILD
> +# OBJTREE points to /spl/obj inside the original OBJTREE for SPL
> +sinclude $(OBJTREE)/../../include/autoconf.mk
> +sinclude $(OBJTREE)/../../include/config.mk
> +else
>   sinclude $(OBJTREE)/include/autoconf.mk
>   sinclude $(OBJTREE)/include/config.mk
> +endif
>
>   # Some architecture config.mk files need to know what CPUDIR is set to,
>   # so calculate CPUDIR before including ARCH/SOC/CPU config.mk files.
> @@ -164,13 +170,30 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
>   CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
>   endif
>
> +ifneq ($(CONFIG_SPL_TEXT_BASE),)

Is 'ifdef' more readable?

> +CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
> +endif
> +
> +# Allow compiling of C and ASM code parts in different way.
> +# Serves also as a replacement for CONFIG_PRELOADER.
> +ifneq ($(CONFIG_UBOOT_SPL_BUILD),)
> +CPPFLAGS += -DCONFIG_UBOOT_SPL_BUILD
> +endif

I think we need to consolidate the CONFIG flags. There are quite a few
in use already.

CONFIG_PRELOADER
CONFIG_ONENAND_IPL
CONFIG_NAND_SPL

I wonder if CONFIG_ONENAND_IPL and CONFIG_NAND_SPL are used today to
distinguish the respective boots specifically or whether they could be
replaced by CONFIG_PRELOADER.

BTW, why do you want to replace CONFIG_PRELOADER with a new flag?

> +
> +CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)
> +
>   ifneq ($(RESET_VECTOR_ADDRESS),)
>   CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
>   endif
>
[snip..]

> +LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
> +ifneq ($(CONFIG_SPL_TEXT_BASE),)
> +LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
> +endif
> +

Do we need this here or can this be in spl/Makefile ?

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 0/4] spl framework prototype
  2011-07-05 16:26       ` [U-Boot] [RFC PATCH 0/4] " Daniel Schwierzeck
                           ` (3 preceding siblings ...)
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 4/4] Hook spl directory into main Makefile Daniel Schwierzeck
@ 2011-07-08  4:40         ` Aneesh V
  4 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-08  4:40 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

Gentle reminder.. Appreciate if you could let us know your thoughts on
this prototype for SPL framework.

On Tuesday 05 July 2011 09:56 PM, Daniel Schwierzeck wrote:
> Hi Aneesh,
>
> I tested your changes with my boards and it worked well after fixing
> some minor issues. Additionally I did some cleanups and included
> feedback from Mike Frysinger.
>
> Best regards,
> Daniel
>
> Daniel Schwierzeck (4):
>    Adapt config.mk for usage in spl/Makefile
>    Use ALL-y style instead of ifeq blocks for better readability and
>      upgradeability
>    Add new folder and build system for SPL
>    Hook spl directory into main Makefile
>
>   Makefile                       |   23 ++++-----
>   arch/blackfin/config.mk        |    2 +-
>   board/pcs440ep/config.mk       |    2 +-
>   board/spear/spear300/config.mk |    2 +-
>   board/spear/spear310/config.mk |    2 +-
>   board/spear/spear320/config.mk |    2 +-
>   board/spear/spear600/config.mk |    2 +-
>   config.mk                      |   28 +++++++++++
>   spl/Makefile                   |   97 ++++++++++++++++++++++++++++++++++++++++
>   9 files changed, 141 insertions(+), 19 deletions(-)
>   create mode 100644 spl/Makefile
>
> --
> 1.7.5.4
>

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile Daniel Schwierzeck
  2011-07-05 17:52           ` Mike Frysinger
  2011-07-06  8:07           ` Aneesh V
@ 2011-07-08  9:08           ` Wolfgang Denk
  2011-07-08 10:20             ` Aneesh V
  2011-07-08 11:34             ` Daniel Schwierzeck
  2 siblings, 2 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08  9:08 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1309883182-12854-2-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> [aneesh at ti.com:
> 1. Changed the definition of OBJTREE and the way 'obj' is defined.
> 2. Defined a flag to identify regular U-Boot build
> 3. Taking care of autoconf.mk etc for SPL due to changed OBJTREE
> ]
> 
> [daniel.schwierzeck at googlemail.com:
> 1. reverted changes on implicite make rules
> 2. readded definition of -DCONFIG_UBOOT_SPL_BUILD in CPPFLAGS
> ]
...
> +# Allow compiling of C and ASM code parts in different way.
> +# Serves also as a replacement for CONFIG_PRELOADER.
> +ifneq ($(CONFIG_UBOOT_SPL_BUILD),)
> +CPPFLAGS += -DCONFIG_UBOOT_SPL_BUILD
> +endif

I don't understand this comment.

> +CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)

Is this not redundant, then?


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"In Christianity neither morality nor religion come into contact with
reality at any point."                          - Friedrich Nietzsche

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

* [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Daniel Schwierzeck
  2011-07-05 17:53           ` Mike Frysinger
@ 2011-07-08  9:12           ` Wolfgang Denk
  2011-07-08 10:28             ` Aneesh V
  1 sibling, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08  9:12 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1309883182-12854-3-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> [daniel.schwierzeck at googlemail.com:
> 1. changed all appendings of ALL target in several config.mk files
>    as Mike Frysinger suggested
> ]

Please omit this '[...]' stuff for the real commits, then.

Else:

Acked-by: Wolfgang Denk <wd@denx.de>

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
It took him several minutes to understand any new idea  put  to  him,
and  this is a very valuable trait in a leader, because anything any-
one is still trying to explain to you after two minutes  is  probably
important  and anything they give up after a mere minute or so is al-
most certainly something they shouldn't have been bothering you  with
in the first place.                   - Terry Pratchett, _Reaper Man_

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL Daniel Schwierzeck
@ 2011-07-08  9:17           ` Wolfgang Denk
  2011-07-08 11:32             ` Aneesh V
  2011-07-08 11:57             ` Daniel Schwierzeck
  0 siblings, 2 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08  9:17 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1309883182-12854-4-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
...
> +# create 'spl/obj' within OBJTREE for spl
> +OBJTREE := $(OBJTREE)/spl/obj
> +LNDIR	:= $(OBJTREE)
> +
> +include $(TOPDIR)/config.mk
> +# We want the final binaries in this directory
> +obj	:= $(obj)../
> +START	= $(OBJTREE)/$(CPUDIR)/start.o

I don't really like these "../" parts.  Can we please try to omit
these?  We can use $(TOPDIR) and/or $(OBJTREE) instead to express the
path names, can't we?

I have to admit that I don't understand what the old and the new
values of $(obj) are above...

[The same applies to the "CPPFLAGS += -I$(OBJTREE)/../../include2
-I$(OBJTREE)/../../include" part in the first patch.]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Lady Nancy Astor:
    "Winston, if you were my husband, I'd put poison in your coffee."
Winston Churchill:
    "Nancy, if you were my wife, I'd drink it."

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

* [U-Boot] [RFC PATCH 4/4] Hook spl directory into main Makefile
  2011-07-05 16:26         ` [U-Boot] [RFC PATCH 4/4] Hook spl directory into main Makefile Daniel Schwierzeck
@ 2011-07-08  9:18           ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08  9:18 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1309883182-12854-5-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> [daniel.schwierzeck at googlemail.com:
> 1. fixed clean target for spl directory
> 2. removed image concatenation of normal U-Boot and SPL image
> ]
> 
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> ---
>  Makefile |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

Acked-by: Wolfgang Denk <wd@denx.de>

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Bankers do it with interest (penalty for early withdrawal).

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-08  9:08           ` Wolfgang Denk
@ 2011-07-08 10:20             ` Aneesh V
  2011-07-08 11:19               ` Wolfgang Denk
  2011-07-08 11:34             ` Daniel Schwierzeck
  1 sibling, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-08 10:20 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Friday 08 July 2011 02:38 PM, Wolfgang Denk wrote:
> Dear Daniel Schwierzeck,
>
> In message<1309883182-12854-2-git-send-email-daniel.schwierzeck@googlemail.com>  you wrote:
>> [aneesh at ti.com:
>> 1. Changed the definition of OBJTREE and the way 'obj' is defined.
>> 2. Defined a flag to identify regular U-Boot build
>> 3. Taking care of autoconf.mk etc for SPL due to changed OBJTREE
>> ]
>>
>> [daniel.schwierzeck at googlemail.com:
>> 1. reverted changes on implicite make rules
>> 2. readded definition of -DCONFIG_UBOOT_SPL_BUILD in CPPFLAGS
>> ]
> ...
>> +# Allow compiling of C and ASM code parts in different way.
>> +# Serves also as a replacement for CONFIG_PRELOADER.
>> +ifneq ($(CONFIG_UBOOT_SPL_BUILD),)
>> +CPPFLAGS += -DCONFIG_UBOOT_SPL_BUILD
>> +endif
>
> I don't understand this comment.
>
>> +CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)
>
> Is this not redundant, then?

Yes, it is. But it was handy for conditional inclusion of source files
in the Makefiles, like this:

+# used only by normal u-boot
+COBJS-$(CONFIG_NORMAL_UBOOT)	+= fileA.o
+# used only by SPL
+COBJS-$(CONFIG_UBOOT_SPL_BUILD)	+= fileB.o
+# used by SPL and normal u-boot
+COBJS-y	+= fileC.o

Without CONFIG_NORMAL_UBOOT this becomes a little cumbersome.

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability
  2011-07-08  9:12           ` Wolfgang Denk
@ 2011-07-08 10:28             ` Aneesh V
  2011-07-08 11:20               ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-08 10:28 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Friday 08 July 2011 02:42 PM, Wolfgang Denk wrote:
> Dear Daniel Schwierzeck,
>
> In message<1309883182-12854-3-git-send-email-daniel.schwierzeck@googlemail.com>  you wrote:
>> [daniel.schwierzeck at googlemail.com:
>> 1. changed all appendings of ALL target in several config.mk files
>>     as Mike Frysinger suggested
>> ]
>
> Please omit this '[...]' stuff for the real commits, then.
>

In patches 1 and 3 of this series I had done some modifications on top
of Daniel's original work. So, I mentioned my changes in [...]. Hope
that is fine?

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-08 10:20             ` Aneesh V
@ 2011-07-08 11:19               ` Wolfgang Denk
  2011-07-08 11:40                 ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08 11:19 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4E16D9DA.4080803@ti.com> you wrote:
> 
> >> +CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)
> >
> > Is this not redundant, then?
> 
> Yes, it is. But it was handy for conditional inclusion of source files
> in the Makefiles, like this:
> 
> +# used only by normal u-boot
> +COBJS-$(CONFIG_NORMAL_UBOOT)	+= fileA.o
> +# used only by SPL
> +COBJS-$(CONFIG_UBOOT_SPL_BUILD)	+= fileB.o
> +# used by SPL and normal u-boot
> +COBJS-y	+= fileC.o
> 
> Without CONFIG_NORMAL_UBOOT this becomes a little cumbersome.

Hm... instead of

COBJS-$(CONFIG_NORMAL_UBOOT) += fileA.o

we could use

COBJS-$(if $(CONFIG_UBOOT_SPL_BUILD),,y)

directly.


Note that Daniel's patches never referenced CONFIG_NORMAL_UBOOT
anywhere, so I think we can remove it for now and decide when it
turns out we really need it.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
: 1.  What is the possibility of this being added in the future?
In the near future, the probability is close to zero. In the  distant
future, I'll be dead, and posterity can do whatever they like... :-)
                                                              - lwall

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

* [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability
  2011-07-08 10:28             ` Aneesh V
@ 2011-07-08 11:20               ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08 11:20 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4E16DBB9.3090803@ti.com> you wrote:
> 
> > Please omit this '[...]' stuff for the real commits, then.
> >
> 
> In patches 1 and 3 of this series I had done some modifications on top
> of Daniel's original work. So, I mentioned my changes in [...]. Hope
> that is fine?

For the final commits, we should get rid of this stuff in the commit
messages.  It should be sufficient if you both add your SoB lines.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
At the source of every error which is blamed on the computer you will
find at least two human errors, including the error of blaming it  on
the computer.

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-08  9:17           ` Wolfgang Denk
@ 2011-07-08 11:32             ` Aneesh V
  2011-07-08 12:32               ` Wolfgang Denk
  2011-07-08 11:57             ` Daniel Schwierzeck
  1 sibling, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-08 11:32 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Friday 08 July 2011 02:47 PM, Wolfgang Denk wrote:
> Dear Daniel Schwierzeck,
>
> In message<1309883182-12854-4-git-send-email-daniel.schwierzeck@googlemail.com>  you wrote:
> ...

Let's consider an out-of-tree build. Then,
$(OBJTREE) is BUILD_DIR here.

>> +# create 'spl/obj' within OBJTREE for spl
>> +OBJTREE := $(OBJTREE)/spl/obj
>> +LNDIR	:= $(OBJTREE)
>> +
>> +include $(TOPDIR)/config.mk

Here:
$(OBJTREE) => BUILD_DIR/spl/obj
$(obj) => BUILD_DIR/spl/obj/spl

>> +# We want the final binaries in this directory
>> +obj	:= $(obj)../
First of all, this was really intended to be:

+obj	:= $(obj)../../

(The original implementation was a mistake!)

So, here:
$(obj) => BUILD_DIR/spl/

I was trying to make an exception for the the spl directory, so that
the final images are in BUILD_DIR/spl/

>> +START	= $(OBJTREE)/$(CPUDIR)/start.o
>
> I don't really like these "../" parts.  Can we please try to omit
> these?  We can use $(TOPDIR) and/or $(OBJTREE) instead to express the
> path names, can't we?

Please note that even if we use $(OBJTREE), to achieve the above, we
will need:

+obj	:= $(OBJTREE)/../

Please note that $(OBJTREE) needs to be updated before including
config.mk while $(obj) needs to be updated after it.

The solution I see to this problem is to have BUILD_DIR/spl/ as the
OBJTREE instead of BUILD_DIR/spl/obj. But this will create problems for
in-tree builds if TOPDIR/spl also had folders for source files like
nand, one-nand etc. In that case you will have something like this:

spl/
    nand/		- source files
    spl/nand/		- object files for the above directory
    one-nand/		- source files
    spl/one-nand/	- object files for the above directory
    arch/...		- object files
    u-boot-spl		- final elf target
    u-boot-spl.bin	- final binary image

I used BUILD_DIR/spl/obj as OBJTREE to avoid this problem.

If we could keep nand-boot.c etc in the regular source tree we can have
something like this:
spl/
    arch/...		- object files
    drivers/...		- object files
    u-boot-spl		- final elf target
    u-boot-spl.bin	- final binary image

Indeed this seems to be more logical for me. All source files for SPL
remain in the regular source tree and just use BUILD_DIR/spl as a
remote build directory.

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-08  9:08           ` Wolfgang Denk
  2011-07-08 10:20             ` Aneesh V
@ 2011-07-08 11:34             ` Daniel Schwierzeck
  2011-07-08 12:25               ` Wolfgang Denk
  1 sibling, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-08 11:34 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Fri, Jul 8, 2011 at 11:08 AM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Daniel Schwierzeck,
>
> In message <1309883182-12854-2-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
>> [aneesh at ti.com:
>> 1. Changed the definition of OBJTREE and the way 'obj' is defined.
>> 2. Defined a flag to identify regular U-Boot build
>> 3. Taking care of autoconf.mk etc for SPL due to changed OBJTREE
>> ]
>>
>> [daniel.schwierzeck at googlemail.com:
>> 1. reverted changes on implicite make rules
>> 2. readded definition of -DCONFIG_UBOOT_SPL_BUILD in CPPFLAGS
>> ]
> ...
>> +# Allow compiling of C and ASM code parts in different way.
>> +# Serves also as a replacement for CONFIG_PRELOADER.
>> +ifneq ($(CONFIG_UBOOT_SPL_BUILD),)
>> +CPPFLAGS += -DCONFIG_UBOOT_SPL_BUILD
>> +endif
>
> I don't understand this comment.

Currently we have CONFIG_PRELOADER (and maybe others?) to conditionally
compile start.S and other code. The idea here is to consolidate those defines
and to use a common name convention for SPL. My suggestion is something
like CONFIG_UBOOT_SPL_BUILD. Are there better ideas?

Best regards,
Daniel

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-08 11:19               ` Wolfgang Denk
@ 2011-07-08 11:40                 ` Aneesh V
  2011-07-08 12:37                   ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-08 11:40 UTC (permalink / raw)
  To: u-boot

On Friday 08 July 2011 04:49 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4E16D9DA.4080803@ti.com>  you wrote:
>>
>>>> +CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)
>>>
>>> Is this not redundant, then?
>>
>> Yes, it is. But it was handy for conditional inclusion of source files
>> in the Makefiles, like this:
>>
>> +# used only by normal u-boot
>> +COBJS-$(CONFIG_NORMAL_UBOOT)	+= fileA.o
>> +# used only by SPL
>> +COBJS-$(CONFIG_UBOOT_SPL_BUILD)	+= fileB.o
>> +# used by SPL and normal u-boot
>> +COBJS-y	+= fileC.o
>>
>> Without CONFIG_NORMAL_UBOOT this becomes a little cumbersome.
>
> Hm... instead of
>
> COBJS-$(CONFIG_NORMAL_UBOOT) += fileA.o
>
> we could use
>
> COBJS-$(if $(CONFIG_UBOOT_SPL_BUILD),,y)

This is what I was trying to avoid. Isn't the above more obvious for
lay-users of make?

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-08  9:17           ` Wolfgang Denk
  2011-07-08 11:32             ` Aneesh V
@ 2011-07-08 11:57             ` Daniel Schwierzeck
  1 sibling, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-08 11:57 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Fri, Jul 8, 2011 at 11:17 AM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Daniel Schwierzeck,
>
> In message <1309883182-12854-4-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> ...
>> +# create 'spl/obj' within OBJTREE for spl
>> +OBJTREE := $(OBJTREE)/spl/obj
>> +LNDIR ? ? ? ?:= $(OBJTREE)
>> +
>> +include $(TOPDIR)/config.mk
>> +# We want the final binaries in this directory
>> +obj ?:= $(obj)../
>> +START ? ? ? ?= $(OBJTREE)/$(CPUDIR)/start.o
>
> I don't really like these "../" parts. ?Can we please try to omit
> these? ?We can use $(TOPDIR) and/or $(OBJTREE) instead to express the
> path names, can't we?
>
> I have to admit that I don't understand what the old and the new
> values of $(obj) are above...
>
> [The same applies to the "CPPFLAGS += -I$(OBJTREE)/../../include2
> -I$(OBJTREE)/../../include" part in the first patch.]
>

This was introduced by Aneesh. To support out-of-tree builds, those include
directories must be relative to OBJTREE because they contain auto-generated
header files. And with this SPL approach we get a second build directory
in TOPDIR/spl/obj. To build inside this directory we have to manipulate the
OBJTREE variable.

Another ideas:
- introducing an additional variable like SPLTREE (set to OBJTREE/spl/obj)
- using $(OBJTREE)$(SUBTREE)/include2" as Mike suggested.

What do you think?

Best regards,
Daniel

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-08 11:34             ` Daniel Schwierzeck
@ 2011-07-08 12:25               ` Wolfgang Denk
  2011-07-08 13:33                 ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08 12:25 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <CACUy__VhV1_eXGW1NuSgLEB1nyVJ51xUXa0vwbY3Tdb=Kvmp2w@mail.gmail.com> you wrote:
> 
> >> +# Allow compiling of C and ASM code parts in different way.
> >> +# Serves also as a replacement for CONFIG_PRELOADER.
> >> +ifneq ($(CONFIG_UBOOT_SPL_BUILD),)
> >> +CPPFLAGS += -DCONFIG_UBOOT_SPL_BUILD
> >> +endif
> >
> > I don't understand this comment.
> 
> Currently we have CONFIG_PRELOADER (and maybe others?) to conditionally
> compile start.S and other code. The idea here is to consolidate those defines
> and to use a common name convention for SPL. My suggestion is something
> like CONFIG_UBOOT_SPL_BUILD. Are there better ideas?

No, I agree with you.  I just don't understand the comment above, i. e.
in which way does this "allow compiling of C and ASM code parts in
different way"?   CPPFLAGS applies the same to .c and .S files, and I
don't see a how this setting would cause different options to be used
for C versus assembler code.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Looks clean and obviously correct to me, but then _everything_ I
write always looks obviously correct to me.  - Linus Torvalds in
<Pine.LNX.4.10.10012090054360.791-100000@penguin.transmeta.com>

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-08 11:32             ` Aneesh V
@ 2011-07-08 12:32               ` Wolfgang Denk
  2011-07-08 12:51                 ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08 12:32 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4E16EAE9.5070505@ti.com> you wrote:
> 
> >> +# create 'spl/obj' within OBJTREE for spl
> >> +OBJTREE := $(OBJTREE)/spl/obj

This is the part I dislike: we redefine variables and lose track of
their original values.

> >> +# We want the final binaries in this directory
> >> +obj	:= $(obj)../
> First of all, this was really intended to be:
> 
> +obj	:= $(obj)../../

Now we have already two levels oif such redefinitions, one going down
and the other going up.

This is, well, confusing.

I think, we should remember the original value of $(OBJTREE), so we
can use it here where we need it.

> > I don't really like these "../" parts.  Can we please try to omit
> > these?  We can use $(TOPDIR) and/or $(OBJTREE) instead to express the
> > path names, can't we?
> 
> Please note that even if we use $(OBJTREE), to achieve the above, we
> will need:
> 
> +obj	:= $(OBJTREE)/../
> 
> Please note that $(OBJTREE) needs to be updated before including
> config.mk while $(obj) needs to be updated after it.

Well, we can of course:

- use a different name instead of OBJTREE everywhere, and leave
  OBJTREE as reference to the origonal value for global use,  or
- introduce a new variable that stores the original setting of OBJTREE
  so we can refer to this later

> I used BUILD_DIR/spl/obj as OBJTREE to avoid this problem.

I understand what you are doing, and I agree with it.  I just dislike
the tiny implementation detaild of using relative chnages up and down
in the directory structure.  I would rather be able to use absolute
directory names (which are way easier to verify for debugging, etc.).

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Mistakes are often the stepping stones to utter failure.

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-08 11:40                 ` Aneesh V
@ 2011-07-08 12:37                   ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08 12:37 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4E16ECB6.5070402@ti.com> you wrote:
>
> >> Without CONFIG_NORMAL_UBOOT this becomes a little cumbersome.
> >
> > Hm... instead of
> >
> > COBJS-$(CONFIG_NORMAL_UBOOT) += fileA.o
> >
> > we could use
> >
> > COBJS-$(if $(CONFIG_UBOOT_SPL_BUILD),,y)
> 
> This is what I was trying to avoid. Isn't the above more obvious for
> lay-users of make?

Yes, it is easier, but it doesn't scale.  Today, for you anything that
is not UBOOT_SPL_BUILD, is considered to be "NORMAL".  Tomorrow, we
may have additional features FOO, BAR and BAZ that need the same type
of handling.  So how do you intend to handle this?  Assume a system
that selects UBOOT_SPL_BUILD and FOO, but neither BAR nor BAZ?  Versus
a system that selects FOO and BAZ, but neither UBOOT_SPL_BUILD nor BAR?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
A stone was placed at a ford in a river with the inscription:
"When this stone is covered it is dangerous to ford here."

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-08 12:32               ` Wolfgang Denk
@ 2011-07-08 12:51                 ` Aneesh V
  2011-07-08 13:04                   ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-08 12:51 UTC (permalink / raw)
  To: u-boot

On Friday 08 July 2011 06:02 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4E16EAE9.5070505@ti.com>  you wrote:
>>
>>>> +# create 'spl/obj' within OBJTREE for spl
>>>> +OBJTREE := $(OBJTREE)/spl/obj
>
> This is the part I dislike: we redefine variables and lose track of
> their original values.
>
>>>> +# We want the final binaries in this directory
>>>> +obj	:= $(obj)../
>> First of all, this was really intended to be:
>>
>> +obj	:= $(obj)../../
>
> Now we have already two levels oif such redefinitions, one going down
> and the other going up.
>
> This is, well, confusing.
>
> I think, we should remember the original value of $(OBJTREE), so we
> can use it here where we need it.
>
>>> I don't really like these "../" parts.  Can we please try to omit
>>> these?  We can use $(TOPDIR) and/or $(OBJTREE) instead to express the
>>> path names, can't we?
>>
>> Please note that even if we use $(OBJTREE), to achieve the above, we
>> will need:
>>
>> +obj	:= $(OBJTREE)/../
>>
>> Please note that $(OBJTREE) needs to be updated before including
>> config.mk while $(obj) needs to be updated after it.
>
> Well, we can of course:
>
> - use a different name instead of OBJTREE everywhere, and leave

What Daniel suggested about using something like SPLTREE(or SPLOBJTREE)
seems to be be right solution then. Are you ok with that?

>    OBJTREE as reference to the origonal value for global use,  or
> - introduce a new variable that stores the original setting of OBJTREE
>    so we can refer to this later
>
>> I used BUILD_DIR/spl/obj as OBJTREE to avoid this problem.
>
> I understand what you are doing, and I agree with it.  I just dislike
> the tiny implementation detaild of using relative chnages up and down
> in the directory structure.  I would rather be able to use absolute
> directory names (which are way easier to verify for debugging, etc.).

You want to continue to maintain nand_boot.c kind of files within
$(TOPDIR)/spl/ , right?

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-08 12:51                 ` Aneesh V
@ 2011-07-08 13:04                   ` Wolfgang Denk
  2011-07-08 13:28                     ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08 13:04 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4E16FD50.3090005@ti.com> you wrote:
>
> > - use a different name instead of OBJTREE everywhere, and leave
> 
> What Daniel suggested about using something like SPLTREE(or SPLOBJTREE)
> seems to be be right solution then. Are you ok with that?

Yes, if it works without too much effort.

> > - introduce a new variable that stores the original setting of OBJTREE
> >    so we can refer to this later
> >
> >> I used BUILD_DIR/spl/obj as OBJTREE to avoid this problem.

Well, this may cause nasty problems.  Note that BUILD_DIR is usually
not set for local builds; current Makefile looks like this:

OBJTREE         := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
SRCTREE         := $(CURDIR)
TOPDIR          := $(SRCTREE)
...
ifneq ($(OBJTREE),$(SRCTREE))
...

Tests like this here will fail if you use BUILD_DIR (which is not set)
instead of OBJTREE (which is set to CURDIR).

> You want to continue to maintain nand_boot.c kind of files within
> $(TOPDIR)/spl/ , right?

Yes.  Copies of, or symlinks to, source files should be avoided.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If you're not part of the solution, you're part of the problem.

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-08 13:04                   ` Wolfgang Denk
@ 2011-07-08 13:28                     ` Aneesh V
  2011-07-08 13:41                       ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-08 13:28 UTC (permalink / raw)
  To: u-boot

On Friday 08 July 2011 06:34 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4E16FD50.3090005@ti.com>  you wrote:
>>
>>> - use a different name instead of OBJTREE everywhere, and leave
>>
>> What Daniel suggested about using something like SPLTREE(or SPLOBJTREE)
>> seems to be be right solution then. Are you ok with that?
>
> Yes, if it works without too much effort.
>
>>> - introduce a new variable that stores the original setting of OBJTREE
>>>     so we can refer to this later
>>>
>>>> I used BUILD_DIR/spl/obj as OBJTREE to avoid this problem.
>
> Well, this may cause nasty problems.  Note that BUILD_DIR is usually
> not set for local builds; current Makefile looks like this:
>
> OBJTREE         := $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
> SRCTREE         := $(CURDIR)
> TOPDIR          := $(SRCTREE)
> ...
> ifneq ($(OBJTREE),$(SRCTREE))
> ...
>
> Tests like this here will fail if you use BUILD_DIR (which is not set)
> instead of OBJTREE (which is set to CURDIR).

Sorry for the confusion. I was using BUILD_DIR only to explain the
situation because OBJTREE now had a different definition. I did not use
BUILD_DIR in the changes I did.

>
>> You want to continue to maintain nand_boot.c kind of files within
>> $(TOPDIR)/spl/ , right?
>
> Yes.  Copies of, or symlinks to, source files should be avoided.

Symlinks, copies are not involved in either case. My question was this:
Where should something like 'nand_spl/nand_boot.c' go in the new
framework?

1) spl/nand/nand_boot.c OR
2) drivers/nand/spl_nand_boot.c

(2) Helps in having:
SPLOBJTREE := (OBJTREE)/spl

where as with (1) we have:
SPLOBJTREE := (OBJTREE)/spl/obj
and with this nand_boot.o will be in
(OBJTREE)/spl/obj/spl/nand/nand_boot.o !

To me (2) looks cleaner, and goes well with the idea of having all
source files in the original source tree.

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-08 12:25               ` Wolfgang Denk
@ 2011-07-08 13:33                 ` Aneesh V
  2011-07-08 13:44                   ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-08 13:33 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Friday 08 July 2011 05:55 PM, Wolfgang Denk wrote:
> Dear Daniel Schwierzeck,
>
> In message<CACUy__VhV1_eXGW1NuSgLEB1nyVJ51xUXa0vwbY3Tdb=Kvmp2w@mail.gmail.com>  you wrote:
>>
>>>> +# Allow compiling of C and ASM code parts in different way.
>>>> +# Serves also as a replacement for CONFIG_PRELOADER.
>>>> +ifneq ($(CONFIG_UBOOT_SPL_BUILD),)
>>>> +CPPFLAGS += -DCONFIG_UBOOT_SPL_BUILD
>>>> +endif
>>>
>>> I don't understand this comment.
>>
>> Currently we have CONFIG_PRELOADER (and maybe others?) to conditionally
>> compile start.S and other code. The idea here is to consolidate those defines
>> and to use a common name convention for SPL. My suggestion is something
>> like CONFIG_UBOOT_SPL_BUILD. Are there better ideas?
>
> No, I agree with you.  I just don't understand the comment above, i. e.
> in which way does this "allow compiling of C and ASM code parts in
> different way"?   CPPFLAGS applies the same to .c and .S files, and I
> don't see a how this setting would cause different options to be used
> for C versus assembler code.

Do you confirm on replacing all instances of CONFIG_PRELOADER with
CONFIG_UBOOT_SPL_BUILD?

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-08 13:28                     ` Aneesh V
@ 2011-07-08 13:41                       ` Wolfgang Denk
  2011-07-08 13:50                         ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08 13:41 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4E170601.1080000@ti.com> you wrote:
>
> Symlinks, copies are not involved in either case. My question was this:
> Where should something like 'nand_spl/nand_boot.c' go in the new
> framework?
> 
> 1) spl/nand/nand_boot.c OR
> 2) drivers/nand/spl_nand_boot.c

I have no strong preferences here...

> (2) Helps in having:
> SPLOBJTREE := (OBJTREE)/spl
> 
> where as with (1) we have:
> SPLOBJTREE := (OBJTREE)/spl/obj
> and with this nand_boot.o will be in
> (OBJTREE)/spl/obj/spl/nand/nand_boot.o !
> 
> To me (2) looks cleaner, and goes well with the idea of having all
> source files in the original source tree.

Agreed.  But maybe we can remove a redundant "nand" from the file
name, like this:

	drivers/nand/spl_boot.c

?

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Faith: not *wanting* to know what is true."    - Friedrich Nietzsche

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-08 13:33                 ` Aneesh V
@ 2011-07-08 13:44                   ` Wolfgang Denk
  2011-07-08 13:52                     ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-08 13:44 UTC (permalink / raw)
  To: u-boot

Dear Aneesh V,

In message <4E17070E.50006@ti.com> you wrote:
> 
> Do you confirm on replacing all instances of CONFIG_PRELOADER with
> CONFIG_UBOOT_SPL_BUILD?

Well, both are just names.  CONFIG_PRELOADER is shorter, but we are
moving more and more to the "spl" names, so maybe we can agree on

	CONFIG_SPL_BUILD

? [The _UBOOT is redundant - what else should we want to build? :-) ]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"Those who will be able to conquer software will be able  to  conquer
the world."                 - Tadahiro Sekimoto, president, NEC Corp.

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

* [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL
  2011-07-08 13:41                       ` Wolfgang Denk
@ 2011-07-08 13:50                         ` Aneesh V
  0 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-08 13:50 UTC (permalink / raw)
  To: u-boot

On Friday 08 July 2011 07:11 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4E170601.1080000@ti.com>  you wrote:
>>
>> Symlinks, copies are not involved in either case. My question was this:
>> Where should something like 'nand_spl/nand_boot.c' go in the new
>> framework?
>>
>> 1) spl/nand/nand_boot.c OR
>> 2) drivers/nand/spl_nand_boot.c
>
> I have no strong preferences here...
>
>> (2) Helps in having:
>> SPLOBJTREE := (OBJTREE)/spl
>>
>> where as with (1) we have:
>> SPLOBJTREE := (OBJTREE)/spl/obj
>> and with this nand_boot.o will be in
>> (OBJTREE)/spl/obj/spl/nand/nand_boot.o !
>>
>> To me (2) looks cleaner, and goes well with the idea of having all
>> source files in the original source tree.
>
> Agreed.  But maybe we can remove a redundant "nand" from the file
> name, like this:
>
> 	drivers/nand/spl_boot.c
>
> ?

ok. Thanks.

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile
  2011-07-08 13:44                   ` Wolfgang Denk
@ 2011-07-08 13:52                     ` Aneesh V
  0 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-08 13:52 UTC (permalink / raw)
  To: u-boot

On Friday 08 July 2011 07:14 PM, Wolfgang Denk wrote:
> Dear Aneesh V,
>
> In message<4E17070E.50006@ti.com>  you wrote:
>>
>> Do you confirm on replacing all instances of CONFIG_PRELOADER with
>> CONFIG_UBOOT_SPL_BUILD?
>
> Well, both are just names.  CONFIG_PRELOADER is shorter, but we are
> moving more and more to the "spl" names, so maybe we can agree on
>
> 	CONFIG_SPL_BUILD

ok.

Thanks,
Aneesh

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

* [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework
  2011-06-16  8:08 [U-Boot] SPL framework re-design Aneesh V
                   ` (2 preceding siblings ...)
  2011-06-28  0:55 ` Graeme Russ
@ 2011-07-13 15:11 ` Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
                     ` (12 more replies)
  3 siblings, 13 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

This patch series is the final proposal from Aneesh and myself for a
generic SPL framework. The implementation already works and have been
tested with in-tree and out-of-tree builds. The latest feedback
from ML is already included.


How it works

There is a new directory TOPDIR/spl which contains only a Makefile.
All source files needed by SPL are recompiled inside this directory
and linked to the final binaries named u-boot-spl[.bin|.map].

During the SPL build a variable named CONFIG_SPL_BUILD is exported
in the make environment and also appended to CPPFLAGS
with -DCONFIG_SPL_BUILD. Thus makefiles and source files are able to
build things differently for SPL.


Config options

CONFIG_SPL
  Enable building of SPL globally.

CONFIG_SPL_TEXT_BASE
  TEXT_BASE that is used when linking the SPL binary.

CONFIG_SPL_GC_SECTIONS
  Optionally enforce garbage collecting of sections for SPL.
  Useful if this is not yet fully supported by ARCH, CPU or SOC

CONFIG_SPL_LIBCOMMON_SUPPORT
CONFIG_SPL_LIBDISK_SUPPORT
CONFIG_SPL_I2C_SUPPORT
CONFIG_SPL_GPIO_SUPPORT
CONFIG_SPL_MMC_SUPPORT
CONFIG_SPL_SERIAL_SUPPORT
CONFIG_SPL_SPI_FLASH_SUPPORT
CONFIG_SPL_SPI_SUPPORT
CONFIG_SPL_FAT_SUPPORT
CONFIG_SPL_LIBGENERIC_SUPPORT
  Enable building and linking of common libraries and drivers into the
  SPL binary.


Aneesh V (3):
  arm: adjust PLATFORM_LIBS for SPL
  scaled down version of generic libraries for SPL
  replace CONFIG_PRELOADER with CONFIG_SPL_BUILD

Daniel Schwierzeck (6):
  Use ALL-y style instead of ifeq blocks for better readability
  spl: add initial support for a generic SPL framework
  Extend build-system for SPL framework
  Hook SPL build-system into toplevel Makefile
  spl: Add support for common libraries and drivers
  spl: add support for omap-common libraries

 Makefile                                  |   28 +++----
 README                                    |    2 +-
 arch/arm/config.mk                        |   11 ++-
 arch/arm/cpu/arm1136/start.S              |   20 +++---
 arch/arm/cpu/arm1176/start.S              |    4 +-
 arch/arm/cpu/arm720t/start.S              |    4 +-
 arch/arm/cpu/arm920t/start.S              |    4 +-
 arch/arm/cpu/arm925t/start.S              |    4 +-
 arch/arm/cpu/arm926ejs/start.S            |   18 ++--
 arch/arm/cpu/arm946es/start.S             |    4 +-
 arch/arm/cpu/arm_intcm/start.S            |    4 +-
 arch/arm/cpu/armv7/start.S                |    6 +-
 arch/arm/cpu/ixp/start.S                  |    4 +-
 arch/arm/cpu/lh7a40x/start.S              |    4 +-
 arch/arm/cpu/pxa/start.S                  |   30 ++++----
 arch/arm/cpu/s3c44b0/start.S              |    4 +-
 arch/arm/cpu/sa1100/start.S               |    4 +-
 arch/arm/lib/Makefile                     |    2 +
 arch/arm/lib/board.c                      |    2 +-
 arch/blackfin/config.mk                   |    2 +-
 board/pcs440ep/config.mk                  |    2 +-
 board/spear/spear300/config.mk            |    2 +-
 board/spear/spear310/config.mk            |    2 +-
 board/spear/spear320/config.mk            |    2 +-
 board/spear/spear600/config.mk            |    2 +-
 common/Makefile                           |    9 ++-
 config.mk                                 |   36 +++++++++-
 drivers/serial/Makefile                   |    3 +
 fs/fat/Makefile                           |    6 +-
 lib/Makefile                              |   11 ++-
 mmc_spl/board/samsung/smdkv310/Makefile   |    2 +-
 nand_spl/board/davinci/da8xxevm/Makefile  |    4 +-
 nand_spl/board/freescale/mx31pdk/Makefile |    4 +-
 nand_spl/board/karo/tx25/Makefile         |    4 +-
 onenand_ipl/board/apollon/Makefile        |    4 +-
 onenand_ipl/board/vpac270/Makefile        |    4 +-
 spl/.gitignore                            |    4 +
 spl/Makefile                              |  119 +++++++++++++++++++++++++++++
 38 files changed, 278 insertions(+), 103 deletions(-)
 create mode 100644 spl/.gitignore
 create mode 100644 spl/Makefile

--
1.7.6

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

* [U-Boot] [RFC PATCH v1 1/9] Use ALL-y style instead of ifeq blocks for better readability
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
@ 2011-07-13 15:11   ` Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
                     ` (11 subsequent siblings)
  12 siblings, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 Makefile                       |   20 ++++++--------------
 arch/blackfin/config.mk        |    2 +-
 board/pcs440ep/config.mk       |    2 +-
 board/spear/spear300/config.mk |    2 +-
 board/spear/spear310/config.mk |    2 +-
 board/spear/spear320/config.mk |    2 +-
 board/spear/spear600/config.mk |    2 +-
 7 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index e56fa02..62c2078 100644
--- a/Makefile
+++ b/Makefile
@@ -341,22 +341,14 @@ BOARD_SIZE_CHECK =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
+ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-ALL += $(obj)u-boot-nand.bin
-endif
-
-ifeq ($(CONFIG_ONENAND_U_BOOT),y)
-ALL += $(obj)u-boot-onenand.bin
+ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
+ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
-endif
-
-ifeq ($(CONFIG_MMC_U_BOOT),y)
-ALL += $(obj)mmc_spl/u-boot-mmc-spl.bin
-endif
+ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
 
-all:		$(ALL)
+all:		$(ALL-y)
 
 $(obj)u-boot.hex:	$(obj)u-boot
 		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
@@ -1096,7 +1088,7 @@ clobber:	clean
 		| xargs -0 rm -f
 	@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
 		$(obj)cscope.* $(obj)*.*~
-	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
+	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
 	@rm -f $(obj)u-boot.kwb
 	@rm -f $(obj)u-boot.imx
 	@rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index 71fd53f..f9d46de 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -44,7 +44,7 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
 
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
-ALL += $(obj)u-boot.ldr
+ALL-y += $(obj)u-boot.ldr
 endif
 ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
 CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
diff --git a/board/pcs440ep/config.mk b/board/pcs440ep/config.mk
index 23631c5..f560ec6 100644
--- a/board/pcs440ep/config.mk
+++ b/board/pcs440ep/config.mk
@@ -26,7 +26,7 @@
 #
 
 # Check the U-Boot Image with a SHA1 checksum
-ALL += $(obj)u-boot.sha1
+ALL-y += $(obj)u-boot.sha1
 
 PLATFORM_CPPFLAGS += -DCONFIG_440=1
 
diff --git a/board/spear/spear300/config.mk b/board/spear/spear300/config.mk
index 11da2c3..5848ef8 100644
--- a/board/spear/spear300/config.mk
+++ b/board/spear/spear300/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear310/config.mk b/board/spear/spear310/config.mk
index 2b59c39..f8a6bdb 100644
--- a/board/spear/spear310/config.mk
+++ b/board/spear/spear310/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear320/config.mk b/board/spear/spear320/config.mk
index 2b59c39..f8a6bdb 100644
--- a/board/spear/spear320/config.mk
+++ b/board/spear/spear320/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear600/config.mk b/board/spear/spear600/config.mk
index 11da2c3..5848ef8 100644
--- a/board/spear/spear600/config.mk
+++ b/board/spear/spear600/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v1 2/9] spl: add initial support for a generic SPL framework
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
@ 2011-07-13 15:11   ` Daniel Schwierzeck
  2011-07-15 16:22     ` [U-Boot] [RFC PATCH v2 " Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 3/9] Extend build-system for " Daniel Schwierzeck
                     ` (10 subsequent siblings)
  12 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 spl/.gitignore |    4 ++
 spl/Makefile   |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 spl/.gitignore
 create mode 100644 spl/Makefile

diff --git a/spl/.gitignore b/spl/.gitignore
new file mode 100644
index 0000000..7c88147
--- /dev/null
+++ b/spl/.gitignore
@@ -0,0 +1,4 @@
+u-boot-spl
+u-boot-spl.bin
+u-boot-spl.lds
+u-boot-spl.map
diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 0000000..f20092f
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,101 @@
+#
+# (C) Copyright 2000-2011
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2011
+# Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
+#
+# (C) Copyright 2011
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V <aneesh@ti.com>
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+# Based on top-level Makefile.
+#
+
+CONFIG_SPL_BUILD := y
+export CONFIG_SPL_BUILD
+
+include $(TOPDIR)/config.mk
+
+# We want the final binaries in this directory
+obj := $(OBJTREE)/spl/
+
+HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \
+			&& echo y || echo n)
+
+START := $(CPUDIR)/start.o
+
+LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
+LIBS-y += $(CPUDIR)/lib$(CPU).o
+ifdef SOC
+LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
+endif
+LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
+LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
+
+START := $(addprefix $(SPLTREE)/,$(START))
+LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
+
+__START := $(subst $(obj),,$(START))
+__LIBS := $(subst $(obj),,$(LIBS))
+
+# Linker Script
+ifdef CONFIG_SYS_SPL_LDSCRIPT
+# need to strip off double quotes
+LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SYS_SPL_LDSCRIPT)))
+endif
+
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+endif
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+	-include $(OBJTREE)/include/config.h \
+	$(shell $(LD) --version | \
+	  sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+ALL-y	+= $(obj)u-boot-spl.bin
+
+all:	$(ALL-y)
+
+$(obj)u-boot-spl.bin:	$(obj)u-boot-spl
+	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
+	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+	cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__START) \
+		--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
+		-Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl:	depend $(START) $(LIBS) $(obj)u-boot-spl.lds
+	$(GEN_UBOOT)
+
+$(START):	depend
+	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+
+$(LIBS):	depend
+	$(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))
+
+$(obj)u-boot-spl.lds: $(LDSCRIPT) depend
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:	$(obj).depend
+.PHONY: depend
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v1 3/9] Extend build-system for SPL framework
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
@ 2011-07-13 15:11   ` Daniel Schwierzeck
  2011-07-14  5:37     ` Aneesh V
  2011-07-15 16:24     ` [U-Boot] [RFC PATCH v2 " Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 4/9] Hook SPL build-system into toplevel Makefile Daniel Schwierzeck
                     ` (9 subsequent siblings)
  12 siblings, 2 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 Makefile  |    3 ++-
 config.mk |   36 +++++++++++++++++++++++++++++++++++-
 2 files changed, 37 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 62c2078..9478059 100644
--- a/Makefile
+++ b/Makefile
@@ -104,10 +104,11 @@ $(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
 endif # ifneq ($(BUILD_DIR),)
 
 OBJTREE		:= $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
+SPLTREE		:= $(OBJTREE)/spl
 SRCTREE		:= $(CURDIR)
 TOPDIR		:= $(SRCTREE)
 LNDIR		:= $(OBJTREE)
-export	TOPDIR SRCTREE OBJTREE
+export	TOPDIR SRCTREE OBJTREE SPLTREE
 
 MKCONFIG	:= $(SRCTREE)/mkconfig
 export MKCONFIG
diff --git a/config.mk b/config.mk
index 2eb7fa2..8809d7a 100644
--- a/config.mk
+++ b/config.mk
@@ -23,19 +23,31 @@
 
 #########################################################################
 
-ifneq ($(OBJTREE),$(SRCTREE))
 ifeq ($(CURDIR),$(SRCTREE))
 dir :=
 else
 dir := $(subst $(SRCTREE)/,,$(CURDIR))
 endif
 
+ifneq ($(OBJTREE),$(SRCTREE))
+# Create object files for SPL in a separate directory
+ifeq ($(CONFIG_SPL_BUILD),y)
+obj := $(if $(dir),$(SPLTREE)/$(dir)/,$(SPLTREE)/)
+else
 obj := $(if $(dir),$(OBJTREE)/$(dir)/,$(OBJTREE)/)
+endif
 src := $(if $(dir),$(SRCTREE)/$(dir)/,$(SRCTREE)/)
 
 $(shell mkdir -p $(obj))
 else
+# Create object files for SPL in a separate directory
+ifeq ($(CONFIG_SPL_BUILD),y)
+obj := $(if $(dir),$(SPLTREE)/$(dir)/,$(SPLTREE)/)
+
+$(shell mkdir -p $(obj))
+else
 obj :=
+endif
 src :=
 endif
 
@@ -158,12 +170,29 @@ OBJCFLAGS += --gap-fill=0xff
 
 gccincdir := $(shell $(CC) -print-file-name=include)
 
+# Use section garbage collect for SPL if enabled by board config
+# and current ARCH, CPU or SOC did not enable it already
+ifeq ($(CONFIG_SPL_BUILD),y)
+ifeq ($(CONFIG_SPL_GC_SECTIONS),y)
+RELFLAGS += -ffunction-sections -fdata-sections
+LDFLAGS_FINAL += --gc-sections
+endif
+endif
+
 CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)		\
 	-D__KERNEL__
 ifneq ($(CONFIG_SYS_TEXT_BASE),)
 CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
 endif
 
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
+endif
+
+ifeq ($(CONFIG_SPL_BUILD),y)
+CPPFLAGS += -DCONFIG_SPL_BUILD
+endif
+
 ifneq ($(RESET_VECTOR_ADDRESS),)
 CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
 endif
@@ -206,6 +235,11 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
+LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+
 # Location of a usable BFD library, where we define "usable" as
 # "built for ${HOST}, supports ${TARGET}".  Sensible values are
 # - When cross-compiling: the root of the cross-environment
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v1 4/9] Hook SPL build-system into toplevel Makefile
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (2 preceding siblings ...)
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 3/9] Extend build-system for " Daniel Schwierzeck
@ 2011-07-13 15:11   ` Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
                     ` (8 subsequent siblings)
  12 siblings, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 9478059..0707036 100644
--- a/Makefile
+++ b/Makefile
@@ -348,6 +348,7 @@ ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
 ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
+ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
 
 all:		$(ALL-y)
 
@@ -445,6 +446,9 @@ mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
 
 $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
 
+$(obj)spl/u-boot-spl.bin:		depend
+		$(MAKE) -C spl all
+
 $(TIMESTAMP_FILE):
 		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
 		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
@@ -1076,6 +1080,7 @@ clean:
 	@rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
 	@rm -f $(ONENAND_BIN)
 	@rm -f $(obj)onenand_ipl/u-boot.lds
+	@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map}
 	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
 	@find $(OBJTREE) -type f \
 		\( -name 'core' -o -name '*.bak' -o -name '*~' \
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v1 5/9] arm: adjust PLATFORM_LIBS for SPL
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (3 preceding siblings ...)
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 4/9] Hook SPL build-system into toplevel Makefile Daniel Schwierzeck
@ 2011-07-13 15:11   ` Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries " Daniel Schwierzeck
                     ` (7 subsequent siblings)
  12 siblings, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

From: Aneesh V <aneesh@ti.com>

Signed-off-by: Aneesh V <aneesh@ti.com>
---
 arch/arm/config.mk |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 788d4c1..9184d06 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -56,9 +56,14 @@ PLATFORM_CPPFLAGS += $(call cc-option,\
 
 # For EABI, make sure to provide raise()
 ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
-# This file is parsed several times; make sure to add only once.
-ifeq (,$(findstring arch/arm/lib/eabi_compat.o,$(PLATFORM_LIBS)))
-PLATFORM_LIBS += $(OBJTREE)/arch/arm/lib/eabi_compat.o
+# This file is parsed several times, with or without CONFIG_SPL_BUILD set
+# Make sure to add only once and with the correct prefix
+ifdef CONFIG_SPL_BUILD
+PLATFORM_LIBS := $(SPLTREE)/arch/arm/lib/eabi_compat.o \
+	$(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
+else
+PLATFORM_LIBS := $(OBJTREE)/arch/arm/lib/eabi_compat.o \
+	$(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
 endif
 endif
 
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries for SPL
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (4 preceding siblings ...)
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
@ 2011-07-13 15:11   ` Daniel Schwierzeck
  2011-07-15 12:31     ` Simon Schwarz
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD Daniel Schwierzeck
                     ` (6 subsequent siblings)
  12 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

From: Aneesh V <aneesh@ti.com>

Signed-off-by: Aneesh V <aneesh@ti.com>
---
 arch/arm/lib/Makefile   |    2 ++
 common/Makefile         |    9 ++++++---
 drivers/serial/Makefile |    3 +++
 fs/fat/Makefile         |    6 +++++-
 lib/Makefile            |   11 +++++++----
 5 files changed, 23 insertions(+), 8 deletions(-)

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
 
 SRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
 	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/common/Makefile b/common/Makefile
index 224b7cc..124a427 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -26,17 +26,15 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libcommon.o
 
 # core
+ifndef CONFIG_SPL_BUILD
 COBJS-y += main.o
-COBJS-y += console.o
 COBJS-y += command.o
 COBJS-y += dlmalloc.o
 COBJS-y += exports.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
 COBJS-y += image.o
-COBJS-y += memsize.o
 COBJS-y += s_record.o
 COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
-COBJS-y += stdio.o
 COBJS-y += xyzModem.o
 
 # core command
@@ -173,6 +171,11 @@ COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
+endif
+
+COBJS-y += console.o
+COBJS-y += memsize.o
+COBJS-y += stdio.o
 
 
 COBJS	:= $(sort $(COBJS-y))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 0e171b6..1dcc1c7 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -55,7 +55,10 @@ COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o
+
+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
+endif
 
 COBJS	:= $(sort $(COBJS-y))
 SRCS	:= $(COBJS:.o=.c)
diff --git a/fs/fat/Makefile b/fs/fat/Makefile
index bc45966..93b6f07 100644
--- a/fs/fat/Makefile
+++ b/fs/fat/Makefile
@@ -24,7 +24,11 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libfat.o
 
 AOBJS	=
-COBJS-$(CONFIG_CMD_FAT)	:= fat.o file.o
+COBJS-$(CONFIG_CMD_FAT)	:= fat.o
+
+ifndef CONFIG_SPL_BUILD
+COBJS-$(CONFIG_CMD_FAT)	+= file.o
+endif
 
 SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
diff --git a/lib/Makefile b/lib/Makefile
index afa6914..884f64c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)libgeneric.o
 
+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
 COBJS-$(CONFIG_BZIP2) += bzlib.o
 COBJS-$(CONFIG_BZIP2) += bzlib_crctable.o
@@ -35,9 +36,7 @@ COBJS-$(CONFIG_USB_TTY) += circbuf.o
 COBJS-y += crc7.o
 COBJS-y += crc16.o
 COBJS-y += crc32.o
-COBJS-y += ctype.o
 COBJS-y += display_options.o
-COBJS-y += div64.o
 COBJS-y += errno.o
 COBJS-$(CONFIG_GZIP) += gunzip.o
 COBJS-y += hashtable.o
@@ -48,11 +47,15 @@ COBJS-y += net_utils.o
 COBJS-y += qsort.o
 COBJS-$(CONFIG_SHA1) += sha1.o
 COBJS-$(CONFIG_SHA256) += sha256.o
-COBJS-y += string.o
 COBJS-y	+= strmhz.o
+COBJS-$(CONFIG_RBTREE)	+= rbtree.o
+endif
+
+COBJS-y += ctype.o
+COBJS-y += div64.o
+COBJS-y += string.o
 COBJS-y += time.o
 COBJS-y += vsprintf.o
-COBJS-$(CONFIG_RBTREE)	+= rbtree.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v1 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (5 preceding siblings ...)
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries " Daniel Schwierzeck
@ 2011-07-13 15:11   ` Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 8/9] spl: Add support for common libraries and drivers Daniel Schwierzeck
                     ` (5 subsequent siblings)
  12 siblings, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

From: Aneesh V <aneesh@ti.com>

replace all occurences of CONFIG_PRELOADER with CONFIG_SPL_BUILD

Signed-off-by: Aneesh V <aneesh@ti.com>
---
 README                                    |    2 +-
 arch/arm/cpu/arm1136/start.S              |   20 +++++++++---------
 arch/arm/cpu/arm1176/start.S              |    4 +-
 arch/arm/cpu/arm720t/start.S              |    4 +-
 arch/arm/cpu/arm920t/start.S              |    4 +-
 arch/arm/cpu/arm925t/start.S              |    4 +-
 arch/arm/cpu/arm926ejs/start.S            |   18 ++++++++--------
 arch/arm/cpu/arm946es/start.S             |    4 +-
 arch/arm/cpu/arm_intcm/start.S            |    4 +-
 arch/arm/cpu/armv7/start.S                |    6 ++--
 arch/arm/cpu/ixp/start.S                  |    4 +-
 arch/arm/cpu/lh7a40x/start.S              |    4 +-
 arch/arm/cpu/pxa/start.S                  |   30 ++++++++++++++--------------
 arch/arm/cpu/s3c44b0/start.S              |    4 +-
 arch/arm/cpu/sa1100/start.S               |    4 +-
 arch/arm/lib/board.c                      |    2 +-
 mmc_spl/board/samsung/smdkv310/Makefile   |    2 +-
 nand_spl/board/davinci/da8xxevm/Makefile  |    4 +-
 nand_spl/board/freescale/mx31pdk/Makefile |    4 +-
 nand_spl/board/karo/tx25/Makefile         |    4 +-
 onenand_ipl/board/apollon/Makefile        |    4 +-
 onenand_ipl/board/vpac270/Makefile        |    4 +-
 22 files changed, 70 insertions(+), 70 deletions(-)

diff --git a/README b/README
index 1e2d4d3..8dc0b51 100644
--- a/README
+++ b/README
@@ -3017,7 +3017,7 @@ Low Level (hardware related) configuration options:
 		other boot loader or by a debugger which performs
 		these initializations itself.
 
-- CONFIG_PRELOADER
+- CONFIG_SPL_BUILD
 		Modifies the behaviour of start.S when compiling a loader
 		that is executed before the actual U-Boot. E.g. when
 		compiling a NAND SPL.
diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 200a800..f5a1134 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -33,7 +33,7 @@
 #include <version.h>
 .globl _start
 _start: b	reset
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	ldr	pc, _hang
 	ldr	pc, _hang
 	ldr	pc, _hang
@@ -68,7 +68,7 @@ _not_used:		.word not_used
 _irq:			.word irq
 _fiq:			.word fiq
 _pad:			.word 0x12345678 /* now 16*4=64 */
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 .global _end_vect
 _end_vect:
 
@@ -201,7 +201,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -243,7 +243,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
@@ -255,7 +255,7 @@ clbss_l:str	r2, [r0]		/* clear loop...		    */
 	add	r0, r0, #4
 	cmp	r0, r1
 	bne	clbss_l
-#endif	/* #ifndef CONFIG_PRELOADER */
+#endif	/* #ifndef CONFIG_SPL_BUILD */
 
 /*
  * We are done. Do not return, instead branch to second part of board
@@ -329,7 +329,7 @@ cpu_init_crit:
 	mov	pc, lr		/* back to my caller */
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 /*
  *************************************************************************
  *
@@ -436,17 +436,17 @@ cpu_init_crit:
 	.macro get_fiq_stack			@ setup FIQ stack
 	ldr	sp, FIQ_STACK_START
 	.endm
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 
 /*
  * exception handlers
  */
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
 	ldr	sp, _TEXT_BASE			/* use 32 words about stack */
 	bl	hang				/* hang and never return */
-#else	/* !CONFIG_PRELOADER */
+#else	/* !CONFIG_SPL_BUILD */
 	.align	5
 undefined_instruction:
 	get_bad_stack
@@ -519,4 +519,4 @@ arm1136_cache_flush:
 		mcr	p15, 0, r1, c7, c14, 0	@ invalidate D cache
 #endif
 		mov	pc, lr			@ back to caller
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index b095f22..0aa613d 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -263,7 +263,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -343,7 +343,7 @@ skip_hw_init:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index e774c3f..091b7d8 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -178,7 +178,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -220,7 +220,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index a7476b0..2a53667 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -221,7 +221,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -263,7 +263,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index 39f2e99..23ccf31 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -215,7 +215,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -257,7 +257,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 0940937..636be75 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -54,7 +54,7 @@
 .globl _start
 _start:
 	b	reset
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 /* No exception handlers in preloader */
 	ldr	pc, _hang
 	ldr	pc, _hang
@@ -98,7 +98,7 @@ _irq:
 _fiq:
 	.word fiq
 
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 	.balignl 16,0xdeadbeef
 
 
@@ -214,7 +214,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -256,7 +256,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
@@ -343,7 +343,7 @@ cpu_init_crit:
 	mov	pc, lr		/* back to my caller */
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 /*
  *************************************************************************
  *
@@ -440,18 +440,18 @@ cpu_init_crit:
 	.macro get_fiq_stack			@ setup FIQ stack
 	ldr	sp, FIQ_STACK_START
 	.endm
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 
 /*
  * exception handlers
  */
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
 	ldr	sp, _TEXT_BASE			/* switch to abort stack */
 1:
 	bl	1b				/* hang and never return */
-#else	/* !CONFIG_PRELOADER */
+#else	/* !CONFIG_SPL_BUILD */
 	.align  5
 undefined_instruction:
 	get_bad_stack
@@ -514,4 +514,4 @@ fiq:
 	bl	do_fiq
 
 #endif
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index 0054b22..09374d5 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -186,7 +186,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -228,7 +228,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index 2fd3b9a..1a93277 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -182,7 +182,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -224,7 +224,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 0e698b6..d2a6207 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -182,7 +182,7 @@ stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	cmp	r0, r6
 	beq	clear_bss		/* skip relocation */
 #endif
@@ -196,7 +196,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -248,7 +248,7 @@ clbss_l:str	r2, [r0]		/* clear loop...		    */
 	add	r0, r0, #4
 	cmp	r0, r1
 	bne	clbss_l
-#endif	/* #ifndef CONFIG_PRELOADER */
+#endif	/* #ifndef CONFIG_SPL_BUILD */
 
 /*
  * We are done. Do not return, instead branch to second part of board
diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S
index a975d42..b17d267 100644
--- a/arch/arm/cpu/ixp/start.S
+++ b/arch/arm/cpu/ixp/start.S
@@ -284,7 +284,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -326,7 +326,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/lh7a40x/start.S b/arch/arm/cpu/lh7a40x/start.S
index 81242b1..61bce5f 100644
--- a/arch/arm/cpu/lh7a40x/start.S
+++ b/arch/arm/cpu/lh7a40x/start.S
@@ -195,7 +195,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -237,7 +237,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
index f1dbc3b..6191a73 100644
--- a/arch/arm/cpu/pxa/start.S
+++ b/arch/arm/cpu/pxa/start.S
@@ -43,7 +43,7 @@ sub  pc,pc,#4
 
 .globl _start
 _start: b	reset
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	ldr	pc, _hang
 	ldr	pc, _hang
 	ldr	pc, _hang
@@ -77,7 +77,7 @@ _data_abort:		.word data_abort
 _not_used:		.word not_used
 _irq:			.word irq
 _fiq:			.word fiq
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 
 	.balignl 16,0xdeadbeef
 
@@ -122,7 +122,7 @@ FIQ_STACK_START:
 	.word 0x0badc0de
 #endif /* CONFIG_USE_IRQ */
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 /* IRQ stack memory (calculated at run-time) + 8 bytes */
 .globl IRQ_STACK_START_IN
 IRQ_STACK_START_IN:
@@ -262,7 +262,7 @@ copy_loop:
 	blo	copy_loop
 	ldmfd sp!, {r0-r12}
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -301,10 +301,10 @@ fixnext:
 	add	r2, r2, #8	/* each rel.dyn entry is 8 bytes */
 	cmp	r2, r3
 	blo	fixloop
-#endif	/* #ifndef CONFIG_PRELOADER */
+#endif	/* #ifndef CONFIG_SPL_BUILD */
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
@@ -316,7 +316,7 @@ clbss_l:str	r2, [r0]		/* clear loop...		    */
 	add	r0, r0, #4
 	cmp	r0, r1
 	bne	clbss_l
-#endif	/* #ifndef CONFIG_PRELOADER */
+#endif	/* #ifndef CONFIG_SPL_BUILD */
 
 /*
  * We are done. Do not return, instead branch to second part of board
@@ -350,7 +350,7 @@ _rel_dyn_end_ofs:
 _dynsym_start_ofs:
 	.word __dynsym_start - _start
 
-#else /* CONFIG_PRELOADER */
+#else /* CONFIG_SPL_BUILD */
 
 /****************************************************************************/
 /*									    */
@@ -375,9 +375,9 @@ reset:
 	/* Start OneNAND IPL */
 	ldr	pc, =start_oneboot
 
-#endif /* CONFIG_PRELOADER */
+#endif /* CONFIG_SPL_BUILD */
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 /****************************************************************************/
 /*									    */
 /* Interrupt handling							    */
@@ -471,7 +471,7 @@ reset:
 	.macro get_fiq_stack			@ setup FIQ stack
 	ldr	sp, FIQ_STACK_START
 	.endm
-#endif	/* CONFIG_PRELOADER
+#endif	/* CONFIG_SPL_BUILD
 
 
 /****************************************************************************/
@@ -480,7 +480,7 @@ reset:
 /*									    */
 /****************************************************************************/
 
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
 	ldr	sp, _TEXT_BASE			/* use 32 words abort stack */
@@ -545,7 +545,7 @@ fiq:
 	get_bad_stack
 	bad_save_user_regs
 	bl	do_fiq
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 #endif /* CONFIG_USE_IRQ */
 
 /****************************************************************************/
@@ -584,7 +584,7 @@ reset_endless:
 
 	b	reset_endless
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 .section .mmudata, "a"
 	.align	14
 	.globl	mmu_table
@@ -604,4 +604,4 @@ mmu_table:
 	.word	(__base << 20) | 0xc12
 	.set	__base, __base + 1
 	.endr
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
diff --git a/arch/arm/cpu/s3c44b0/start.S b/arch/arm/cpu/s3c44b0/start.S
index 10f5284..2545cf6 100644
--- a/arch/arm/cpu/s3c44b0/start.S
+++ b/arch/arm/cpu/s3c44b0/start.S
@@ -167,7 +167,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -209,7 +209,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
index b27e970..c3acf7a 100644
--- a/arch/arm/cpu/sa1100/start.S
+++ b/arch/arm/cpu/sa1100/start.S
@@ -171,7 +171,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -213,7 +213,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index fc52a26..d4fd2cc 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -360,7 +360,7 @@ void board_init_f (ulong bootflag)
 
 	debug ("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10, addr);
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * reserve memory for malloc() arena
 	 */
diff --git a/mmc_spl/board/samsung/smdkv310/Makefile b/mmc_spl/board/samsung/smdkv310/Makefile
index f1ce066..de2c1a2 100644
--- a/mmc_spl/board/samsung/smdkv310/Makefile
+++ b/mmc_spl/board/samsung/smdkv310/Makefile
@@ -35,7 +35,7 @@ LDSCRIPT= $(TOPDIR)/mmc_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS	= -Bstatic -T $(mmcobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
 AFLAGS	+= -DCONFIG_MMC_SPL
 CFLAGS	+= -DCONFIG_MMC_SPL
-CFLAGS	+= -DCONFIG_PRELOADER
+CFLAGS	+= -DCONFIG_SPL_BUILD
 
 SOBJS	= start.o mem_setup.o lowlevel_init.o
 COBJS	= mmc_boot.o
diff --git a/nand_spl/board/davinci/da8xxevm/Makefile b/nand_spl/board/davinci/da8xxevm/Makefile
index c3cb1bb..b3f4bd6 100644
--- a/nand_spl/board/davinci/da8xxevm/Makefile
+++ b/nand_spl/board/davinci/da8xxevm/Makefile
@@ -33,8 +33,8 @@ nandobj	:= $(OBJTREE)/nand_spl/
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
 SOBJS	= start.o _udivsi3.o _divsi3.o
 COBJS	= cpu.o davinci_nand.o ns16550.o div0.o davinci_pinmux.o psc.o	\
diff --git a/nand_spl/board/freescale/mx31pdk/Makefile b/nand_spl/board/freescale/mx31pdk/Makefile
index 984f959..e6ec10a 100644
--- a/nand_spl/board/freescale/mx31pdk/Makefile
+++ b/nand_spl/board/freescale/mx31pdk/Makefile
@@ -8,8 +8,8 @@ nandobj	:= $(OBJTREE)/nand_spl/
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
 SOBJS	= start.o lowlevel_init.o
 COBJS	= nand_boot_fsl_nfc.o
diff --git a/nand_spl/board/karo/tx25/Makefile b/nand_spl/board/karo/tx25/Makefile
index 8bc54d1..0336346 100644
--- a/nand_spl/board/karo/tx25/Makefile
+++ b/nand_spl/board/karo/tx25/Makefile
@@ -29,8 +29,8 @@ nandobj	:= $(OBJTREE)/nand_spl/
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
 SOBJS	= start.o lowlevel_init.o
 COBJS	= nand_boot_fsl_nfc.o
diff --git a/onenand_ipl/board/apollon/Makefile b/onenand_ipl/board/apollon/Makefile
index 5397186..3bc9920 100644
--- a/onenand_ipl/board/apollon/Makefile
+++ b/onenand_ipl/board/apollon/Makefile
@@ -4,8 +4,8 @@ include $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/config.mk
 
 LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds
 LDFLAGS	= -Bstatic -T $(onenandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_ONENAND_IPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_ONENAND_IPL
 OBJCFLAGS += --gap-fill=0x00
 
 SOBJS	:= low_levelinit.o
diff --git a/onenand_ipl/board/vpac270/Makefile b/onenand_ipl/board/vpac270/Makefile
index 7300692..f850ddd 100644
--- a/onenand_ipl/board/vpac270/Makefile
+++ b/onenand_ipl/board/vpac270/Makefile
@@ -4,8 +4,8 @@ include $(TOPDIR)/board/$(BOARDDIR)/config.mk
 
 LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds
 LDFLAGS	= -Bstatic -T $(onenandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_ONENAND_IPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_ONENAND_IPL
 OBJCFLAGS += --gap-fill=0x00
 
 SOBJS	+= start.o
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v1 8/9] spl: Add support for common libraries and drivers
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (6 preceding siblings ...)
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD Daniel Schwierzeck
@ 2011-07-13 15:11   ` Daniel Schwierzeck
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 9/9] spl: add support for omap-common libraries Daniel Schwierzeck
                     ` (4 subsequent siblings)
  12 siblings, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 spl/Makefile |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/spl/Makefile b/spl/Makefile
index f20092f..957825a 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -36,6 +36,17 @@ endif
 LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
 LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
 
+LIBS-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/libcommon.o
+LIBS-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/libdisk.o
+LIBS-$(CONFIG_SPL_I2C_SUPPORT) += drivers/i2c/libi2c.o
+LIBS-$(CONFIG_SPL_GPIO_SUPPORT) += drivers/gpio/libgpio.o
+LIBS-$(CONFIG_SPL_MMC_SUPPORT) += drivers/mmc/libmmc.o
+LIBS-$(CONFIG_SPL_SERIAL_SUPPORT) += drivers/serial/libserial.o
+LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/libspi_flash.o
+LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o
+LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/libfat.o
+LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/libgeneric.o
+
 START := $(addprefix $(SPLTREE)/,$(START))
 LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
 
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v1 9/9] spl: add support for omap-common libraries
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (7 preceding siblings ...)
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 8/9] spl: Add support for common libraries and drivers Daniel Schwierzeck
@ 2011-07-13 15:11   ` Daniel Schwierzeck
  2011-07-13 15:17   ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Albert ARIBAUD
                     ` (3 subsequent siblings)
  12 siblings, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-13 15:11 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
 spl/Makefile |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/spl/Makefile b/spl/Makefile
index 957825a..fda4049 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -47,6 +47,13 @@ LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o
 LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/libfat.o
 LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/libgeneric.o
 
+ifeq ($(SOC),omap3)
+LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
+endif
+ifeq ($(SOC),omap4)
+LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
+endif
+
 START := $(addprefix $(SPLTREE)/,$(START))
 LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
 
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (8 preceding siblings ...)
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 9/9] spl: add support for omap-common libraries Daniel Schwierzeck
@ 2011-07-13 15:17   ` Albert ARIBAUD
  2011-07-14 20:06   ` Wolfgang Denk
                     ` (2 subsequent siblings)
  12 siblings, 0 replies; 172+ messages in thread
From: Albert ARIBAUD @ 2011-07-13 15:17 UTC (permalink / raw)
  To: u-boot

Le 13/07/2011 17:11, Daniel Schwierzeck a ?crit :

> This patch series is the final proposal from Aneesh and myself for a
> generic SPL framework. The implementation already works and have been
> tested with in-tree and out-of-tree builds. The latest feedback
> from ML is already included.

Please, in future messages do not use this e-mail address for reasching 
me about u-boot; use the one mentioned in the custodians page on the 
U-Boot site.

Amicalement,
-- 
Albert.

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

* [U-Boot] [RFC PATCH v1 3/9] Extend build-system for SPL framework
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 3/9] Extend build-system for " Daniel Schwierzeck
@ 2011-07-14  5:37     ` Aneesh V
  2011-07-14  9:45       ` Wolfgang Denk
  2011-07-15 16:24     ` [U-Boot] [RFC PATCH v2 " Daniel Schwierzeck
  1 sibling, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-14  5:37 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Wednesday 13 July 2011 08:41 PM, Daniel Schwierzeck wrote:

[snip ..]

>   gccincdir := $(shell $(CC) -print-file-name=include)
>
> +# Use section garbage collect for SPL if enabled by board config
> +# and current ARCH, CPU or SOC did not enable it already
> +ifeq ($(CONFIG_SPL_BUILD),y)
> +ifeq ($(CONFIG_SPL_GC_SECTIONS),y)
> +RELFLAGS += -ffunction-sections -fdata-sections
> +LDFLAGS_FINAL += --gc-sections

We were not sure whether to globally enable --gc-sections
unconditionally for SPL or not. My opinion is that these flags should
be globally enabled for all SPLs for the following reasons:

1. We chose only a few essential files per library for building the SPL
libraries. There may be undefined references from some of the functions
in the selected files to other files in the library. The functions that
have these undefined references are those that are eventually not used
by SPL. To avoid these linking errors we need --gc-sections

2. On the other hand if we built the libraries with all the files just
as you would do in u-boot, we will definitely over step the internal
RAM budget. So, in this case also we will need --gc-sections.

As such I propose that the above shall be made un-conditional after
taking care not to duplicate it if it's already defined in the platform
config.mk for the u-boot.

What do you think?

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH v1 3/9] Extend build-system for SPL framework
  2011-07-14  5:37     ` Aneesh V
@ 2011-07-14  9:45       ` Wolfgang Denk
  2011-07-14 10:02         ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-14  9:45 UTC (permalink / raw)
  To: u-boot

Dear Aneesh,

In message <4E1E8096.2000307@ti.com> you wrote:
> 
> We were not sure whether to globally enable --gc-sections
> unconditionally for SPL or not. My opinion is that these flags should
> be globally enabled for all SPLs for the following reasons:
...
> As such I propose that the above shall be made un-conditional after
> taking care not to duplicate it if it's already defined in the platform
> config.mk for the u-boot.

I agree - we should enable these optimizations unconditionally.
[Would duplication of these options be a problem?  I don't think so -
it's just bad for esthetic reasons.]

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Bei genauerem Hinsehen ist die  Arbeit  weniger  langweilig  als  das
Vergn?gen.                                      -- Charles Baudelaire

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

* [U-Boot] [RFC PATCH v1 3/9] Extend build-system for SPL framework
  2011-07-14  9:45       ` Wolfgang Denk
@ 2011-07-14 10:02         ` Aneesh V
  0 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-14 10:02 UTC (permalink / raw)
  To: u-boot

On Thursday 14 July 2011 03:15 PM, Wolfgang Denk wrote:
> Dear Aneesh,
>
> In message<4E1E8096.2000307@ti.com>  you wrote:
>>
>> We were not sure whether to globally enable --gc-sections
>> unconditionally for SPL or not. My opinion is that these flags should
>> be globally enabled for all SPLs for the following reasons:
> ...
>> As such I propose that the above shall be made un-conditional after
>> taking care not to duplicate it if it's already defined in the platform
>> config.mk for the u-boot.
>
> I agree - we should enable these optimizations unconditionally.
> [Would duplication of these options be a problem?  I don't think so -
> it's just bad for esthetic reasons.]

Yes, duplication will only make command line look ugly. I don't think
it will result in any compilation issue.

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (9 preceding siblings ...)
  2011-07-13 15:17   ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Albert ARIBAUD
@ 2011-07-14 20:06   ` Wolfgang Denk
  2011-07-14 20:25   ` Wolfgang Denk
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
  12 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-14 20:06 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1310569869-31810-1-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> This patch series is the final proposal from Aneesh and myself for a
> generic SPL framework. The implementation already works and have been
> tested with in-tree and out-of-tree builds. The latest feedback
> from ML is already included.
> 
> 
> How it works
...

It seems useful to add this "How it works" part as a new
doc/README.SPL ; could you please add this?

Also, the new CONFIG_SPL_* variables must be documented in the README.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You don't need a weatherman to know which way the wind blows.
                                                          - Bob Dylan

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

* [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (10 preceding siblings ...)
  2011-07-14 20:06   ` Wolfgang Denk
@ 2011-07-14 20:25   ` Wolfgang Denk
  2011-07-15  7:57     ` Aneesh V
  2011-07-15 15:02     ` Daniel Schwierzeck
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
  12 siblings, 2 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-14 20:25 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1310569869-31810-1-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> This patch series is the final proposal from Aneesh and myself for a
> generic SPL framework. The implementation already works and have been
> tested with in-tree and out-of-tree builds. The latest feedback
> from ML is already included.

I read your patches, and except to the documentation commetns I
already made I have but only one question (I did not spend enough time
to figure this out myself, sorry):  Do you think the split of the
patches is OK, i. e. do we maintain bisectability ?

Assuming you reply yes, and add the docs I aseked for, you have my:

Acked-by: Wolfgang Denk <wd@denx.de>

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Gew?hnlich glaubt der Mensch,  wenn er nur Worte h?rt,  es m?sse sich
dabei doch auch was denken lassen.                 -- Goethe, Faust I

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

* [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework
  2011-07-14 20:25   ` Wolfgang Denk
@ 2011-07-15  7:57     ` Aneesh V
  2011-07-15  8:35       ` Wolfgang Denk
  2011-07-15 15:02     ` Daniel Schwierzeck
  1 sibling, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-15  7:57 UTC (permalink / raw)
  To: u-boot

On Friday 15 July 2011 01:55 AM, Wolfgang Denk wrote:
> Dear Daniel Schwierzeck,
>
> In message<1310569869-31810-1-git-send-email-daniel.schwierzeck@googlemail.com>  you wrote:
>> This patch series is the final proposal from Aneesh and myself for a
>> generic SPL framework. The implementation already works and have been
>> tested with in-tree and out-of-tree builds. The latest feedback
>> from ML is already included.
>
> I read your patches, and except to the documentation commetns I
> already made I have but only one question (I did not spend enough time
> to figure this out myself, sorry):  Do you think the split of the
> patches is OK, i. e. do we maintain bisectability ?

I tried building after applying each patch one by one. There are no
errors or warnings.

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework
  2011-07-15  7:57     ` Aneesh V
@ 2011-07-15  8:35       ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-15  8:35 UTC (permalink / raw)
  To: u-boot

Dear Aneesh,

In message <4E1FF2D7.3010807@ti.com> you wrote:
>
> > I read your patches, and except to the documentation commetns I
> > already made I have but only one question (I did not spend enough time
> > to figure this out myself, sorry):  Do you think the split of the
> > patches is OK, i. e. do we maintain bisectability ?
> 
> I tried building after applying each patch one by one. There are no
> errors or warnings.

Excellent. Thanks for the good work.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Lead me not into temptation... I can find it myself.

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

* [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries for SPL
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries " Daniel Schwierzeck
@ 2011-07-15 12:31     ` Simon Schwarz
  2011-07-15 12:41       ` Aneesh V
  0 siblings, 1 reply; 172+ messages in thread
From: Simon Schwarz @ 2011-07-15 12:31 UTC (permalink / raw)
  To: u-boot

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.

I really like the new SPL - good work! ;)

Regards
Simon

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

* [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries for SPL
  2011-07-15 12:31     ` Simon Schwarz
@ 2011-07-15 12:41       ` Aneesh V
  2011-07-15 13:10         ` Simon Schwarz
  2011-07-15 14:43         ` Daniel Schwierzeck
  0 siblings, 2 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-15 12:41 UTC (permalink / raw)
  To: u-boot

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.

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries for SPL
  2011-07-15 12:41       ` Aneesh V
@ 2011-07-15 13:10         ` Simon Schwarz
  2011-07-15 13:35           ` Aneesh V
  2011-07-15 14:43         ` Daniel Schwierzeck
  1 sibling, 1 reply; 172+ messages in thread
From: Simon Schwarz @ 2011-07-15 13:10 UTC (permalink / raw)
  To: u-boot

Hi Aneesh,

>> 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
>>> =A0LIB =A0 =A0=3D $(obj)lib$(ARCH).o
>>> =A0LIBGCC =3D $(obj)libgcc.o
>>>
>>> +ifndef CONFIG_SPL_BUILD
>>> =A0GLSOBJS =A0 =A0 =A0 =A0+=3D _ashldi3.o
>>> =A0GLSOBJS =A0 =A0 =A0 =A0+=3D _ashrdi3.o
>>> =A0GLSOBJS =A0 =A0 =A0 =A0+=3D _divsi3.o
>>> @@ -45,6 +46,7 @@ COBJS-y =A0 =A0 =A0 +=3D interrupts.o
>>> =A0COBJS-y =A0 =A0 =A0 =A0+=3D reset.o
>>> =A0SOBJS-$(CONFIG_USE_ARCH_MEMSET) +=3D memset.o
>>> =A0SOBJS-$(CONFIG_USE_ARCH_MEMCPY) +=3D 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.

Then I think I didn't understand the concept correctly.

In this patch: http://patchwork.ozlabs.org/patch/104534/ you modify
board.c and add CONFIG_SPL_BUILD. Then this was just automatic search
and replace and isn't needed anymore for the new SPL?

So the new board_init_f then is created in the same dir as board.c but
e.g. named spl-board.c? Or is it preferred to write these functions -
like in the old system - totally board depended and place it in
./board/[BOARDDIR]/spl-[BOARD].c?

Thanks for answering these - probably dump - questions!

Regards
Simon

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

* [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries for SPL
  2011-07-15 13:10         ` Simon Schwarz
@ 2011-07-15 13:35           ` Aneesh V
  0 siblings, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-15 13:35 UTC (permalink / raw)
  To: u-boot

On Friday 15 July 2011 06:40 PM, Simon Schwarz wrote:
> Hi Aneesh,
>
>>> 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
>>>> =A0LIB =A0 =A0=3D $(obj)lib$(ARCH).o
>>>> =A0LIBGCC =3D $(obj)libgcc.o
>>>>
>>>> +ifndef CONFIG_SPL_BUILD
>>>> =A0GLSOBJS =A0 =A0 =A0 =A0+=3D _ashldi3.o
>>>> =A0GLSOBJS =A0 =A0 =A0 =A0+=3D _ashrdi3.o
>>>> =A0GLSOBJS =A0 =A0 =A0 =A0+=3D _divsi3.o
>>>> @@ -45,6 +46,7 @@ COBJS-y =A0 =A0 =A0 +=3D interrupts.o
>>>> =A0COBJS-y =A0 =A0 =A0 =A0+=3D reset.o
>>>> =A0SOBJS-$(CONFIG_USE_ARCH_MEMSET) +=3D memset.o
>>>> =A0SOBJS-$(CONFIG_USE_ARCH_MEMCPY) +=3D 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.
>
> Then I think I didn't understand the concept correctly.
>
> In this patch: http://patchwork.ozlabs.org/patch/104534/ you modify
> board.c and add CONFIG_SPL_BUILD. Then this was just automatic search
> and replace and isn't needed anymore for the new SPL?

Yes. That was just a search and replace. I don't think any SPL will
really use the board_init_f() in this file, be it the old framework or
new framework.

>
> So the new board_init_f then is created in the same dir as board.c but
> e.g. named spl-board.c? Or is it preferred to write these functions -
> like in the old system - totally board depended and place it in
> ./board/[BOARDDIR]/spl-[BOARD].c?

Yes, it would be typically board/SoC dependent and written according to
the needs of the board/SoC and much lesser in scope compared to the one
in arch/arm/lib/board.c

For omap I have it at:
arch/arm/cpu/armv7/omap-common/spl.c

best regards,
Aneesh

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

* [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries for SPL
  2011-07-15 12:41       ` Aneesh V
  2011-07-15 13:10         ` Simon Schwarz
@ 2011-07-15 14:43         ` Daniel Schwierzeck
  1 sibling, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-15 14:43 UTC (permalink / raw)
  To: u-boot

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

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

* [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework
  2011-07-14 20:25   ` Wolfgang Denk
  2011-07-15  7:57     ` Aneesh V
@ 2011-07-15 15:02     ` Daniel Schwierzeck
  1 sibling, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-15 15:02 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Thu, Jul 14, 2011 at 10:25 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Daniel Schwierzeck,
>
> In message <1310569869-31810-1-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
>> This patch series is the final proposal from Aneesh and myself for a
>> generic SPL framework. The implementation already works and have been
>> tested with in-tree and out-of-tree builds. The latest feedback
>> from ML is already included.
>
> I read your patches, and except to the documentation commetns I
> already made I have but only one question (I did not spend enough time
> to figure this out myself, sorry): ?Do you think the split of the
> patches is OK, i. e. do we maintain bisectability ?

I guess yes. We focussed on splitting in generic and ARM specfifc patches.

>
> Assuming you reply yes, and add the docs I aseked for, you have my:

I have a README file in my queue but left it out for the RFC series.

>
> Acked-by: Wolfgang Denk <wd@denx.de>

Thanks. Then I'll create a new series with the README files and the
gc-sections patch
from Aneesh.

Best regards,
Daniel

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

* [U-Boot] [RFC PATCH v2 2/9] spl: add initial support for a generic SPL framework
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
@ 2011-07-15 16:22     ` Daniel Schwierzeck
  2011-07-18 16:06       ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-15 16:22 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
Changes since RFC v1:
 added documentation for SPL

 README         |   36 ++++++++++++++++++++
 doc/README.SPL |   59 ++++++++++++++++++++++++++++++++
 spl/.gitignore |    4 ++
 spl/Makefile   |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 200 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.SPL
 create mode 100644 spl/.gitignore
 create mode 100644 spl/Makefile

diff --git a/README b/README
index 1e2d4d3..63a897d 100644
--- a/README
+++ b/README
@@ -2236,6 +2236,42 @@ FIT uImage format:
 		Adds the MTD partitioning infrastructure from the Linux
 		kernel. Needed for UBI support.

+- SPL framework
+                CONFIG_SPL
+                Enable building of SPL globally.
+
+                CONFIG_SPL_TEXT_BASE
+                TEXT_BASE that is used when linking the SPL binary.
+
+                CONFIG_SPL_LIBCOMMON_SUPPORT
+                Support for common/libcommon.o in SPL binary
+
+                CONFIG_SPL_LIBDISK_SUPPORT
+                Support for disk/libdisk.o in SPL binary
+
+                CONFIG_SPL_I2C_SUPPORT
+                Support for drivers/i2c/libi2c.o in SPL binary
+
+                CONFIG_SPL_GPIO_SUPPORT
+                Support for drivers/gpio/libgpio.o in SPL binary
+
+                CONFIG_SPL_MMC_SUPPORT
+                Support for drivers/mmc/libmmc.o in SPL binary
+
+                CONFIG_SPL_SERIAL_SUPPORT
+                Support for drivers/serial/libserial.o in SPL binary
+
+                CONFIG_SPL_SPI_FLASH_SUPPORT
+                Support for drivers/mtd/spi/libspi_flash.o in SPL binary
+
+                CONFIG_SPL_SPI_SUPPORT
+                Support for drivers/spi/libspi.o in SPL binary
+
+                CONFIG_SPL_FAT_SUPPORT
+                Support for fs/fat/libfat.o in SPL binary
+
+                CONFIG_SPL_LIBGENERIC_SUPPORT
+                Support for lib/libgeneric.o in SPL binary

 Modem Support:
 --------------
diff --git a/doc/README.SPL b/doc/README.SPL
new file mode 100644
index 0000000..0a89821
--- /dev/null
+++ b/doc/README.SPL
@@ -0,0 +1,59 @@
+Generic SPL framework
+=====================
+
+Overview
+--------
+
+To unify all existing implementations for a secondary program loader (SPL)
+and to allow simply adding of new implementations this generic SPL framework
+have been created. With this framework almost all source files for a board
+can be reused. No code duplication or symlinking is necessary anymore.
+
+
+How it works
+------------
+
+There is a new directory TOPDIR/spl which contains only a Makefile.
+All source files needed by SPL are recompiled inside this directory
+and linked to the final binaries named u-boot-spl[.bin|.map].
+
+During the SPL build a variable named CONFIG_SPL_BUILD is exported
+in the make environment and also appended to CPPFLAGS with -DCONFIG_SPL_BUILD.
+Thus makefiles and source files are able to build things differently for SPL.
+
+For example:
+
+ifeq ($(CONFIG_SPL_BUILD),y)
+COBJS-y += board_spl.o
+else
+COBJS-y += board.o
+endif
+
+COBJS-$(CONFIG_SPL_BUILD) += foo.o
+
+#ifdef CONFIG_SPL_BUILD
+        foo();
+#endif
+
+
+The building of SPL images can be with:
+
+#define CONFIG_SPL
+
+Because SPL images normally have a different test base, one have to be
+configured by defining CONFIG_SPL_TEXT_BASE.
+
+To support generic U-Boot libraries and drivers in the SPL binary one can
+optionally define CONFIG_SPL_XXX_SUPPORT. Currently following options
+are supported:
+
+CONFIG_SPL_LIBCOMMON_SUPPORT (common/libcommon.o)
+CONFIG_SPL_LIBDISK_SUPPORT (disk/libdisk.o)
+CONFIG_SPL_I2C_SUPPORT (drivers/i2c/libi2c.o)
+CONFIG_SPL_GPIO_SUPPORT (drivers/gpio/libgpio.o)
+CONFIG_SPL_MMC_SUPPORT (drivers/mmc/libmmc.o)
+CONFIG_SPL_SERIAL_SUPPORT (drivers/serial/libserial.o)
+CONFIG_SPL_SPI_FLASH_SUPPORT (drivers/mtd/spi/libspi_flash.o)
+CONFIG_SPL_SPI_SUPPORT (drivers/spi/libspi.o)
+CONFIG_SPL_FAT_SUPPORT (fs/fat/libfat.o)
+CONFIG_SPL_LIBGENERIC_SUPPORT (lib/libgeneric.o)
diff --git a/spl/.gitignore b/spl/.gitignore
new file mode 100644
index 0000000..7c88147
--- /dev/null
+++ b/spl/.gitignore
@@ -0,0 +1,4 @@
+u-boot-spl
+u-boot-spl.bin
+u-boot-spl.lds
+u-boot-spl.map
diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 0000000..f20092f
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,101 @@
+#
+# (C) Copyright 2000-2011
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2011
+# Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
+#
+# (C) Copyright 2011
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V <aneesh@ti.com>
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+# Based on top-level Makefile.
+#
+
+CONFIG_SPL_BUILD := y
+export CONFIG_SPL_BUILD
+
+include $(TOPDIR)/config.mk
+
+# We want the final binaries in this directory
+obj := $(OBJTREE)/spl/
+
+HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \
+			&& echo y || echo n)
+
+START := $(CPUDIR)/start.o
+
+LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
+LIBS-y += $(CPUDIR)/lib$(CPU).o
+ifdef SOC
+LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
+endif
+LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
+LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
+
+START := $(addprefix $(SPLTREE)/,$(START))
+LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
+
+__START := $(subst $(obj),,$(START))
+__LIBS := $(subst $(obj),,$(LIBS))
+
+# Linker Script
+ifdef CONFIG_SYS_SPL_LDSCRIPT
+# need to strip off double quotes
+LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SYS_SPL_LDSCRIPT)))
+endif
+
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+endif
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+	-include $(OBJTREE)/include/config.h \
+	$(shell $(LD) --version | \
+	  sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+ALL-y	+= $(obj)u-boot-spl.bin
+
+all:	$(ALL-y)
+
+$(obj)u-boot-spl.bin:	$(obj)u-boot-spl
+	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
+	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+	cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__START) \
+		--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
+		-Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl:	depend $(START) $(LIBS) $(obj)u-boot-spl.lds
+	$(GEN_UBOOT)
+
+$(START):	depend
+	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+
+$(LIBS):	depend
+	$(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))
+
+$(obj)u-boot-spl.lds: $(LDSCRIPT) depend
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:	$(obj).depend
+.PHONY: depend
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
--
1.7.6

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

* [U-Boot] [RFC PATCH v2 3/9] Extend build-system for SPL framework
  2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 3/9] Extend build-system for " Daniel Schwierzeck
  2011-07-14  5:37     ` Aneesh V
@ 2011-07-15 16:24     ` Daniel Schwierzeck
  1 sibling, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-15 16:24 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
Changes since RFC v1:
 make garbage collect of unused sections unconditionally for SPL

 Makefile  |    3 ++-
 config.mk |   34 +++++++++++++++++++++++++++++++++-
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 62c2078..9478059 100644
--- a/Makefile
+++ b/Makefile
@@ -104,10 +104,11 @@ $(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
 endif # ifneq ($(BUILD_DIR),)

 OBJTREE		:= $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
+SPLTREE		:= $(OBJTREE)/spl
 SRCTREE		:= $(CURDIR)
 TOPDIR		:= $(SRCTREE)
 LNDIR		:= $(OBJTREE)
-export	TOPDIR SRCTREE OBJTREE
+export	TOPDIR SRCTREE OBJTREE SPLTREE

 MKCONFIG	:= $(SRCTREE)/mkconfig
 export MKCONFIG
diff --git a/config.mk b/config.mk
index 2eb7fa2..ed44d03 100644
--- a/config.mk
+++ b/config.mk
@@ -23,19 +23,31 @@

 #########################################################################

-ifneq ($(OBJTREE),$(SRCTREE))
 ifeq ($(CURDIR),$(SRCTREE))
 dir :=
 else
 dir := $(subst $(SRCTREE)/,,$(CURDIR))
 endif

+ifneq ($(OBJTREE),$(SRCTREE))
+# Create object files for SPL in a separate directory
+ifeq ($(CONFIG_SPL_BUILD),y)
+obj := $(if $(dir),$(SPLTREE)/$(dir)/,$(SPLTREE)/)
+else
 obj := $(if $(dir),$(OBJTREE)/$(dir)/,$(OBJTREE)/)
+endif
 src := $(if $(dir),$(SRCTREE)/$(dir)/,$(SRCTREE)/)

 $(shell mkdir -p $(obj))
 else
+# Create object files for SPL in a separate directory
+ifeq ($(CONFIG_SPL_BUILD),y)
+obj := $(if $(dir),$(SPLTREE)/$(dir)/,$(SPLTREE)/)
+
+$(shell mkdir -p $(obj))
+else
 obj :=
+endif
 src :=
 endif

@@ -160,10 +172,25 @@ gccincdir := $(shell $(CC) -print-file-name=include)

 CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)		\
 	-D__KERNEL__
+
+# Enable garbage collection of un-used sections for SPL
+ifeq ($(CONFIG_SPL_BUILD),y)
+CPPFLAGS += -ffunction-sections -fdata-sections
+LDFLAGS_FINAL += --gc-sections
+endif
+
 ifneq ($(CONFIG_SYS_TEXT_BASE),)
 CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
 endif

+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
+endif
+
+ifeq ($(CONFIG_SPL_BUILD),y)
+CPPFLAGS += -DCONFIG_SPL_BUILD
+endif
+
 ifneq ($(RESET_VECTOR_ADDRESS),)
 CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
 endif
@@ -206,6 +233,11 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif

+LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+
 # Location of a usable BFD library, where we define "usable" as
 # "built for ${HOST}, supports ${TARGET}".  Sensible values are
 # - When cross-compiling: the root of the cross-environment
--
1.7.6

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

* [U-Boot] [RFC PATCH v2 2/9] spl: add initial support for a generic SPL framework
  2011-07-15 16:22     ` [U-Boot] [RFC PATCH v2 " Daniel Schwierzeck
@ 2011-07-18 16:06       ` Wolfgang Denk
  2011-07-18 16:22         ` Daniel Schwierzeck
  0 siblings, 1 reply; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-18 16:06 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1310746944-32711-1-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> Signed-off-by: Aneesh V <aneesh@ti.com>
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>

Thanks.

> +Overview
> +--------
> +
> +To unify all existing implementations for a secondary program loader (SPL)
> +and to allow simply adding of new implementations this generic SPL framework
> +have been created. With this framework almost all source files for a board

s/have/has/

> +How it works
> +------------
> +
> +There is a new directory TOPDIR/spl which contains only a Makefile.
> +All source files needed by SPL are recompiled inside this directory
> +and linked to the final binaries named u-boot-spl[.bin|.map].

The "recompiled inside this directory" might be misinterpreted.  How
about: "are compiled such that the resulting object files are placed
into this directory" or similar?

> +Thus makefiles and source files are able to build things differently for SPL.

Strictly speaking, the source files don't build anything themself.How
about: "This way we can compile the source files with different
settings for SPL." ?

> +Because SPL images normally have a different test base, one have to be

s/test/text/


Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Marriage is the sole cause of divorce.

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

* [U-Boot] [PATCH v3 0/9] Add initial support for a generic SPL framework
  2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
                     ` (11 preceding siblings ...)
  2011-07-14 20:25   ` Wolfgang Denk
@ 2011-07-18 16:09   ` Daniel Schwierzeck
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
                       ` (9 more replies)
  12 siblings, 10 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

This is the finalized version for the SPL framework:
http://marc.info/?l=u-boot&m=131056990001719&w=2

Changes since RFC v1:
- added documentation for SPL framework
- enable garbage collect of unused sections for SPL unconditionally

Changes since RFC v2:
- renamed CONFIG_SYS_SPL_LDSCRIPT to CONFIG_SPL_LDSCRIPT
- added missing documentation for CONFIG_SPL_LDSCRIPT

Aneesh V (3):
  arm: adjust PLATFORM_LIBS for SPL
  scaled down version of generic libraries for SPL
  replace CONFIG_PRELOADER with CONFIG_SPL_BUILD

Daniel Schwierzeck (6):
  Use ALL-y style instead of ifeq blocks for better readability
  spl: add initial support for a generic SPL framework
  Extend build-system for SPL framework
  Hook SPL build-system into toplevel Makefile
  spl: Add support for common libraries and drivers
  spl: add support for omap-common libraries

 Makefile                                  |   28 +++----
 README                                    |   41 ++++++++++-
 arch/arm/config.mk                        |   11 ++-
 arch/arm/cpu/arm1136/start.S              |   20 +++---
 arch/arm/cpu/arm1176/start.S              |    4 +-
 arch/arm/cpu/arm720t/start.S              |    4 +-
 arch/arm/cpu/arm920t/start.S              |    4 +-
 arch/arm/cpu/arm925t/start.S              |    4 +-
 arch/arm/cpu/arm926ejs/start.S            |   18 ++--
 arch/arm/cpu/arm946es/start.S             |    4 +-
 arch/arm/cpu/arm_intcm/start.S            |    4 +-
 arch/arm/cpu/armv7/start.S                |    6 +-
 arch/arm/cpu/ixp/start.S                  |    4 +-
 arch/arm/cpu/lh7a40x/start.S              |    4 +-
 arch/arm/cpu/pxa/start.S                  |   30 ++++----
 arch/arm/cpu/s3c44b0/start.S              |    4 +-
 arch/arm/cpu/sa1100/start.S               |    4 +-
 arch/arm/lib/Makefile                     |    2 +
 arch/arm/lib/board.c                      |    2 +-
 arch/blackfin/config.mk                   |    2 +-
 board/pcs440ep/config.mk                  |    2 +-
 board/spear/spear300/config.mk            |    2 +-
 board/spear/spear310/config.mk            |    2 +-
 board/spear/spear320/config.mk            |    2 +-
 board/spear/spear600/config.mk            |    2 +-
 common/Makefile                           |    9 ++-
 config.mk                                 |   34 ++++++++-
 doc/README.SPL                            |   60 +++++++++++++++
 drivers/serial/Makefile                   |    3 +
 fs/fat/Makefile                           |    6 +-
 lib/Makefile                              |   11 ++-
 mmc_spl/board/samsung/smdkv310/Makefile   |    2 +-
 nand_spl/board/davinci/da8xxevm/Makefile  |    4 +-
 nand_spl/board/freescale/mx31pdk/Makefile |    4 +-
 nand_spl/board/karo/tx25/Makefile         |    4 +-
 onenand_ipl/board/apollon/Makefile        |    4 +-
 onenand_ipl/board/vpac270/Makefile        |    4 +-
 spl/.gitignore                            |    4 +
 spl/Makefile                              |  119 +++++++++++++++++++++++++++++
 39 files changed, 375 insertions(+), 103 deletions(-)
 create mode 100644 doc/README.SPL
 create mode 100644 spl/.gitignore
 create mode 100644 spl/Makefile

-- 
1.7.6

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

* [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
@ 2011-07-18 16:09     ` Daniel Schwierzeck
  2011-07-19  3:51       ` Vipin Kumar
  2011-07-26 12:41       ` Wolfgang Denk
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
                       ` (8 subsequent siblings)
  9 siblings, 2 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
Cc: Mike Frysinger <vapier@gentoo.org>
Cc: Stefan Roese <sr@denx.de>
Cc: Vipin Kumar <vipin.kumar@st.com>
---
Changes since RFC v1:
- none

 Makefile                       |   20 ++++++--------------
 arch/blackfin/config.mk        |    2 +-
 board/pcs440ep/config.mk       |    2 +-
 board/spear/spear300/config.mk |    2 +-
 board/spear/spear310/config.mk |    2 +-
 board/spear/spear320/config.mk |    2 +-
 board/spear/spear600/config.mk |    2 +-
 7 files changed, 12 insertions(+), 20 deletions(-)

diff --git a/Makefile b/Makefile
index e56fa02..62c2078 100644
--- a/Makefile
+++ b/Makefile
@@ -341,22 +341,14 @@ BOARD_SIZE_CHECK =
 endif
 
 # Always append ALL so that arch config.mk's can add custom ones
-ALL += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
+ALL-y += $(obj)u-boot.srec $(obj)u-boot.bin $(obj)System.map
 
-ifeq ($(CONFIG_NAND_U_BOOT),y)
-ALL += $(obj)u-boot-nand.bin
-endif
-
-ifeq ($(CONFIG_ONENAND_U_BOOT),y)
-ALL += $(obj)u-boot-onenand.bin
+ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
+ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
-endif
-
-ifeq ($(CONFIG_MMC_U_BOOT),y)
-ALL += $(obj)mmc_spl/u-boot-mmc-spl.bin
-endif
+ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
 
-all:		$(ALL)
+all:		$(ALL-y)
 
 $(obj)u-boot.hex:	$(obj)u-boot
 		$(OBJCOPY) ${OBJCFLAGS} -O ihex $< $@
@@ -1096,7 +1088,7 @@ clobber:	clean
 		| xargs -0 rm -f
 	@rm -f $(OBJS) $(obj)*.bak $(obj)ctags $(obj)etags $(obj)TAGS \
 		$(obj)cscope.* $(obj)*.*~
-	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL)
+	@rm -f $(obj)u-boot $(obj)u-boot.map $(obj)u-boot.hex $(ALL-y)
 	@rm -f $(obj)u-boot.kwb
 	@rm -f $(obj)u-boot.imx
 	@rm -f $(obj)tools/{env/crc32.c,inca-swap-bytes}
diff --git a/arch/blackfin/config.mk b/arch/blackfin/config.mk
index 71fd53f..f9d46de 100644
--- a/arch/blackfin/config.mk
+++ b/arch/blackfin/config.mk
@@ -44,7 +44,7 @@ PLATFORM_RELFLAGS += -ffunction-sections -fdata-sections
 PLATFORM_RELFLAGS += -mcpu=$(CONFIG_BFIN_CPU)
 
 ifneq ($(CONFIG_BFIN_BOOT_MODE),BFIN_BOOT_BYPASS)
-ALL += $(obj)u-boot.ldr
+ALL-y += $(obj)u-boot.ldr
 endif
 ifeq ($(CONFIG_ENV_IS_EMBEDDED_IN_LDR),y)
 CREATE_LDR_ENV = $(obj)tools/envcrc --binary > $(obj)env-ldr.o
diff --git a/board/pcs440ep/config.mk b/board/pcs440ep/config.mk
index 23631c5..f560ec6 100644
--- a/board/pcs440ep/config.mk
+++ b/board/pcs440ep/config.mk
@@ -26,7 +26,7 @@
 #
 
 # Check the U-Boot Image with a SHA1 checksum
-ALL += $(obj)u-boot.sha1
+ALL-y += $(obj)u-boot.sha1
 
 PLATFORM_CPPFLAGS += -DCONFIG_440=1
 
diff --git a/board/spear/spear300/config.mk b/board/spear/spear300/config.mk
index 11da2c3..5848ef8 100644
--- a/board/spear/spear300/config.mk
+++ b/board/spear/spear300/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear310/config.mk b/board/spear/spear310/config.mk
index 2b59c39..f8a6bdb 100644
--- a/board/spear/spear310/config.mk
+++ b/board/spear/spear310/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear320/config.mk b/board/spear/spear320/config.mk
index 2b59c39..f8a6bdb 100644
--- a/board/spear/spear320/config.mk
+++ b/board/spear/spear320/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
diff --git a/board/spear/spear600/config.mk b/board/spear/spear600/config.mk
index 11da2c3..5848ef8 100644
--- a/board/spear/spear600/config.mk
+++ b/board/spear/spear600/config.mk
@@ -25,7 +25,7 @@
 
 CONFIG_SYS_TEXT_BASE = 0x00700000
 
-ALL += $(obj)u-boot.img
+ALL-y += $(obj)u-boot.img
 
 # Environment variables in NAND
 ifeq ($(ENV),NAND)
-- 
1.7.6

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

* [U-Boot] [PATCH v3 2/9] spl: add initial support for a generic SPL framework
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
@ 2011-07-18 16:09     ` Daniel Schwierzeck
  2011-07-18 17:48       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 3/9] Extend build-system for " Daniel Schwierzeck
                       ` (7 subsequent siblings)
  9 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
Changes since RFC v1:
- added documentation for SPL

Changes since RFC v2:
- renamed CONFIG_SYS_SPL_LDSCRIPT to CONFIG_SPL_LDSCRIPT
- added missing documentation for CONFIG_SPL_LDSCRIPT

 README         |   39 +++++++++++++++++++++
 doc/README.SPL |   60 +++++++++++++++++++++++++++++++++
 spl/.gitignore |    4 ++
 spl/Makefile   |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 204 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.SPL
 create mode 100644 spl/.gitignore
 create mode 100644 spl/Makefile

diff --git a/README b/README
index 1e2d4d3..8cac56c 100644
--- a/README
+++ b/README
@@ -2236,6 +2236,45 @@ FIT uImage format:
 		Adds the MTD partitioning infrastructure from the Linux
 		kernel. Needed for UBI support.
 
+- SPL framework
+                CONFIG_SPL
+                Enable building of SPL globally.
+
+                CONFIG_SPL_TEXT_BASE
+                TEXT_BASE for linking the SPL binary.
+
+                CONFIG_SPL_LDSCRIPT
+                LDSCRIPT for linking the SPL binary.
+
+                CONFIG_SPL_LIBCOMMON_SUPPORT
+                Support for common/libcommon.o in SPL binary
+
+                CONFIG_SPL_LIBDISK_SUPPORT
+                Support for disk/libdisk.o in SPL binary
+
+                CONFIG_SPL_I2C_SUPPORT
+                Support for drivers/i2c/libi2c.o in SPL binary
+
+                CONFIG_SPL_GPIO_SUPPORT
+                Support for drivers/gpio/libgpio.o in SPL binary
+
+                CONFIG_SPL_MMC_SUPPORT
+                Support for drivers/mmc/libmmc.o in SPL binary
+
+                CONFIG_SPL_SERIAL_SUPPORT
+                Support for drivers/serial/libserial.o in SPL binary
+
+                CONFIG_SPL_SPI_FLASH_SUPPORT
+                Support for drivers/mtd/spi/libspi_flash.o in SPL binary
+
+                CONFIG_SPL_SPI_SUPPORT
+                Support for drivers/spi/libspi.o in SPL binary
+
+                CONFIG_SPL_FAT_SUPPORT
+                Support for fs/fat/libfat.o in SPL binary
+
+                CONFIG_SPL_LIBGENERIC_SUPPORT
+                Support for lib/libgeneric.o in SPL binary
 
 Modem Support:
 --------------
diff --git a/doc/README.SPL b/doc/README.SPL
new file mode 100644
index 0000000..3afe28f
--- /dev/null
+++ b/doc/README.SPL
@@ -0,0 +1,60 @@
+Generic SPL framework
+=====================
+
+Overview
+--------
+
+To unify all existing implementations for a secondary program loader (SPL)
+and to allow simply adding of new implementations this generic SPL framework
+have been created. With this framework almost all source files for a board
+can be reused. No code duplication or symlinking is necessary anymore.
+
+
+How it works
+------------
+
+There is a new directory TOPDIR/spl which contains only a Makefile.
+All source files needed by SPL are recompiled inside this directory
+and linked to the final binaries named u-boot-spl[.bin|.map].
+
+During the SPL build a variable named CONFIG_SPL_BUILD is exported
+in the make environment and also appended to CPPFLAGS with -DCONFIG_SPL_BUILD.
+Thus makefiles and source files are able to build things differently for SPL.
+
+For example:
+
+ifeq ($(CONFIG_SPL_BUILD),y)
+COBJS-y += board_spl.o
+else
+COBJS-y += board.o
+endif
+
+COBJS-$(CONFIG_SPL_BUILD) += foo.o
+
+#ifdef CONFIG_SPL_BUILD
+        foo();
+#endif
+
+
+The building of SPL images can be with:
+
+#define CONFIG_SPL
+
+Because SPL images normally have a different test base, one have to be
+configured by defining CONFIG_SPL_TEXT_BASE. The linker script have to be
+defined with CONFIG_SPL_LDSCRIPT.
+
+To support generic U-Boot libraries and drivers in the SPL binary one can
+optionally define CONFIG_SPL_XXX_SUPPORT. Currently following options
+are supported:
+
+CONFIG_SPL_LIBCOMMON_SUPPORT (common/libcommon.o)
+CONFIG_SPL_LIBDISK_SUPPORT (disk/libdisk.o)
+CONFIG_SPL_I2C_SUPPORT (drivers/i2c/libi2c.o)
+CONFIG_SPL_GPIO_SUPPORT (drivers/gpio/libgpio.o)
+CONFIG_SPL_MMC_SUPPORT (drivers/mmc/libmmc.o)
+CONFIG_SPL_SERIAL_SUPPORT (drivers/serial/libserial.o)
+CONFIG_SPL_SPI_FLASH_SUPPORT (drivers/mtd/spi/libspi_flash.o)
+CONFIG_SPL_SPI_SUPPORT (drivers/spi/libspi.o)
+CONFIG_SPL_FAT_SUPPORT (fs/fat/libfat.o)
+CONFIG_SPL_LIBGENERIC_SUPPORT (lib/libgeneric.o)
diff --git a/spl/.gitignore b/spl/.gitignore
new file mode 100644
index 0000000..7c88147
--- /dev/null
+++ b/spl/.gitignore
@@ -0,0 +1,4 @@
+u-boot-spl
+u-boot-spl.bin
+u-boot-spl.lds
+u-boot-spl.map
diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 0000000..bc24c3b
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,101 @@
+#
+# (C) Copyright 2000-2011
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2011
+# Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
+#
+# (C) Copyright 2011
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V <aneesh@ti.com>
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+# Based on top-level Makefile.
+#
+
+CONFIG_SPL_BUILD := y
+export CONFIG_SPL_BUILD
+
+include $(TOPDIR)/config.mk
+
+# We want the final binaries in this directory
+obj := $(OBJTREE)/spl/
+
+HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \
+			&& echo y || echo n)
+
+START := $(CPUDIR)/start.o
+
+LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
+LIBS-y += $(CPUDIR)/lib$(CPU).o
+ifdef SOC
+LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
+endif
+LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
+LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
+
+START := $(addprefix $(SPLTREE)/,$(START))
+LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
+
+__START := $(subst $(obj),,$(START))
+__LIBS := $(subst $(obj),,$(LIBS))
+
+# Linker Script
+ifdef CONFIG_SPL_LDSCRIPT
+# need to strip off double quotes
+LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SPL_LDSCRIPT)))
+endif
+
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+endif
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+	-include $(OBJTREE)/include/config.h \
+	$(shell $(LD) --version | \
+	  sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+ALL-y	+= $(obj)u-boot-spl.bin
+
+all:	$(ALL-y)
+
+$(obj)u-boot-spl.bin:	$(obj)u-boot-spl
+	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
+	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+	cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__START) \
+		--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
+		-Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl:	depend $(START) $(LIBS) $(obj)u-boot-spl.lds
+	$(GEN_UBOOT)
+
+$(START):	depend
+	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+
+$(LIBS):	depend
+	$(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))
+
+$(obj)u-boot-spl.lds: $(LDSCRIPT) depend
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:	$(obj).depend
+.PHONY: depend
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
+
-- 
1.7.6

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

* [U-Boot] [PATCH v3 3/9] Extend build-system for SPL framework
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
@ 2011-07-18 16:09     ` Daniel Schwierzeck
  2011-07-26 12:42       ` Wolfgang Denk
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 4/9] Hook SPL build-system into toplevel Makefile Daniel Schwierzeck
                       ` (6 subsequent siblings)
  9 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
Changes since RFC v1:
- enable garbage collect of unused sections for SPL unconditionally

Changes since RFC v2:
- none

 Makefile  |    3 ++-
 config.mk |   34 +++++++++++++++++++++++++++++++++-
 2 files changed, 35 insertions(+), 2 deletions(-)

diff --git a/Makefile b/Makefile
index 62c2078..9478059 100644
--- a/Makefile
+++ b/Makefile
@@ -104,10 +104,11 @@ $(if $(BUILD_DIR),,$(error output directory "$(saved-output)" does not exist))
 endif # ifneq ($(BUILD_DIR),)
 
 OBJTREE		:= $(if $(BUILD_DIR),$(BUILD_DIR),$(CURDIR))
+SPLTREE		:= $(OBJTREE)/spl
 SRCTREE		:= $(CURDIR)
 TOPDIR		:= $(SRCTREE)
 LNDIR		:= $(OBJTREE)
-export	TOPDIR SRCTREE OBJTREE
+export	TOPDIR SRCTREE OBJTREE SPLTREE
 
 MKCONFIG	:= $(SRCTREE)/mkconfig
 export MKCONFIG
diff --git a/config.mk b/config.mk
index 2eb7fa2..ed44d03 100644
--- a/config.mk
+++ b/config.mk
@@ -23,19 +23,31 @@
 
 #########################################################################
 
-ifneq ($(OBJTREE),$(SRCTREE))
 ifeq ($(CURDIR),$(SRCTREE))
 dir :=
 else
 dir := $(subst $(SRCTREE)/,,$(CURDIR))
 endif
 
+ifneq ($(OBJTREE),$(SRCTREE))
+# Create object files for SPL in a separate directory
+ifeq ($(CONFIG_SPL_BUILD),y)
+obj := $(if $(dir),$(SPLTREE)/$(dir)/,$(SPLTREE)/)
+else
 obj := $(if $(dir),$(OBJTREE)/$(dir)/,$(OBJTREE)/)
+endif
 src := $(if $(dir),$(SRCTREE)/$(dir)/,$(SRCTREE)/)
 
 $(shell mkdir -p $(obj))
 else
+# Create object files for SPL in a separate directory
+ifeq ($(CONFIG_SPL_BUILD),y)
+obj := $(if $(dir),$(SPLTREE)/$(dir)/,$(SPLTREE)/)
+
+$(shell mkdir -p $(obj))
+else
 obj :=
+endif
 src :=
 endif
 
@@ -160,10 +172,25 @@ gccincdir := $(shell $(CC) -print-file-name=include)
 
 CPPFLAGS := $(DBGFLAGS) $(OPTFLAGS) $(RELFLAGS)		\
 	-D__KERNEL__
+
+# Enable garbage collection of un-used sections for SPL
+ifeq ($(CONFIG_SPL_BUILD),y)
+CPPFLAGS += -ffunction-sections -fdata-sections
+LDFLAGS_FINAL += --gc-sections
+endif
+
 ifneq ($(CONFIG_SYS_TEXT_BASE),)
 CPPFLAGS += -DCONFIG_SYS_TEXT_BASE=$(CONFIG_SYS_TEXT_BASE)
 endif
 
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+CPPFLAGS += -DCONFIG_SPL_TEXT_BASE=$(CONFIG_SPL_TEXT_BASE)
+endif
+
+ifeq ($(CONFIG_SPL_BUILD),y)
+CPPFLAGS += -DCONFIG_SPL_BUILD
+endif
+
 ifneq ($(RESET_VECTOR_ADDRESS),)
 CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
 endif
@@ -206,6 +233,11 @@ ifneq ($(CONFIG_SYS_TEXT_BASE),)
 LDFLAGS_u-boot += -Ttext $(CONFIG_SYS_TEXT_BASE)
 endif
 
+LDFLAGS_u-boot-spl += -T $(obj)u-boot-spl.lds $(LDFLAGS_FINAL)
+ifneq ($(CONFIG_SPL_TEXT_BASE),)
+LDFLAGS_u-boot-spl += -Ttext $(CONFIG_SPL_TEXT_BASE)
+endif
+
 # Location of a usable BFD library, where we define "usable" as
 # "built for ${HOST}, supports ${TARGET}".  Sensible values are
 # - When cross-compiling: the root of the cross-environment
-- 
1.7.6

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

* [U-Boot] [PATCH v3 4/9] Hook SPL build-system into toplevel Makefile
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
                       ` (2 preceding siblings ...)
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 3/9] Extend build-system for " Daniel Schwierzeck
@ 2011-07-18 16:09     ` Daniel Schwierzeck
  2011-07-26 12:43       ` Wolfgang Denk
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
                       ` (5 subsequent siblings)
  9 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
Changes since RFC v1:
- none

 Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/Makefile b/Makefile
index 9478059..0707036 100644
--- a/Makefile
+++ b/Makefile
@@ -348,6 +348,7 @@ ALL-$(CONFIG_NAND_U_BOOT) += $(obj)u-boot-nand.bin
 ALL-$(CONFIG_ONENAND_U_BOOT) += $(obj)u-boot-onenand.bin
 ONENAND_BIN ?= $(obj)onenand_ipl/onenand-ipl-2k.bin
 ALL-$(CONFIG_MMC_U_BOOT) += $(obj)mmc_spl/u-boot-mmc-spl.bin
+ALL-$(CONFIG_SPL) += $(obj)spl/u-boot-spl.bin
 
 all:		$(ALL-y)
 
@@ -445,6 +446,9 @@ mmc_spl:	$(TIMESTAMP_FILE) $(VERSION_FILE) depend
 
 $(obj)mmc_spl/u-boot-mmc-spl.bin:	mmc_spl
 
+$(obj)spl/u-boot-spl.bin:		depend
+		$(MAKE) -C spl all
+
 $(TIMESTAMP_FILE):
 		@LC_ALL=C date +'#define U_BOOT_DATE "%b %d %C%y"' > $@
 		@LC_ALL=C date +'#define U_BOOT_TIME "%T"' >> $@
@@ -1076,6 +1080,7 @@ clean:
 	@rm -f $(obj)mmc_spl/{u-boot.lds,u-boot-spl,u-boot-spl.map,u-boot-spl.bin,u-boot-mmc-spl.bin}
 	@rm -f $(ONENAND_BIN)
 	@rm -f $(obj)onenand_ipl/u-boot.lds
+	@rm -f $(obj)spl/{u-boot-spl,u-boot-spl.bin,u-boot-spl.lds,u-boot-spl.map}
 	@rm -f $(TIMESTAMP_FILE) $(VERSION_FILE)
 	@find $(OBJTREE) -type f \
 		\( -name 'core' -o -name '*.bak' -o -name '*~' \
-- 
1.7.6

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

* [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
                       ` (3 preceding siblings ...)
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 4/9] Hook SPL build-system into toplevel Makefile Daniel Schwierzeck
@ 2011-07-18 16:09     ` Daniel Schwierzeck
  2011-07-19  9:21       ` Albert ARIBAUD
  2011-07-19 15:51       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 6/9] scaled down version of generic libraries " Daniel Schwierzeck
                       ` (4 subsequent siblings)
  9 siblings, 2 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

From: Aneesh V <aneesh@ti.com>

Signed-off-by: Aneesh V <aneesh@ti.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
---
Changes since RFC v1:
- none

 arch/arm/config.mk |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 788d4c1..9184d06 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -56,9 +56,14 @@ PLATFORM_CPPFLAGS += $(call cc-option,\
 
 # For EABI, make sure to provide raise()
 ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
-# This file is parsed several times; make sure to add only once.
-ifeq (,$(findstring arch/arm/lib/eabi_compat.o,$(PLATFORM_LIBS)))
-PLATFORM_LIBS += $(OBJTREE)/arch/arm/lib/eabi_compat.o
+# This file is parsed several times, with or without CONFIG_SPL_BUILD set
+# Make sure to add only once and with the correct prefix
+ifdef CONFIG_SPL_BUILD
+PLATFORM_LIBS := $(SPLTREE)/arch/arm/lib/eabi_compat.o \
+	$(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
+else
+PLATFORM_LIBS := $(OBJTREE)/arch/arm/lib/eabi_compat.o \
+	$(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
 endif
 endif
 
-- 
1.7.6

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

* [U-Boot] [PATCH v3 6/9] scaled down version of generic libraries for SPL
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
                       ` (4 preceding siblings ...)
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
@ 2011-07-18 16:09     ` Daniel Schwierzeck
  2011-07-26 12:44       ` Wolfgang Denk
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD Daniel Schwierzeck
                       ` (3 subsequent siblings)
  9 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

From: Aneesh V <aneesh@ti.com>

Signed-off-by: Aneesh V <aneesh@ti.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
---
Changes since RFC v1:
- none

 arch/arm/lib/Makefile   |    2 ++
 common/Makefile         |    9 ++++++---
 drivers/serial/Makefile |    3 +++
 fs/fat/Makefile         |    6 +++++-
 lib/Makefile            |   11 +++++++----
 5 files changed, 23 insertions(+), 8 deletions(-)

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
 
 SRCS	:= $(GLSOBJS:.o=.S) $(GLCOBJS:.o=.c) \
 	   $(SOBJS-y:.o=.S) $(COBJS-y:.o=.c)
diff --git a/common/Makefile b/common/Makefile
index 224b7cc..124a427 100644
--- a/common/Makefile
+++ b/common/Makefile
@@ -26,17 +26,15 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libcommon.o
 
 # core
+ifndef CONFIG_SPL_BUILD
 COBJS-y += main.o
-COBJS-y += console.o
 COBJS-y += command.o
 COBJS-y += dlmalloc.o
 COBJS-y += exports.o
 COBJS-$(CONFIG_SYS_HUSH_PARSER) += hush.o
 COBJS-y += image.o
-COBJS-y += memsize.o
 COBJS-y += s_record.o
 COBJS-$(CONFIG_SERIAL_MULTI) += serial.o
-COBJS-y += stdio.o
 COBJS-y += xyzModem.o
 
 # core command
@@ -173,6 +171,11 @@ COBJS-$(CONFIG_LYNXKDI) += lynxkdi.o
 COBJS-$(CONFIG_MODEM_SUPPORT) += modem.o
 COBJS-$(CONFIG_UPDATE_TFTP) += update.o
 COBJS-$(CONFIG_USB_KEYBOARD) += usb_kbd.o
+endif
+
+COBJS-y += console.o
+COBJS-y += memsize.o
+COBJS-y += stdio.o
 
 
 COBJS	:= $(sort $(COBJS-y))
diff --git a/drivers/serial/Makefile b/drivers/serial/Makefile
index 0e171b6..1dcc1c7 100644
--- a/drivers/serial/Makefile
+++ b/drivers/serial/Makefile
@@ -55,7 +55,10 @@ COBJS-$(CONFIG_S3C44B0_SERIAL) += serial_s3c44b0.o
 COBJS-$(CONFIG_XILINX_UARTLITE) += serial_xuartlite.o
 COBJS-$(CONFIG_SCIF_CONSOLE) += serial_sh.o
 COBJS-$(CONFIG_TEGRA2) += serial_tegra2.o
+
+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_USB_TTY) += usbtty.o
+endif
 
 COBJS	:= $(sort $(COBJS-y))
 SRCS	:= $(COBJS:.o=.c)
diff --git a/fs/fat/Makefile b/fs/fat/Makefile
index bc45966..93b6f07 100644
--- a/fs/fat/Makefile
+++ b/fs/fat/Makefile
@@ -24,7 +24,11 @@ include $(TOPDIR)/config.mk
 LIB	= $(obj)libfat.o
 
 AOBJS	=
-COBJS-$(CONFIG_CMD_FAT)	:= fat.o file.o
+COBJS-$(CONFIG_CMD_FAT)	:= fat.o
+
+ifndef CONFIG_SPL_BUILD
+COBJS-$(CONFIG_CMD_FAT)	+= file.o
+endif
 
 SRCS	:= $(AOBJS:.o=.S) $(COBJS-y:.o=.c)
 OBJS	:= $(addprefix $(obj),$(AOBJS) $(COBJS-y))
diff --git a/lib/Makefile b/lib/Makefile
index afa6914..884f64c 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -25,6 +25,7 @@ include $(TOPDIR)/config.mk
 
 LIB	= $(obj)libgeneric.o
 
+ifndef CONFIG_SPL_BUILD
 COBJS-$(CONFIG_ADDR_MAP) += addr_map.o
 COBJS-$(CONFIG_BZIP2) += bzlib.o
 COBJS-$(CONFIG_BZIP2) += bzlib_crctable.o
@@ -35,9 +36,7 @@ COBJS-$(CONFIG_USB_TTY) += circbuf.o
 COBJS-y += crc7.o
 COBJS-y += crc16.o
 COBJS-y += crc32.o
-COBJS-y += ctype.o
 COBJS-y += display_options.o
-COBJS-y += div64.o
 COBJS-y += errno.o
 COBJS-$(CONFIG_GZIP) += gunzip.o
 COBJS-y += hashtable.o
@@ -48,11 +47,15 @@ COBJS-y += net_utils.o
 COBJS-y += qsort.o
 COBJS-$(CONFIG_SHA1) += sha1.o
 COBJS-$(CONFIG_SHA256) += sha256.o
-COBJS-y += string.o
 COBJS-y	+= strmhz.o
+COBJS-$(CONFIG_RBTREE)	+= rbtree.o
+endif
+
+COBJS-y += ctype.o
+COBJS-y += div64.o
+COBJS-y += string.o
 COBJS-y += time.o
 COBJS-y += vsprintf.o
-COBJS-$(CONFIG_RBTREE)	+= rbtree.o
 
 COBJS	:= $(COBJS-y)
 SRCS	:= $(COBJS:.o=.c)
-- 
1.7.6

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

* [U-Boot] [PATCH v3 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
                       ` (5 preceding siblings ...)
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 6/9] scaled down version of generic libraries " Daniel Schwierzeck
@ 2011-07-18 16:09     ` Daniel Schwierzeck
  2011-07-26 12:45       ` Wolfgang Denk
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 8/9] spl: Add support for common libraries and drivers Daniel Schwierzeck
                       ` (2 subsequent siblings)
  9 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

From: Aneesh V <aneesh@ti.com>

replace all occurences of CONFIG_PRELOADER with CONFIG_SPL_BUILD

Signed-off-by: Aneesh V <aneesh@ti.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
---
Changes since RFC v1:
- none

 README                                    |    2 +-
 arch/arm/cpu/arm1136/start.S              |   20 +++++++++---------
 arch/arm/cpu/arm1176/start.S              |    4 +-
 arch/arm/cpu/arm720t/start.S              |    4 +-
 arch/arm/cpu/arm920t/start.S              |    4 +-
 arch/arm/cpu/arm925t/start.S              |    4 +-
 arch/arm/cpu/arm926ejs/start.S            |   18 ++++++++--------
 arch/arm/cpu/arm946es/start.S             |    4 +-
 arch/arm/cpu/arm_intcm/start.S            |    4 +-
 arch/arm/cpu/armv7/start.S                |    6 ++--
 arch/arm/cpu/ixp/start.S                  |    4 +-
 arch/arm/cpu/lh7a40x/start.S              |    4 +-
 arch/arm/cpu/pxa/start.S                  |   30 ++++++++++++++--------------
 arch/arm/cpu/s3c44b0/start.S              |    4 +-
 arch/arm/cpu/sa1100/start.S               |    4 +-
 arch/arm/lib/board.c                      |    2 +-
 mmc_spl/board/samsung/smdkv310/Makefile   |    2 +-
 nand_spl/board/davinci/da8xxevm/Makefile  |    4 +-
 nand_spl/board/freescale/mx31pdk/Makefile |    4 +-
 nand_spl/board/karo/tx25/Makefile         |    4 +-
 onenand_ipl/board/apollon/Makefile        |    4 +-
 onenand_ipl/board/vpac270/Makefile        |    4 +-
 22 files changed, 70 insertions(+), 70 deletions(-)

diff --git a/README b/README
index 8cac56c..fdef254 100644
--- a/README
+++ b/README
@@ -3056,7 +3056,7 @@ Low Level (hardware related) configuration options:
 		other boot loader or by a debugger which performs
 		these initializations itself.
 
-- CONFIG_PRELOADER
+- CONFIG_SPL_BUILD
 		Modifies the behaviour of start.S when compiling a loader
 		that is executed before the actual U-Boot. E.g. when
 		compiling a NAND SPL.
diff --git a/arch/arm/cpu/arm1136/start.S b/arch/arm/cpu/arm1136/start.S
index 200a800..f5a1134 100644
--- a/arch/arm/cpu/arm1136/start.S
+++ b/arch/arm/cpu/arm1136/start.S
@@ -33,7 +33,7 @@
 #include <version.h>
 .globl _start
 _start: b	reset
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	ldr	pc, _hang
 	ldr	pc, _hang
 	ldr	pc, _hang
@@ -68,7 +68,7 @@ _not_used:		.word not_used
 _irq:			.word irq
 _fiq:			.word fiq
 _pad:			.word 0x12345678 /* now 16*4=64 */
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 .global _end_vect
 _end_vect:
 
@@ -201,7 +201,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -243,7 +243,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
@@ -255,7 +255,7 @@ clbss_l:str	r2, [r0]		/* clear loop...		    */
 	add	r0, r0, #4
 	cmp	r0, r1
 	bne	clbss_l
-#endif	/* #ifndef CONFIG_PRELOADER */
+#endif	/* #ifndef CONFIG_SPL_BUILD */
 
 /*
  * We are done. Do not return, instead branch to second part of board
@@ -329,7 +329,7 @@ cpu_init_crit:
 	mov	pc, lr		/* back to my caller */
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 /*
  *************************************************************************
  *
@@ -436,17 +436,17 @@ cpu_init_crit:
 	.macro get_fiq_stack			@ setup FIQ stack
 	ldr	sp, FIQ_STACK_START
 	.endm
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 
 /*
  * exception handlers
  */
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
 	ldr	sp, _TEXT_BASE			/* use 32 words about stack */
 	bl	hang				/* hang and never return */
-#else	/* !CONFIG_PRELOADER */
+#else	/* !CONFIG_SPL_BUILD */
 	.align	5
 undefined_instruction:
 	get_bad_stack
@@ -519,4 +519,4 @@ arm1136_cache_flush:
 		mcr	p15, 0, r1, c7, c14, 0	@ invalidate D cache
 #endif
 		mov	pc, lr			@ back to caller
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
diff --git a/arch/arm/cpu/arm1176/start.S b/arch/arm/cpu/arm1176/start.S
index b095f22..0aa613d 100644
--- a/arch/arm/cpu/arm1176/start.S
+++ b/arch/arm/cpu/arm1176/start.S
@@ -263,7 +263,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -343,7 +343,7 @@ skip_hw_init:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm720t/start.S b/arch/arm/cpu/arm720t/start.S
index e774c3f..091b7d8 100644
--- a/arch/arm/cpu/arm720t/start.S
+++ b/arch/arm/cpu/arm720t/start.S
@@ -178,7 +178,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -220,7 +220,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm920t/start.S b/arch/arm/cpu/arm920t/start.S
index a7476b0..2a53667 100644
--- a/arch/arm/cpu/arm920t/start.S
+++ b/arch/arm/cpu/arm920t/start.S
@@ -221,7 +221,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -263,7 +263,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm925t/start.S b/arch/arm/cpu/arm925t/start.S
index 39f2e99..23ccf31 100644
--- a/arch/arm/cpu/arm925t/start.S
+++ b/arch/arm/cpu/arm925t/start.S
@@ -215,7 +215,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -257,7 +257,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm926ejs/start.S b/arch/arm/cpu/arm926ejs/start.S
index 0940937..636be75 100644
--- a/arch/arm/cpu/arm926ejs/start.S
+++ b/arch/arm/cpu/arm926ejs/start.S
@@ -54,7 +54,7 @@
 .globl _start
 _start:
 	b	reset
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 /* No exception handlers in preloader */
 	ldr	pc, _hang
 	ldr	pc, _hang
@@ -98,7 +98,7 @@ _irq:
 _fiq:
 	.word fiq
 
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 	.balignl 16,0xdeadbeef
 
 
@@ -214,7 +214,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -256,7 +256,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
@@ -343,7 +343,7 @@ cpu_init_crit:
 	mov	pc, lr		/* back to my caller */
 #endif /* CONFIG_SKIP_LOWLEVEL_INIT */
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 /*
  *************************************************************************
  *
@@ -440,18 +440,18 @@ cpu_init_crit:
 	.macro get_fiq_stack			@ setup FIQ stack
 	ldr	sp, FIQ_STACK_START
 	.endm
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 
 /*
  * exception handlers
  */
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
 	ldr	sp, _TEXT_BASE			/* switch to abort stack */
 1:
 	bl	1b				/* hang and never return */
-#else	/* !CONFIG_PRELOADER */
+#else	/* !CONFIG_SPL_BUILD */
 	.align  5
 undefined_instruction:
 	get_bad_stack
@@ -514,4 +514,4 @@ fiq:
 	bl	do_fiq
 
 #endif
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
diff --git a/arch/arm/cpu/arm946es/start.S b/arch/arm/cpu/arm946es/start.S
index 0054b22..09374d5 100644
--- a/arch/arm/cpu/arm946es/start.S
+++ b/arch/arm/cpu/arm946es/start.S
@@ -186,7 +186,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -228,7 +228,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/arm_intcm/start.S b/arch/arm/cpu/arm_intcm/start.S
index 2fd3b9a..1a93277 100644
--- a/arch/arm/cpu/arm_intcm/start.S
+++ b/arch/arm/cpu/arm_intcm/start.S
@@ -182,7 +182,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -224,7 +224,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/armv7/start.S b/arch/arm/cpu/armv7/start.S
index 0e698b6..d2a6207 100644
--- a/arch/arm/cpu/armv7/start.S
+++ b/arch/arm/cpu/armv7/start.S
@@ -182,7 +182,7 @@ stack_setup:
 	mov	sp, r4
 
 	adr	r0, _start
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	cmp	r0, r6
 	beq	clear_bss		/* skip relocation */
 #endif
@@ -196,7 +196,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -248,7 +248,7 @@ clbss_l:str	r2, [r0]		/* clear loop...		    */
 	add	r0, r0, #4
 	cmp	r0, r1
 	bne	clbss_l
-#endif	/* #ifndef CONFIG_PRELOADER */
+#endif	/* #ifndef CONFIG_SPL_BUILD */
 
 /*
  * We are done. Do not return, instead branch to second part of board
diff --git a/arch/arm/cpu/ixp/start.S b/arch/arm/cpu/ixp/start.S
index a975d42..b17d267 100644
--- a/arch/arm/cpu/ixp/start.S
+++ b/arch/arm/cpu/ixp/start.S
@@ -284,7 +284,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -326,7 +326,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/lh7a40x/start.S b/arch/arm/cpu/lh7a40x/start.S
index 81242b1..61bce5f 100644
--- a/arch/arm/cpu/lh7a40x/start.S
+++ b/arch/arm/cpu/lh7a40x/start.S
@@ -195,7 +195,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -237,7 +237,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/pxa/start.S b/arch/arm/cpu/pxa/start.S
index f1dbc3b..6191a73 100644
--- a/arch/arm/cpu/pxa/start.S
+++ b/arch/arm/cpu/pxa/start.S
@@ -43,7 +43,7 @@ sub  pc,pc,#4
 
 .globl _start
 _start: b	reset
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	ldr	pc, _hang
 	ldr	pc, _hang
 	ldr	pc, _hang
@@ -77,7 +77,7 @@ _data_abort:		.word data_abort
 _not_used:		.word not_used
 _irq:			.word irq
 _fiq:			.word fiq
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 
 	.balignl 16,0xdeadbeef
 
@@ -122,7 +122,7 @@ FIQ_STACK_START:
 	.word 0x0badc0de
 #endif /* CONFIG_USE_IRQ */
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 /* IRQ stack memory (calculated at run-time) + 8 bytes */
 .globl IRQ_STACK_START_IN
 IRQ_STACK_START_IN:
@@ -262,7 +262,7 @@ copy_loop:
 	blo	copy_loop
 	ldmfd sp!, {r0-r12}
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -301,10 +301,10 @@ fixnext:
 	add	r2, r2, #8	/* each rel.dyn entry is 8 bytes */
 	cmp	r2, r3
 	blo	fixloop
-#endif	/* #ifndef CONFIG_PRELOADER */
+#endif	/* #ifndef CONFIG_SPL_BUILD */
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
@@ -316,7 +316,7 @@ clbss_l:str	r2, [r0]		/* clear loop...		    */
 	add	r0, r0, #4
 	cmp	r0, r1
 	bne	clbss_l
-#endif	/* #ifndef CONFIG_PRELOADER */
+#endif	/* #ifndef CONFIG_SPL_BUILD */
 
 /*
  * We are done. Do not return, instead branch to second part of board
@@ -350,7 +350,7 @@ _rel_dyn_end_ofs:
 _dynsym_start_ofs:
 	.word __dynsym_start - _start
 
-#else /* CONFIG_PRELOADER */
+#else /* CONFIG_SPL_BUILD */
 
 /****************************************************************************/
 /*									    */
@@ -375,9 +375,9 @@ reset:
 	/* Start OneNAND IPL */
 	ldr	pc, =start_oneboot
 
-#endif /* CONFIG_PRELOADER */
+#endif /* CONFIG_SPL_BUILD */
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 /****************************************************************************/
 /*									    */
 /* Interrupt handling							    */
@@ -471,7 +471,7 @@ reset:
 	.macro get_fiq_stack			@ setup FIQ stack
 	ldr	sp, FIQ_STACK_START
 	.endm
-#endif	/* CONFIG_PRELOADER
+#endif	/* CONFIG_SPL_BUILD
 
 
 /****************************************************************************/
@@ -480,7 +480,7 @@ reset:
 /*									    */
 /****************************************************************************/
 
-#ifdef CONFIG_PRELOADER
+#ifdef CONFIG_SPL_BUILD
 	.align	5
 do_hang:
 	ldr	sp, _TEXT_BASE			/* use 32 words abort stack */
@@ -545,7 +545,7 @@ fiq:
 	get_bad_stack
 	bad_save_user_regs
 	bl	do_fiq
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
 #endif /* CONFIG_USE_IRQ */
 
 /****************************************************************************/
@@ -584,7 +584,7 @@ reset_endless:
 
 	b	reset_endless
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 .section .mmudata, "a"
 	.align	14
 	.globl	mmu_table
@@ -604,4 +604,4 @@ mmu_table:
 	.word	(__base << 20) | 0xc12
 	.set	__base, __base + 1
 	.endr
-#endif	/* CONFIG_PRELOADER */
+#endif	/* CONFIG_SPL_BUILD */
diff --git a/arch/arm/cpu/s3c44b0/start.S b/arch/arm/cpu/s3c44b0/start.S
index 10f5284..2545cf6 100644
--- a/arch/arm/cpu/s3c44b0/start.S
+++ b/arch/arm/cpu/s3c44b0/start.S
@@ -167,7 +167,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -209,7 +209,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/cpu/sa1100/start.S b/arch/arm/cpu/sa1100/start.S
index b27e970..c3acf7a 100644
--- a/arch/arm/cpu/sa1100/start.S
+++ b/arch/arm/cpu/sa1100/start.S
@@ -171,7 +171,7 @@ copy_loop:
 	cmp	r0, r2			/* until source end address [r2]    */
 	blo	copy_loop
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * fix .rel.dyn relocations
 	 */
@@ -213,7 +213,7 @@ fixnext:
 #endif
 
 clear_bss:
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	ldr	r0, _bss_start_ofs
 	ldr	r1, _bss_end_ofs
 	mov	r4, r6			/* reloc addr */
diff --git a/arch/arm/lib/board.c b/arch/arm/lib/board.c
index fc52a26..d4fd2cc 100644
--- a/arch/arm/lib/board.c
+++ b/arch/arm/lib/board.c
@@ -360,7 +360,7 @@ void board_init_f (ulong bootflag)
 
 	debug ("Reserving %ldk for U-Boot at: %08lx\n", gd->mon_len >> 10, addr);
 
-#ifndef CONFIG_PRELOADER
+#ifndef CONFIG_SPL_BUILD
 	/*
 	 * reserve memory for malloc() arena
 	 */
diff --git a/mmc_spl/board/samsung/smdkv310/Makefile b/mmc_spl/board/samsung/smdkv310/Makefile
index f1ce066..de2c1a2 100644
--- a/mmc_spl/board/samsung/smdkv310/Makefile
+++ b/mmc_spl/board/samsung/smdkv310/Makefile
@@ -35,7 +35,7 @@ LDSCRIPT= $(TOPDIR)/mmc_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS	= -Bstatic -T $(mmcobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
 AFLAGS	+= -DCONFIG_MMC_SPL
 CFLAGS	+= -DCONFIG_MMC_SPL
-CFLAGS	+= -DCONFIG_PRELOADER
+CFLAGS	+= -DCONFIG_SPL_BUILD
 
 SOBJS	= start.o mem_setup.o lowlevel_init.o
 COBJS	= mmc_boot.o
diff --git a/nand_spl/board/davinci/da8xxevm/Makefile b/nand_spl/board/davinci/da8xxevm/Makefile
index c3cb1bb..b3f4bd6 100644
--- a/nand_spl/board/davinci/da8xxevm/Makefile
+++ b/nand_spl/board/davinci/da8xxevm/Makefile
@@ -33,8 +33,8 @@ nandobj	:= $(OBJTREE)/nand_spl/
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
 SOBJS	= start.o _udivsi3.o _divsi3.o
 COBJS	= cpu.o davinci_nand.o ns16550.o div0.o davinci_pinmux.o psc.o	\
diff --git a/nand_spl/board/freescale/mx31pdk/Makefile b/nand_spl/board/freescale/mx31pdk/Makefile
index 984f959..e6ec10a 100644
--- a/nand_spl/board/freescale/mx31pdk/Makefile
+++ b/nand_spl/board/freescale/mx31pdk/Makefile
@@ -8,8 +8,8 @@ nandobj	:= $(OBJTREE)/nand_spl/
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
 SOBJS	= start.o lowlevel_init.o
 COBJS	= nand_boot_fsl_nfc.o
diff --git a/nand_spl/board/karo/tx25/Makefile b/nand_spl/board/karo/tx25/Makefile
index 8bc54d1..0336346 100644
--- a/nand_spl/board/karo/tx25/Makefile
+++ b/nand_spl/board/karo/tx25/Makefile
@@ -29,8 +29,8 @@ nandobj	:= $(OBJTREE)/nand_spl/
 LDSCRIPT= $(TOPDIR)/nand_spl/board/$(BOARDDIR)/u-boot.lds
 LDFLAGS := -T $(nandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(LDFLAGS) \
 	   $(LDFLAGS_FINAL)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_NAND_SPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_NAND_SPL
 
 SOBJS	= start.o lowlevel_init.o
 COBJS	= nand_boot_fsl_nfc.o
diff --git a/onenand_ipl/board/apollon/Makefile b/onenand_ipl/board/apollon/Makefile
index 5397186..3bc9920 100644
--- a/onenand_ipl/board/apollon/Makefile
+++ b/onenand_ipl/board/apollon/Makefile
@@ -4,8 +4,8 @@ include $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/config.mk
 
 LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds
 LDFLAGS	= -Bstatic -T $(onenandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_ONENAND_IPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_ONENAND_IPL
 OBJCFLAGS += --gap-fill=0x00
 
 SOBJS	:= low_levelinit.o
diff --git a/onenand_ipl/board/vpac270/Makefile b/onenand_ipl/board/vpac270/Makefile
index 7300692..f850ddd 100644
--- a/onenand_ipl/board/vpac270/Makefile
+++ b/onenand_ipl/board/vpac270/Makefile
@@ -4,8 +4,8 @@ include $(TOPDIR)/board/$(BOARDDIR)/config.mk
 
 LDSCRIPT= $(TOPDIR)/onenand_ipl/board/$(BOARDDIR)/u-boot.onenand.lds
 LDFLAGS	= -Bstatic -T $(onenandobj)u-boot.lds -Ttext $(CONFIG_SYS_TEXT_BASE) $(PLATFORM_LDFLAGS)
-AFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
-CFLAGS	+= -DCONFIG_PRELOADER -DCONFIG_ONENAND_IPL
+AFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_ONENAND_IPL
+CFLAGS	+= -DCONFIG_SPL_BUILD -DCONFIG_ONENAND_IPL
 OBJCFLAGS += --gap-fill=0x00
 
 SOBJS	+= start.o
-- 
1.7.6

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

* [U-Boot] [PATCH v3 8/9] spl: Add support for common libraries and drivers
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
                       ` (6 preceding siblings ...)
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD Daniel Schwierzeck
@ 2011-07-18 16:09     ` Daniel Schwierzeck
  2011-07-26 12:45       ` Wolfgang Denk
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 9/9] spl: add support for omap-common libraries Daniel Schwierzeck
  2011-07-20 21:12     ` [U-Boot] [PATCH v3 0/9] Add initial support for a generic SPL framework Paulraj, Sandeep
  9 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
Changes since RFC v1:
- none

 spl/Makefile |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/spl/Makefile b/spl/Makefile
index bc24c3b..6c36d6f 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -36,6 +36,17 @@ endif
 LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
 LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
 
+LIBS-$(CONFIG_SPL_LIBCOMMON_SUPPORT) += common/libcommon.o
+LIBS-$(CONFIG_SPL_LIBDISK_SUPPORT) += disk/libdisk.o
+LIBS-$(CONFIG_SPL_I2C_SUPPORT) += drivers/i2c/libi2c.o
+LIBS-$(CONFIG_SPL_GPIO_SUPPORT) += drivers/gpio/libgpio.o
+LIBS-$(CONFIG_SPL_MMC_SUPPORT) += drivers/mmc/libmmc.o
+LIBS-$(CONFIG_SPL_SERIAL_SUPPORT) += drivers/serial/libserial.o
+LIBS-$(CONFIG_SPL_SPI_FLASH_SUPPORT) += drivers/mtd/spi/libspi_flash.o
+LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o
+LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/libfat.o
+LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/libgeneric.o
+
 START := $(addprefix $(SPLTREE)/,$(START))
 LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
 
-- 
1.7.6

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

* [U-Boot] [PATCH v3 9/9] spl: add support for omap-common libraries
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
                       ` (7 preceding siblings ...)
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 8/9] spl: Add support for common libraries and drivers Daniel Schwierzeck
@ 2011-07-18 16:09     ` Daniel Schwierzeck
  2011-07-26 12:45       ` Wolfgang Denk
  2011-07-20 21:12     ` [U-Boot] [PATCH v3 0/9] Add initial support for a generic SPL framework Paulraj, Sandeep
  9 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:09 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
Changes since RFC v1:
- none

 spl/Makefile |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/spl/Makefile b/spl/Makefile
index 6c36d6f..638aab7 100644
--- a/spl/Makefile
+++ b/spl/Makefile
@@ -47,6 +47,13 @@ LIBS-$(CONFIG_SPL_SPI_SUPPORT) += drivers/spi/libspi.o
 LIBS-$(CONFIG_SPL_FAT_SUPPORT) += fs/fat/libfat.o
 LIBS-$(CONFIG_SPL_LIBGENERIC_SUPPORT) += lib/libgeneric.o
 
+ifeq ($(SOC),omap3)
+LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
+endif
+ifeq ($(SOC),omap4)
+LIBS-y += $(CPUDIR)/omap-common/libomap-common.o
+endif
+
 START := $(addprefix $(SPLTREE)/,$(START))
 LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
 
-- 
1.7.6

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

* [U-Boot] [RFC PATCH v2 2/9] spl: add initial support for a generic SPL framework
  2011-07-18 16:06       ` Wolfgang Denk
@ 2011-07-18 16:22         ` Daniel Schwierzeck
  0 siblings, 0 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 16:22 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

sorry, I sent the new series too early and missed your answer.
I'll address your comments.

On Mon, Jul 18, 2011 at 6:06 PM, Wolfgang Denk <wd@denx.de> wrote:
> Dear Daniel Schwierzeck,
>
> In message <1310746944-32711-1-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
>> Signed-off-by: Aneesh V <aneesh@ti.com>
>> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
>
> Thanks.
>
>> +Overview
>> +--------
>> +
>> +To unify all existing implementations for a secondary program loader (SPL)
>> +and to allow simply adding of new implementations this generic SPL framework
>> +have been created. With this framework almost all source files for a board
>
> s/have/has/
>
>> +How it works
>> +------------
>> +
>> +There is a new directory TOPDIR/spl which contains only a Makefile.
>> +All source files needed by SPL are recompiled inside this directory
>> +and linked to the final binaries named u-boot-spl[.bin|.map].
>
> The "recompiled inside this directory" might be misinterpreted. ?How
> about: "are compiled such that the resulting object files are placed
> into this directory" or similar?
>
>> +Thus makefiles and source files are able to build things differently for SPL.
>
> Strictly speaking, the source files don't build anything themself.How
> about: "This way we can compile the source files with different
> settings for SPL." ?
>
>> +Because SPL images normally have a different test base, one have to be
>
> s/test/text/
>
>
> Best regards,
>
> Wolfgang Denk
>
> --
> DENX Software Engineering GmbH, ? ? MD: Wolfgang Denk & Detlev Zundel
> HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
> Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
> Marriage is the sole cause of divorce.
>

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

* [U-Boot] [PATCH v4 2/9] spl: add initial support for a generic SPL framework
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
@ 2011-07-18 17:48       ` Daniel Schwierzeck
  2011-07-26 12:42         ` Wolfgang Denk
  0 siblings, 1 reply; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-18 17:48 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Aneesh V <aneesh@ti.com>
Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
---
Changes since RFC v1:
- added documentation for SPL

Changes since RFC v2:
- renamed CONFIG_SYS_SPL_LDSCRIPT to CONFIG_SPL_LDSCRIPT
- added missing documentation for CONFIG_SPL_LDSCRIPT

Changes since v3:
- fixed documentation

 README         |   39 ++++++++++++++++++++++
 doc/README.SPL |   62 ++++++++++++++++++++++++++++++++++
 spl/.gitignore |    4 ++
 spl/Makefile   |  100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 205 insertions(+), 0 deletions(-)
 create mode 100644 doc/README.SPL
 create mode 100644 spl/.gitignore
 create mode 100644 spl/Makefile

diff --git a/README b/README
index 1e2d4d3..8cac56c 100644
--- a/README
+++ b/README
@@ -2236,6 +2236,45 @@ FIT uImage format:
 		Adds the MTD partitioning infrastructure from the Linux
 		kernel. Needed for UBI support.
 
+- SPL framework
+                CONFIG_SPL
+                Enable building of SPL globally.
+
+                CONFIG_SPL_TEXT_BASE
+                TEXT_BASE for linking the SPL binary.
+
+                CONFIG_SPL_LDSCRIPT
+                LDSCRIPT for linking the SPL binary.
+
+                CONFIG_SPL_LIBCOMMON_SUPPORT
+                Support for common/libcommon.o in SPL binary
+
+                CONFIG_SPL_LIBDISK_SUPPORT
+                Support for disk/libdisk.o in SPL binary
+
+                CONFIG_SPL_I2C_SUPPORT
+                Support for drivers/i2c/libi2c.o in SPL binary
+
+                CONFIG_SPL_GPIO_SUPPORT
+                Support for drivers/gpio/libgpio.o in SPL binary
+
+                CONFIG_SPL_MMC_SUPPORT
+                Support for drivers/mmc/libmmc.o in SPL binary
+
+                CONFIG_SPL_SERIAL_SUPPORT
+                Support for drivers/serial/libserial.o in SPL binary
+
+                CONFIG_SPL_SPI_FLASH_SUPPORT
+                Support for drivers/mtd/spi/libspi_flash.o in SPL binary
+
+                CONFIG_SPL_SPI_SUPPORT
+                Support for drivers/spi/libspi.o in SPL binary
+
+                CONFIG_SPL_FAT_SUPPORT
+                Support for fs/fat/libfat.o in SPL binary
+
+                CONFIG_SPL_LIBGENERIC_SUPPORT
+                Support for lib/libgeneric.o in SPL binary
 
 Modem Support:
 --------------
diff --git a/doc/README.SPL b/doc/README.SPL
new file mode 100644
index 0000000..ce8e19f
--- /dev/null
+++ b/doc/README.SPL
@@ -0,0 +1,62 @@
+Generic SPL framework
+=====================
+
+Overview
+--------
+
+To unify all existing implementations for a secondary program loader (SPL)
+and to allow simply adding of new implementations this generic SPL framework
+has been created. With this framework almost all source files for a board
+can be reused. No code duplication or symlinking is necessary anymore.
+
+
+How it works
+------------
+
+There is a new directory TOPDIR/spl which contains only a Makefile.
+The object files are built separately for SPL and placed in this directory.
+The final binaries which are generated are u-boot-spl, u-boot-spl.bin and
+u-boot-spl.map.
+
+During the SPL build a variable named CONFIG_SPL_BUILD is exported
+in the make environment and also appended to CPPFLAGS with -DCONFIG_SPL_BUILD.
+Source files can therefore be compiled for SPL with different settings.
+ARM-based boards have previously used the option CONFIG_PRELOADER for it.
+
+For example:
+
+ifeq ($(CONFIG_SPL_BUILD),y)
+COBJS-y += board_spl.o
+else
+COBJS-y += board.o
+endif
+
+COBJS-$(CONFIG_SPL_BUILD) += foo.o
+
+#ifdef CONFIG_SPL_BUILD
+        foo();
+#endif
+
+
+The building of SPL images can be with:
+
+#define CONFIG_SPL
+
+Because SPL images normally have a different text base, one have to be
+configured by defining CONFIG_SPL_TEXT_BASE. The linker script have to be
+defined with CONFIG_SPL_LDSCRIPT.
+
+To support generic U-Boot libraries and drivers in the SPL binary one can
+optionally define CONFIG_SPL_XXX_SUPPORT. Currently following options
+are supported:
+
+CONFIG_SPL_LIBCOMMON_SUPPORT (common/libcommon.o)
+CONFIG_SPL_LIBDISK_SUPPORT (disk/libdisk.o)
+CONFIG_SPL_I2C_SUPPORT (drivers/i2c/libi2c.o)
+CONFIG_SPL_GPIO_SUPPORT (drivers/gpio/libgpio.o)
+CONFIG_SPL_MMC_SUPPORT (drivers/mmc/libmmc.o)
+CONFIG_SPL_SERIAL_SUPPORT (drivers/serial/libserial.o)
+CONFIG_SPL_SPI_FLASH_SUPPORT (drivers/mtd/spi/libspi_flash.o)
+CONFIG_SPL_SPI_SUPPORT (drivers/spi/libspi.o)
+CONFIG_SPL_FAT_SUPPORT (fs/fat/libfat.o)
+CONFIG_SPL_LIBGENERIC_SUPPORT (lib/libgeneric.o)
diff --git a/spl/.gitignore b/spl/.gitignore
new file mode 100644
index 0000000..7c88147
--- /dev/null
+++ b/spl/.gitignore
@@ -0,0 +1,4 @@
+u-boot-spl
+u-boot-spl.bin
+u-boot-spl.lds
+u-boot-spl.map
diff --git a/spl/Makefile b/spl/Makefile
new file mode 100644
index 0000000..32e6a09
--- /dev/null
+++ b/spl/Makefile
@@ -0,0 +1,100 @@
+#
+# (C) Copyright 2000-2011
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.
+#
+# (C) Copyright 2011
+# Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.
+#
+# (C) Copyright 2011
+# Texas Instruments Incorporated - http://www.ti.com/
+# Aneesh V <aneesh@ti.com>
+#
+# This file is released under the terms of GPL v2 and any later version.
+# See the file COPYING in the root directory of the source tree for details.
+#
+# Based on top-level Makefile.
+#
+
+CONFIG_SPL_BUILD := y
+export CONFIG_SPL_BUILD
+
+include $(TOPDIR)/config.mk
+
+# We want the final binaries in this directory
+obj := $(OBJTREE)/spl/
+
+HAVE_VENDOR_COMMON_LIB := $(shell [ -f $(SRCTREE)/board/$(VENDOR)/common/Makefile ] \
+			&& echo y || echo n)
+
+START := $(CPUDIR)/start.o
+
+LIBS-y += arch/$(ARCH)/lib/lib$(ARCH).o
+LIBS-y += $(CPUDIR)/lib$(CPU).o
+ifdef SOC
+LIBS-y += $(CPUDIR)/$(SOC)/lib$(SOC).o
+endif
+LIBS-y += board/$(BOARDDIR)/lib$(BOARD).o
+LIBS-$(HAVE_VENDOR_COMMON_LIB) += board/$(VENDOR)/common/lib$(VENDOR).o
+
+START := $(addprefix $(SPLTREE)/,$(START))
+LIBS := $(addprefix $(SPLTREE)/,$(sort $(LIBS-y)))
+
+__START := $(subst $(obj),,$(START))
+__LIBS := $(subst $(obj),,$(LIBS))
+
+# Linker Script
+ifdef CONFIG_SPL_LDSCRIPT
+# need to strip off double quotes
+LDSCRIPT := $(addprefix $(SRCTREE)/,$(subst ",,$(CONFIG_SPL_LDSCRIPT)))
+endif
+
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/board/$(BOARDDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+	LDSCRIPT := $(TOPDIR)/$(CPUDIR)/u-boot-spl.lds
+endif
+ifeq ($(wildcard $(LDSCRIPT)),)
+$(error could not find linker script)
+endif
+
+# Special flags for CPP when processing the linker script.
+# Pass the version down so we can handle backwards compatibility
+# on the fly.
+LDPPFLAGS += \
+	-include $(TOPDIR)/include/u-boot/u-boot.lds.h \
+	-include $(OBJTREE)/include/config.h \
+	$(shell $(LD) --version | \
+	  sed -ne 's/GNU ld version \([0-9][0-9]*\)\.\([0-9][0-9]*\).*/-DLD_MAJOR=\1 -DLD_MINOR=\2/p')
+
+ALL-y	+= $(obj)u-boot-spl.bin
+
+all:	$(ALL-y)
+
+$(obj)u-boot-spl.bin:	$(obj)u-boot-spl
+	$(OBJCOPY) $(OBJCFLAGS) -O binary $< $@
+
+GEN_UBOOT = \
+	UNDEF_SYM=`$(OBJDUMP) -x $(LIBS) | \
+	sed  -n -e 's/.*\($(SYM_PREFIX)__u_boot_cmd_.*\)/-u\1/p'|sort|uniq`;\
+	cd $(obj) && $(LD) $(LDFLAGS) $(LDFLAGS_$(@F)) $$UNDEF_SYM $(__START) \
+		--start-group $(__LIBS) --end-group $(PLATFORM_LIBS) \
+		-Map u-boot-spl.map -o u-boot-spl
+
+$(obj)u-boot-spl:	depend $(START) $(LIBS) $(obj)u-boot-spl.lds
+	$(GEN_UBOOT)
+
+$(START):	depend
+	$(MAKE) -C $(SRCTREE)/$(CPUDIR) $@
+
+$(LIBS):	depend
+	$(MAKE) -C $(SRCTREE)$(dir $(subst $(SPLTREE),,$@))
+
+$(obj)u-boot-spl.lds: $(LDSCRIPT) depend
+	$(CPP) $(CPPFLAGS) $(LDPPFLAGS) -ansi -D__ASSEMBLY__ -P - < $< > $@
+
+depend:	$(obj).depend
+.PHONY: depend
+
+# defines $(obj).depend target
+include $(SRCTREE)/rules.mk
-- 
1.7.6

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

* [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
@ 2011-07-19  3:51       ` Vipin Kumar
  2011-07-26 12:41       ` Wolfgang Denk
  1 sibling, 0 replies; 172+ messages in thread
From: Vipin Kumar @ 2011-07-19  3:51 UTC (permalink / raw)
  To: u-boot

On 7/18/2011 9:39 PM, Daniel Schwierzeck wrote:
> diff --git a/board/spear/spear300/config.mk b/board/spear/spear300/config.mk
> index 11da2c3..5848ef8 100644
> --- a/board/spear/spear300/config.mk
> +++ b/board/spear/spear300/config.mk
> @@ -25,7 +25,7 @@
>  
>  CONFIG_SYS_TEXT_BASE = 0x00700000
>  
> -ALL += $(obj)u-boot.img
> +ALL-y += $(obj)u-boot.img
>  
>  # Environment variables in NAND
>  ifeq ($(ENV),NAND)
> diff --git a/board/spear/spear310/config.mk b/board/spear/spear310/config.mk
> index 2b59c39..f8a6bdb 100644
> --- a/board/spear/spear310/config.mk
> +++ b/board/spear/spear310/config.mk
> @@ -25,7 +25,7 @@
>  
>  CONFIG_SYS_TEXT_BASE = 0x00700000
>  
> -ALL += $(obj)u-boot.img
> +ALL-y += $(obj)u-boot.img
>  
>  # Environment variables in NAND
>  ifeq ($(ENV),NAND)
> diff --git a/board/spear/spear320/config.mk b/board/spear/spear320/config.mk
> index 2b59c39..f8a6bdb 100644
> --- a/board/spear/spear320/config.mk
> +++ b/board/spear/spear320/config.mk
> @@ -25,7 +25,7 @@
>  
>  CONFIG_SYS_TEXT_BASE = 0x00700000
>  
> -ALL += $(obj)u-boot.img
> +ALL-y += $(obj)u-boot.img
>  
>  # Environment variables in NAND
>  ifeq ($(ENV),NAND)
> diff --git a/board/spear/spear600/config.mk b/board/spear/spear600/config.mk
> index 11da2c3..5848ef8 100644
> --- a/board/spear/spear600/config.mk
> +++ b/board/spear/spear600/config.mk
> @@ -25,7 +25,7 @@
>  
>  CONFIG_SYS_TEXT_BASE = 0x00700000
>  
> -ALL += $(obj)u-boot.img
> +ALL-y += $(obj)u-boot.img
>  
>  # Environment variables in NAND
>  ifeq ($(ENV),NAND)

Acked-by : Vipin Kumar <vipin.kumar@st.com>

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

* [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
@ 2011-07-19  9:21       ` Albert ARIBAUD
  2011-07-19 10:38         ` Aneesh V
  2011-07-19 15:51       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
  1 sibling, 1 reply; 172+ messages in thread
From: Albert ARIBAUD @ 2011-07-19  9:21 UTC (permalink / raw)
  To: u-boot

Hi Daniel / Aneesh,

Le 18/07/2011 18:09, Daniel Schwierzeck a ?crit :
> From: Aneesh V<aneesh@ti.com>
>
> Signed-off-by: Aneesh V<aneesh@ti.com>
> Cc: Albert ARIBAUD<albert.u.boot@aribaud.net>
> ---
> Changes since RFC v1:
> - none
>
>   arch/arm/config.mk |   11 ++++++++---
>   1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
> index 788d4c1..9184d06 100644
> --- a/arch/arm/config.mk
> +++ b/arch/arm/config.mk
> @@ -56,9 +56,14 @@ PLATFORM_CPPFLAGS += $(call cc-option,\
>
>   # For EABI, make sure to provide raise()
>   ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
> -# This file is parsed several times; make sure to add only once.
> -ifeq (,$(findstring arch/arm/lib/eabi_compat.o,$(PLATFORM_LIBS)))
> -PLATFORM_LIBS += $(OBJTREE)/arch/arm/lib/eabi_compat.o
> +# This file is parsed several times, with or without CONFIG_SPL_BUILD set
> +# Make sure to add only once and with the correct prefix
> +ifdef CONFIG_SPL_BUILD
> +PLATFORM_LIBS := $(SPLTREE)/arch/arm/lib/eabi_compat.o \
> +	$(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
> +else
> +PLATFORM_LIBS := $(OBJTREE)/arch/arm/lib/eabi_compat.o \
> +	$(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
>   endif
>   endif

Seems like the two issues of parsing several times and of parsing with 
or without SPL are independent, so please rephrase the comment to 
clearly separate both points; and as for the "make sure... several 
times" point, please change comment to point the reader to the use of 
filter-out (i.e., one should read "making sure that... by using 
'filter-out'").

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL
  2011-07-19  9:21       ` Albert ARIBAUD
@ 2011-07-19 10:38         ` Aneesh V
  2011-07-19 11:03           ` Albert ARIBAUD
  0 siblings, 1 reply; 172+ messages in thread
From: Aneesh V @ 2011-07-19 10:38 UTC (permalink / raw)
  To: u-boot

Hi Albert,

On Tuesday 19 July 2011 02:51 PM, Albert ARIBAUD wrote:
> Hi Daniel / Aneesh,
>
> Le 18/07/2011 18:09, Daniel Schwierzeck a ?crit :
>> From: Aneesh V<aneesh@ti.com>
>>
>> Signed-off-by: Aneesh V<aneesh@ti.com>
>> Cc: Albert ARIBAUD<albert.u.boot@aribaud.net>
>> ---
>> Changes since RFC v1:
>> - none
>>
>> arch/arm/config.mk | 11 ++++++++---
>> 1 files changed, 8 insertions(+), 3 deletions(-)
>>
>> diff --git a/arch/arm/config.mk b/arch/arm/config.mk
>> index 788d4c1..9184d06 100644
>> --- a/arch/arm/config.mk
>> +++ b/arch/arm/config.mk
>> @@ -56,9 +56,14 @@ PLATFORM_CPPFLAGS += $(call cc-option,\
>>
>> # For EABI, make sure to provide raise()
>> ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
>> -# This file is parsed several times; make sure to add only once.
>> -ifeq (,$(findstring arch/arm/lib/eabi_compat.o,$(PLATFORM_LIBS)))
>> -PLATFORM_LIBS += $(OBJTREE)/arch/arm/lib/eabi_compat.o
>> +# This file is parsed several times, with or without CONFIG_SPL_BUILD
>> set
>> +# Make sure to add only once and with the correct prefix

How about something like this:

# This file is parsed many times, so the string may get added multiple
# times. Also, the prefix needs to be different based on whether
# CONFIG_SPL_BUILD is defined or not. 'filter-out' the existing entry
# before adding the correct one.

>> +ifdef CONFIG_SPL_BUILD
>> +PLATFORM_LIBS := $(SPLTREE)/arch/arm/lib/eabi_compat.o \
>> + $(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
>> +else
>> +PLATFORM_LIBS := $(OBJTREE)/arch/arm/lib/eabi_compat.o \
>> + $(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
>> endif
>> endif
>
> Seems like the two issues of parsing several times and of parsing with
> or without SPL are independent, so please rephrase the comment to
> clearly separate both points; and as for the "make sure... several
> times" point, please change comment to point the reader to the use of
> filter-out (i.e., one should read "making sure that... by using
> 'filter-out'").

filter-out helps to avoid both problems.

best regards,
Aneesh

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

* [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL
  2011-07-19 10:38         ` Aneesh V
@ 2011-07-19 11:03           ` Albert ARIBAUD
  0 siblings, 0 replies; 172+ messages in thread
From: Albert ARIBAUD @ 2011-07-19 11:03 UTC (permalink / raw)
  To: u-boot

Hi Aneesh,

Le 19/07/2011 12:38, Aneesh V a ?crit :

> How about something like this:
>
> # This file is parsed many times, so the string may get added multiple
> # times. Also, the prefix needs to be different based on whether
> # CONFIG_SPL_BUILD is defined or not. 'filter-out' the existing entry
> # before adding the correct one.

Fine, thanks!

> best regards,
> Aneesh

Amicalement,
-- 
Albert.

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

* [U-Boot] [PATCH v4 5/9] arm: adjust PLATFORM_LIBS for SPL
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
  2011-07-19  9:21       ` Albert ARIBAUD
@ 2011-07-19 15:51       ` Daniel Schwierzeck
  2011-07-20  7:59         ` Aneesh V
  2011-07-26 12:44         ` Wolfgang Denk
  1 sibling, 2 replies; 172+ messages in thread
From: Daniel Schwierzeck @ 2011-07-19 15:51 UTC (permalink / raw)
  To: u-boot

From: Aneesh V <aneesh@ti.com>

Signed-off-by: Aneesh V <aneesh@ti.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
---
Changes since RFC v1:
- none

Changes since RFC v2:
- none

Changes since v3:
- improved comment

 arch/arm/config.mk |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/arch/arm/config.mk b/arch/arm/config.mk
index 788d4c1..9b4e581 100644
--- a/arch/arm/config.mk
+++ b/arch/arm/config.mk
@@ -56,9 +56,16 @@ PLATFORM_CPPFLAGS += $(call cc-option,\
 
 # For EABI, make sure to provide raise()
 ifneq (,$(findstring -mabi=aapcs-linux,$(PLATFORM_CPPFLAGS)))
-# This file is parsed several times; make sure to add only once.
-ifeq (,$(findstring arch/arm/lib/eabi_compat.o,$(PLATFORM_LIBS)))
-PLATFORM_LIBS += $(OBJTREE)/arch/arm/lib/eabi_compat.o
+# This file is parsed many times, so the string may get added multiple
+# times. Also, the prefix needs to be different based on whether
+# CONFIG_SPL_BUILD is defined or not. 'filter-out' the existing entry
+# before adding the correct one.
+ifdef CONFIG_SPL_BUILD
+PLATFORM_LIBS := $(SPLTREE)/arch/arm/lib/eabi_compat.o \
+	$(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
+else
+PLATFORM_LIBS := $(OBJTREE)/arch/arm/lib/eabi_compat.o \
+	$(filter-out %/arch/arm/lib/eabi_compat.o, $(PLATFORM_LIBS))
 endif
 endif
 
-- 
1.7.6

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

* [U-Boot] [PATCH v4 5/9] arm: adjust PLATFORM_LIBS for SPL
  2011-07-19 15:51       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
@ 2011-07-20  7:59         ` Aneesh V
  2011-07-26 12:44         ` Wolfgang Denk
  1 sibling, 0 replies; 172+ messages in thread
From: Aneesh V @ 2011-07-20  7:59 UTC (permalink / raw)
  To: u-boot

Dear Wolfgang,

On Tuesday 19 July 2011 09:21 PM, Daniel Schwierzeck wrote:
> From: Aneesh V<aneesh@ti.com>
>
> Signed-off-by: Aneesh V<aneesh@ti.com>
> Cc: Albert ARIBAUD<albert.u.boot@aribaud.net>
> ---
> Changes since RFC v1:
> - none
>
> Changes since RFC v2:
> - none
>
> Changes since v3:
> - improved comment

I think this was the final change requested. Will you be pulling this
now?

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

* [U-Boot] [PATCH v3 0/9] Add initial support for a generic SPL framework
  2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
                       ` (8 preceding siblings ...)
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 9/9] spl: add support for omap-common libraries Daniel Schwierzeck
@ 2011-07-20 21:12     ` Paulraj, Sandeep
  9 siblings, 0 replies; 172+ messages in thread
From: Paulraj, Sandeep @ 2011-07-20 21:12 UTC (permalink / raw)
  To: u-boot



> 
> This is the finalized version for the SPL framework:
> http://marc.info/?l=u-boot&m=131056990001719&w=2
> 
> Changes since RFC v1:
> - added documentation for SPL framework
> - enable garbage collect of unused sections for SPL unconditionally
> 
> Changes since RFC v2:
> - renamed CONFIG_SYS_SPL_LDSCRIPT to CONFIG_SPL_LDSCRIPT
> - added missing documentation for CONFIG_SPL_LDSCRIPT
> 
> Aneesh V (3):
>   arm: adjust PLATFORM_LIBS for SPL
>   scaled down version of generic libraries for SPL
>   replace CONFIG_PRELOADER with CONFIG_SPL_BUILD
> 
> Daniel Schwierzeck (6):
>   Use ALL-y style instead of ifeq blocks for better readability
>   spl: add initial support for a generic SPL framework
>   Extend build-system for SPL framework
>   Hook SPL build-system into toplevel Makefile
>   spl: Add support for common libraries and drivers
>   spl: add support for omap-common libraries
> 

Pushed this series to u-boot-ti

http://git.denx.de/?p=u-boot/u-boot-ti.git;a=summary


Thanks,
Sandeep

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

* [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
  2011-07-19  3:51       ` Vipin Kumar
@ 2011-07-26 12:41       ` Wolfgang Denk
  1 sibling, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-26 12:41 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1311005361-26241-2-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> Cc: Mike Frysinger <vapier@gentoo.org>
> Cc: Stefan Roese <sr@denx.de>
> Cc: Vipin Kumar <vipin.kumar@st.com>
> ---
> Changes since RFC v1:
> - none
> 
>  Makefile                       |   20 ++++++--------------
>  arch/blackfin/config.mk        |    2 +-
>  board/pcs440ep/config.mk       |    2 +-
>  board/spear/spear300/config.mk |    2 +-
>  board/spear/spear310/config.mk |    2 +-
>  board/spear/spear320/config.mk |    2 +-
>  board/spear/spear600/config.mk |    2 +-
>  7 files changed, 12 insertions(+), 20 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
You're dead, Jim.
	-- McCoy, "Amok Time", stardate 3372.7

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

* [U-Boot] [PATCH v4 2/9] spl: add initial support for a generic SPL framework
  2011-07-18 17:48       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
@ 2011-07-26 12:42         ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-26 12:42 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1311011287-28223-1-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> Signed-off-by: Aneesh V <aneesh@ti.com>
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> ---
> Changes since RFC v1:
> - added documentation for SPL
> 
> Changes since RFC v2:
> - renamed CONFIG_SYS_SPL_LDSCRIPT to CONFIG_SPL_LDSCRIPT
> - added missing documentation for CONFIG_SPL_LDSCRIPT
> 
> Changes since v3:
> - fixed documentation
> 
>  README         |   39 ++++++++++++++++++++++
>  doc/README.SPL |   62 ++++++++++++++++++++++++++++++++++
>  spl/.gitignore |    4 ++
>  spl/Makefile   |  100 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  4 files changed, 205 insertions(+), 0 deletions(-)
>  create mode 100644 doc/README.SPL
>  create mode 100644 spl/.gitignore
>  create mode 100644 spl/Makefile

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Far back in the mists of ancient time, in the great and glorious days
of the former Galactic Empire, life was wild, rich  and  largely  tax
free.         - Douglas Adams, _The Hitchhiker's Guide to the Galaxy_

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

* [U-Boot] [PATCH v3 3/9] Extend build-system for SPL framework
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 3/9] Extend build-system for " Daniel Schwierzeck
@ 2011-07-26 12:42       ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-26 12:42 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1311005361-26241-4-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> Signed-off-by: Aneesh V <aneesh@ti.com>
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> ---
> Changes since RFC v1:
> - enable garbage collect of unused sections for SPL unconditionally
> 
> Changes since RFC v2:
> - none
> 
>  Makefile  |    3 ++-
>  config.mk |   34 +++++++++++++++++++++++++++++++++-
>  2 files changed, 35 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Boykottiert Microsoft - Kauft Eure Fenster bei OBI!

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

* [U-Boot] [PATCH v3 4/9] Hook SPL build-system into toplevel Makefile
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 4/9] Hook SPL build-system into toplevel Makefile Daniel Schwierzeck
@ 2011-07-26 12:43       ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-26 12:43 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1311005361-26241-5-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> Signed-off-by: Aneesh V <aneesh@ti.com>
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> ---
> Changes since RFC v1:
> - none
> 
>  Makefile |    5 +++++
>  1 files changed, 5 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I still miss my ex-wife, but my aim is getting better.

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

* [U-Boot] [PATCH v4 5/9] arm: adjust PLATFORM_LIBS for SPL
  2011-07-19 15:51       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
  2011-07-20  7:59         ` Aneesh V
@ 2011-07-26 12:44         ` Wolfgang Denk
  1 sibling, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-26 12:44 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1311090701-11801-1-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> From: Aneesh V <aneesh@ti.com>
> 
> Signed-off-by: Aneesh V <aneesh@ti.com>
> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> Changes since RFC v1:
> - none
> 
> Changes since RFC v2:
> - none
> 
> Changes since v3:
> - improved comment
> 
>  arch/arm/config.mk |   13 ++++++++++---
>  1 files changed, 10 insertions(+), 3 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I distrust all systematisers, and avoid them. The will  to  a  system
shows a lack of honesty.
- Friedrich Wilhelm Nietzsche _G?tzen-D?mmerung [The Twilight of  the
Idols]_ ``Maxims and Missiles'' no. 26

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

* [U-Boot] [PATCH v3 6/9] scaled down version of generic libraries for SPL
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 6/9] scaled down version of generic libraries " Daniel Schwierzeck
@ 2011-07-26 12:44       ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-26 12:44 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1311005361-26241-7-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> From: Aneesh V <aneesh@ti.com>
> 
> Signed-off-by: Aneesh V <aneesh@ti.com>
> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> Changes since RFC v1:
> - none
> 
>  arch/arm/lib/Makefile   |    2 ++
>  common/Makefile         |    9 ++++++---
>  drivers/serial/Makefile |    3 +++
>  fs/fat/Makefile         |    6 +++++-
>  lib/Makefile            |   11 +++++++----
>  5 files changed, 23 insertions(+), 8 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"How to make a million dollars:  First, get a million dollars."
- Steve Martin

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

* [U-Boot] [PATCH v3 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD Daniel Schwierzeck
@ 2011-07-26 12:45       ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-26 12:45 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1311005361-26241-8-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> From: Aneesh V <aneesh@ti.com>
> 
> replace all occurences of CONFIG_PRELOADER with CONFIG_SPL_BUILD
> 
> Signed-off-by: Aneesh V <aneesh@ti.com>
> Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
> ---
> Changes since RFC v1:
> - none
> 
>  README                                    |    2 +-
>  arch/arm/cpu/arm1136/start.S              |   20 +++++++++---------
>  arch/arm/cpu/arm1176/start.S              |    4 +-
>  arch/arm/cpu/arm720t/start.S              |    4 +-
>  arch/arm/cpu/arm920t/start.S              |    4 +-
>  arch/arm/cpu/arm925t/start.S              |    4 +-
>  arch/arm/cpu/arm926ejs/start.S            |   18 ++++++++--------
>  arch/arm/cpu/arm946es/start.S             |    4 +-
>  arch/arm/cpu/arm_intcm/start.S            |    4 +-
>  arch/arm/cpu/armv7/start.S                |    6 ++--
>  arch/arm/cpu/ixp/start.S                  |    4 +-
>  arch/arm/cpu/lh7a40x/start.S              |    4 +-
>  arch/arm/cpu/pxa/start.S                  |   30 ++++++++++++++--------------
>  arch/arm/cpu/s3c44b0/start.S              |    4 +-
>  arch/arm/cpu/sa1100/start.S               |    4 +-
>  arch/arm/lib/board.c                      |    2 +-
>  mmc_spl/board/samsung/smdkv310/Makefile   |    2 +-
>  nand_spl/board/davinci/da8xxevm/Makefile  |    4 +-
>  nand_spl/board/freescale/mx31pdk/Makefile |    4 +-
>  nand_spl/board/karo/tx25/Makefile         |    4 +-
>  onenand_ipl/board/apollon/Makefile        |    4 +-
>  onenand_ipl/board/vpac270/Makefile        |    4 +-
>  22 files changed, 70 insertions(+), 70 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
I will also, for an appropriate fee, certify that  your  keyboard  is
object-oriented,  and  that  the bits on your hard disk are template-
compatible.            - Jeffrey S. Haemer in <411akr$3ga@cygnus.com>

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

* [U-Boot] [PATCH v3 8/9] spl: Add support for common libraries and drivers
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 8/9] spl: Add support for common libraries and drivers Daniel Schwierzeck
@ 2011-07-26 12:45       ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-26 12:45 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1311005361-26241-9-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> Signed-off-by: Aneesh V <aneesh@ti.com>
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> ---
> Changes since RFC v1:
> - none
> 
>  spl/Makefile |   11 +++++++++++
>  1 files changed, 11 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Many aligators will be slain, but the swamp will remain.

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

* [U-Boot] [PATCH v3 9/9] spl: add support for omap-common libraries
  2011-07-18 16:09     ` [U-Boot] [PATCH v3 9/9] spl: add support for omap-common libraries Daniel Schwierzeck
@ 2011-07-26 12:45       ` Wolfgang Denk
  0 siblings, 0 replies; 172+ messages in thread
From: Wolfgang Denk @ 2011-07-26 12:45 UTC (permalink / raw)
  To: u-boot

Dear Daniel Schwierzeck,

In message <1311005361-26241-10-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
> Signed-off-by: Aneesh V <aneesh@ti.com>
> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@googlemail.com>
> ---
> Changes since RFC v1:
> - none
> 
>  spl/Makefile |    7 +++++++
>  1 files changed, 7 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Human beings were created by water to transport it uphill.

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

end of thread, other threads:[~2011-07-26 12:45 UTC | newest]

Thread overview: 172+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-16  8:08 [U-Boot] SPL framework re-design Aneesh V
2011-06-16 10:47 ` Wolfgang Denk
2011-06-16 11:50   ` Aneesh V
2011-06-16 12:15     ` Wolfgang Denk
2011-06-16 13:38       ` Aneesh V
2011-06-16 21:52         ` Wolfgang Denk
2011-06-16 12:55   ` Daniel Schwierzeck
2011-06-16 13:10     ` Andreas Bießmann
2011-06-26 23:17       ` Ilya Yanok
2011-06-27  4:29         ` Aneesh V
2011-06-27  8:24           ` Ilya Yanok
2011-06-27  9:08             ` Aneesh V
2011-06-27  8:42           ` Simon Schwarz
2011-06-27  9:36           ` Wolfgang Denk
2011-06-27 18:42             ` Scott Wood
2011-06-27 20:54               ` Wolfgang Denk
2011-06-27  9:27         ` Wolfgang Denk
2011-06-27 13:42           ` Daniel Schwierzeck
2011-06-27 20:48             ` Wolfgang Denk
2011-06-27 18:34           ` Scott Wood
2011-06-27 20:50             ` Wolfgang Denk
2011-06-27 20:55               ` Scott Wood
2011-06-27 21:10                 ` Wolfgang Denk
2011-06-27 21:18                   ` Scott Wood
2011-06-27 21:22                     ` Wolfgang Denk
2011-06-28  6:54                       ` Aneesh V
2011-06-28 16:18                         ` Scott Wood
2011-06-29  7:27                           ` Aneesh V
2011-06-16 13:57     ` Aneesh V
2011-06-16 14:27       ` Daniel Schwierzeck
2011-06-16 21:55       ` Wolfgang Denk
2011-06-16 21:47     ` Wolfgang Denk
2011-06-17 18:45       ` Daniel Schwierzeck
2011-06-17 18:51         ` Scott Wood
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 0/7] spl framework prototype Aneesh V
2011-07-01  5:20       ` Aneesh V
2011-07-05 16:26       ` [U-Boot] [RFC PATCH 0/4] " Daniel Schwierzeck
2011-07-05 16:26         ` [U-Boot] [RFC PATCH 1/4] Adapt config.mk for usage in spl/Makefile Daniel Schwierzeck
2011-07-05 17:52           ` Mike Frysinger
2011-07-06  8:07           ` Aneesh V
2011-07-08  9:08           ` Wolfgang Denk
2011-07-08 10:20             ` Aneesh V
2011-07-08 11:19               ` Wolfgang Denk
2011-07-08 11:40                 ` Aneesh V
2011-07-08 12:37                   ` Wolfgang Denk
2011-07-08 11:34             ` Daniel Schwierzeck
2011-07-08 12:25               ` Wolfgang Denk
2011-07-08 13:33                 ` Aneesh V
2011-07-08 13:44                   ` Wolfgang Denk
2011-07-08 13:52                     ` Aneesh V
2011-07-05 16:26         ` [U-Boot] [RFC PATCH 2/4] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Daniel Schwierzeck
2011-07-05 17:53           ` Mike Frysinger
2011-07-08  9:12           ` Wolfgang Denk
2011-07-08 10:28             ` Aneesh V
2011-07-08 11:20               ` Wolfgang Denk
2011-07-05 16:26         ` [U-Boot] [RFC PATCH 3/4] Add new folder and build system for SPL Daniel Schwierzeck
2011-07-08  9:17           ` Wolfgang Denk
2011-07-08 11:32             ` Aneesh V
2011-07-08 12:32               ` Wolfgang Denk
2011-07-08 12:51                 ` Aneesh V
2011-07-08 13:04                   ` Wolfgang Denk
2011-07-08 13:28                     ` Aneesh V
2011-07-08 13:41                       ` Wolfgang Denk
2011-07-08 13:50                         ` Aneesh V
2011-07-08 11:57             ` Daniel Schwierzeck
2011-07-05 16:26         ` [U-Boot] [RFC PATCH 4/4] Hook spl directory into main Makefile Daniel Schwierzeck
2011-07-08  9:18           ` Wolfgang Denk
2011-07-08  4:40         ` [U-Boot] [RFC PATCH 0/4] spl framework prototype Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 1/7] Adapt config.mk for usage in spl/Makefile Aneesh V
2011-06-29 18:52       ` Mike Frysinger
2011-06-30  5:12         ` Aneesh V
2011-06-30 11:09           ` Daniel Schwierzeck
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 2/7] Use ALL-y style instead of ifeq blocks for better readability and upgradeability Aneesh V
2011-06-29 18:54       ` Mike Frysinger
2011-06-30  5:14         ` Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 3/7] Add new folder and build system for SPL Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 4/7] Hook spl directory into main Makefile Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 5/7] armv7: adapt Makefile for spl building Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 6/7] omap: common spl support for OMAP3/4 Aneesh V
2011-06-30  6:01       ` Heiko Schocher
2011-06-30  6:12         ` Aneesh V
2011-06-30  7:08           ` Andreas Bießmann
2011-07-01  9:27             ` Aneesh V
2011-07-01  9:55               ` Andreas Bießmann
2011-07-01 11:48                 ` Aneesh V
2011-07-01 19:51                   ` Albert ARIBAUD
2011-07-03  4:47                     ` Aneesh V
2011-07-03  6:56                       ` Albert ARIBAUD
2011-07-03  7:31                         ` Andreas Bießmann
2011-07-03  7:48                           ` Albert ARIBAUD
2011-07-03  8:39                         ` Aneesh V
2011-06-30  7:53           ` Heiko Schocher
2011-06-30  8:21             ` Simon Schwarz
2011-06-30 10:05               ` Aneesh V
2011-06-30 11:09               ` Albert ARIBAUD
2011-06-30 11:18                 ` Aneesh V
2011-06-29 13:09     ` [U-Boot] [RFC PATCH 7/7] omap4: adapt Makefile for spl building Aneesh V
2011-06-17 16:48   ` [U-Boot] SPL framework re-design Aneesh V
2011-06-17 22:28     ` Scott Wood
2011-06-19 10:22       ` V, Aneesh
2011-06-20 16:19         ` Scott Wood
2011-06-21  3:22           ` Aneesh V
2011-06-21 10:59     ` Aneesh V
2011-06-25  8:06       ` Aneesh V
2011-06-25 12:10       ` Wolfgang Denk
2011-06-25 16:11         ` Daniel Schwierzeck
2011-06-27  4:19         ` Aneesh V
2011-06-27  9:27           ` Wolfgang Denk
2011-06-27 14:56             ` Aneesh V
2011-06-27 20:49               ` Wolfgang Denk
2011-06-16 16:45 ` Scott Wood
2011-06-16 22:09   ` Wolfgang Denk
2011-06-16 22:22     ` Scott Wood
2011-06-17  7:02     ` Aneesh V
2011-06-17  7:00   ` Aneesh V
2011-06-28  0:55 ` Graeme Russ
2011-06-28  4:10   ` Wolfgang Denk
2011-07-13 15:11 ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
2011-07-15 16:22     ` [U-Boot] [RFC PATCH v2 " Daniel Schwierzeck
2011-07-18 16:06       ` Wolfgang Denk
2011-07-18 16:22         ` Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 3/9] Extend build-system for " Daniel Schwierzeck
2011-07-14  5:37     ` Aneesh V
2011-07-14  9:45       ` Wolfgang Denk
2011-07-14 10:02         ` Aneesh V
2011-07-15 16:24     ` [U-Boot] [RFC PATCH v2 " Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 4/9] Hook SPL build-system into toplevel Makefile Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 6/9] scaled down version of generic libraries " Daniel Schwierzeck
2011-07-15 12:31     ` Simon Schwarz
2011-07-15 12:41       ` Aneesh V
2011-07-15 13:10         ` Simon Schwarz
2011-07-15 13:35           ` Aneesh V
2011-07-15 14:43         ` Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 8/9] spl: Add support for common libraries and drivers Daniel Schwierzeck
2011-07-13 15:11   ` [U-Boot] [RFC PATCH v1 9/9] spl: add support for omap-common libraries Daniel Schwierzeck
2011-07-13 15:17   ` [U-Boot] [RFC PATCH v1 0/9] Prototype for generic SPL framework Albert ARIBAUD
2011-07-14 20:06   ` Wolfgang Denk
2011-07-14 20:25   ` Wolfgang Denk
2011-07-15  7:57     ` Aneesh V
2011-07-15  8:35       ` Wolfgang Denk
2011-07-15 15:02     ` Daniel Schwierzeck
2011-07-18 16:09   ` [U-Boot] [PATCH v3 0/9] Add initial support for a " Daniel Schwierzeck
2011-07-18 16:09     ` [U-Boot] [PATCH v3 1/9] Use ALL-y style instead of ifeq blocks for better readability Daniel Schwierzeck
2011-07-19  3:51       ` Vipin Kumar
2011-07-26 12:41       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 2/9] spl: add initial support for a generic SPL framework Daniel Schwierzeck
2011-07-18 17:48       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
2011-07-26 12:42         ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 3/9] Extend build-system for " Daniel Schwierzeck
2011-07-26 12:42       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 4/9] Hook SPL build-system into toplevel Makefile Daniel Schwierzeck
2011-07-26 12:43       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 5/9] arm: adjust PLATFORM_LIBS for SPL Daniel Schwierzeck
2011-07-19  9:21       ` Albert ARIBAUD
2011-07-19 10:38         ` Aneesh V
2011-07-19 11:03           ` Albert ARIBAUD
2011-07-19 15:51       ` [U-Boot] [PATCH v4 " Daniel Schwierzeck
2011-07-20  7:59         ` Aneesh V
2011-07-26 12:44         ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 6/9] scaled down version of generic libraries " Daniel Schwierzeck
2011-07-26 12:44       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 7/9] replace CONFIG_PRELOADER with CONFIG_SPL_BUILD Daniel Schwierzeck
2011-07-26 12:45       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 8/9] spl: Add support for common libraries and drivers Daniel Schwierzeck
2011-07-26 12:45       ` Wolfgang Denk
2011-07-18 16:09     ` [U-Boot] [PATCH v3 9/9] spl: add support for omap-common libraries Daniel Schwierzeck
2011-07-26 12:45       ` Wolfgang Denk
2011-07-20 21:12     ` [U-Boot] [PATCH v3 0/9] Add initial support for a generic SPL framework Paulraj, Sandeep

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.