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: 5
- Drop <asm/utils.h> from spl.c (noticed by Stefan)

Series-changes: 3
- Fix checkpatch.pl warning

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>
SPL: Create arch/arm/lib/spl.c for board_init_f and jump_to_image_linux

In SPL (CONFIG_SPL_FRAMEWORK) board_init_f must setup the stack pointer,
clear the BSS and call board_init_r.  We mark this as weak as some
platforms may need to perform additional initalization at this point.
We provide a gd that we know will be in a usable location, once the BSS
has been cleared to help with this as well.  Finally, we no longer call
relocate_code so remove that from the armv7 version.

Next, both board_init_f and jump_to_image_linux are going to be
inherently arch-specific, so move these versions to arch/arm/lib/spl.c

Series-changes: 5
- After seeing Stefan's PowerPC series, move gdata to arch/arm/lib/spl.c

Series-changes: 4
- Document what board_init_f must do
- Based on PowerPC, use memset to clear BSS rather than relocate_code
- Move board_init_f / jump_to_image_linux to arch/arm/lib/spl.c
- Make board_init_f setup the global data pointer, after clearing BSS.

Signed-off-by: Tom Rini <trini@ti.com>
SPL: do not use fix value for u-boot size

If an u-boot image is not found, SPL thinks to load a bare
u-boot.bin image with a maximum size of 200KB.
Use CONFIG_SYS_MONITOR_LEN instead.

Series-changes: 4
- Add Stefano's patch for CONFIG_SYS_MONITOR_LEN

Signed-off-by: Stefan Roese <stefan.roese@gmail.com>
Signed-off-by: Stefano Babic <sbabic@denx.de>
Signed-off-by: Tom Rini <trini@ti.com>
SPL: Use image_get_xxx() functions to access header values

Series-changes: 5
- Add Stefan's patch to use image_get_xxx() functions

Signed-off-by: Stefan Roese <sr@denx.de>
SPL: NAND: Move arch/arm/cpu/armv7/omap-common/spl_nand.c to common/spl

We move the spl_nand_load_image function to common/spl.  This will allow
for easier integration of SPL-boots-Linux code on other arches.

Series-changes: 5
- Move the file to common/spl/ rather than integrate with another file,
  after talking with Scott Wood

Series-changes: 4
- Leave nand_spl_load.c alone, move the new load into nand_spl_simple.c

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: 5
- Update davinci conversion for NAND change

Series-changes: 4
- Adapt davinci to new board_init_f requirements

Series-changes: 3
- Make use of board_init_f being a weak function now so that we can
  perform early init.  Fixes the cannot reset problem.
- Make u-boot.ais use u-boot.img not u-boot.bin, now that it uses
  CONFIG_SPL_FRAMEWORK

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: Add README.da850

This file documents when to build for da850evm and when to build for
da850_am18xxevm.  It also documents how to write the u-boot.ais file to
persistent storage (such as SPI), in some cases as well as how to write
a recovery image.

Series-changes: 4
- Further re-word README.da850 based on feedback from Christian Riesch

Series-changes: 3
- Fix thinko, Nand -> SPI (spotted by Prabhakar Lad)
- Rename to README.da850, add more direct recovery method (Christian Riesch)

Series-changes: 2
- Add README.da850_am18xxevm

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