summaryrefslogtreecommitdiff
path: root/common/spl
Commit message (Collapse)AuthorAgeLines
* spl: Drop announce_boot_device()Simon Glass2016-12-09-83/+3
| | | | | | This task can be handled by inline code now. Drop this function. Signed-off-by: Simon Glass <sjg@chromium.org>
* spl: Pass the loader into spl_load_image()Simon Glass2016-12-09-4/+4
| | | | | | | 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>
* spl: Move the loading code into its own functionSimon Glass2016-12-09-12/+29
| | | | | | | 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>
* spl: Add a name to the SPL load-image methodsSimon Glass2016-12-09-16/+18
| | | | | | | | | | | 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>
* dm: spl: mmc: Fix EXT SPL supportMichal Simek2016-12-05-2/+2
| | | | | | | | | | | | | | 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>
* dm: core: Handle global_data moving in SPLSimon Glass2016-12-02-0/+3
| | | | | | | | | | | | | 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>
* SPL: mmc: Make spl_mmc_load_image availableMarek Vasut2016-12-01-2/+2
| | | | | | | | | | 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>
* mmc: Tinification of the mmc codeMarek Vasut2016-12-01-1/+5
| | | | | | | | | | | | 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>
* spl: mmc: fix switch statementMax Krummenacher2016-11-29-1/+0
| | | | | | | | | | | | 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>
* spl: add USB Gadget config optionStefan Agner2016-11-28-12/+21
| | | | | | | | | 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>
* spl: dfu: move DFU Kconfig to SPL KconfigStefan Agner2016-11-28-0/+26
| | | | | | | | | | | | | | | | 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>
* spl: add RAM boot device only if it is actually definedStefan Agner2016-11-28-0/+2
| | | | | | | | | | | | 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>
* spl: remove redundant call to parse_image_header()tomas.melin@vaisala.com2016-11-28-1/+0
| | | | | | | | 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>
* spl: add check for FIT-header when loading imagetomas.melin@vaisala.com2016-11-28-1/+2
| | | | | | | | | | 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>
* ext4: Allow reading files with non-zero offset, clamp read lenStefan Brüns2016-11-21-4/+4
| | | | | | | | 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>
* spl: Convert CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR to KconfigSemen Protsenko2016-11-18-2/+29
| | | | | | Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org> [trini: Fix sniper and kc1 migration] Signed-off-by: Tom Rini <trini@konsulko.com>
* spl: move SYS_OS_BASE to KconfigHeiko Schocher2016-10-15-0/+10
| | | | | | | | | 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>
* spl: move SPL_OS_BOOT to KconfigHeiko Schocher2016-10-14-0/+8
| | | | | | | Move SPL_OS_BOOT to Kconfig and cleanup existing uses. Signed-off-by: Heiko Schocher <hs@denx.de>
* spl: saveenv: adding saveenv support in SPLB, Ravi2016-10-08-0/+13
| | | | | | | | | | | | | | | | | | | | | 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
* spl: Make spl_boot_list a local variableSimon Glass2016-10-06-12/+12
| | | | | | | | | | | 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>
* spl: Update spl_load_simple_fit() to take an spl_image paramSimon Glass2016-10-06-10/+11
| | | | | | | 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>
* spl: Update fat functions to take an spl_image parameterSimon Glass2016-10-06-20/+29
| | | | | | | 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>
* spl: Update ext functions to take an spl_image parameterSimon Glass2016-10-06-11/+14
| | | | | | | 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>
* spl: Pass spl_image as a parameter to load_image() methodsSimon Glass2016-10-06-75/+98
| | | | | | | | | 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>
* spl: Convert spl_board_load_image() to use linker listSimon Glass2016-10-06-11/+2
| | | | | | | | 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>
* spl: Convert spl_net_load_image() to use linker listSimon Glass2016-10-06-14/+25
| | | | | | | | | 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>
* spl: Convert spl_spi_load_image() to use linker listSimon Glass2016-10-06-5/+3
| | | | | | | | 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>
* spl: spi: Move the generic SPI loader into common/splSimon Glass2016-10-06-0/+124
| | | | | | | | | | | 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>
* spl: Convert spl_sata_load_image() to use linker listSimon Glass2016-10-06-5/+2
| | | | | | | | 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>
* spl: Convert spl_usb_load_image() to use linker listSimon Glass2016-10-06-4/+2
| | | | | | | | 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>
* spl: Convert spl_ymodem_load_image() to use linker listSimon Glass2016-10-06-5/+2
| | | | | | | | 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>
* spl: Convert spl_nor_load_image() to use linker listSimon Glass2016-10-06-5/+2
| | | | | | | | 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>
* spl: Convert spl_onenand_load_image() to use linker listSimon Glass2016-10-06-5/+3
| | | | | | | | 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>
* spl: Convert spl_nand_load_image() to use linker listSimon Glass2016-10-06-5/+3
| | | | | | | | 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>
* spl: Convert spl_ubi_load_image() to use linker listSimon Glass2016-10-06-6/+3
| | | | | | | | 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>
* spl: Convert spl_mmc_load_image() to use linker listSimon Glass2016-10-06-7/+5
| | | | | | | | 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>
* spl: Convert spl_ram_load_image() to use linker listSimon Glass2016-10-06-9/+9
| | | | | | | | | | 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>
* spl: Add a way to declare an SPL image loaderSimon Glass2016-10-06-0/+20
| | | | | | | | 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>
* spl: Convert boot_device into a structSimon Glass2016-10-06-32/+37
| | | | | | | | | | | 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>
* spl: Kconfig: Move SPL_DISPLAY_PRINT to KconfigSimon Glass2016-10-06-0/+9
| | | | | | | | 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>
* spl: Add a parameter to jump_to_image_linux()Simon Glass2016-10-06-1/+2
| | | | | | | | 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>
* spl: Add a parameter to spl_parse_image_header()Simon Glass2016-10-06-33/+36
| | | | | | | | 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>
* spl: Add a parameter to spl_set_header_raw_uboot()Simon Glass2016-10-06-8/+8
| | | | | | | | 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>
* dra7x: boot: add dfu bootmode supportB, Ravi2016-09-27-1/+9
| | | | | | | | 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>
* spl: dfu: adding dfu support functions for SPL-DFUB, Ravi2016-09-27-0/+58
| | | | | | | Adding support functions to run dfu spl commands. Signed-off-by: Ravi Babu <ravibabu@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* Kconfig: tpl: Add some TPL support options to KconfigSimon Glass2016-09-16-0/+67
| | | | | | | 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>
* Kconfig: spl: Add SPL support options to KconfigSimon Glass2016-09-16-0/+411
| | | | | | | | 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>
* Kconfig: Move SPL settings into their own fileSimon Glass2016-09-16-0/+67
| | | | | | Move the SPL settings into common/spl where most of the SPL code is kept. Signed-off-by: Simon Glass <sjg@chromium.org>
* spl: Rework image header parse to allow abort on raw image and os bootPaul Kocialkowski2016-09-06-4/+7
| | | | | | | | | 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>
* spl_nor.c: Support devicetree sizes different from 16kMike Looijmans2016-08-08-2/+2
| | | | | | | | | 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>