summaryrefslogtreecommitdiff
path: root/common/spl
AgeCommit message (Collapse)Author
2016-12-09spl: Drop announce_boot_device()Simon Glass
This task can be handled by inline code now. Drop this function. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-12-09spl: Pass the loader into spl_load_image()Simon Glass
Rather than have this function figure out the correct loader again, pass it in as a parameter. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-12-09spl: Move the loading code into its own functionSimon Glass
Create a boot_from_devices() function to handle trying each device. This helps to reduce the size of the already-large board_init_r() function. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-12-09spl: Add a name to the SPL load-image methodsSimon Glass
It is useful to name each method so that we can print out this name when using the method. Currently this happens using a separate function. In preparation for unifying this, add a name to each method. The name is only available if we have libcommon support (i.e can use printf()). Signed-off-by: Simon Glass <sjg@chromium.org>
2016-12-05dm: spl: mmc: Fix EXT SPL supportMichal Simek
The patch "dm: spl: mmc: Support CONFIG_BLK in SPL MMC" (sha1: 87bce4e5c0b55452d70830928b2d7b98fa24d4e3) converted FAT part of spl_mmc_do_fs_boot() but forget to update also EXT part by 's/&mmc->block_dev/mmc_get_blk_desc(mmc)/'. This patch is fixing compilation error when CONFIG_SPL_EXT_SUPPORT is enabled. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Jaehoon Chung <jh80.chung@samsung.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-12-03dm: core: Handle global_data moving in SPLSimon Glass
When CONFIG_SPL_STACK_R is enabled, and spl_init() is called before board_init_r(), spl_relocate_stack_gd() will move global_data to a new place in memory. This affects driver model since it uses a list for the uclasses. Unless this is updated the list will become invalid. When looking for a non-existent uclass, such as when adding a new one, the loop in uclass_find() may continue forever, thus causing a hang. Add a function to correct this rather obscure bug. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-12-01SPL: mmc: Make spl_mmc_load_image availableMarek Vasut
Make the spl_mmc_load_image() available globally, so it can be invoked directly by SPL on extremely space-constrained systems. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Jaehoon Chung <jh80.chung@samsung.com>
2016-12-01mmc: Tinification of the mmc codeMarek Vasut
Add new configuration option CONFIG_MMC_TINY which strips away all memory allocation within the MMC code and code for handling multiple cards. This allows extremely space-constrained SPL code use the MMC framework. Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Jaehoon Chung <jh80.chung@samsung.com>
2016-11-29spl: mmc: fix switch statementMax Krummenacher
If CONFIG_SPL_LIBCOMMON_SUPPORT is not defined there is a lone case statement at the end of the switch leading to a compile error. Remove the offending case statement. | common/spl/spl_mmc.c:339:7: error: label at end of compound statement Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Marek Vasut <marex@denx.de>
2016-11-29spl: add USB Gadget config optionStefan Agner
Introduce USB Gadget config option. This allows to combine Makefile entries for SPL_USBETH_SUPPORT and SPL_DFU_SUPPORT. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com> Tested-by: Ravi Babu <ravibabu@ti.com>
2016-11-29spl: dfu: move DFU Kconfig to SPL KconfigStefan Agner
The DFU Kconfig menu entries should be part of the SPL Kconfig file. Also avoid using the top level Makefile by moving the config dependent build artifacts to the driver/ and driver/usb/gadget/ Makfiles. With that, DFU can be built again in SPL if CONFIG_SPL_DFU_SUPPORT is enabled. Fixes: 6ad6102246d8 ("usb:gadget: Disallow DFU in SPL for now") Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
2016-11-29spl: add RAM boot device only if it is actually definedStefan Agner
Some devices (e.g. dra7xx) support loading to RAM using DFU without having direct boot from RAM support. Make sure the linker list does not contain BOOT_DEVICE_RAM if CONFIG_SPL_RAM_DEVICE is not enabled. Fixes: 98136b2f26fa ("spl: Convert spl_ram_load_image() to use linker list") Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Lukasz Majewski <l.majewski@samsung.com>
2016-11-28spl: remove redundant call to parse_image_header()tomas.melin@vaisala.com
Image header was checked twice. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Acked-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-11-28spl: add check for FIT-header when loading imagetomas.melin@vaisala.com
Add check for FDT_MAGIC, otherwise also legacy images will be loaded as a FIT. With this check in place, the loader works correct both with legacy and FIT images. Signed-off-by: Tomas Melin <tomas.melin@vaisala.com> Acked-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-11-21ext4: Allow reading files with non-zero offset, clamp read lenStefan Brüns
Support was already implemented, but not hooked up. This fixes several fails in the test cases. Signed-off-by: Stefan Brüns <stefan.bruens@rwth-aachen.de> Acked-by: Stephen Warren <swarren@wwwdotorg.org>
2016-11-19spl: Convert CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to KconfigSemen Protsenko
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> [trini: Fix sniper and kc1 migration] Signed-off-by: Tom Rini <trini@konsulko.com>
2016-10-15spl: move SYS_OS_BASE to KconfigHeiko Schocher
Move SYS_OS_BASE to Kconfig and cleanup existing uses. Signed-off-by: Heiko Schocher <hs@denx.de> [trini: Also migrate a4m2k] Signed-off-by: Tom Rini <trini@konsulko.com>
2016-10-15spl: move SPL_OS_BOOT to KconfigHeiko Schocher
Move SPL_OS_BOOT to Kconfig and cleanup existing uses. Signed-off-by: Heiko Schocher <hs@denx.de>
2016-10-08spl: saveenv: adding saveenv support in SPLB, Ravi
By default saveenv option is not supported for SPL. This patch enable the support for save environment variable for SPL build. Enable save environment support in SPL after setenv. By default the saveenv option is not provided in SPL, but some boards need this support in 'Falcon' boot, where SPL need to boot from different images based on environment variable set by OS. For example OS may set "reboot_image" environment variable to "recovery" inorder to boot recovery image by SPL. The SPL read "reboot_image" and act accordingly and change the reboot_image to default mode using setenv and save the environemnt. Signed-off-by: Ravi Babu <ravibabu@ti.com> Reviewed-by: Simon Glass <sig@chromium.org> change in v1: - dropped SUPPORT, use CONFIG_SPL_SAVEENV - updates the comments in mmc_private.h
2016-10-06spl: Make spl_boot_list a local variableSimon Glass
There is no need for this to be in the BSS region. By moving it we can delay use of BSS in SPL. This is useful for machines where the BSS region is not in writeable space. On 64-bit x86, SPL runs from SPI flash and it is easier to eliminate BSS use than link SPL to run with BSS at a particular cache-as-RAM (CAR) address. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Update spl_load_simple_fit() to take an spl_image paramSimon Glass
Upda the SPL FIT code to use the spl_image parameter. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Update fat functions to take an spl_image parameterSimon Glass
Update the fat loader to avoid using the spl_image global variable. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Update ext functions to take an spl_image parameterSimon Glass
Update the ext loader to avoid using the spl_image global variable. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Pass spl_image as a parameter to load_image() methodsSimon Glass
Rather than having a global variable, pass the spl_image as a parameter. This avoids BSS use, and makes it clearer what the function is actually doing. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_board_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Update existing users. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_net_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. We need two variants - one for BOOT_DEVICE_CPGMAC and one for BOOT_DEVICE_USBETH. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_spi_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Also set up the sunxi function. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: spi: Move the generic SPI loader into common/splSimon Glass
All the other SPL loaders are in this directory, so move the SPI one in there too. There are two board-specific SPI loaders (fsl and sunxi). These remain in the drivers/mtd/spi directory, since they do not contain generic code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_sata_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_usb_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_ymodem_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_nor_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_onenand_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_nand_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_ubi_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_mmc_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert spl_ram_load_image() to use linker listSimon Glass
Add a linker list declaration for this method and remove the explicit switch() code. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> [trini: Include updating the DFU case] Signed-off-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Add a way to declare an SPL image loaderSimon Glass
Add a linker list macro which can be used to declare an SPL image loader. Update spl_load_image() to search available loaders for the correct one. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Convert boot_device into a structSimon Glass
At present some spl_xxx_load_image() functions take a parameter and some don't. Of those that do, most take an integer but one takes a string. Convert this parameter into a struct so that we can pass all functions the same thing. This will allow us to use a common function signature. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Kconfig: Move SPL_DISPLAY_PRINT to KconfigSimon Glass
Move this option to Kconfig and tidy up existing uses. Also add a function comment to the header file. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Add a parameter to jump_to_image_linux()Simon Glass
Instead of using the global spl_image variable, pass the required struct in as an argument. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Add a parameter to spl_parse_image_header()Simon Glass
Instead of using the global spl_image variable, pass the required struct in as an argument. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-10-06spl: Add a parameter to spl_set_header_raw_uboot()Simon Glass
Rather than act on the global variable, pass the required struct in as a parameter. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-09-27dra7x: boot: add dfu bootmode supportB, Ravi
This patch enables the DFU boot mode support for dra7x platform. Signed-off-by: Ravi Babu <ravibabu@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-09-27spl: dfu: adding dfu support functions for SPL-DFUB, Ravi
Adding support functions to run dfu spl commands. Signed-off-by: Ravi Babu <ravibabu@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-09-16Kconfig: tpl: Add some TPL support options to KconfigSimon Glass
Some of the SPL options have TPL equivalents. Add these to Kconfig so that we can convert these options over to work from Kconfig. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-16Kconfig: spl: Add SPL support options to KconfigSimon Glass
There are a lot of SPL options in U-Boot to enable various features and drivers. Currently these do not use Kconfig. Add them to Kconfig along with suitable help, and drop them from the README. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-16Kconfig: Move SPL settings into their own fileSimon Glass
Move the SPL settings into common/spl where most of the SPL code is kept. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-09-06spl: Rework image header parse to allow abort on raw image and os bootPaul Kocialkowski
This reworks spl_set_header_raw_uboot to allow having both os boot (which comes with a valid header) and aborting when no valid header is found (thus excluding raw u-boot.bin images). Signed-off-by: Paul Kocialkowski <contact@paulk.fr> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-08-08spl_nor.c: Support devicetree sizes different from 16kMike Looijmans
The devicetrees for various platforms already exceed 16k. Add a define CONFIG_SYS_FDT_SIZE to specify the FDT size, and set to 16k for the two boards that define this CONFIG_SYS_FDT_BASE parameter. This allows platforms with larger devicetree blobs to boot from NOR. Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl>