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: 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>
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: 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>
SPL: NAND: Enhance drivers/mtd/nand/nand_spl_simple.c

Takes the load function from arch/arm/cpu/armv7/omap-common/spl_nand.c
instead.  This will allow for easier integration of SPL-boots-Linux code on
other arches.

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>
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: 4
Cover-letter:
ARM: SPL: Make more generic, merge DaVinci and OMAP
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