Skip to contentSkip to conversation

SPL framework re-design

U-Boot New Aneesh V 14 participants 172 messages Jun 16, 2011 – Jul 26, 2011

Subsystems (4)
lore
Share & tools
lore

Aneesh V

author
#0 lore raw

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

#1 lore raw

Dear Aneesh,

Quoted 6 lines · In message <[email protected]> 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!

Quoted 3 lines

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).

Quoted 7 lines

* 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.

Quoted 3 lines

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
	...
Quoted 2 lines

* 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).

Quoted 2 lines

* 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.

Quoted 2 lines

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

...together by spl/Makefile ...

Quoted 11 lines

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.

Quoted 3 lines

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.

Quoted 2 lines

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

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

Quoted 8 lines

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.

Quoted 3 lines

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.

Quoted 2 lines

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.

Quoted 2 lines

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

Signature · 6 lines
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_
author
#2 lore raw

Dear Wolfgang,

Quoted 41 lines · Wolfgang Denk

Dear Aneesh,

Quoted 6 lines · In message<[email protected]> 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!

Quoted 3 lines

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).

Quoted 7 lines

* 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.

Quoted 3 lines

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/

Quoted 8 lines

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.

Quoted 13 lines

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
	...
Quoted 6 lines
Quoted 2 lines

* 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?

Quoted 24 lines
Quoted 3 lines

* 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.

Quoted 2 lines

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

...together by spl/Makefile ...

Quoted 11 lines

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.

Quoted 7 lines

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.

Quoted 11 lines
Quoted 4 lines

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.

Quoted 2 lines

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.

Quoted 14 lines
Quoted 9 lines

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.

Quoted 5 lines

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

#3 lore raw

Dear Aneesh V,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 4 lines

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

Quoted 8 lines
Quoted 5 lines

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
	...
Quoted 6 lines
Quoted 3 lines

...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/

Quoted 7 lines
Quoted 3 lines

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.

Quoted 2 lines

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?

Quoted 3 lines

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.

Quoted 4 lines

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.

Quoted 2 lines

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.

Quoted 7 lines

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

Signature · 4 lines
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
author
#4 lore raw
Quoted 13 lines · Wolfgang Denk

Dear Aneesh V,

Quoted 10 lines · In message<[email protected]> you wrote:
Quoted 9 lines

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/

Quoted 8 lines
Quoted 2 lines

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.

Quoted 29 lines
Quoted 7 lines
Quoted 4 lines

...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/

Quoted 7 lines
Quoted 3 lines

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.

Quoted 5 lines
Quoted 2 lines

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?

Quoted 7 lines
Quoted 4 lines

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

#5 lore raw

Dear Aneesh V,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 4 lines
Quoted 3 lines

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

Quoted 8 lines
Quoted 5 lines

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.

Quoted 6 lines
Quoted 2 lines

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.

Quoted 2 lines

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?

Quoted 9 lines
Quoted 6 lines
Quoted 3 lines

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.

Quoted 2 lines

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

Signature · 5 lines
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
#6 lore raw
In reply to Wolfgang Denk

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

Quoted 1 line · Wolfgang Denk

Dear Aneesh,

[snip]

Quoted 59 lines

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
? ? ? ?...

Quoted 2 lines

* 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).

Quoted 2 lines

* 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.

Quoted 2 lines

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

...together by spl/Makefile ...

Quoted 11 lines

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.

Quoted 7 lines

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.

Quoted 11 lines
Quoted 4 lines

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.

Quoted 2 lines

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.

Quoted 35 lines
Quoted 9 lines

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.

Quoted 3 lines

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.

Quoted 2 lines

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.

Quoted 2 lines

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

Quoted 8 lines

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

#7 lore raw

Dear all,

Am 16.06.2011 14:55, schrieb Daniel Schwierzeck:

<snip>

Quoted 2 lines · Wolfgang Denk
Quoted 1 line

Dear Aneesh,

<snip>

Quoted 7 lines
Quoted 3 lines

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

Quoted 9 lines
Quoted 9 lines
Quoted 3 lines

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.

Quoted 2 lines

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

Quoted 6 lines
Quoted 1 line

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

#8 lore raw

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.

author
#9 lore raw

Hi Ilya,

Quoted 5 lines · Ilya Yanok

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.

Quoted 7 lines

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).

Quoted 3 lines

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

#10 lore raw

Hi Aneesh,

Quoted 8 lines · Aneesh V
Quoted 8 lines

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_?

Quoted 7 lines
Quoted 1 line

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...

Quoted 10 lines
Quoted 2 lines

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.

author
#11 lore raw

Hi Ilya,

Quoted 19 lines · Ilya Yanok

Hi Aneesh,

Quoted 8 lines · Aneesh V
Quoted 8 lines

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_?

Quoted 7 lines
Quoted 1 line

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).

Quoted 7 lines

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

#12 lore raw
In reply to Aneesh V

Hi,

Quoted 2 lines

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...

Quoted 4 lines

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.

Quoted 4 lines

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

#13 lore raw
In reply to Aneesh V

Dear Aneesh,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 7 lines

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_?

Quoted 7 lines
Quoted 1 line

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.

Quoted 1 line

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.

Quoted 3 lines

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

Signature · 5 lines
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.
#14 lore raw
Quoted 18 lines · On Mon, 27 Jun 2011 11:36:33 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Aneesh,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 7 lines

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_?

Quoted 7 lines
Quoted 1 line

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).

Quoted 4 lines

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

#15 lore raw

Dear Scott Wood,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 5 lines

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.

Quoted 7 lines

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

Signature · 5 lines
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
#16 lore raw
In reply to Ilya Yanok

Dear Ilya,

Quoted 6 lines · In message <[email protected]> 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

Signature · 4 lines
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."
#17 lore raw

Hi,

Quoted 9 lines · Wolfgang Denk

Dear Ilya,

Quoted 6 lines · In message <[email protected]> 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.

Quoted 3 lines

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

#18 lore raw

Dear Daniel,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 3 lines

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

Signature · 5 lines
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?"
#19 lore raw
In reply to Wolfgang Denk
Quoted 4 lines · On Mon, 27 Jun 2011 11:27:31 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Ilya,

Quoted 1 line · In message <[email protected]> you wrote:
Quoted 8 lines
Quoted 5 lines

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

#20 lore raw

Dear Scott Wood,

Quoted 6 lines · In message <[email protected]> you wrote:
Quoted 3 lines

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

Signature · 5 lines
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.
#21 lore raw
Quoted 7 lines · On Mon, 27 Jun 2011 22:50:46 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Scott Wood,

Quoted 4 lines · In message <[email protected]> you wrote:
Quoted 3 lines

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

Quoted 6 lines
Quoted 2 lines

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

#22 lore raw

Dear Scott Wood,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 4 lines

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

Signature · 4 lines
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."
#23 lore raw
Quoted 4 lines · On Mon, 27 Jun 2011 23:10:33 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Scott Wood,

Quoted 1 line · In message <[email protected]> you wrote:
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

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

#24 lore raw

Dear Scott Wood,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

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).

Quoted 8 lines
Quoted 4 lines
Quoted 2 lines

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

Signature · 4 lines
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.
author
#25 lore raw
Quoted 11 lines · Wolfgang Denk

Dear Scott Wood,

Quoted 8 lines · In message<[email protected]> you wrote:
Quoted 8 lines
Quoted 7 lines
Quoted 4 lines

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.

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

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

#26 lore raw
Quoted 4 lines · On Tue, 28 Jun 2011 12:24:11 +0530 Aneesh V <[email protected]> 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

author
#27 lore raw
Quoted 9 lines · Scott Wood
Quoted 4 lines · On Tue, 28 Jun 2011 12:24:11 +0530 Aneesh V<[email protected]> 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?

author
#28 lore raw
In reply to Daniel Schwierzeck

Hi Daniel,

This looks like an interesting alternative.

Quoted 6 lines · Daniel Schwierzeck

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.

Quoted 8 lines

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.

Quoted 8 lines

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

#29 lore raw
Quoted 21 lines · Aneesh V

Hi Daniel,

This looks like an interesting alternative.

Quoted 7 lines · Daniel Schwierzeck

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.

Quoted 8 lines

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.

Quoted 4 lines

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.

Quoted 10 lines
Quoted 9 lines

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.

Quoted 3 lines

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

Quoted 5 lines

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.

Quoted 3 lines

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

#30 lore raw
In reply to Aneesh V

Dear Aneesh V,

Quoted 5 lines · In message <[email protected]> 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

Signature · 5 lines
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
#31 lore raw
In reply to Daniel Schwierzeck

Dear Daniel Schwierzeck,

Quoted 4 lines · In message <[email protected]> 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().

Quoted 9 lines
Quoted 4 lines
Quoted 2 lines

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

Signature · 4 lines
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
#32 lore raw

Dear Wolfgang,

Quoted 4 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

Quoted 1 line · In message <[email protected]> you wrote:
Quoted 8 lines
Quoted 3 lines

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.

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 4 lines

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

Quoted 8 lines
Quoted 6 lines
Quoted 1 line

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

#33 lore raw
Quoted 16 lines · On Fri, 17 Jun 2011 20:45:19 +0200 Daniel Schwierzeck…

Dear Wolfgang,

Quoted 4 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

Quoted 1 line · In message <[email protected]> you wrote:
Quoted 8 lines
Quoted 3 lines

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().

Quoted 7 lines

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

author
#34 lore raw

cover spl framework prototype

In reply to Daniel Schwierzeck

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
author
#35 lore raw

cover spl framework prototype

Dear Wolfgang,

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

best regards,
Aneesh

Quoted 40 lines · Aneesh V

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

#36 lore raw

cover spl framework prototype

In reply to Aneesh V

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

#37 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

[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 ]

---
 config.mk |   28 ++++++++++++++++++++++++++++
 1 files changed, 28 insertions(+), 0 deletions(-)
config.mk +28 -0
index 2eb7fa2..a16e761 100644
@@ -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
Signature · 1 line
1.7.5.4
#38 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

config.mk RANLIB = $(CROSS_COMPILE)RANLIB · line 126

Quoted 8 lines · On Tuesday, July 05, 2011 12:26:19 Daniel Schwierzeck wrote:
config.mk +6 -0
+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

author
#39 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

In reply to Daniel Schwierzeck

Hi Daniel,

Quoted 37 lines · Daniel Schwierzeck

[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 ]

---
  config.mk |   28 ++++++++++++++++++++++++++++
  1 files changed, 28 insertions(+), 0 deletions(-)
config.mk +6 -0
index 2eb7fa2..a16e761 100644
@@ -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.

config.mk ifneq ($(CONFIG_SYS_TEXT_BASE),) · line 173

Quoted 4 lines
config.mk +1 -0
@@ -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?

config.mk ifneq ($(CONFIG_SYS_TEXT_BASE),) · line 181

Quoted 8 lines
config.mk +8 -0
+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?

Quoted 7 lines
config.mk +3 -0
+
+CONFIG_NORMAL_UBOOT = $(if $(CONFIG_UBOOT_SPL_BUILD),,y)
+
  ifneq ($(RESET_VECTOR_ADDRESS),)
  CPPFLAGS += -DRESET_VECTOR_ADDRESS=$(RESET_VECTOR_ADDRESS)
  endif
 

[snip..]

config.mk ifneq ($(CONFIG_SYS_TEXT_BASE),) · line 236

Quoted 5 lines
config.mk +5 -0
+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

#40 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

In reply to Daniel Schwierzeck

Dear Daniel Schwierzeck,

Quoted 10 lines · In message <1309883182-12854-2-git-send-email-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 ]

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

...

config.mk ifneq ($(CONFIG_SYS_TEXT_BASE),) · line 181

Quoted 5 lines
config.mk +5 -0
+# 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.

Quoted 1 line

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

Is this not redundant, then?

Best regards,

Wolfgang Denk

Signature · 5 lines
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
author
#41 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

Dear Wolfgang,

Quoted 22 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

Quoted 10 lines · In message<1309883182-12854-2-git-send-email-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 ]

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

...

config.mk ifneq ($(CONFIG_SYS_TEXT_BASE),) · line 181

Quoted 5 lines
config.mk +5 -0
+# 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.

Quoted 3 lines
Quoted 1 line

+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

#42 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

Dear Aneesh V,

Quoted 15 lines · In message <[email protected]> you wrote:
Quoted 4 lines
Quoted 2 lines

+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:

(quoted diff) +6 -0
+# 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
Quoted 1 line

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

Signature · 7 lines
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
author
#43 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

Quoted 22 lines · Wolfgang Denk

Dear Aneesh V,

Quoted 15 lines · In message<[email protected]> you wrote:
Quoted 4 lines
Quoted 2 lines

+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:

(quoted diff) +6 -0
+# 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
Quoted 1 line

Without CONFIG_NORMAL_UBOOT this becomes a little cumbersome.

Hm... instead of

Quoted 5 lines

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

#44 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

Dear Aneesh V,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 5 lines
Quoted 2 lines

Without CONFIG_NORMAL_UBOOT this becomes a little cumbersome.

Hm... instead of

Quoted 8 lines
Quoted 5 lines

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

Signature · 5 lines
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."
#45 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

In reply to Wolfgang Denk

Dear Wolfgang,

Quoted 13 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

Quoted 10 lines · In message <1309883182-12854-2-git-send-email-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 ]

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

Quoted 8 lines

...

config.mk ifneq ($(CONFIG_SYS_TEXT_BASE),) · line 181

Quoted 5 lines
config.mk +5 -0
+# 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

#46 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

Dear Daniel Schwierzeck,

Quoted 9 lines · In message <CACUy__VhV1_eXGW1NuSgLEB1nyVJ51xUXa0vwbY3Tdb=Kvmp2w@mail.gmail.com>…
Quoted 8 lines

config.mk ifneq ($(CONFIG_SYS_TEXT_BASE),) · line 181

Quoted 6 lines
config.mk +5 -0
+# 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.

Quoted 4 lines

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

Signature · 6 lines
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
<[email protected]>
author
#47 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

Dear Wolfgang,

Quoted 17 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

Quoted 9 lines · In message<CACUy__VhV1_eXGW1NuSgLEB1nyVJ51xUXa0vwbY3Tdb=Kvmp2w@mail.gmail.com>…
Quoted 8 lines

config.mk ifneq ($(CONFIG_SYS_TEXT_BASE),) · line 181

Quoted 6 lines
config.mk +5 -0
+# 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.

Quoted 4 lines

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?

Quoted 5 lines

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

#48 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

Dear Aneesh V,

Quoted 3 lines · In message <[email protected]> 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

Signature · 5 lines
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.
author
#49 lore raw

RFC PATCH 1/4 Adapt config.mk for usage in spl/Makefile

Quoted 11 lines · Wolfgang Denk

Dear Aneesh V,

Quoted 3 lines · In message<[email protected]> 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

#50 lore raw

RFC PATCH 2/4 Use ALL-y style instead of ifeq blocks for better readability and upgradeability

In reply to Daniel Schwierzeck

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

---
 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(-)
Makefile +5 -13
index e56fa02..8833f4b 100644
@@ -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 $< $@
arch/blackfin/config.mk +1 -1
index 71fd53f..f9d46de 100644
@@ -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
board/pcs440ep/config.mk +1 -1
index 23631c5..f560ec6 100644
@@ -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
 
board/spear/spear300/config.mk +1 -1
index 11da2c3..5848ef8 100644
@@ -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)
board/spear/spear310/config.mk +1 -1
index 2b59c39..f8a6bdb 100644
@@ -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)
board/spear/spear320/config.mk +1 -1
index 2b59c39..f8a6bdb 100644
@@ -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)
board/spear/spear600/config.mk +1 -1
index 11da2c3..5848ef8 100644
@@ -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)
Signature · 1 line
1.7.5.4
#52 lore raw

RFC PATCH 2/4 Use ALL-y style instead of ifeq blocks for better readability and upgradeability

In reply to Daniel Schwierzeck

Dear Daniel Schwierzeck,

Quoted 4 lines · In message <1309883182-12854-3-git-send-email-daniel.schwierzeck@googlemail.com…

[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:

Best regards,

Wolfgang Denk

Signature · 9 lines
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_
author
#53 lore raw

RFC PATCH 2/4 Use ALL-y style instead of ifeq blocks for better readability and upgradeability

Dear Wolfgang,

Quoted 10 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

Quoted 4 lines · In message<1309883182-12854-3-git-send-email-daniel.schwierzeck@googlemail.com>…

[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

#54 lore raw

RFC PATCH 2/4 Use ALL-y style instead of ifeq blocks for better readability and upgradeability

Dear Aneesh V,

Quoted 7 lines · In message <[email protected]> you wrote:
Quoted 3 lines

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

Signature · 6 lines
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.
#55 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

In reply to Daniel Schwierzeck

[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 ]

---
 spl/Makefile |   97 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 97 insertions(+), 0 deletions(-)
 create mode 100644 spl/Makefile
spl/Makefile new file +97 -0
new file mode 100644
index 0000000..0521008
@@ -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 <[email protected]>
+#
+# 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
+
Signature · 1 line
1.7.5.4
#56 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

Dear Daniel Schwierzeck,

In message <1309883182-12854-4-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
...

spl/Makefile line 22

Quoted 8 lines
spl/Makefile new file +8 -0
+# 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

Signature · 7 lines
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."
author
#57 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

Dear Wolfgang,

Quoted 4 lines · Wolfgang Denk

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.

Quoted 5 lines

spl/Makefile line 19

Quoted 5 lines
spl/Makefile new file +5 -0
+# 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

Quoted 2 lines

spl/Makefile line 21

Quoted 2 lines
spl/Makefile new file +2 -0
+# 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/

Quoted 5 lines
Quoted 1 line

+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

#58 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

Dear Aneesh V,

Quoted 3 lines · In message <[email protected]> you wrote:
Quoted 3 lines

spl/Makefile line 16

Quoted 3 lines
spl/Makefile new file +2 -0
+# 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.

Quoted 5 lines
Quoted 2 lines

spl/Makefile line 21

Quoted 2 lines
spl/Makefile new file +2 -0
+# 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.

Quoted 11 lines
Quoted 3 lines

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

Quoted 1 line

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

Signature · 4 lines
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.
author
#59 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

Quoted 31 lines · Wolfgang Denk

Dear Aneesh V,

Quoted 3 lines · In message<[email protected]> you wrote:
Quoted 3 lines

spl/Makefile line 16

Quoted 3 lines
spl/Makefile new file +2 -0
+# 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.

Quoted 5 lines
Quoted 2 lines

spl/Makefile line 21

Quoted 2 lines
spl/Makefile new file +2 -0
+# 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.

Quoted 7 lines
Quoted 3 lines

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:

Quoted 8 lines
Quoted 4 lines

+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?

Quoted 10 lines

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

Quoted 1 line

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

#60 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

Dear Aneesh V,

Quoted 5 lines · In message <[email protected]> you wrote:
Quoted 2 lines

- 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.

Quoted 4 lines
Quoted 4 lines

- introduce a new variable that stores the original setting of OBJTREE so we can refer to this later

Quoted 1 line

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).

Quoted 2 lines

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

Signature · 4 lines
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.
author
#61 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

Quoted 22 lines · Wolfgang Denk

Dear Aneesh V,

Quoted 5 lines · In message<[email protected]> you wrote:
Quoted 2 lines

- 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.

Quoted 4 lines
Quoted 4 lines

- introduce a new variable that stores the original setting of OBJTREE so we can refer to this later

Quoted 1 line

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)
Quoted 6 lines

...
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.

Quoted 5 lines
Quoted 3 lines

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

#62 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

Dear Aneesh V,

Quoted 7 lines · In message <[email protected]> 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...

Quoted 10 lines

(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

Signature · 4 lines
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
author
#63 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

Quoted 24 lines · Wolfgang Denk

Dear Aneesh V,

Quoted 7 lines · In message<[email protected]> 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...

Quoted 10 lines

(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.

Quoted 6 lines

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

#64 lore raw

RFC PATCH 3/4 Add new folder and build system for SPL

In reply to Wolfgang Denk

Dear Wolfgang,

Quoted 17 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

In message <1309883182-12854-4-git-send-email-daniel.schwierzeck@googlemail.com> you wrote:
...

spl/Makefile

Quoted 8 lines
spl/Makefile new file +8 -0
+# 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?

Quoted 6 lines

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

#65 lore raw

RFC PATCH 4/4 Hook spl directory into main Makefile

In reply to Daniel Schwierzeck

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

---
 Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Makefile +5 -0
index 8833f4b..d05c2b1 100644
@@ -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 '*~' \
Signature · 1 line
1.7.5.4
#66 lore raw

RFC PATCH 4/4 Hook spl directory into main Makefile

Dear Daniel Schwierzeck,

Quoted 9 lines · In message <1309883182-12854-5-git-send-email-daniel.schwierzeck@googlemail.com…

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

---
 Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Best regards,

Wolfgang Denk

Signature · 4 lines
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).
author
#67 lore raw

cover spl framework prototype

In reply to Daniel Schwierzeck

Dear Wolfgang,

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

Quoted 26 lines · Daniel Schwierzeck

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(-)
Quoted 5 lines

create mode 100644 spl/Makefile

--
1.7.5.4

best regards,
Aneesh

author
#68 lore raw

RFC PATCH 1/7 Adapt config.mk for usage in spl/Makefile

In reply to Daniel Schwierzeck

From: Daniel Schwierzeck <[email protected]>

[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 ]

---
 config.mk |   32 +++++++++++++++++++++++++++-----
 1 files changed, 27 insertions(+), 5 deletions(-)
config.mk +27 -5
index 7ce554e..2ad15c6 100644
@@ -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
 
 #########################################################################
Signature · 1 line
1.7.0.4
#69 lore raw

RFC PATCH 1/7 Adapt config.mk for usage in spl/Makefile

Quoted 2 lines · 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

author
#70 lore raw

RFC PATCH 1/7 Adapt config.mk for usage in spl/Makefile

Quoted 3 lines · Mike Frysinger
Quoted 2 lines · 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

#71 lore raw

RFC PATCH 1/7 Adapt config.mk for usage in spl/Makefile

Hi Aneesh,

Quoted 7 lines · Aneesh V
Quoted 5 lines · Mike Frysinger
Quoted 3 lines · On Wednesday, June 29, 2011 09:09:21 Aneesh V wrote:

-$(obj)%.s: ? ? %.S
+$(obj)%.s: ? ? $(src)%.S

Quoted 8 lines

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

author
#72 lore raw

RFC PATCH 2/7 Use ALL-y style instead of ifeq blocks for better readability and upgradeability

In reply to Daniel Schwierzeck

From: Daniel Schwierzeck <[email protected]>

---
 Makefile |   18 +++++-------------
 1 files changed, 5 insertions(+), 13 deletions(-)
Makefile +5 -13
index dcf5d93..813b03b 100644
@@ -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 $< $@
Signature · 1 line
1.7.0.4
#73 lore raw

RFC PATCH 2/7 Use ALL-y style instead of ifeq blocks for better readability and upgradeability

Quoted 4 lines · 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

author
#74 lore raw

RFC PATCH 2/7 Use ALL-y style instead of ifeq blocks for better readability and upgradeability

Quoted 9 lines · Mike Frysinger
Quoted 4 lines · 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

author
#75 lore raw

RFC PATCH 3/7 Add new folder and build system for SPL

In reply to Daniel Schwierzeck

From: Daniel Schwierzeck <[email protected]>

[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
]

---
 spl/Makefile |  105 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 spl/Makefile
spl/Makefile new file +105 -0
new file mode 100644
index 0000000..46edf2b
@@ -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 <[email protected]>
+#
+# 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
+
Signature · 1 line
1.7.0.4
author
#76 lore raw

RFC PATCH 4/7 Hook spl directory into main Makefile

In reply to Daniel Schwierzeck

From: Daniel Schwierzeck <[email protected]>

---
 Makefile |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
Makefile +8 -0
index 813b03b..ea35b17 100644
@@ -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 '*~' \
Signature · 1 line
1.7.0.4
author
#77 lore raw

RFC PATCH 5/7 armv7: adapt Makefile for spl building

In reply to Daniel Schwierzeck
---
 arch/arm/cpu/armv7/Makefile |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
arch/arm/cpu/armv7/Makefile +5 -4
index 8c0e915..549ade6 100644
@@ -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)
Signature · 1 line
1.7.0.4
author
#78 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

In reply to Daniel Schwierzeck
---
 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
arch/arm/cpu/armv7/omap-common/Makefile +5 -4
index dc01ee5..7931303 100644
@@ -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)
 
arch/arm/cpu/armv7/omap-common/spl.c new file +56 -0

56 lines not on this page · raw message

arch/arm/cpu/armv7/omap-common/spl.lds new file +62 -0

62 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#79 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Hello Aneesh,

Quoted 9 lines · Aneesh V
---
 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

[...]

Quoted 5 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +0 -0
new file mode 100644
index 0000000..b5a5f3c

[...]

arch/arm/cpu/armv7/omap-common/spl.c line 5

Quoted 6 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +5 -0
@@ -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

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
author
#80 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Hi Heiko,

Quoted 19 lines · Heiko Schocher

Hello Aneesh,

Quoted 9 lines · Aneesh V
---
  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

[...]

Quoted 5 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +0 -0
new file mode 100644
index 0000000..b5a5f3c

[...]

Quoted 8 lines

arch/arm/cpu/armv7/omap-common/spl.c line 5

Quoted 6 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +5 -0
@@ -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.

Quoted 3 lines

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

#81 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Dear Aneesh V,

Am 30.06.2011 um 08:12 schrieb Aneesh V:

Quoted 34 lines

Hi Heiko,

Quoted 19 lines · Heiko Schocher

Hello Aneesh,

Quoted 9 lines · Aneesh V
---
 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

[...]

Quoted 5 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +0 -0
new file mode 100644
index 0000000..b5a5f3c

[...]

Quoted 8 lines

arch/arm/cpu/armv7/omap-common/spl.c line 5

Quoted 6 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +5 -0
@@ -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.

Quoted 1 line
Quoted 7 lines
Quoted 2 lines

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

author
#82 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Dear Andreas,

Quoted 41 lines · Andreas Bie?mann

Dear Aneesh V,

Am 30.06.2011 um 08:12 schrieb Aneesh V:

Quoted 37 lines

Hi Heiko,

Quoted 19 lines · Heiko Schocher

Hello Aneesh,

Quoted 9 lines · Aneesh V
---
  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

[...]

Quoted 5 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +0 -0
new file mode 100644
index 0000000..b5a5f3c

[...]

Quoted 8 lines

arch/arm/cpu/armv7/omap-common/spl.c line 5

Quoted 6 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +5 -0
@@ -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.

Quoted 3 lines

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

Quoted 6 lines
Quoted 4 lines

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?

Quoted 2 lines

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

#83 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Dear Aneesh,

Am 01.07.2011 11:27, schrieb Aneesh V:

Quoted 14 lines

Dear Andreas,

Quoted 11 lines · Andreas Bie?mann

Dear Aneesh V,

Am 30.06.2011 um 08:12 schrieb Aneesh V:

Quoted 7 lines

Hi Heiko,

Quoted 4 lines · Heiko Schocher

Hello Aneesh,

Quoted 1 line · Aneesh V

<snip>

Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 14 lines
Quoted 6 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +0 -0
new file mode 100644
index 0000000..b5a5f3c

[...]

Quoted 7 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +4 -0
@@ -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>

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines
Quoted 2 lines

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

Quoted 6 lines
Quoted 3 lines

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.

Quoted 7 lines
Quoted 2 lines

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

author
#84 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Dear Andreas,

Quoted 1 line · Andreas Bie?mann

Dear Aneesh,

[snip ..]

Quoted 4 lines

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

Quoted 9 lines

---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

#85 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Hi Aneesh,

Le 01/07/2011 13:48, Aneesh V a ?crit :

Quoted 34 lines

Dear Andreas,

Quoted 1 line · Andreas Bie?mann

Dear Aneesh,

[snip ..]

Quoted 4 lines

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

Quoted 9 lines

---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.

Quoted 2 lines

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()?

Quoted 2 lines

best regards,
Aneesh

Amicalement,

Signature · 1 line
Albert.
author
#86 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Hi Albert,

Quoted 37 lines · Albert ARIBAUD

Hi Aneesh,

Le 01/07/2011 13:48, Aneesh V a ?crit :

Quoted 34 lines

Dear Andreas,

Quoted 1 line · Andreas Bie?mann

Dear Aneesh,

[snip ..]

Quoted 4 lines

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

Quoted 9 lines

---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.

Quoted 5 lines
Quoted 2 lines

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

#87 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Hi Aneesh,

Le 03/07/2011 06:47, Aneesh V a ?crit :

Quoted 53 lines

Hi Albert,

Quoted 37 lines · Albert ARIBAUD

Hi Aneesh,

Le 01/07/2011 13:48, Aneesh V a ?crit :

Quoted 34 lines

Dear Andreas,

Quoted 1 line · Andreas Bie?mann

Dear Aneesh,

[snip ..]

Quoted 4 lines

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

Quoted 9 lines

---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.

Quoted 5 lines
Quoted 2 lines

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.

Quoted 8 lines

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?

Quoted 2 lines

br,
Aneesh

Amicalement,

Signature · 1 line
Albert.
#88 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Dear Albert Aribaud,

Am 03.07.2011 um 08:56 schrieb Albert ARIBAUD:

Quoted 8 lines

Hi Aneesh,

Le 03/07/2011 06:47, Aneesh V a ?crit :

Quoted 5 lines

Hi Albert,

Quoted 2 lines · Albert ARIBAUD

Hi Aneesh,

<snip>

Quoted 14 lines
Quoted 14 lines

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()

Quoted 7 lines
Quoted 1 line

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

#89 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Le 03/07/2011 09:31, Andreas Bie?mann a ?crit :

Quoted 45 lines

Dear Albert Aribaud,

Am 03.07.2011 um 08:56 schrieb Albert ARIBAUD:

Quoted 8 lines

Hi Aneesh,

Le 03/07/2011 06:47, Aneesh V a ?crit :

Quoted 5 lines

Hi Albert,

Quoted 2 lines · Albert ARIBAUD

Hi Aneesh,

<snip>

Quoted 14 lines
Quoted 14 lines

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()

Quoted 7 lines
Quoted 1 line

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

Quoted 8 lines
    ->  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.

Quoted 3 lines

regards

Andreas Bie?mann

Amicalement,

Signature · 1 line
Albert.
author
#90 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

In reply to Albert ARIBAUD

Hi Albert,

Quoted 69 lines · Albert ARIBAUD

Hi Aneesh,

Le 03/07/2011 06:47, Aneesh V a ?crit :

Quoted 54 lines

Hi Albert,

Quoted 38 lines · Albert ARIBAUD

Hi Aneesh,

Le 01/07/2011 13:48, Aneesh V a ?crit :

Quoted 35 lines

Dear Andreas,

Quoted 1 line · Andreas Bie?mann

Dear Aneesh,

[snip ..]

Quoted 9 lines

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---

Quoted 5 lines

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.

Quoted 5 lines
Quoted 2 lines

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.

Quoted 8 lines

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)

Quoted 8 lines

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

#91 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

In reply to Aneesh V

Hello Aneesh,

Quoted 23 lines · Aneesh V
Quoted 22 lines · Heiko Schocher

Hello Aneesh,

Quoted 11 lines · Aneesh V
---
  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

[...]

Quoted 6 lines
arch/arm/cpu/armv7/omap-common/spl.c new file +0 -0
new file mode 100644
index 0000000..b5a5f3c

[...]

[...]

Quoted 8 lines
Quoted 3 lines

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().

Quoted 3 lines

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

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#92 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Hi,

Quoted 3 lines

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

author
#93 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Quoted 10 lines · Simon Schwarz

Hi,

Quoted 3 lines

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

#94 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

In reply to Simon Schwarz

Hi Simon,

Le 30/06/2011 10:21, Simon Schwarz a ?crit :

Quoted 10 lines

Hi,

Quoted 3 lines

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.

Quoted 2 lines

Regards
Simon

Amicalement,

Signature · 1 line
Albert.
author
#95 lore raw

RFC PATCH 6/7 omap: common spl support for OMAP3/4

Quoted 9 lines · Albert ARIBAUD

Hi Simon,

Le 30/06/2011 10:21, Simon Schwarz a ?crit :

Quoted 6 lines

Hi,

Quoted 3 lines

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().

Quoted 8 lines
Quoted 4 lines

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

author
#96 lore raw

RFC PATCH 7/7 omap4: adapt Makefile for spl building

In reply to Daniel Schwierzeck
---
 arch/arm/cpu/armv7/omap4/Makefile |   12 ++++++------
 include/configs/omap4_sdp4430.h   |    8 ++++++++
 2 files changed, 14 insertions(+), 6 deletions(-)
arch/arm/cpu/armv7/omap4/Makefile +6 -6
index 987dc9d..f28eb37 100644
@@ -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)
 
include/configs/omap4_sdp4430.h +8 -0
index 584a52b..0af8e45 100644
@@ -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 */
Signature · 1 line
1.7.0.4
author
#97 lore raw
In reply to Wolfgang Denk

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

Makefile +5 -0
index dcf5d93..4a2cb58 100644
@@ -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 \

(quoted diff) +0 -0

b/include/configs/omap4_sdp4430.h
index 68ffa87..3122d1c 100644

include/configs/omap4_sdp4430.h +1 -0
@@ -243,4 +243,5 @@
  #define CONFIG_SYS_PL310_BASE	0x48242000
  #endif
 
+#define CONFIG_SYS_SPL_MMC_SUPPORT
  #endif /* __CONFIG_H */
spl/Makefile new file +5 -0
new file mode 100644
index 0000000..8dc6e88
@@ -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

spl/mmc/Makefile new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
1.7.0.4
#98 lore raw
Quoted 9 lines · On Fri, 17 Jun 2011 22:18:57 +0530 Aneesh V <[email protected]> wrote:
(quoted diff) +0 -1
@@ -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

(quoted diff) +1 -1
-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.

Review

Quoted 2 lines
(quoted diff) +2 -0
+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?

Review

Quoted 2 lines

+$(LIBS-y): depend

(quoted diff) +1 -0
+		$(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

#99 lore raw
Quoted 15 lines · Scott Wood
Quoted 9 lines · On Fri, 17 Jun 2011 22:18:57 +0530 Aneesh V <[email protected]> wrote:
(quoted diff) +0 -0
@@ -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.

Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+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

Quoted 10 lines

Why are these in mmc?

What is it you propose would be in these files?

Quoted 2 lines

+$(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).

Quoted 4 lines

-Scott

#100 lore raw
Quoted 20 lines · Aneesh
Quoted 15 lines · Scott Wood
Quoted 9 lines · On Fri, 17 Jun 2011 22:18:57 +0530 Aneesh V <[email protected]> wrote:
(quoted diff) +0 -0
@@ -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.

Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+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:

Review

Quoted 2 lines
(quoted diff) +2 -0
+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.

Quoted 4 lines

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

author
#101 lore raw
Quoted 19 lines · Scott Wood
Quoted 16 lines · Aneesh
Quoted 15 lines · Scott Wood
Quoted 9 lines · On Fri, 17 Jun 2011 22:18:57 +0530 Aneesh V<[email protected]> wrote:
(quoted diff) +0 -1
@@ -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
(quoted diff) +1 -1
-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.

Quoted 8 lines

Review

Quoted 6 lines
Quoted 2 lines

Review

Quoted 2 lines
(quoted diff) +2 -0
+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:

(quoted diff) +2 -0
+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.

Quoted 7 lines

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
...

Quoted 8 lines

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

Quoted 4 lines

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

author
#102 lore raw
In reply to Aneesh V

Dear Wolfgang,

Quoted 5 lines · Aneesh V

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

Makefile +4 -0
index 8540e39..0321634 100644
@@ -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)

(quoted diff) +0 -0

b/include/configs/omap4_sdp4430.h
index c424951..c9adc3c 100644

include/configs/omap4_sdp4430.h +1 -0
@@ -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 */
spl/Makefile new file +5 -0
new file mode 100644
index 0000000..9e3a5b1
@@ -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

spl/mmc/Makefile new file +55 -0

55 lines not on this page · raw message

Signature · 1 line
1.7.0.4
author
#103 lore raw

Dear Wolfgang,

Quoted 5 lines · Aneesh V

Dear Wolfgang,

Quoted 2 lines · Aneesh V

Dear Wolfgang,

Quoted 7 lines
Quoted 3 lines

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

#104 lore raw
In reply to Aneesh V

Dear Aneesh V,

Quoted 24 lines · In message <[email protected]> you wrote:
Quoted 4 lines

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

Makefile +0 -0
index 8540e39..0321634 100644

Makefile BOARD_SIZE_CHECK = · line 320

Quoted 5 lines
Makefile +1 -0
@@ -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.

Makefile $(obj)u-boot-onenand.bin: onenand_ipl $(obj)u-boot.bin · line 435

Quoted 9 lines
Makefile +3 -0
  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?

Makefile clean: · line 1147

Quoted 4 lines
Makefile +0 -0
  $(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/ ?

Makefile clean: · line 1149

Quoted 2 lines
Makefile +0 -0
  	@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.

Makefile clean: · line 1151

Quoted 2 lines
Makefile +1 -0
+	@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.

Quoted 2 lines
Makefile +0 -0
  	@rm -f $(ONENAND_BIN)
  	@rm -f $(obj)onenand_ipl/u-boot.lds

Goes away?

spl/Makefile line 2

Quoted 5 lines
spl/Makefile new file +2 -0
@@ -0,0 +1,94 @@
+#
+# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.

Really???

spl/Makefile

Quoted 10 lines
spl/Makefile new file +2 -0
+# 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.

spl/Makefile new file +7 -0
+#
+
+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?

spl/Makefile

Quoted 9 lines
spl/Makefile new file +7 -0
+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 \

spl/Makefile new file +1 -0
+	"$(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)").

spl/Makefile

Quoted 3 lines
spl/Makefile new file +3 -0
+ALL	= $(obj)u-boot-spl.bin
+
+all:	$(ALL)

Do we need ALL then at all?

...

spl/mmc/Makefile line 3

Quoted 9 lines
spl/mmc/Makefile new file +3 -0
new file mode 100644
index 0000000..b4f7efd
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.

Really???

spl/mmc/Makefile line 34

Quoted 7 lines
spl/mmc/Makefile new file +7 -0
+$(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

Signature · 6 lines
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
#105 lore raw

Dear Wolfgang,

Quoted 73 lines · Wolfgang Denk

Dear Aneesh V,

Quoted 24 lines · In message<[email protected]> you wrote:
Quoted 4 lines

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

Makefile +0 -0
index 8540e39..0321634 100644

Makefile BOARD_SIZE_CHECK = · line 320

Quoted 5 lines
Makefile +1 -0
@@ -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.

Makefile $(obj)u-boot-onenand.bin: onenand_ipl $(obj)u-boot.bin · line 435

Quoted 9 lines
Makefile +3 -0
   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?

Makefile clean: · line 1147

Quoted 4 lines
Makefile +0 -0
   $(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/ ?

Makefile clean: · line 1149

Quoted 2 lines
Makefile +0 -0
   	@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.

Makefile clean: · line 1151

Quoted 2 lines
Makefile +1 -0
+	@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.

Quoted 2 lines
Makefile +0 -0
   	@rm -f $(ONENAND_BIN)
   	@rm -f $(obj)onenand_ipl/u-boot.lds

Goes away?

Quoted 7 lines

spl/Makefile line 2

Quoted 5 lines
spl/Makefile new file +2 -0
@@ -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.

Quoted 14 lines

spl/Makefile

Quoted 11 lines
spl/Makefile new file +2 -0
+# 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.

spl/Makefile new file +7 -0
+#
+
+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.

Quoted 14 lines

spl/Makefile

Quoted 10 lines
spl/Makefile new file +7 -0
+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 \

spl/Makefile new file +1 -0
+	"$(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)").

Quoted 5 lines

spl/Makefile

Quoted 3 lines
spl/Makefile new file +3 -0
+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.

Quoted 14 lines

...

spl/mmc/Makefile line 3

Quoted 9 lines
spl/mmc/Makefile new file +3 -0
new file mode 100644
index 0000000..b4f7efd
@@ -0,0 +1,55 @@
+#
+# (C) Copyright 2000-2003
+# Wolfgang Denk, DENX Software Engineering, wd at denx.de.

Really???

Quoted 9 lines

spl/mmc/Makefile line 34

Quoted 7 lines
spl/mmc/Makefile new file +7 -0
+$(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

author
#106 lore raw
In reply to Wolfgang Denk

Dear Wolfgang,

Quoted 29 lines · Wolfgang Denk

Dear Aneesh V,

Quoted 26 lines · In message<[email protected]> you wrote:
Quoted 4 lines

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

Makefile +0 -0
index 8540e39..0321634 100644
@@ -316,6 +316,7 @@ BOARD_SIZE_CHECK =
   endif
 
Quoted 5 lines

Makefile BOARD_SIZE_CHECK = · line 320

Quoted 3 lines
Makefile +1 -0
   # 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.

Quoted 6 lines
Quoted 6 lines
Makefile +0 -0
   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
 
Quoted 6 lines

Makefile $(obj)u-boot-onenand.bin: onenand_ipl $(obj)u-boot.bin · line 435

Quoted 4 lines
Makefile +3 -0
+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.

Quoted 13 lines

Makefile clean: · line 1147

Quoted 5 lines
Makefile +0 -0
   $(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/ ?

Makefile clean: · line 1149

Quoted 2 lines
Makefile +0 -0
   	@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.

Quoted 8 lines

Makefile clean: · line 1151

Quoted 2 lines
Makefile +1 -0
+	@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.

Quoted 5 lines
Quoted 3 lines
Makefile +0 -0
   	@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.

Quoted 8 lines

spl/Makefile line 2

Quoted 6 lines
spl/Makefile new file +2 -0
@@ -0,0 +1,94 @@
+#
+# (C) Copyright 2011 Daniel Schwierzeck, daniel.schwierzeck at googlemail.com.

Really???

I copied Daniel's Makefile and started from there.

Quoted 14 lines

spl/Makefile

Quoted 11 lines
spl/Makefile new file +2 -0
+# 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.

spl/Makefile new file +7 -0
+#
+
+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?

Quoted 13 lines

spl/Makefile

Quoted 10 lines
spl/Makefile new file +7 -0
+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 \

spl/Makefile new file +1 -0
+	"$(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.

Quoted 6 lines

spl/Makefile

Quoted 4 lines
spl/Makefile new file +3 -0
+ALL	= $(obj)u-boot-spl.bin
+
+all:	$(ALL)

Do we need ALL then at all?

ok. I will remove it.

Quoted 13 lines

...

spl/mmc/Makefile line 3

Quoted 9 lines
spl/mmc/Makefile new file +3 -0
new file mode 100644
index 0000000..b4f7efd
@@ -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.

Quoted 10 lines

spl/mmc/Makefile line 34

Quoted 8 lines
spl/mmc/Makefile new file +7 -0
+$(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

#107 lore raw

Dear Aneesh,

Quoted 10 lines · In message <[email protected]> you wrote:
Quoted 7 lines

Makefile $(obj)u-boot-onenand.bin: onenand_ipl $(obj)u-boot.bin · line 435

Quoted 5 lines
Makefile +3 -0
+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.

Quoted 9 lines
Quoted 7 lines

spl/Makefile line 2

Quoted 5 lines
spl/Makefile new file +2 -0
@@ -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...

Quoted 5 lines
Quoted 2 lines

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.

Quoted 2 lines

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"?

Quoted 4 lines
Quoted 1 line

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.

Quoted 9 lines
Quoted 1 line

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?

Quoted 3 lines

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

Signature · 5 lines
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"
author
#108 lore raw

Dear Wolfgang,

Quoted 42 lines · Wolfgang Denk

Dear Aneesh,

Quoted 10 lines · In message<[email protected]> you wrote:
Quoted 7 lines

Makefile $(obj)u-boot-onenand.bin: onenand_ipl $(obj)u-boot.bin · line 435

Quoted 5 lines
Makefile +3 -0
+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.

Quoted 9 lines
Quoted 7 lines

spl/Makefile line 2

Quoted 5 lines
spl/Makefile new file +2 -0
@@ -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...

Quoted 5 lines
Quoted 2 lines

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.

Quoted 2 lines

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

There are actually two different topics here:

Quoted 9 lines

- 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

#109 lore raw

Dear Aneesh V,

Quoted 9 lines · In message <[email protected]> you wrote:
Quoted 4 lines

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

Signature · 5 lines
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_
#110 lore raw
In reply to Aneesh V
Quoted 5 lines · On Thu, 16 Jun 2011 13:38:00 +0530 Aneesh V <[email protected]> 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.

Quoted 3 lines

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.

Quoted 6 lines

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

#111 lore raw

Dear Scott Wood,

Quoted 5 lines · In message <[email protected]> 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.

Quoted 7 lines

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?

Quoted 3 lines

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.

Quoted 10 lines
Quoted 6 lines

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

Signature · 7 lines
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
#112 lore raw
Quoted 11 lines · On Fri, 17 Jun 2011 00:09:00 +0200 Wolfgang Denk <[email protected]> wrote:

Dear Scott Wood,

Quoted 5 lines · In message <[email protected]> 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.

Quoted 10 lines
Quoted 7 lines

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.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

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?

Quoted 7 lines
Quoted 3 lines

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

author
#113 lore raw
In reply to Wolfgang Denk
Quoted 15 lines · Wolfgang Denk

Dear Scott Wood,

Quoted 5 lines · In message<[email protected]> 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.

Quoted 3 lines

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

Quoted 7 lines
Quoted 4 lines

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

author
#114 lore raw
In reply to Scott Wood
Quoted 14 lines · Scott Wood
Quoted 5 lines · On Thu, 16 Jun 2011 13:38:00 +0530 Aneesh V<[email protected]> 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.

Quoted 7 lines

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.

Quoted 4 lines

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

#115 lore raw
In reply to Aneesh V

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

#116 lore raw

Dear Graeme Russ,

Quoted 10 lines · In message <[email protected]> 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.)

Quoted 8 lines

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.

Quoted 3 lines

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.

Quoted 2 lines

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

Signature · 5 lines
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
#117 lore raw

cover Prototype for generic SPL framework

In reply to Aneesh V

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

#118 lore raw

RFC PATCH 1/9 Use ALL-y style instead of ifeq blocks for better readability

---
 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(-)
Makefile +6 -14
index e56fa02..62c2078 100644
@@ -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}
arch/blackfin/config.mk +1 -1
index 71fd53f..f9d46de 100644
@@ -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
board/pcs440ep/config.mk +1 -1
index 23631c5..f560ec6 100644
@@ -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
 
board/spear/spear300/config.mk +1 -1
index 11da2c3..5848ef8 100644
@@ -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)
board/spear/spear310/config.mk +1 -1
index 2b59c39..f8a6bdb 100644
@@ -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)
board/spear/spear320/config.mk +1 -1
index 2b59c39..f8a6bdb 100644
@@ -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)
board/spear/spear600/config.mk +1 -1
index 11da2c3..5848ef8 100644
@@ -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)
Signature · 1 line
1.7.6
#119 lore raw

RFC PATCH 2/9 spl: add initial support for a generic SPL framework

In reply to Daniel Schwierzeck
---
 spl/.gitignore |    4 ++
 spl/Makefile   |  101 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 105 insertions(+), 0 deletions(-)
 create mode 100644 spl/.gitignore
 create mode 100644 spl/Makefile
spl/.gitignore new file +4 -0
new file mode 100644
index 0000000..7c88147
@@ -0,0 +1,4 @@
+u-boot-spl
+u-boot-spl.bin
+u-boot-spl.lds
+u-boot-spl.map
spl/Makefile new file +101 -0

101 lines not on this page · raw message

Signature · 1 line
1.7.6
#120 lore raw

RFC PATCH v2 2/9 spl: add initial support for a generic SPL framework

---
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
README +36 -0
index 1e2d4d3..63a897d 100644
@@ -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:
 --------------
doc/README.SPL new file +59 -0

59 lines not on this page · raw message

spl/.gitignore new file +4 -0
new file mode 100644
index 0000000..7c88147
@@ -0,0 +1,4 @@
+u-boot-spl
+u-boot-spl.bin
+u-boot-spl.lds
+u-boot-spl.map
spl/Makefile new file +101 -0

101 lines not on this page · raw message

--
1.7.6

#121 lore raw

RFC PATCH v2 2/9 spl: add initial support for a generic SPL framework

Dear Daniel Schwierzeck,

Quoted 2 lines · In message <1310746944-32711-1-git-send-email-daniel.schwierzeck@googlemail.com…

Thanks.

doc/README.SPL line 9

Quoted 6 lines
doc/README.SPL new file +6 -0
+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/

doc/README.SPL line 18

Quoted 6 lines
doc/README.SPL new file +6 -0
+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?

Quoted 1 line

+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." ?

Quoted 1 line

+Because SPL images normally have a different test base, one have to be

s/test/text/

Best regards,

Wolfgang Denk

Signature · 4 lines
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.
#122 lore raw

RFC PATCH v2 2/9 spl: add initial support for a generic SPL framework

Dear Wolfgang,

sorry, I sent the new series too early and missed your answer. I'll address your comments.

Quoted 49 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

Quoted 2 lines · In message <1310746944-32711-1-git-send-email-daniel.schwierzeck@googlemail.com…

Thanks.

doc/README.SPL line 9

Quoted 6 lines
doc/README.SPL new file +6 -0
+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/

doc/README.SPL line 18

Quoted 6 lines
doc/README.SPL new file +6 -0
+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?

Quoted 1 line

+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." ?

Quoted 1 line

+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.

#123 lore raw

RFC PATCH 3/9 Extend build-system for SPL framework

In reply to Daniel Schwierzeck
---
 Makefile  |    3 ++-
 config.mk |   36 +++++++++++++++++++++++++++++++++++-
 2 files changed, 37 insertions(+), 2 deletions(-)
Makefile +2 -1
index 62c2078..9478059 100644
@@ -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
config.mk +35 -1
index 2eb7fa2..8809d7a 100644
@@ -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
Signature · 1 line
1.7.6
author
#124 lore raw

RFC PATCH 3/9 Extend build-system for SPL framework

Dear Wolfgang,

On Wednesday 13 July 2011 08:41 PM, Daniel Schwierzeck wrote:

[snip ..]

config.mk OBJCFLAGS += --gap-fill=0xff · line 178

Quoted 8 lines
  gccincdir := $(shell $(CC) -print-file-name=include)
config.mk +6 -0
+# 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

#125 lore raw

RFC PATCH 3/9 Extend build-system for SPL framework

Dear Aneesh,

Quoted 4 lines · In message <[email protected]> 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:

...

Quoted 3 lines

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

Signature · 5 lines
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
author
#126 lore raw

RFC PATCH 3/9 Extend build-system for SPL framework

Quoted 7 lines · Wolfgang Denk

Dear Aneesh,

Quoted 4 lines · In message<[email protected]> 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:

Quoted 8 lines

...

Quoted 3 lines

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

#127 lore raw

RFC PATCH v2 3/9 Extend build-system for SPL framework

In reply to Daniel Schwierzeck

---
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(-)
Makefile +2 -1
index 62c2078..9478059 100644
@@ -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
config.mk +33 -1
index 2eb7fa2..ed44d03 100644
@@ -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

#128 lore raw

RFC PATCH 4/9 Hook SPL build-system into toplevel Makefile

In reply to Daniel Schwierzeck
---
 Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Makefile +5 -0
index 9478059..0707036 100644
@@ -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 '*~' \
Signature · 1 line
1.7.6
#129 lore raw

RFC PATCH 5/9 arm: adjust PLATFORM_LIBS for SPL

In reply to Daniel Schwierzeck

From: Aneesh V <[email protected]>

---
 arch/arm/config.mk |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
arch/arm/config.mk +8 -3
index 788d4c1..9184d06 100644
@@ -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
 
Signature · 1 line
1.7.6
#130 lore raw

RFC PATCH 6/9 scaled down version of generic libraries for SPL

In reply to Daniel Schwierzeck

From: Aneesh V <[email protected]>

---
 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(-)
arch/arm/lib/Makefile +2 -0
index d31321a..300c8fa 100644
@@ -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)
common/Makefile +6 -3
index 224b7cc..124a427 100644
@@ -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))
drivers/serial/Makefile +3 -0
index 0e171b6..1dcc1c7 100644
@@ -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)
fs/fat/Makefile +5 -1
index bc45966..93b6f07 100644
@@ -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))
lib/Makefile +7 -4
index afa6914..884f64c 100644
@@ -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)
Signature · 1 line
1.7.6
#131 lore raw

RFC PATCH 6/9 scaled down version of generic libraries for SPL

Hi Daniel,

at the moment I'am playing a bit with your patch.

I stumbled over this:

Quoted 13 lines
arch/arm/lib/Makefile +0 -0
index d31321a..300c8fa 100644
@@ -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

arch/arm/lib/Makefile +0 -0
@@ -45,6 +46,7 @@ COBJS-y ? ? ? += interrupts.o
Quoted 4 lines

?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

author
#132 lore raw

RFC PATCH 6/9 scaled down version of generic libraries for SPL

Hi Simon,

Quoted 13 lines · Simon Schwarz

Hi Daniel,

at the moment I'am playing a bit with your patch.

I stumbled over this:

Quoted 8 lines
arch/arm/lib/Makefile +0 -0
index d31321a..300c8fa 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk
  LIB    = $(obj)lib$(ARCH).o
  LIBGCC = $(obj)libgcc.o
 
Quoted 13 lines

arch/arm/lib/Makefile COBJS-y += interrupts.o · line 49

Quoted 9 lines
arch/arm/lib/Makefile +2 -0
+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

#133 lore raw

RFC PATCH 6/9 scaled down version of generic libraries for SPL

Hi Aneesh,

Quoted 31 lines
Quoted 12 lines

at the moment I'am playing a bit with your patch.

I stumbled over this:

Quoted 9 lines
arch/arm/lib/Makefile +0 -0
index d31321a..300c8fa 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk

=A0LIB =A0 =A0=3D $(obj)lib$(ARCH).o
=A0LIBGCC =3D $(obj)libgcc.o

Quoted 13 lines
Quoted 9 lines

+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

arch/arm/lib/Makefile +0 -0
@@ -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.

Quoted 5 lines

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

author
#134 lore raw

RFC PATCH 6/9 scaled down version of generic libraries for SPL

Quoted 39 lines · Simon Schwarz

Hi Aneesh,

Quoted 31 lines
Quoted 12 lines

at the moment I'am playing a bit with your patch.

I stumbled over this:

Quoted 9 lines
arch/arm/lib/Makefile +0 -0
index d31321a..300c8fa 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk

=A0LIB =A0 =A0=3D $(obj)lib$(ARCH).o
=A0LIBGCC =3D $(obj)libgcc.o

Quoted 13 lines
Quoted 9 lines

+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

arch/arm/lib/Makefile +0 -0
@@ -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.

Quoted 5 lines

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.

Quoted 5 lines

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.

Quoted 5 lines

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

#135 lore raw

RFC PATCH 6/9 scaled down version of generic libraries for SPL

In reply to Aneesh V

Hi Simon,

Quoted 37 lines · Aneesh V

Hi Simon,

Quoted 15 lines · Simon Schwarz

Hi Daniel,

at the moment I'am playing a bit with your patch.

I stumbled over this:

Quoted 9 lines
arch/arm/lib/Makefile +0 -0
index d31321a..300c8fa 100644
@@ -26,6 +26,7 @@ include $(TOPDIR)/config.mk

?LIB ? ?= $(obj)lib$(ARCH).o
?LIBGCC = $(obj)libgcc.o

Quoted 13 lines
Quoted 9 lines

+ifndef CONFIG_SPL_BUILD
?GLSOBJS ? ? ? ?+= _ashldi3.o
?GLSOBJS ? ? ? ?+= _ashrdi3.o
?GLSOBJS ? ? ? ?+= _divsi3.o

arch/arm/lib/Makefile +0 -0
@@ -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.

Quoted 6 lines

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

#136 lore raw

RFC PATCH 7/9 replace CONFIG_PRELOADER with CONFIG_SPL_BUILD

In reply to Daniel Schwierzeck

From: Aneesh V <[email protected]>

replace all occurences of CONFIG_PRELOADER with CONFIG_SPL_BUILD

---
 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(-)
README +1 -1
index 1e2d4d3..8dc0b51 100644
@@ -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.
arch/arm/cpu/arm1136/start.S +10 -10
index 200a800..f5a1134 100644
@@ -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 */
arch/arm/cpu/arm1176/start.S +2 -2
index b095f22..0aa613d 100644
@@ -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 */
arch/arm/cpu/arm720t/start.S +2 -2
index e774c3f..091b7d8 100644
@@ -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 */
arch/arm/cpu/arm920t/start.S +2 -2
index a7476b0..2a53667 100644
@@ -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 */
arch/arm/cpu/arm925t/start.S +2 -2
index 39f2e99..23ccf31 100644
@@ -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 */
arch/arm/cpu/arm926ejs/start.S +9 -9
index 0940937..636be75 100644
@@ -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 */
arch/arm/cpu/arm946es/start.S +2 -2
index 0054b22..09374d5 100644
@@ -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 */
arch/arm/cpu/arm_intcm/start.S +2 -2
index 2fd3b9a..1a93277 100644
@@ -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 */
arch/arm/cpu/armv7/start.S +3 -3
index 0e698b6..d2a6207 100644
@@ -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
arch/arm/cpu/ixp/start.S +2 -2
index a975d42..b17d267 100644
@@ -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 */
arch/arm/cpu/lh7a40x/start.S +2 -2
index 81242b1..61bce5f 100644
@@ -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 */
arch/arm/cpu/pxa/start.S +15 -15
index f1dbc3b..6191a73 100644
@@ -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 */
arch/arm/cpu/s3c44b0/start.S +2 -2
index 10f5284..2545cf6 100644
@@ -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 */
arch/arm/cpu/sa1100/start.S +2 -2
index b27e970..c3acf7a 100644
@@ -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 */
arch/arm/lib/board.c +1 -1
index fc52a26..d4fd2cc 100644
@@ -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
 	 */
mmc_spl/board/samsung/smdkv310/Makefile +1 -1
index f1ce066..de2c1a2 100644
@@ -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
nand_spl/board/davinci/da8xxevm/Makefile +2 -2
index c3cb1bb..b3f4bd6 100644
@@ -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	\
nand_spl/board/freescale/mx31pdk/Makefile +2 -2
index 984f959..e6ec10a 100644
@@ -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
nand_spl/board/karo/tx25/Makefile +2 -2
index 8bc54d1..0336346 100644
@@ -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
onenand_ipl/board/apollon/Makefile +2 -2
index 5397186..3bc9920 100644
@@ -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
onenand_ipl/board/vpac270/Makefile +2 -2
index 7300692..f850ddd 100644
@@ -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
Signature · 1 line
1.7.6
#137 lore raw

RFC PATCH 8/9 spl: Add support for common libraries and drivers

In reply to Daniel Schwierzeck
---
 spl/Makefile |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
spl/Makefile +11 -0
index f20092f..957825a 100644
@@ -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)))
 
Signature · 1 line
1.7.6
#138 lore raw

RFC PATCH 9/9 spl: add support for omap-common libraries

In reply to Daniel Schwierzeck
---
 spl/Makefile |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
spl/Makefile +7 -0
index 957825a..fda4049 100644
@@ -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)))
 
Signature · 1 line
1.7.6
#139 lore raw

cover Prototype for generic SPL framework

In reply to Daniel Schwierzeck

Le 13/07/2011 17:11, Daniel Schwierzeck a ?crit :

Quoted 4 lines

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,

Signature · 1 line
Albert.
#140 lore raw

cover Prototype for generic SPL framework

In reply to Daniel Schwierzeck

Dear Daniel Schwierzeck,

Quoted 7 lines · In message <1310569869-31810-1-git-send-email-daniel.schwierzeck@googlemail.com…

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

Signature · 5 lines
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
#141 lore raw

cover Prototype for generic SPL framework

In reply to Daniel Schwierzeck

Dear Daniel Schwierzeck,

Quoted 4 lines · In message <1310569869-31810-1-git-send-email-daniel.schwierzeck@googlemail.com…

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:

Best regards,

Wolfgang Denk

Signature · 5 lines
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
author
#142 lore raw

cover Prototype for generic SPL framework

Quoted 8 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

Quoted 4 lines · In message<1310569869-31810-1-git-send-email-daniel.schwierzeck@googlemail.com>…

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.

Quoted 4 lines

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

#143 lore raw

cover Prototype for generic SPL framework

Dear Aneesh,

Quoted 8 lines · In message <[email protected]> you wrote:
Quoted 5 lines

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

Signature · 4 lines
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.
#144 lore raw

cover Prototype for generic SPL framework

In reply to Wolfgang Denk

Dear Wolfgang,

Quoted 8 lines · Wolfgang Denk

Dear Daniel Schwierzeck,

Quoted 4 lines · In message <1310569869-31810-1-git-send-email-daniel.schwierzeck@googlemail.com…

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.

Quoted 4 lines

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.

Quoted 2 lines

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.

Quoted 2 lines

Thanks. Then I'll create a new series with the README files and the gc-sections patch
from Aneesh.

Best regards,
Daniel

#145 lore raw

v3 cover Add initial support for a generic SPL framework

In reply to Daniel Schwierzeck

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
Signature · 1 line
1.7.6
#146 lore raw

PATCH v3 1/9 Use ALL-y style instead of ifeq blocks for better readability

Cc Mike Frysinger <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Vipin Kumar <[email protected]>

---
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(-)
Makefile +6 -14
index e56fa02..62c2078 100644
@@ -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}
arch/blackfin/config.mk +1 -1
index 71fd53f..f9d46de 100644
@@ -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
board/pcs440ep/config.mk +1 -1
index 23631c5..f560ec6 100644
@@ -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
 
board/spear/spear300/config.mk +1 -1
index 11da2c3..5848ef8 100644
@@ -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)
board/spear/spear310/config.mk +1 -1
index 2b59c39..f8a6bdb 100644
@@ -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)
board/spear/spear320/config.mk +1 -1
index 2b59c39..f8a6bdb 100644
@@ -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)
board/spear/spear600/config.mk +1 -1
index 11da2c3..5848ef8 100644
@@ -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)
Signature · 1 line
1.7.6
#147 lore raw

PATCH v3 1/9 Use ALL-y style instead of ifeq blocks for better readability

Quoted 44 lines · Daniel Schwierzeck
board/spear/spear300/config.mk +1 -1
index 11da2c3..5848ef8 100644
@@ -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)
board/spear/spear310/config.mk +1 -1
index 2b59c39..f8a6bdb 100644
@@ -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)
board/spear/spear320/config.mk +1 -1
index 2b59c39..f8a6bdb 100644
@@ -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)
board/spear/spear600/config.mk +0 -0
index 11da2c3..5848ef8 100644

board/spear/spear600/config.mk line 31

Quoted 8 lines
board/spear/spear600/config.mk +1 -1
@@ -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)
#148 lore raw

PATCH v3 1/9 Use ALL-y style instead of ifeq blocks for better readability

In reply to Daniel Schwierzeck

Dear Daniel Schwierzeck,

Quoted 8 lines · In message <1311005361-26241-2-git-send-email-daniel.schwierzeck@googlemail.com…
Cc Mike Frysinger <[email protected]>
Cc Stefan Roese <[email protected]>
Cc Vipin Kumar <[email protected]>

---
Changes since RFC v1:
- none

Quoted 8 lines
 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

Signature · 5 lines
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
#149 lore raw

PATCH v3 2/9 spl: add initial support for a generic SPL framework

In reply to Daniel Schwierzeck

---
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
README +39 -0
index 1e2d4d3..8cac56c 100644
@@ -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:
 --------------
doc/README.SPL new file +60 -0

60 lines not on this page · raw message

spl/.gitignore new file +4 -0
new file mode 100644
index 0000000..7c88147
@@ -0,0 +1,4 @@
+u-boot-spl
+u-boot-spl.bin
+u-boot-spl.lds
+u-boot-spl.map
spl/Makefile new file +101 -0

101 lines not on this page · raw message

Signature · 1 line
1.7.6
#150 lore raw

PATCH v4 2/9 spl: add initial support for a generic SPL framework

---
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
README +39 -0
index 1e2d4d3..8cac56c 100644
@@ -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:
 --------------
doc/README.SPL new file +62 -0

62 lines not on this page · raw message

spl/.gitignore new file +4 -0
new file mode 100644
index 0000000..7c88147
@@ -0,0 +1,4 @@
+u-boot-spl
+u-boot-spl.bin
+u-boot-spl.lds
+u-boot-spl.map
spl/Makefile new file +100 -0

100 lines not on this page · raw message

Signature · 1 line
1.7.6
#151 lore raw

PATCH v4 2/9 spl: add initial support for a generic SPL framework

Dear Daniel Schwierzeck,

Quoted 13 lines · In message <1311011287-28223-1-git-send-email-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

Quoted 8 lines
 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

Signature · 6 lines
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_
#152 lore raw

PATCH v3 3/9 Extend build-system for SPL framework

In reply to Daniel Schwierzeck

---
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(-)
Makefile +2 -1
index 62c2078..9478059 100644
@@ -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
config.mk +33 -1
index 2eb7fa2..ed44d03 100644
@@ -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
Signature · 1 line
1.7.6
#153 lore raw

PATCH v3 3/9 Extend build-system for SPL framework

Dear Daniel Schwierzeck,

Quoted 6 lines · In message <1311005361-26241-4-git-send-email-daniel.schwierzeck@googlemail.com…

---
Changes since RFC v1:
- enable garbage collect of unused sections for SPL unconditionally

Quoted 6 lines

Changes since RFC v2:
- none

 Makefile  |    3 ++-
 config.mk |   34 +++++++++++++++++++++++++++++++++-
 2 files changed, 35 insertions(+), 2 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
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!
#154 lore raw

PATCH v3 4/9 Hook SPL build-system into toplevel Makefile

In reply to Daniel Schwierzeck

---
Changes since RFC v1:
- none

 Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
Makefile +5 -0
index 9478059..0707036 100644
@@ -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 '*~' \
Signature · 1 line
1.7.6
#155 lore raw

PATCH v3 4/9 Hook SPL build-system into toplevel Makefile

Dear Daniel Schwierzeck,

Quoted 8 lines · In message <1311005361-26241-5-git-send-email-daniel.schwierzeck@googlemail.com…

---
Changes since RFC v1:
- none

 Makefile |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
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.
#156 lore raw

PATCH v3 5/9 arm: adjust PLATFORM_LIBS for SPL

In reply to Daniel Schwierzeck

From: Aneesh V <[email protected]>

Cc Albert ARIBAUD <[email protected]>

---
Changes since RFC v1:
- none

 arch/arm/config.mk |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
arch/arm/config.mk +8 -3
index 788d4c1..9184d06 100644
@@ -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
 
Signature · 1 line
1.7.6
#157 lore raw

PATCH v3 5/9 arm: adjust PLATFORM_LIBS for SPL

Hi Daniel / Aneesh,

Le 18/07/2011 18:09, Daniel Schwierzeck a ?crit :

Quoted 22 lines

From: Aneesh V<[email protected]>

Cc Albert ARIBAUD<[email protected]>

---
Changes since RFC v1:
- none

  arch/arm/config.mk |   11 ++++++++---
  1 files changed, 8 insertions(+), 3 deletions(-)
arch/arm/config.mk +0 -3
index 788d4c1..9184d06 100644
@@ -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

arch/arm/config.mk PLATFORM_CPPFLAGS += $(call cc-option,\ · line 68

Quoted 10 lines
arch/arm/config.mk +8 -0
+# 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,

Signature · 1 line
Albert.
author
#158 lore raw

PATCH v3 5/9 arm: adjust PLATFORM_LIBS for SPL

Hi Albert,

Quoted 20 lines · Albert ARIBAUD

Hi Daniel / Aneesh,

Le 18/07/2011 18:09, Daniel Schwierzeck a ?crit :

Quoted 17 lines

From: Aneesh V<[email protected]>

Cc Albert ARIBAUD<[email protected]>

---
Changes since RFC v1:
- none

arch/arm/config.mk | 11 ++++++++---

1 files changed, 8 insertions(+), 3 deletions(-)
arch/arm/config.mk +0 -0
index 788d4c1..9184d06 100644
@@ -56,9 +56,14 @@ PLATFORM_CPPFLAGS += $(call cc-option,\
 
Quoted 8 lines
Quoted 8 lines
arch/arm/config.mk +1 -3
 # 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.
Quoted 7 lines
Quoted 7 lines
arch/arm/config.mk +6 -0
+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

Quoted 8 lines
Quoted 1 line

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

#159 lore raw

PATCH v3 5/9 arm: adjust PLATFORM_LIBS for SPL

Hi Aneesh,

Le 19/07/2011 12:38, Aneesh V a ?crit :

Quoted 6 lines

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!

Quoted 2 lines

best regards,
Aneesh

Amicalement,

Signature · 1 line
Albert.
#160 lore raw

PATCH v4 5/9 arm: adjust PLATFORM_LIBS for SPL

In reply to Daniel Schwierzeck

From: Aneesh V <[email protected]>

Cc Albert ARIBAUD <[email protected]>

---
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(-)
arch/arm/config.mk +10 -3
index 788d4c1..9b4e581 100644
@@ -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
 
Signature · 1 line
1.7.6
author
#161 lore raw

PATCH v4 5/9 arm: adjust PLATFORM_LIBS for SPL

Dear Wolfgang,

Quoted 8 lines · Daniel Schwierzeck

From: Aneesh V<[email protected]>

Cc Albert ARIBAUD<[email protected]>

---
Changes since RFC v1:
- none

Quoted 5 lines

Changes since RFC v2:
- none

Changes since v3:
- improved comment

I think this was the final change requested. Will you be pulling this now?

#162 lore raw

PATCH v4 5/9 arm: adjust PLATFORM_LIBS for SPL

In reply to Daniel Schwierzeck

Dear Daniel Schwierzeck,

Quoted 8 lines · In message <1311090701-11801-1-git-send-email-daniel.schwierzeck@googlemail.com…

From: Aneesh V <[email protected]>

Cc Albert ARIBAUD <[email protected]>

---
Changes since RFC v1:
- none

Quoted 8 lines

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

Signature · 7 lines
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
#163 lore raw

PATCH v3 6/9 scaled down version of generic libraries for SPL

In reply to Daniel Schwierzeck

From: Aneesh V <[email protected]>

Cc Albert ARIBAUD <[email protected]>

---
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(-)
arch/arm/lib/Makefile +2 -0
index d31321a..300c8fa 100644
@@ -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)
common/Makefile +6 -3
index 224b7cc..124a427 100644
@@ -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))
drivers/serial/Makefile +3 -0
index 0e171b6..1dcc1c7 100644
@@ -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)
fs/fat/Makefile +5 -1
index bc45966..93b6f07 100644
@@ -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))
lib/Makefile +7 -4
index afa6914..884f64c 100644
@@ -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)
Signature · 1 line
1.7.6
#164 lore raw

PATCH v3 6/9 scaled down version of generic libraries for SPL

Dear Daniel Schwierzeck,

Quoted 8 lines · In message <1311005361-26241-7-git-send-email-daniel.schwierzeck@googlemail.com…

From: Aneesh V <[email protected]>

Cc Albert ARIBAUD <[email protected]>

---
Changes since RFC v1:
- none

Quoted 6 lines
 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

Signature · 5 lines
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
#165 lore raw

PATCH v3 7/9 replace CONFIG_PRELOADER with CONFIG_SPL_BUILD

In reply to Daniel Schwierzeck

From: Aneesh V <[email protected]>

replace all occurences of CONFIG_PRELOADER with CONFIG_SPL_BUILD

Cc Albert ARIBAUD <[email protected]>

---
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(-)
README +1 -1
index 8cac56c..fdef254 100644
@@ -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.
arch/arm/cpu/arm1136/start.S +10 -10
index 200a800..f5a1134 100644
@@ -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 */
arch/arm/cpu/arm1176/start.S +2 -2
index b095f22..0aa613d 100644
@@ -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 */
arch/arm/cpu/arm720t/start.S +2 -2
index e774c3f..091b7d8 100644
@@ -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 */
arch/arm/cpu/arm920t/start.S +2 -2
index a7476b0..2a53667 100644
@@ -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 */
arch/arm/cpu/arm925t/start.S +2 -2
index 39f2e99..23ccf31 100644
@@ -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 */
arch/arm/cpu/arm926ejs/start.S +9 -9
index 0940937..636be75 100644
@@ -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 */
arch/arm/cpu/arm946es/start.S +2 -2
index 0054b22..09374d5 100644
@@ -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 */
arch/arm/cpu/arm_intcm/start.S +2 -2
index 2fd3b9a..1a93277 100644
@@ -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 */
arch/arm/cpu/armv7/start.S +3 -3
index 0e698b6..d2a6207 100644
@@ -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
arch/arm/cpu/ixp/start.S +2 -2
index a975d42..b17d267 100644
@@ -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 */
arch/arm/cpu/lh7a40x/start.S +2 -2
index 81242b1..61bce5f 100644
@@ -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 */
arch/arm/cpu/pxa/start.S +15 -15
index f1dbc3b..6191a73 100644
@@ -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 */
arch/arm/cpu/s3c44b0/start.S +2 -2
index 10f5284..2545cf6 100644
@@ -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 */
arch/arm/cpu/sa1100/start.S +2 -2
index b27e970..c3acf7a 100644
@@ -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 */
arch/arm/lib/board.c +1 -1
index fc52a26..d4fd2cc 100644
@@ -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
 	 */
mmc_spl/board/samsung/smdkv310/Makefile +1 -1
index f1ce066..de2c1a2 100644
@@ -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
nand_spl/board/davinci/da8xxevm/Makefile +2 -2
index c3cb1bb..b3f4bd6 100644
@@ -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	\
nand_spl/board/freescale/mx31pdk/Makefile +2 -2
index 984f959..e6ec10a 100644
@@ -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
nand_spl/board/karo/tx25/Makefile +2 -2
index 8bc54d1..0336346 100644
@@ -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
onenand_ipl/board/apollon/Makefile +2 -2
index 5397186..3bc9920 100644
@@ -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
onenand_ipl/board/vpac270/Makefile +2 -2
index 7300692..f850ddd 100644
@@ -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
Signature · 1 line
1.7.6
#166 lore raw

PATCH v3 7/9 replace CONFIG_PRELOADER with CONFIG_SPL_BUILD

Dear Daniel Schwierzeck,

Quoted 25 lines · In message <1311005361-26241-8-git-send-email-daniel.schwierzeck@googlemail.com…

From: Aneesh V <[email protected]>

replace all occurences of CONFIG_PRELOADER with CONFIG_SPL_BUILD

Cc Albert ARIBAUD <[email protected]>

---
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 +-
Quoted 8 lines
 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

Signature · 6 lines
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 <[email protected]>
#167 lore raw

PATCH v3 8/9 spl: Add support for common libraries and drivers

In reply to Daniel Schwierzeck

---
Changes since RFC v1:
- none

 spl/Makefile |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)
spl/Makefile +11 -0
index bc24c3b..6c36d6f 100644
@@ -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)))
 
Signature · 1 line
1.7.6
#168 lore raw

PATCH v3 8/9 spl: Add support for common libraries and drivers

Dear Daniel Schwierzeck,

Quoted 8 lines · In message <1311005361-26241-9-git-send-email-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

Signature · 4 lines
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.
#169 lore raw

PATCH v3 9/9 spl: add support for omap-common libraries

In reply to Daniel Schwierzeck

---
Changes since RFC v1:
- none

 spl/Makefile |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)
spl/Makefile +7 -0
index 6c36d6f..638aab7 100644
@@ -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)))
 
Signature · 1 line
1.7.6
#170 lore raw

PATCH v3 9/9 spl: add support for omap-common libraries

Dear Daniel Schwierzeck,

Quoted 8 lines · In message <1311005361-26241-10-git-send-email-daniel.schwierzeck@googlemail.co…

---
Changes since RFC v1:
- none

 spl/Makefile |    7 +++++++
 1 files changed, 7 insertions(+), 0 deletions(-)

Applied, thanks.

Best regards,

Wolfgang Denk

Signature · 4 lines
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.
#171 lore raw

v3 cover Add initial support for a generic SPL framework

In reply to Daniel Schwierzeck
Quoted 19 lines

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

Quoted 8 lines

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