Commit Graph

3985 Commits

Author SHA1 Message Date
Steve Rae 9bc34799c8 fastboot: sparse: resync common/image-sparse.c (part 2)
- 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-27 16:37:38 -04:00
Steve Rae cc0f08cd34 fastboot: sparse: resync common/image-sparse.c (part 1)
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-27 16:37:36 -04:00
Steve Rae 64ece84854 fastboot: sparse: remove session-id logic
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-27 16:36:33 -04:00
Marek Vasut 2b1cdafa9f common: Pass the boot device into spl_boot_mode()
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-26 20:17:22 +02:00
Andrej Rosano bd62e2419b common: Fix support for environment file in EXT4
Signed-off-by: Andrej Rosano <andrej@inversepath.com>
2016-06-24 17:24:35 -04:00
Masahiro Yamada f1f9d4fac5 hush: complete renaming CONFIG_SYS_HUSH_PARSER to CONFIG_HUSH_PARSER
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-24 17:24:34 -04:00
Michael Trimarchi 4f1318b29c common: image: minimal android image iminfo support
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-24 17:23:07 -04:00
Masahiro Yamada 41598c8251 autoboot: add CONFIG_AUTOBOOT to allow to not compile autoboot.c
Since commit bb597c0eeb ("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-20 05:19:09 -04:00
Tom Rini 2313d48445 Merge git://git.denx.de/u-boot-nand-flash 2016-06-20 05:15:52 -04:00
Sergey Kubushyn 61717571f2 common: fb_nand: won't compile
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-19 19:15:31 -05:00
Boris Brezillon 80ef700f8d spl: nand: support redundant u-boot image
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-19 19:11:57 -05:00
Petr Kulhavy 9ab165d8b0 SPL ext: cosmetic: correct error message in spl_load_image_ext()
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-19 09:57:48 -04:00
Petr Kulhavy 58c95d5356 SPL: ext: remove redundant ifdef statement
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-17 09:51:00 -04:00
Andreas Dannenberg e17adbb350 common: image-fit: Cleanup spelling mistakes
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-17 09:50:59 -04:00
Tom Rini 5e4e87418e common/Kconfig: Change the default BOOTDELAY to 2
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-17 09:33:45 -04:00
Tom Rini 232d77e723 Merge branch 'master' of git://git.denx.de/u-boot-ubi 2016-06-17 09:33:06 -04:00
Eran Matityahu 1cb075c6c6 splash_source: add support for ubifs formatted nand
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-14 05:33:02 +02:00
Tom Rini f4abfed1de Merge branch 'master' of git://git.denx.de/u-boot-ubi 2016-06-13 08:51:21 -04:00
Tom Rini fd9102dafe Merge branch 'master' of git://git.denx.de/u-boot-atmel 2016-06-13 08:50:58 -04:00
Marcin Niestroj c1f51e0f3e common: env_ubi: Clear environment buffer before reading
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-13 06:41:20 +02:00
Simon Glass b4d956f6bc bootm: Align cache flush end address correctly
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-12 23:49:38 +02:00
Teddy Reed 51c14cd128 verified-boot: Minimal support for booting U-Boot proper from SPL
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-12 13:14:58 -04:00
Heiko Schocher 496c5483e9 bootstage: call show_boot_progress also in SPL
show_boot_progress() is now called from SPL also.

Signed-off-by: Heiko Schocher <hs@denx.de>
2016-06-09 13:53:08 -04:00
Heiko Schocher bb597c0eeb common: bootdelay: move CONFIG_BOOTDELAY into a Kconfig option
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-09 13:53:05 -04:00
Ed Swarthout 69c125fe7b dm: scsi: if_typename should be scsi
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-06 13:39:12 -04:00
Tom Rini ffd859979e Merge branch 'master' of git://git.denx.de/u-boot-usb
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-06 13:37:56 -04:00
Tom Rini 1cb9cb3ec0 Merge branch 'master' of git://www.denx.de/git/u-boot-microblaze 2016-06-06 07:16:39 -04:00
Michal Simek 340b0e3bb6 env: Setup GD_FLG_ENV_DEFAULT flag when default environment are used
Setup flag when default environment are used to be able to
rewrite default distro boot variables based on SoC boot mode.

Signed-off-by: Michal Simek <michal.simek@xilinx.com>
Reviewed-by: Alexander Graf <agraf@suse.de>
2016-06-06 11:23:27 +02:00
Andreas Dannenberg 8aa57a95a2 spl: fit: Fix non-matching DT names console output
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-04 08:50:17 -04:00
Scott Wood b616d9b0a7 nand: Embed mtd_info in struct nand_chip
nand_info[] is now an array of pointers, with the actual mtd_info
instance embedded in struct nand_chip.

This is in preparation for syncing the NAND code with Linux 4.6,
which makes the same change to struct nand_chip.  It's in a separate
commit due to the large amount of changes required to accommodate the
change to nand_info[].

Signed-off-by: Scott Wood <oss@buserror.net>
2016-06-03 20:27:48 -05:00
Scott Wood 151c06ec61 mtd: nand: Remove nand_info_t typedef
This typedef serves no purpose other than causing confusion with
struct nand_chip.

Signed-off-by: Scott Wood <oss@buserror.net>
2016-06-03 20:27:48 -05:00
Masahiro Yamada 0a8cc1a3a4 usb: move CONFIG_USB_XHCI to Kconfig with renaming
Move CONFIG_USB_XHCI to defconfig files for all boards, renaming it
into CONFIG_USB_XHCI_HCD.

As commented in the help of "config USB_XHCI" entry, this has been
a TODO for a long time; now CONFIG_USB_XHCI_HCD and CONFIG_USB_XHCI
have been unified in favor of the former.

Note:
Some boards define CONFIG_USB_XHCI in their headers without
CONFIG_USB, which does not meet the "depends on" in Kconfig.
I added CONFIG_USB=y for those boards when converting.
Otherwise, they would fail to build.

Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com>
2016-06-04 00:43:53 +02:00
Tom Rini edb697cfcc Merge branch 'master' of git://git.denx.de/u-boot-socfpga 2016-06-02 21:42:23 -04:00
Marek Vasut 94b9e22e50 spl: Allow settings malloc_f base address
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-02 21:21:42 -04:00
Marek Vasut 1254667689 spl: Remove bogus GD_FLG_SPL_INIT check
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-01 22:44:14 +02:00
Lokesh Vutla 8b528709c5 spl: fit: Fix load address of fit header
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-06-01 07:12:38 -04:00
Tom Rini e4a94ce4ac Merge git://git.denx.de/u-boot-dm
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-27 20:34:12 -04:00
Lokesh Vutla fa715193c0 spl: Add an option to load a FIT containing U-Boot from UART
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-27 15:47:42 -04:00
Lokesh Vutla cfe32a4be2 spl: fit: Do not print selected dtb during fit load
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-27 15:47:42 -04:00
Lokesh Vutla 8bd8877279 spl: Support loading a FIT from NAND
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-27 15:47:14 -04:00
Lokesh Vutla 97ca364faf spl: Support loading a FIT from FAT FS
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-27 15:41:40 -04:00
Lokesh Vutla eafd5410af spl: Allow to load a FIT containing U-Boot from FS
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-27 15:41:39 -04:00
Lokesh Vutla 4d9d34a7f2 spl: fit: Fix the number of bytes read when reading fdt from fit
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-27 15:41:39 -04:00
Simon Glass 9be2e790eb Drop use of CONFIG_SYS_GENERIC_BOARD in U-Boot
This option is always enabled and is about to be removed. Drop references
to it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Andreas Bießmann <andreas@biessmann.org>
2016-05-27 15:39:54 -04:00
Simon Glass b0b359536e board_f: Don't require CONFIG_SYS_MONITOR_BASE
Allow this to be unset, such that gd->mon_len is invalid. This seems to be
what the sh architecture does.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-27 15:39:51 -04:00
Lukasz Majewski 851bda8148 cosmetic: debug: Replace #ifdef DEBUG with debug() macro
Replace #ifdef DEBUG with dedicated debug() macro.

Signed-off-by: Lukasz Majewski <l.majewski@majess.pl>
2016-05-27 15:39:48 -04:00
Simon Glass ef5609c33f dm: mmc: spl: Add support for CONFIG_BLK
Allow driver model to be used for block devices in SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-27 10:23:09 -06:00
Simon Glass 5461acba44 dm: env: mmc: Convert env_mmc to support CONFIG_BLK
Update the MMC environment code so that it works with driver-model enabled
for block devices.

Signed-off-by: Simon Glass <sjg@chromium.org>
2016-05-27 10:23:08 -06:00
Michal Simek 90a7417602 SPL: FIT: Align loading address for header
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-27 09:56:20 -04:00
Paul Burton 49717b18be fdt: Document the rest of struct of_bus
Provide some documentation for the fields of struct of_bus, for
consistency with that provided for the new match field.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
2016-05-25 23:13:38 +02:00