fdt: Add a function to count strings

Given a device tree node and a property name, the fdt_count_strings()
function counts the number of strings found in the property value.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
fdt: Add a function to get the index of a string

Given a device tree node and a property name, the new fdt_find_string()
function will look up a given string in the string list contained in the
property's value and return its index.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
fdt: Add functions to retrieve strings

Given a device tree node, a property name and an index, the new function
fdt_get_string_index() will return in an output argument a pointer to
the index'th string in the property's value.

The fdt_get_string() is a shortcut for the above with the index being 0.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
fdt: Add resource parsing functions

Add the fdt_get_resource() and fdt_get_named_resource() functions which
can be used to parse resources (memory regions) from an FDT. A helper to
compute the size of a region is also provided.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
fdt: Add a function to return PCI BDF triplet

The fdtdec_pci_get_bdf() function returns the bus, device, function
triplet of a PCI device by parsing the "reg" property according to the
PCI device tree binding.

Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
fdt: Add a subnodes iterator macro

The fdt_for_each_subnode() iterator macro provided by this patch can be
used to iterate over a device tree node's subnodes. At each iteration a
loop variable will be set to the next subnode.

Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
x86: config: Enable dhcp on link

The dhcp option is required to get bootp to work on the Chromebook Pixel,
so enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>
x86: Add device tree information for Chrome OS EC

Add the required node describing how to find the EC on link.

Signed-off-by: Simon Glass <sjg@chromium.org>
x86: dts: Add device tree compatible string for Intel IPC

Add this to the table so that it can be recognised.

Signed-off-by: Simon Glass <sjg@chromium.org>
x86: cros_ec: Update LPC driver for new cros_ec header

There was a minor rename of one of the defines, so update the driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
x86: cros_ec: Enable cros_ec for link

Add defines to enable the Chrome OS EC interface and set it up on init.

Signed-off-by: Simon Glass <sjg@chromium.org>
doc: Remove note about auto-complete not working with hush

It does seem to work (tested on link), so update the docs.

Signed-off-by: Simon Glass <sjg@chromium.org>
x86: link: Tidy up the command lines options

We may as well use hush. The auto-complete option was incorrect so this was
not enabled. Also expand the command line size a little and go back to the
default prompt since "boot>" doesn't seem any more useful.

Signed-off-by: Simon Glass <sjg@chromium.org>
x86: config: link: Display the board model on the screen

To get a display in U-Boot on link you must either build a coreboot that
always sets it up, or use Esc-Refresh-Power to reset the machine.

When we do have a display, it is nice to display the model at the top, so
enable this option.

Signed-off-by: Simon Glass <sjg@chromium.org>
x86: Enable FIT, ELF on coreboot

Enable FIT support and the bootelf command. Also change the default load
address to somewhere other than the normal load address of the kernel,
to allow for decompression without overwriting the original file.

Signed-off-by: Simon Glass <sjg@chromium.org>
net: Display the size when tftpboot finishes

If we know the file size, display it after loading the file.

Signed-off-by: Simon Glass <sjg@chromium.org>
Merge git://git.denx.de/u-boot-fdt
Merge git://git.denx.de/u-boot-x86
arm: kirkwood: Move some SoC files into new arch/arm/mvebu-common

By moving some kirkwood files into a Marvell common directory, those files
can be used by other Marvell platforms as well. The name mvebu is taken
from the Linux kernel source tree. It has been chosen there to represent
the SoC's from the Marvell EBU (Engineering Business Unit). Those SoC's
currently are:

Armada 370/375/XP, Dove, mv78xx0, Kirkwood, Orion5x

This will be used by the upcoming Armada XP (MV78460) platform support.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Luka Perkov <luka@openwrt.org>
Acked-by: Prafulla Wadaskar <prafulla@marvell.com>
arm: marvell: Move arch/kirkwood.h to arch/soc.h

This move makes is possible to use this header not only from kirkwood
platforms but from all Marvell mvebu platforms.

Signed-off-by: Stefan Roese <sr@denx.de>
Tested-by: Luka Perkov <luka@openwrt.org>
Acked-by: Prafulla Wadaskar <prafulla@marvell.com>