summaryrefslogtreecommitdiff
path: root/common
AgeCommit message (Collapse)Author
2016-07-15dm: 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-15spl: 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-14board_f: prevent misleading "Watchdog enabled" outputAnatolij Gustschin
Output the "Watchdog enabled" message only if hw_watchdog_init() call really happened. Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-07-14board_f: init designware watchdog if CONFIG_DESIGNWARE_WATCHDOG=yAnatolij Gustschin
The designware watchdog init is skipped even if CONFIG_DESIGNWARE_WATCHDOG is enabled. Fix it. Signed-off-by: Anatolij Gustschin <agust@denx.de>
2016-07-14bootm: fixup silent Linux out of BOOTM_STATE_LOADOS stateHector Palacios
The function fixup_silent_linux() is called in status BOOTM_STATE_LOADOS to silence Linux if variable 'silent' is set. Currently only the 'bootm' command state machine contains BOOTM_STATE_LOADOS, but others like 'booti' or 'bootz' commands do not. This means silent Linux does not work with these commands. This patch moves the fixup_silent_linux() call out of the BOOTM_STATE_LOADOS state and into BOOTM_STATE_OS_PREP, to silence Linux independently of the used command (booti, bootm or bootz). Signed-off-by: Hector Palacios <hector.palacios@digi.com>
2016-07-14sandbox: Don't exit when bootm completesSimon Glass
At present sandbox exits when the 'bootm' command completes, since it is not actually able to run the OS that is loaded. Normally 'bootm' failure is considered a fatal error in U-Boot. However this is annoying for tests, which may want to examine the state after a test is complete. In any case there is a 'reset' command which can be used to exit, if required. Change the behaviour to return normally from the 'bootm' command on sandbox. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Teddy Reed <teddy.reed@gmail.com>
2016-07-14image: Add functions to obtain category informationSimon Glass
Add generic functions which can look up information about a category: - the number of items in the category - the category description - an item long time - an item short time Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-07-14image: Add a name for invalid typesSimon Glass
At present the name is NULL, which prevents qsort() fromp being used. Use the name "invalid" instead. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
2016-07-14image: Create a table of information for each categorySimon Glass
Add a table that contains the category name, the number of items in each category and a pointer to the table of items. This will allow us to use generic code to deal with the categories. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@konsulko.com>
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-11Merge branch 'master' of git://git.denx.de/u-boot-spiTom Rini
2016-07-11common: block: fix compiler error with CONFIG_FASTBOOT_FLASH_MMC_DEVXu Ziyuan
This fixes the following compiler error: common/fb_mmc.c: In function ‘fb_mmc_erase’: common/fb_mmc.c:209:17: error: ‘struct blk_desc’ has no member named ‘block_erase’ Signed-off-by: Ziyuan Xu <xzy.xu@rock-chips.com> Acked-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-07-09dm: spi: Read default speed and mode values from DTVignesh R
In case of DT boot, don't read default speed and mode for SPI from CONFIG_*, instead read from DT node. This will make sure that boards with multiple SPI/QSPI controllers can be probed at different bus frequencies and SPI modes. Signed-off-by: Vignesh R <vigneshr@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Mugunthan V N <mugunthanvnm@ti.com> Reviewed-by: Jagan Teki <jteki@openedev.com>
2016-07-01autoboot: move bootdelay >= 0 check to abortboot()Masahiro Yamada
Move the bootdelay >= 0 check to the caller, which simplifies the callees. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-01autoboot: move CONFIG_SILENT_CONSOLE handlingMasahiro Yamada
Factor out the same code from the callees to the caller. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-01autoboot: rename abortboot_{keyed, normal} to __abortbootMasahiro Yamada
Because abortboot_keyed() and abortboot_normal() are not compiled at the same time, we can rename both of them to __abortboot(). This allows to drop #ifdef from the caller. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Stefan Roese <sr@denx.de> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-07-01autoboot: remove CONFIG_ZERO_BOOTDELAY_CHECKMasahiro Yamada
As the help message of CONFIG_BOOTDELAY says, CONFIG_BOOTDELAY=-2 means the autoboot with no delay, with no abort check even if CONFIG_ZERO_BOOTDELAY_CHECK is defined. To sum up, the autoboot behaves as follows: [1] CONFIG_BOOTDELAY=0 && CONFIG_ZERO_BOOTDELAY_CHECK=y autoboot with no delay, but you can abort it by key input [2] CONFIG_BOOTDELAY=0 && CONFIG_ZERO_BOOTDELAY_CHECK=n autoboot with no delay, with no check for abort [3] CONFIG_BOOTDELAY=-1 disable autoboot [4] CONFIG_BOOTDELAY=-2 autoboot with no delay, with no check for abort As you notice, [2] and [4] come to the same result, which means we do not need CONFIG_ZERO_BOOTDELAY_CHECK. We can control all the cases only by CONFIG_BOOTDELAY, like this: [1] CONFIG_BOOTDELAY=0 autoboot with no delay, but you can abort it by key input [2] CONFIG_BOOTDELAY=-1 disable autoboot [3] CONFIG_BOOTDELAY=-2 autoboot with no delay, with no check for abort This commit converts the logic as follow: CONFIG_BOOTDELAY=0 && CONFIG_ZERO_BOOTDELAY_CHECK=n --> CONFIG_BOOTDELAY=-2 Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Stefan Roese <sr@denx.de> Acked-by: Igor Grinberg <grinberg@compulab.co.il> Reviewed-by: Simon Glass <sjg@chromium.org> Acked-by: Vladimir Zapolskiy <vz@mleia.com> Reviewed-by: Heiko Schocher <hs@denx.de> Acked-by: Christian Riesch <christian.riesch@omicronenergy.com> Acked-by: Hannes Schmelzer <hannes.schmelzer@br-automation.com>
2016-07-01doc: bootdelay: drop explanation about CONFIG_BOOTDELAY from READMEMasahiro Yamada
The same information now exists in common/Kconfig. Do not duplicate documentation from the point of view of maintainability. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de>
2016-06-28common: add new boot media kconfig entryPeng Fan
Add CONFIG_{SD|NAND|ONENAND|SPI|QSPI|SATA}_BOOT kconfig entries. SoCs supports loading U-Boot from different medias to DRAM, such as i.MX6/7 supports loading U-Boot to DRAM from sd/emmc/nand/qspi/spi/sata and etc. For i.MX, imximage will generate different IVT headers according to boot medias. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heiko Schocher <hs@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Christophe Ricard <christophe-h.ricard@st.com> Cc: Nikita Kiryanov <nikita@compulab.co.il> Cc: Francois Retief <fgretief@spaceteq.co.za> Cc: Tom Rini <trini@konsulko.com>
2016-06-28Kconfig: make NOR_BOOT a common optionPeng Fan
Not only am335x supports booting from NOR, i.MX6 SoCs also supports booting from NOR. Make NOR_BOOT a common option to let different SoCs share it. Signed-off-by: Peng Fan <peng.fan@nxp.com> Cc: Simon Glass <sjg@chromium.org> Cc: Heiko Schocher <hs@denx.de> Cc: Joe Hershberger <joe.hershberger@ni.com> Cc: Christophe Ricard <christophe-h.ricard@st.com> Cc: Bin Meng <bmeng.cn@gmail.com> Cc: Francois Retief <fgretief@spaceteq.co.za> Cc: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-06-27fastboot: sparse: improve CHUNK_TYPE_FILL write performanceSteve Rae
- increase the size of the fill buffer - testing has shown a 10x improvement when the sparse image has large CHUNK_TYPE_FILL chunks Signed-off-by: Steve Rae <srae@broadcom.com>
2016-06-27fastboot: sparse: implement reserve()Steve Rae
In order to process the CHUNK_TYPE_DONT_CARE properly, there is a requirement to be able to 'reserve' a specified number of blocks in the storage media. Because of the special handling of "bad blocks" in NAND devices, this is implemented in a storage abstraction function. Signed-off-by: Steve Rae <srae@broadcom.com> Reviewed-by: Maxime Ripard <maxime.ripard@free-electrons.com>
2016-06-27fastboot: sparse: resync common/image-sparse.c (part 2)Steve Rae
- update fastboot_okay() and fastboot_fail() This file originally came from upstream code. While retaining the storage abstraction feature, this is the second set of the changes required to resync with the cmd_flash_mmc_sparse_img() in the file aboot.c from https://us.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=LE.BR.1.2.1 Signed-off-by: Steve Rae <srae@broadcom.com>
2016-06-27fastboot: sparse: resync common/image-sparse.c (part 1)Steve Rae
This file originally came from upstream code. While retaining the storage abstraction feature, this is the first set of the changes required to resync with the cmd_flash_mmc_sparse_img() in the file aboot.c from https://us.codeaurora.org/cgit/quic/la/kernel/lk/plain/app/aboot/aboot.c?h=LE.BR.1.2.1 Signed-off-by: Steve Rae <srae@broadcom.com>
2016-06-27fastboot: sparse: remove session-id logicSteve Rae
This "session-id" alogrithm is not required, and currently corrupts the stored image whenever more the one "session" is required. Signed-off-by: Steve Rae <srae@broadcom.com>
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-24common: Fix support for environment file in EXT4Andrej Rosano
Signed-off-by: Andrej Rosano <andrej@inversepath.com>
2016-06-24hush: complete renaming CONFIG_SYS_HUSH_PARSER to CONFIG_HUSH_PARSERMasahiro Yamada
There is no more define of CONFIG_SYS_HUSH_PARSER. Rename some remaining references and drop the backward compatible Kconfig entry. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-06-24common: image: minimal android image iminfo supportMichael Trimarchi
We already support iminfo for other images. The idea of this patch is start to have a minimal support for android image format. We still need to print id[] array Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-06-20autoboot: add CONFIG_AUTOBOOT to allow to not compile autoboot.cMasahiro Yamada
Since commit bb597c0eeb7e ("common: bootdelay: move CONFIG_BOOTDELAY into a Kconfig option"), CONFIG_BOOTDELAY is defined for all boards. Prior to that commit, it was allowed to unset CONFIG_BOOTDELAY to not compile common/autoboot.c, as described in common/Makefile: # This option is not just y/n - it can have a numeric value ifdef CONFIG_BOOTDELAY obj-y += autoboot.o endif It was a bit odd to enable/disable code with an integer type option, but it was how this option worked before that commit, and several boards actually unset it to opt out of the autoboot feature. This commit adds a new bool option, CONFIG_AUTOBOOT, and makes CONFIG_BOOTDELAY depend on it. I chose "default y" for this option because most boards use the autoboot. I added "# CONFIG_AUTOBOOT is not set" for the boards that had not set CONFIG_BOOTDELAY prior to the bad commit. Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-06-20Merge git://git.denx.de/u-boot-nand-flashTom Rini
2016-06-20common: fb_nand: won't compileSergey Kubushyn
Somehow this got overlooked when getting rid of nand_info. Small patch, won't affect anything else, no reason to wait for the next cycle. Signed-off-by: Sergey Kubushyn <ksi@koi8.net>
2016-06-20spl: 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-17common: image-fit: Cleanup spelling mistakesAndreas Dannenberg
The comments in the source file are riddled with spelling mistakes. Be a good citizen and take a stab at cleaning up some of the more obvious ones. Signed-off-by: Andreas Dannenberg <dannenberg@ti.com> Reviewed-by: Simon Glass <sjg@chromium.org>
2016-06-17common/Kconfig: Change the default BOOTDELAY to 2Tom Rini
The value of 0 is fairly uncommon while 2 is one of the more common ones so switch. Signed-off-by: Tom Rini <trini@konsulko.com>
2016-06-17Merge branch 'master' of git://git.denx.de/u-boot-ubiTom Rini
2016-06-14splash_source: add support for ubifs formatted nandEran Matityahu
Add support for loading splash image from NAND Flash formatted with a (UBI) filesystem. Signed-off-by: Eran Matityahu <eran.m@variscite.com> Cc: Heiko Schocher <hs@denx.de> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Cc: Nikita Kiryanov <nikita@compulab.co.il> Cc: Stefano Babic <sbabic@denx.de> Acked-by: Nikita Kiryanov <nikita@compulab.co.il>
2016-06-13Merge branch 'master' of git://git.denx.de/u-boot-ubiTom Rini
2016-06-13Merge branch 'master' of git://git.denx.de/u-boot-atmelTom Rini
2016-06-13common: env_ubi: Clear environment buffer before readingMarcin Niestroj
In case we have restarted u-boot there is a chance that environment buffer contains old environment (from the previous boot). If UBI volume is zero size, ubi_volume_read() doesn't modify the buffer and exits successfully. We need to clear buffer manually before reading it from UBI, so the invalid CRC will cause setting default environment in case that the UBI volume is zero size. Signed-off-by: Marcin Niestroj <m.niestroj@grinn-global.com>
2016-06-12bootm: Align cache flush end address correctlySimon Glass
Flushing part of the cache should be done on cache boundaries. Trying to flush part of a cache line is not supported and the request may be ignored or print warnings. Adjust the bootm code to align the end address to prevent this problem. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de> Tested-on: smartweb, corvus, taurus, axm Tested-by: Heiko Schocher <hs@denx.de> Reviewed-by: Joe Hershberger <joe.hershberger@ni.com> Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
2016-06-12verified-boot: Minimal support for booting U-Boot proper from SPLTeddy Reed
This allows a board to configure verified boot within the SPL using a FIT or FIT with external data. It also allows the SPL to perform signature verification without needing relocation. The board configuration will need to add the following feature defines: CONFIG_SPL_CRYPTO_SUPPORT CONFIG_SPL_HASH_SUPPORT CONFIG_SPL_SHA256 In this example, SHA256 is the only selected hashing algorithm. And the following booleans: CONFIG_SPL=y CONFIG_SPL_DM=y CONFIG_SPL_LOAD_FIT=y CONFIG_SPL_FIT=y CONFIG_SPL_OF_CONTROL=y CONFIG_SPL_OF_LIBFDT=y CONFIG_SPL_FIT_SIGNATURE=y Signed-off-by: Teddy Reed <teddy.reed@gmail.com> Acked-by: Simon Glass <sjg@chromium.org> Acked-by: Andreas Dannenberg <dannenberg@ti.com> Acked-by: Sumit Garg <sumit.garg@nxp.com>
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-09common: bootdelay: move CONFIG_BOOTDELAY into a Kconfig optionHeiko Schocher
move CONFIG_BOOTDELAY into a Kconfig option. Used for this purpose the moveconfig.py tool in tools. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Tom Rini <trini@konsulko.com> Acked-by: Viresh Kumar <viresh.kumar@linaro.org> Acked-by: Igor Grinberg <grinberg@compulab.co.il>
2016-06-06dm: scsi: if_typename should be scsiEd Swarthout
Fixes: => ext2ls scsi 0:1 ** Bad device scsi 0:1 ** for boards which use the scsi legacy driver (such as ls1043ardb). Signed-off-by: Ed Swarthout <Ed.Swarthout@nxp.com> Tested-by: George McCollister <george.mccollister@gmail.com> Acked-by: Simon Glass <sjg@chromium.org>
2016-06-06Merge branch 'master' of git://git.denx.de/u-boot-usbTom Rini
Modified: configs/ls1012afrdm_qspi_defconfig configs/ls1012aqds_qspi_defconfig configs/ls1012ardb_qspi_defconfig include/configs/ls1012afrdm.h include/configs/ls1012aqds.h include/configs/ls1012ardb.h Signed-off-by: Tom Rini <trini@konsulko.com>
2016-06-06Merge branch 'master' of git://www.denx.de/git/u-boot-microblazeTom Rini