Makefile: Move SPL files to clobber, remove from clean

The 'clean' target has been removing all of spl but not u-boot itself.
For consistency and ease of testing, only remove SPL binaries / maps in
the clobber target, just like for full U-Boot

Signed-off-by: Tom Rini <trini@ti.com>
spl_mmc: Make FAT checks / calls guarded with CONFIG_SPL_FAT_SUPPORT

Signed-off-by: Tom Rini <trini@ti.com>
omap-common: SPL: Add CONFIG_SPL_DISPLAY_PRINT / spl_display_print()

Only omap4/5 currently have a meaningful set of display text and overo
had been adding a function to display nothing.  Change how this works to
be opt-in and only turned on for omap4/5 now.

Signed-off-by: Tom Rini <trini@ti.com>
omap-common: Fix typo in save_boot_params() in lowlevel_init.S

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Rename omap_boot_device to spl_boot_device

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Rename omap_boot_mode to spl_boot_mode()

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Remove NAND_MODE_HW_ECC from spl_nand.c

This detection code doesn't (and can't) do anything currently, so
remove.

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Only call mem_malloc_init if configured

We can only attempt to setup a malloc pool if
CONFIG_SYS_SPL_MALLOC_START is defined, and not all boards require it.
Make the call depend on the define.

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Add <asm/spl.h> and <asm/arch/spl.h>

Move the SPL prototypes from <asm/omap_common.h> into <asm/spl.h> and
add <asm/arch/spl.h> for arch specific portions of CONFIG_SPL_FRAMEWORK.

Series-changes: 2
- Fix checkpatch warning (u32* boot_params_ptr -> u32 *boot_params_ptr)

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Make spl_mmc.c more generic

Move the default omap/related-centric board_mmc_init to
arch/arm/cpu/armv7/omap-common/boot-common.c and move the type defines
to <asm/spl.h>

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Clean up spl.c / spl_nand.c slightly

- Remove includes we don't need
- Switch some printf statements to puts
- Convert some printf statements to debug, introduce new puts statements
  - In most cases saying just "No mkimage signature, assuming
    u-boot.bin" or similar is sufficient.  This also means the non-DEBUG
    case doesn't need printf, in the core of SPL.
  - The other case here is that PLAIN_VERSION provided what we wanted
    already, so just use it.

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Start hooking in the current SPI SPL support

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Move gpmc_init() to spl_board_init()

This is an OMAP/related-specific function, move calling it to
spl_board_init() and turn on CONFIG_SPL_BOARD_INIT on the boards that
enabled NAND and didn't enable this already.

Signed-off-by: Tom Rini <trini@ti.com>
SPL: Move the omap SPL framework to common/spl

Add a new flag, CONFIG_SPL_FRAMEWORK to opt into the common/spl SPL
framework, enable on all of the previously using boards.  We move the
spl_ymodem.c portion to common/ and spl_mmc.c to drivers/mmc/.  We leave
the NAND one in-place as we plan to replace it later in this series.

We use common/spl to avoid linker problems with respect to merging
constant strings in objects.   Otherwise all strings in common/ will be
linked in and kept which grows SPL in size too much.

Series-changes: 2
- Reorder all of the patches that used to follow this to precede.
- Place files into common/spl (due to gcc bug #54303) and include/spl.h

Signed-off-by: Tom Rini <trini@ti.com>
ARM: SPL: Convert davinci to CONFIG_SPL_FRAMEWORK

- Convert the non-relocation part of board_init_f to spl_board_init,
  turn on CONFIG_SPL_BOARD_INIT in the configs.
- Remove duplicated code.
- Add spl_boot_device() that returns the statically chosen boot device.

Series-changes: 2
- Add CONFIG_SYS_SPL_MALLOC_START / SIZE defines from Christian Riesch
- Add arch/arm/cpu/arm926ejs/davinci/config.mk to build u-boot.ais

Signed-off-by: Tom Rini <trini@ti.com>
da850_am18xxevm: Add README.da850_am18xxevm

Add a board-specific README that documents how to write u-boot.ais to
the SPI found on this board.

Changes-series: 2
- Add

Signed-off-by: Tom Rini <trini@ti.com>
SPL: Enhance drivers/mtd/nand/nand_spl_load.c

Takes the load function from arch/arm/lib/spl_nand.c instead.  This will
allow for easier integration of SPL-boots-Linux code on other arches.
Kill off CONFIG_SPL_NAND_LOAD as a separate option.

Signed-off-by: Tom Rini <trini@ti.com>
SPL: Enhance spi_spl_load to match the other load functions

Signed-off-by: Tom Rini <trini@ti.com>

Series-to: uboot
Series-cc: criesch, plad, criesch, srajashekhara, mhadli, sganu
Series-version: 2
Cover-letter:
Hey all,

The following patch series merges the davinci and omap-common SPL
frameworks into a single framework, CONFIG_SPL_FRAMEWORK along with a
few small cleanups to the code to make it a little smaller and more
flexible.  The end result is that davinci can now opt in on
SPL-boots-Linux by just setting the right defines and other platforms
would just need to adapt to this framework.  In my testing, davinci
gains between 300 and 700 bytes for this (not enabling the SPL OS
feature) and omap4/5/etc lose just a little bit (from the printf->puts
changes).  I've tested this on omap3_beagle (xM and classic) and
omap4_panda.  I don't have any davinci platforms that were previously
using SPL so I can't boot-test those changes but since everyone sets
CONFIG_SPL_MAX_SIZE, we're OK in that department.

To make this series easier to test I've placed it on
http://github.com/trini/u-boot WIP/spl-improvements

I've looked a little into re-reducing the size and the biggest problem I
see is that SPI a lot of informational prints that we don't need,
strictly speaking, but are nice in a normal U-Boot context.  I'm unsure
of the best way to quiet these as I don't like the idea of sprinkling
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54303 and I'm sending
another email to discuss that.

--
Tom
END