arm: fdt_control: fix a build error with CONFIG_OF_EMBED=y

The build fails if a non-generic ARM board is compiled
with CONFIG_OF_EMBED=y.

The correct symbol name for embedded FDT is not __dtb_db_begin,
but __dtb_dt_begin. (A typo introduced by commit 6ab6b2af)

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
kbuild: remove unused RANLIB

RANLIB was added by commit e221174 (more than a decade ago)
but it has been never referenced at all.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
kbuild: add missing PERL definition

"checkstack" target uses $(PERL) so PERL must be defined.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
boards.cfg: fix a configuration error of ep8248 board again

"make ep8248_config" fails with an error like this:

    $ make ep8248_config
    make: *** [ep8248_config] Error 1

Its cause is that there are two entries for "ep8248".

The first is around line 661 of boards.cfg. (as Active)
The second appears around line 1242. (as Orphan)

This bug was originally introduced by commit e7e90901
and I fixed it by commit 8ad5d45e.
(Refer to git-log of commit 8ad5d45e)

But this bug was re-introduced by commit 05d134b0 because
the custodian made a mistake when he resolved a merge conflict.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Albert ARIBAUD <albert.u.boot@aribaud.net>
Cc: Heiko Schocher <hs@denx.de>
Cc: Kim Phillips <kim.phillips@linaro.org>
Add final result tests for run_command_list()

run_command_list() is supposed to return a return code of 0 for success
and 1 for failure. Add a few simple tests that confirm this. These tests
work both with the built-in parser and hush.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fix itest mask overflow

The mask value used in itest overflows and therefore it can return an
incorrect result for something like 'itest 0 == 1'. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Fix hush to give the correct return code for a simple command

When a simple command like 'false' is provided, hush should return the
result of that command. However, hush only does this if the
FLAG_EXIT_FROM_LOOP flag is provided. Without this flag, hush will
happily execute the empty string command immediate after 'false' and
then return a success code.

This behaviour does not seem very useful, and requiring the flag also
seems wrong, since it means that hush will execute only the first command
in a sequence.

Add a check for empty string and fall out of the loop in that case. That
at least fixes the simple command case. This is a change in behaviour but
it is unlikely that the old behaviour would be considered correct in any
case.

Reported-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
Signed-off-by: Simon Glass <sjg@chromium.org>
Correct return code from builtin_run_command_list()

The return code is not consistent with cli_simple_run_command_list(). For the
last command in a sequence, the return code is actually inverted.

Fix it.
Signed-off-by: Simon Glass <sjg@chromium.org>
mkimage : Split out and clean pbl_crc32 for use by other image types

The crc32 used by pblimgae is NOT the same as zlib crc32.

The pbl_crc32 is useful for other purposes in mkimage so split it out.

While we are about it, clean up redundant and confusing code.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
tools: Refactor mxsimage to use pbl_crc32

Both pblimage and mxsimage use the same crc algorithm, so refactor.

Signed-off-by: Charles Manning <cdhmanning@gmail.com>
Prevent a stack overflow in fit_check_sign

It is trivial to crash fit_check_sign by invoking with an
absolute path in a deeply nested directory.  This is exposed
by vboot_test.sh.

Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com>
Acked-by: Simon Glass <sjg@chromium.org>
phy: fix create_phy_by_mask for when its given an actual search mask

get_phy_id returns -EIO when it can't read from a phy at a given addr.  This would cause
create_phy_by_mask to return prematurely before it had tested the other addresses in the provided mask.

Example usage:
Replace
    phydev = phy_connect(bus, phy_addr, dev, phy_if)
with
    phydev = phy_find_by_mask(bus, phy_mask, phy_if)
    if (phydev)
	phy_connect_dev(phydev, dev);

Signed-off-by: Cormier, Jonathan <jcormier@criticallink.com>
Cc: Joe Hershberger <joe.hershberger@gmail.com>
openrisc: update SPR registers definition

The OpenRISC architecture specification v1.0 defines
new SPR registers. This patch adds registers definition
for group 0 and update bit definitions for the CPU
configuration register.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
openrisc: fix relocation code

The relocation code can now relocate from anywhere to
the RAM.

The old code assumed that the binary was copied to the RAM
by some PBL and then it just relocated the .text section
from the loaded address to the linked address.

Now, it first checks if vectors are somewhere else than the
linked address. If yes, there are copied to address 0 (or
to the exception vector base address if register EVBAR is
present).

Then, the .text section is relocated from its current location
to the RAM.

Signed-off-by: Franck Jullien <franck.jullien@gmail.com>
fat: Define MAX_CLUSTSIZE using CONFIG_FS_FAT_MAX_CLUSTSIZE

Define the MAX_CLUSTSIZE to default of 65536 only if
CONFIG_FS_FAT_MAX_CLUSTSIZE is not defined.
This option has been provided to save memory in some
memory constrained cases.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Acked-by: Michal Simek <monstr@monstr.eu>
env_eeprom: Assign default environment during board_init_f

Assign default environment and set env valid during board_init_f
before relocation as the actual environment will be read from eeprom
later.

Signed-off-by: Siva Durga Prasad Paladugu <sivadur@xilinx.com>
Acked-by: Michal Simek <monstr@monstr.eu>
disk: part_efi: resolve endianness issues

Tested on little endian ARMv7 and ARMv8 configurations

Signed-off-by: Steve Rae <srae@broadcom.com>
disk: part_efi: clarify lbaint_t usage

- update the comments regarding lbaint_t usage
- cleanup casting of values related to the lbaint_t type
- cleanup of a type that requires a u64

Tested on little endian ARMv7 and ARMv8 configurations

Signed-off-by: Steve Rae <srae@broadcom.com>
disk: part_efi: add get_partition_info_efi_by_name()

Add function to find a GPT table entry by name.

Tested on little endian ARMv7 and ARMv8 configurations

Signed-off-by: Steve Rae <srae@broadcom.com>
FDT: Fix DTC repository references

The Device Tree Compiler (DTC) used to have its master
repository located on jdl.com.  While it is still there,
its official, new, shiny location is on kernel.org here:

    git://git.kernel.org/pub/scm/utils/dtc/dtc.git

Update a few references to point there instead.

Signed-off-by: Jon Loeliger <jdl@jdl.com>
Acked-by: Simon Glass <sjg@chromium.org>