summaryrefslogtreecommitdiff
path: root/common/spl
Commit message (Collapse)AuthorAgeLines
* 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>
* dm: spl: mmc: Support raw partitions with CONFIG_BLKSimon Glass2016-07-27-1/+1
| | | | | | | | Fix up the call in mmc_load_image_raw_partition() to use the correct function to obtain the MMC device, so that this code can support driver model. Signed-off-by: Simon Glass <sjg@chromium.org>
* spl: fit: Fix the number of bytes read in raw modeLokesh Vutla2016-07-22-1/+3
| | | | | | | | | | | In raw mode a full sector is to be read even if image covers part of a sector. Number of sectors are calculated as ROUND_UP(size)/sec_size by FIT framework. This calculation assumes that image is at the 0th offset of a sector, which is not true always in FIT case. So, include the image offset while calculating number of sectors. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com>
* spl: zImage support in Falcon modeLadislav Michl2016-07-22-0/+23
| | | | | | | | Other payload than uImage is currently considered to be raw U-Boot image. Check also for zImage in Falcon mode. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Heiko Schocher <hs@denx.de>
* spl: support loading from UBI volumesLadislav Michl2016-07-22-0/+87
| | | | | | | | Add support for loading from UBI volumes on the top of NAND and OneNAND. Signed-off-by: Ladislav Michl <ladis@linux-mips.org> Reviewed-by: Heiko Schocher <hs@denx.de>
* spl: Fix compilation warnings for arm64Michal Simek2016-07-22-1/+2
| | | | | | | | | | | | | | | Make code 64bit aware. Warnings: +../arch/arm/lib/spl.c: In function ‘jump_to_image_linux’: +../arch/arm/lib/spl.c:63:3: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] +../common/spl/spl_fat.c: In function ‘spl_load_image_fat’: +../common/spl/spl_fat.c:91:33: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast] Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* Merge branch 'master' of http://git.denx.de/u-boot-sunxiTom Rini2016-07-15-2/+2
|\
| * sunxi: Support booting from SPI flashSiarhei Siamashka2016-07-15-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allwinner devices support SPI flash as one of the possible bootable media type. The SPI flash chip needs to be connected to SPI0 pins (port C) to make this work. More information is available at: https://linux-sunxi.org/Bootable_SPI_flash This patch adds the initial support for booting from SPI flash. The existing SPI frameworks are not used in order to reduce the SPL code size. Right now the SPL size grows by ~370 bytes when CONFIG_SPL_SPI_SUNXI option is enabled. While there are no popular Allwinner devices with SPI flash at the moment, testing can be done using a SPI flash module (it can be bought for ~2$ on ebay) and jumper wires with the boards, which expose relevant pins on the expansion header. The SPI flash chips themselves are very cheap (some prices are even listed as low as 4 cents) and should not cost much if somebody decides to design a development board with an SPI flash chip soldered on the PCB. Another nice feature of the SPI flash is that it can be safely accessed in a device-independent way (since we know that the boot ROM is already probing these pins during the boot time). And if, for example, Olimex boards opted to use SPI flash instead of EEPROM, then they would have been able to have U-Boot installed in the SPI flash now and boot the rest of the system from the SATA hard drive. Hopefully we may see new interesting Allwinner based development boards in the future, now that the software support for the SPI flash is in a better shape :-) Testing can be done by enabling the CONFIG_SPL_SPI_SUNXI option in a board defconfig, then building U-Boot and finally flashing the resulting u-boot-sunxi-with-spl.bin binary over USB OTG with a help of the sunxi-fel tool: sunxi-fel spiflash-write 0 u-boot-sunxi-with-spl.bin The device needs to be switched into FEL (USB recovery) mode first. The most suitable boards for testing are Orange Pi PC and Pine64. Because these boards are cheap, have no built-in NAND/eMMC and expose SPI0 pins on the Raspberry Pi compatible expansion header. The A13-OLinuXino-Micro board also can be used. Signed-off-by: Siarhei Siamashka <siarhei.siamashka@gmail.com> Reviewed-by: Simon Glass <sjg@chromium.org> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
* | Merge git://git.denx.de/u-boot-dmTom Rini2016-07-15-3/+3
|\ \
| * | dm: spl: Bind in all devices in SPL with of-platdataSimon Glass2016-07-14-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When CONFIG_OF_PLATDATA is enabled, we cannot use the u-boot,dm-pre-reloc device tree property since the device tree is not available. However, dt-platdata.c only includes devices which would have been present in the device tree, and we can assume that all such devices are needed for SPL. If they were not needed, they would have been omitted to save space. So in this case, bind all devices regardless of the u-boot,dm-pre-reloc setting. This avoids needing to add a DM_FLAG_PRE_RELOC to every driver, thus affecting U-Boot proper also. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | dm: spl: Don't set up device tree with of-platdataSimon Glass2016-07-14-1/+1
| | | | | | | | | | | | | | | | | | When this feature is enabled, we should not access the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
| * | spl: Drop include of i2c.hSimon Glass2016-07-14-1/+0
| |/ | | | | | | | | | | This file does not appear to use I2C, so drop this include. Signed-off-by: Simon Glass <sjg@chromium.org>
* | spl: fit: add support for post-processing of imagesDaniel Allred2016-07-14-5/+16
|/ | | | | | | | | | | | | | | | | | The next stage boot loader image and the selected FDT can be post- processed by board/platform/device-specific code, which can include modifying the size and altering the starting source address before copying these binary blobs to their final destination. This might be desired to do things like strip headers or footers attached to the images before they were packaged into the FIT, or to perform operations such as decryption or authentication. Introduce new configuration option CONFIG_SPL_FIT_IMAGE_POST_PROCESS to allow controlling this feature. If enabled, a platform-specific post-process function must be provided. Signed-off-by: Daniel Allred <d-allred@ti.com> Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* dm: spl: mmc: Support CONFIG_BLK in SPL MMCSimon Glass2016-07-11-3/+3
| | | | | | | Update the method of accessing the block device so that it works with CONFIG_BLK enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Pass the boot device into spl_boot_mode()Marek Vasut2016-06-26-1/+1
| | | | | | | | | | | | | | | | | | The SPL code already knows which boot device it calls the spl_boot_mode() on, so pass that information into the function. This allows the code of spl_boot_mode() avoid invoking spl_boot_device() again, but it also lets board_boot_order() correctly alter the behavior of the boot process. The later one is important, since in certain cases, it is desired that spl_boot_device() return value be overriden using board_boot_order(). Signed-off-by: Marek Vasut <marex@denx.de> Cc: Andreas Bießmann <andreas.devel@googlemail.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Andreas Bießmann <andreas@biessmann.org> [add newly introduced zynq variant] Signed-aff-by: Andreas Bießmann <andreas@biessmann.org>
* Merge git://git.denx.de/u-boot-nand-flashTom Rini2016-06-20-0/+7
|\
| * spl: nand: support redundant u-boot imageBoris Brezillon2016-06-19-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On modern NAND it's more than recommended to have a backup copy of the u-boot binary to recover from corruption: bitflips are quite common on MLC NANDs, and the read-disturbance will corrupt your u-boot partitition more quickly than what you would see on an SLC NAND. Add an extra Kconfig option to specify the offset of the redundant u-boot image. Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com> Acked-by: Hans de Goede <hdegoede@redhat.com> [scottwood: added ifdef to fix build break] Signed-off-by: Scott Wood <oss@buserror.net>