summaryrefslogtreecommitdiffstats
path: root/common/spl/spl_nand.c
Commit message (Collapse)AuthorAgeFilesLines
* spl: nand: support redundant u-boot imageBoris Brezillon2016-06-191-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>
* spl: Support loading a FIT from NANDLokesh Vutla2016-05-271-5/+32
| | | | | | | | | | | 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>
* SPL: Let spl_parse_image_header() return valueMarek Vasut2016-05-171-2/+7
| | | | | | | | | | | 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>
* Common: SPL: spl_nand: Fixed debug correct NAND ECC type.Ahmed Samir Khalil2016-04-011-0/+4
| | | | | | | | | | 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>
* spl: change return values of spl_*_load_image()Nikita Kiryanov2015-11-181-6/+12
| | | | | | | | | | | | | | | | | | | | | | | Make spl_*_load_image() functions return a value instead of hanging if a problem is encountered. This enables main spl code to make the decision whether to hang or not, thus preparing it to support alternative boot devices. Some boot devices (namely nand and spi) do not hang on error. Instead, they return normally and SPL proceeds to boot the contents of the load address. This is considered a bug and is rectified by hanging on error for these devices as well. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Igor Grinberg <grinberg@compulab.co.il> Cc: Tom Rini <trini@konsulko.com> Cc: Simon Glass <sjg@chromium.org> Cc: Ian Campbell <ijc@hellion.org.uk> Cc: Hans De Goede <hdegoede@redhat.com> Cc: Albert Aribaud <albert.u.boot@aribaud.net> Cc: Jagan Teki <jteki@openedev.com> Reviewed-by: Tom Rini <trini@konsulko.com> Reviewed-by: Simon Glass <sjg@chromium.org>
* spl: nand: remove code duplicationNikita Kiryanov2015-11-181-15/+16
| | | | | | | | | | | | | | | Remove code duplication in spl_nand_load_image(). No functional changes. Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il> Cc: Scott Wood <scottwood@freescale.com> Cc: Igor Grinberg <grinberg@compulab.co.il> Acked-by: Scott Wood <scottwood@freescale.com> Reviewed-by: Simon Glass <sjg@chromium.org> Reviewed-by: Heiko Schocher <hs@denx.de> [trini: Add back cast to unsigned long of spl_image.load_addr] Signed-off-by: Tom Rini <trini@konsulko.com>
* armv8/ls2085aqds: NAND boot supportScott Wood2015-04-231-1/+1
| | | | | | | | | This adds NAND boot support for LS2085AQDS, using SPL framework. Details of forming NAND image can be found in README. Signed-off-by: Scott Wood <scottwood@freescale.com> [York Sun: Remove +S from defconfig after commit 252ed872] Signed-off-by: York Sun <yorksun@freescale.com>
* spl, nand: add option to boot raw u-boot.bin image onlyHeiko Schocher2014-11-171-0/+13
| | | | | | | | | | | enable to boot only a raw u-boot.bin image from nand with the CONFIG_SPL_NAND_RAW_ONLY define. This option saves space on boards where spl space is low. Signed-off-by: Heiko Schocher <hs@denx.de> Reviewed-by: Andreas Bießmann <andreas.devel@googlemail.com> Reviewed-by: Bo Shen <voice.shen@atmel.com> Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
* spl: nand: read only in the size of image_header on the first accessMasahiro Yamada2014-07-221-3/+3
| | | | | | | | | | | For the same reason as in commit 50c8d66d, all the remaining CONFIG_SYS_NAND_PAGE_SIZE in common/spl/spl_nand.c can be replaced with sizeof(*header). Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Cc: Tim Harvey <tharvey@gateworks.com> Cc: Scott Wood <scottwood@freescale.com> Cc: Stefano Babic <sbabic@denx.de>
* nand: remove CONFIG_SYS_NAND_PAGE_SIZETim Harvey2014-05-151-1/+1
| | | | | | | | | | We only need to read in the size of struct image_header and thus don't need to know the page size of the nand device. Cc: Scott Wood <scottwood@freescale.com> Signed-off-by: Tim Harvey <tharvey@gateworks.com> Acked-by: Stefano Babic <sbabic@denx.de> Acked-by: Scott Wood <scottwood@freescale.com>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-241-17/+1
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* SPL: NAND: Move arch/arm/cpu/armv7/omap-common/spl_nand.c to common/splTom Rini2012-09-271-0/+100
We move the spl_nand_load_image function to common/spl. This will allow for easier integration of SPL-boots-Linux code on other arches. Signed-off-by: Tom Rini <trini@ti.com>
OpenPOWER on IntegriCloud