summaryrefslogtreecommitdiff
path: root/common/spl
AgeCommit message (Collapse)Author
2017-04-05common: spl: don't optimize away version stringColibri-iMX7_LXDE-Image_2.7b2-20170410Colibri-iMX6_LXDE-Image_2.7b2-20170410Colibri-VF_LXDE-Image_2.7b2-20170410Colibri-T30_LXDE-Image_2.7b2-20170410Colibri-T20_LXDE-Image_2.7b2-20170410Apalis-iMX6_LXDE-Image_2.7b2-20170410Apalis-TK1_LXDE-Image_2.7b2-20170410Apalis-T30_LXDE-Image_2.7b2-20170410Max Krummenacher
With CONFIG_SPL_SILENT_CONSOLE the 'U-Boot SPL...' version string is no longer linked into the SPL binary. Factor out the version string and make sure that it is not optimize away by lto. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-03-30common: apalis/colibri imx6: spl: add config to silence console outputMax Krummenacher
This adds a Kconfig SPL_SILENCE_CONSOLE which allows to suppress any console output which in the normal program flow is printed in the SPL. Error messages and the likes will still be printed. Signed-off-by: Max Krummenacher <max.krummenacher@toradex.com> Acked-by: Marcel Ziswiler <marcel.ziswiler@toradex.com>
2017-01-18spl: add serial download protocol (SDP) supportStefan Agner
Add USB serial download protocol support to SPL. If the SoC started in recovery mode the SPL will immediately switch to SDP and wait for further downloads/commands from the host side. Signed-off-by: Stefan Agner <stefan.agner@toradex.com> Acked-by: Max Krummenacher <max.krummenacher@toradex.com>
2017-01-11spl: 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> (cherry picked from commit e94793c844a40606252f2e3f6428063e057b3fd2)
2017-01-11spl: 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> (cherry picked from commit 5991703e88f320767d9390d64a6a9bd62560696b)
2017-01-11spl: 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> (cherry picked from commit 34ee947ac3be7a79b89fa8bb690379651cc9598a)
2017-01-11spl: 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> (cherry picked from commit c8d7647f639813cff08a4a7de62db815829ec72b)
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-14spl: 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>
2016-07-27dm: spl: mmc: Support raw partitions with CONFIG_BLKSimon Glass
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>
2016-07-22spl: fit: Fix the number of bytes read in raw modeLokesh Vutla
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>
2016-07-22spl: zImage support in Falcon modeLadislav Michl
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>
2016-07-22spl: support loading from UBI volumesLadislav Michl
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>
2016-07-22spl: Fix compilation warnings for arm64Michal Simek
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>
2016-07-15Merge branch 'master' of http://git.denx.de/u-boot-sunxiTom Rini
2016-07-15Merge git://git.denx.de/u-boot-dmTom Rini
2016-07-15sunxi: Support booting from SPI flashSiarhei Siamashka
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>
2016-07-14dm: spl: Bind in all devices in SPL with of-platdataSimon Glass
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>