summaryrefslogtreecommitdiff
path: root/common/spl
AgeCommit message (Collapse)Author
2016-07-14dm: spl: Don't set up device tree with of-platdataSimon Glass
When this feature is enabled, we should not access the device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14spl: Drop include of i2c.hSimon Glass
This file does not appear to use I2C, so drop this include. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-07-14spl: fit: add support for post-processing of imagesDaniel Allred
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>
2016-07-11dm: spl: mmc: Support CONFIG_BLK in SPL MMCSimon Glass
Update the method of accessing the block device so that it works with CONFIG_BLK enabled. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-06-26common: Pass the boot device into spl_boot_mode()Marek Vasut
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>
2016-06-20Merge git://git.denx.de/u-boot-nand-flashTom Rini
2016-06-19spl: nand: support redundant u-boot imageBoris Brezillon
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>
2016-06-19SPL ext: cosmetic: correct error message in spl_load_image_ext()Petr Kulhavy
Correct the error message in spl_load_image_ext() when image parsing fails. Instead of "ext4fs_read failed" print "failed to parse image header". Signed-off-by: Petr Kulhavy <brain@jikos.cz> CC: Guillaume GARDET <guillaume.gardet@free.fr> CC: Tom Rini <trini@konsulko.com>
2016-06-17SPL: ext: remove redundant ifdef statementPetr Kulhavy
Remove redundant #if defined(CONFIG_SPL_OS_BOOT) statement around getenv() calls in spl_load_image_ext_os(). The whole function is surrounded by #ifdef CONFIG_SPL_OS_BOOT. No functional change. Signed-off-by: Petr Kulhavy <brain@jikos.cz> CC: Guillaume GARDET <guillaume.gardet@free.fr> Acked-by: Guillaume GARDET <guillaume.gardet@free.fr>
2016-06-09bootstage: call show_boot_progress also in SPLHeiko Schocher
show_boot_progress() is now called from SPL also. Signed-off-by: Heiko Schocher <hs@denx.de>
2016-06-04spl: fit: Fix non-matching DT names console outputAndreas Dannenberg
When no DTB can be matched successfully to the board that's being used a list of available FIT-embedded DTBs will be output to the console for diagnostic purposes. But rather than the contents of the "description" FDT property a non-existent property was accessed and as a result "NULL" was output instead of the actual name(s) of the DTB(s). Fix this issue by using the correct property which is also the exact same property that's used earlier during the actual board matching process. Signed-off-by: Andreas Dannenberg <dannenberg@ti.com>
2016-06-02Merge branch 'master' of git://git.denx.de/u-boot-socfpgaTom Rini
2016-06-02spl: Allow settings malloc_f base addressMarek Vasut
Allow configuring the begining of the malloc_f area in SPL. This patch uses the same CONFIG_MALLOC_F_ADDR established by the sandbox. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org>
2016-06-01spl: Remove bogus GD_FLG_SPL_INIT checkMarek Vasut
Remove the check for GD_FLG_SPL_INIT in spl_relocate_stack_gd(). The check will always fail. This is because spl_relocate_stack_gd() is called from ARM's crt0.S and it is called before board_init_r(). The board_init_r() calls spl_init(), which sets the GD_FLG_SPL_INIT flag. Note that reserving the malloc area in RAM is not a problem even if the GD_FLG_SPL_INIT flag is not set. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Chin Liang See <clsee@altera.com> Cc: Dinh Nguyen <dinguyen@opensource.altera.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Pavel Machek <pavel@denx.de> Cc: Stefan Roese <sr@denx.de> Cc: Stephen Warren <swarren@nvidia.com>
2016-06-01spl: fit: Fix load address of fit headerLokesh Vutla
When loading fit header, it should be loaded to a previous address aligned to ARCH_DMA_MINALIGN and not 8. Fixing the same. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2016-05-27Merge git://git.denx.de/u-boot-dmTom Rini
For odroid-c2 (arch-meson) for now disable designware eth as meson now needs to do some harder GPIO work. Signed-off-by: Tom Rini <trini@konsulko.com> Conflicts: lib/efi_loader/efi_disk.c Modified: configs/odroid-c2_defconfig
2016-05-27spl: Add an option to load a FIT containing U-Boot from UARTLokesh Vutla
This provides a way to load a FIT containing U-Boot and a selection of device tree files from UART. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2016-05-27spl: fit: Do not print selected dtb during fit loadLokesh Vutla
No prints should be allowed during UART load. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2016-05-27spl: Support loading a FIT from NANDLokesh Vutla
Detect a FIT when loading from NAND and handle it using the new FIT SPL support. Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> [trini: Make sure we continue to use (void *)(unsigned long) for load_addr]. Signed-off-by: Tom Rini <trini@konsulko.com>
2016-05-27spl: Support loading a FIT from FAT FSLokesh Vutla
Detect a FIT when loading from a FAT File system and handle it using the new FIT SPL support. Tested-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2016-05-27spl: Allow to load a FIT containing U-Boot from FSLokesh Vutla
This provides a way to load a FIT containing U-Boot and a selection of device tree files from a File system. Making sure that all the reads and writes are aligned to their respective needs. Tested-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com> [trini: Make this still apply with Michal's alignment change for 'fit'] Signed-off-by: Tom Rini <trini@konsulko.com>
2016-05-27spl: fit: Fix the number of bytes read when reading fdt from fitLokesh Vutla
sectors field is not being updated when reading fdt from fit image. Because of this size_of(u-boot.bin) is being read when reading fdt. Fixing it by updating the sectors field properly. Tested-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com> Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2016-05-27dm: mmc: spl: Add support for CONFIG_BLKSimon Glass
Allow driver model to be used for block devices in SPL. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-27SPL: FIT: Align loading address for headerMichal Simek
If bl_len is not aligned it can caused a problem because another code expects that start is aligned. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-24SPL: FIT: Enable SPL_FIT_LOAD in RAM based boot modeMichal Simek
Support loading FIT in SPL for RAM bootmode. CONFIG_SPL_LOAD_FIT_ADRESS points to address where FIT image is stored in memory. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Lokesh Vutla <lokeshvutla@ti.com>
2016-05-24spl: Introduce new function spl_board_prepare_for_bootMichal Simek
Call this function before passing control from SPL. For fpga case it is necessary to enable for example level shifters when bitstream is programmed. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-23SPL: fat: Fix spl_parse_image_header() return value handlingTom Rini
The spl_parse_image_header() can return 0 and it is not an error. Only treat non-zero return value as an error. Signed-off-by: Marek Vasut <marex@denx.de> Reviewed-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Peng Fan <van.freenix@gmail.com> Reviewed-by: Stefano Babic <sbabic@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-05-23spl: fit: Print error message when FDT is not presentMichal Simek
When FDT is not present in the image user doesn't get any error what's wrong. Print error message if LIBCOMMON_SUPPORT is enabled. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Seris-cc: uboot Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-17Merge git://git.denx.de/u-boot-dmTom Rini
2016-05-17dm: mmc: Use the new select_hwpart() APISimon Glass
Avoid calling directly into the MMC code - use the new API call instead. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-17dm: scsi: Drop the get_dev() functionSimon Glass
This function is implemented by the legacy block functions now. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-17dm: usb: Drop the get_dev() functionSimon Glass
This function is implemented by the legacy block functions now. Drop it. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-17SPL: Add CONFIG_SPL_ABORT_ON_RAW_IMAGEMarek Vasut
When defined, SPL will proceed to another boot method if the image it has loaded does not have a signature. This is useful if the subsequent boot methods are much more complex. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Tom Rini <trini@konsulko.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Peng Fan <van.freenix@gmail.com> Cc: Fabio Estevam <fabio.estevam@nxp.com>
2016-05-17SPL: Let spl_parse_image_header() return valueMarek Vasut
Allow the spl_parse_image_header() to return value. This is convenient for controlling the SPL boot flow if the loaded image is corrupted. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Fabio Estevam <fabio.estevam@nxp.com> Cc: Peng Fan <van.freenix@gmail.com> Cc: Stefano Babic <sbabic@denx.de> Cc: Tom Rini <trini@konsulko.com>
2016-04-25spl: spl_mmc: Disambiguate error messageFabio Estevam
The error message "spl: mmc block read error" may come from two different functions, so we should better annotate the function name where the error comes from to help debugging. Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-04-11spl: mmc: raw: Try to load u-boot if Linux image is not foundLokesh Vutla
If CONFIG_SPL_OS_BOOT is enabled and Linux image is not flashed at RAW_MODE_KERNEL_SECTOR in MMC, spl still assumes that Linux is available and tries to boot it and hangs. In order to avoid this, adding a check to verify if parsed image header is of type IH_OS_LINUX. If it fails then fall back to load u-boot image. Signed-off-by: Lokesh Vutla <lokeshvutla@ti.com>
2016-04-01Common: SPL: spl_nand: Fixed debug correct NAND ECC type.Ahmed Samir Khalil
In case of #define DEBUG 1 (fordebugging SPL). A bug in spl_nand_load_image() will be triggered, because it prints using hw ecc regardless of soft ecc configurations and initializations. Signed-off-by: Ahmed Samir <engkhalil86@gmail.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-23Merge branch 'master' of http://git.denx.de/u-boot-sunxiTom Rini
2016-03-23spl: Print from which mmc slot spl is trying to bootHans de Goede
On some sunxi boards (and presumably also non sunxi boards) u-boot can be either loaded from a sdcard in a micro-sd slot, or from eMMC. Print which MMC spl tries to boot from, to help debugging. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-24spl_mmc: allow to load raw imageMasahiro Yamada
The function spl_parse_image_header() falls back to a raw image if the U-Boot header is missing and CONFIG_SPL_PANIC_ON_RAW_IMAGE is undefined. While, mmc_load_image_raw_sector() only accepts a U-Boot legacy image or an FIT image, preventing us from loading a raw image. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-15spl_nor: fix warning when compiled for 64bit targetMasahiro Yamada
Fix "warning: cast to pointer from integer of different size". Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-03-14Merge git://git.denx.de/u-boot-dmTom Rini
2016-03-14spl: Support loading a FIT from MMCSimon Glass
Detect a FIT when loading from MMC and handle it using the new FIT SPL support. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14spl: Add an option to load a FIT containing U-BootSimon Glass
This provides a way to load a FIT containing U-Boot and a selection of device tree files. The board can select the correct device tree by probing the hardware. Then U-Boot is started with the selected device tree. Signed-off-by: Simon Glass <sjg@chromium.org>
2016-03-14dm: part: Rename some partition functionsSimon Glass
Rename three partition functions so that they start with part_. This makes it clear what they relate to. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-03-14dm: Drop the block_dev_desc_t typedefSimon Glass
Use 'struct' instead of a typdef. Also since 'struct block_dev_desc' is long and causes 80-column violations, rename it to struct blk_desc. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Stephen Warren <swarren@nvidia.com>
2016-02-19spl: if MMCSD_MODE_RAW fails, try MMCSD_MODE_FSGuillaume GARDET
Since commit fd61d39970b9901217efc7536d9f3a61b4e1752a: spl: mmc: add break statements in spl_mmc_load_image() RAW and FS boot modes are now exclusive again. So, if MMCSD_MODE_RAW fails, the board hangs. This patch allows to try MMCSD_MODE_FS then. It has been tested on a beaglebone black to boot on an EXT partition. Signed-off-by: Guillaume GARDET <guillaume.gardet@free.fr> Cc: Tom Rini <trini@konsulko.com> Cc: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Paul Kocialkowski <contact@paulk.fr> Cc: Pantelis Antoniou <panto@antoniou-consulting.com> Cc: Simon Glass <sjg@chromium.org> Cc: Matwey V. Kornilov <matwey.kornilov@gmail.com> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
2016-01-13block: pass block dev not num to read/write/erase()Stephen Warren
This will allow the implementation to make use of data in the block_dev structure beyond the base device number. This will be useful so that eMMC block devices can encompass the HW partition ID rather than treating this out-of-band. Equally, the existence of the priv field is crying out for this patch to exist. Signed-off-by: Stephen Warren <swarren@nvidia.com> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-01-13arm: move gd handling outside of C codeAlbert ARIBAUD
As of gcc 5.2.1 for Thumb-1, it is not possible any more to assign gd from C code, as gd is mapped to r9, and r9 may now be saved in the prolog sequence, and restored in the epilog sequence, of any C functions. Therefore arch_setup_gd(), which is supposed to set r9, may actually have no effect, causing U-Boot to use a bad address to access GD. Fix this by never calling arch_setup_gd() for ARM, and instead setting r9 in arch/arm/lib/crt0.S, to the value returned by board_init_f_alloc_reserve(). Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net> Reviewed-by: Simon Glass <sjg@chromium.org>
2015-12-16Merge git://git.denx.de/u-boot-rockchipTom Rini