platform/kernel/u-boot.git
9 years agoRevert "hush: fix segfault on syntax error"
Rabin Vincent [Fri, 21 Nov 2014 22:05:22 +0000 (23:05 +0100)]
Revert "hush: fix segfault on syntax error"

128059b92 ("hush: fix segfault on syntax error") attempted to fix a
segfault on syntax errors, but it broke Ctrl-C handling, and the
assumption that it made, that rcode could not be -1, is incorrect.
Revert this change.

Reported-by: Stephen Warren <swarren@wwwdotorg.org>
Reported-by: Przemyslaw Marczak <p.marczak@samsung.com>
Signed-off-by: Rabin Vincent <rabin@rab.in>
9 years agoMerge branch 'master' of git://www.denx.de/git/u-boot-imx
Tom Rini [Mon, 24 Nov 2014 17:02:12 +0000 (12:02 -0500)]
Merge branch 'master' of git://denx.de/git/u-boot-imx

9 years agoMerge git://git.denx.de/u-boot-dm
Tom Rini [Mon, 24 Nov 2014 17:01:48 +0000 (12:01 -0500)]
Merge git://git.denx.de/u-boot-dm

Conflicts:
drivers/serial/serial-uclass.c

Signed-off-by: Tom Rini <trini@ti.com>
9 years agoMerge git://git.denx.de/u-boot-x86
Tom Rini [Mon, 24 Nov 2014 17:00:00 +0000 (12:00 -0500)]
Merge git://git.denx.de/u-boot-x86

Conflicts:
arch/x86/cpu/Makefile

Signed-off-by: Tom Rini <trini@ti.com>
9 years agomx6boards: Fix error handling in board_mmc_init()
Fabio Estevam [Fri, 21 Nov 2014 18:42:58 +0000 (16:42 -0200)]
mx6boards: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Cc: Eric Benard <eric@eukrea.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agonitrogen6x: Fix error handling in board_mmc_init()
Fabio Estevam [Fri, 21 Nov 2014 18:42:57 +0000 (16:42 -0200)]
nitrogen6x: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Cc: Eric Nelson <eric.nelson@boundarydevices.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agoot1200: Fix error handling in board_mmc_init()
Fabio Estevam [Fri, 21 Nov 2014 18:42:56 +0000 (16:42 -0200)]
ot1200: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Cc: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agoarm: imx: stop sata on boot
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:26 +0000 (12:47 +0200)]
arm: imx: stop sata on boot

Ideally, the Linux kernel should get the hardware in its most
untouched state. For the most part, U-Boot does not reset the various
subsystems it touches before boot, and usually Linux deals with it, but
on some boards (cm_fx6) the Linux kernel fails to detect the ssd
correctly if sata is used by U-Boot.

Power off sata on OS boot so that Linux will have a clean state to work
with.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
9 years agoarm: mx6: cm_fx6: implement board specific sata stop
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:25 +0000 (12:47 +0200)]
arm: mx6: cm_fx6: implement board specific sata stop

Provide board specific implementation for sata stop command for
cm_fx6.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
9 years agocmd_sata: implement sata stop command
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:24 +0000 (12:47 +0200)]
cmd_sata: implement sata stop command

Implement sata stop command.
This introduces the __sata_stop() weak function, which mirrors
the weak __sata_initialize() function, giving users the option of
undoing the custom steps performed in overrides of sata_initialize().

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Marek Vasut <marex@denx.de>
Cc: Tom Rini <trini@ti.com>
9 years agosata: implement reset_sata for dwc_ahsata
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:23 +0000 (12:47 +0200)]
sata: implement reset_sata for dwc_ahsata

Add reset_sata() to the sata driver interface and implement it
for dwc_ahsata. This function cleans up after sata_init(), and
therefore accepts a device number like sata_init() does.
A dummy implementation is provided for the rest of the drivers.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Simon Glass <sjg@chromium.org>
Cc: Stefano Babic <sbabic@denx.de>
9 years agoarm: mx6: introduce disable_sata_clock
Nikita Kiryanov [Fri, 21 Nov 2014 10:47:22 +0000 (12:47 +0200)]
arm: mx6: introduce disable_sata_clock

Implement disable_sata_clock for mx6 SoCs.

Signed-off-by: Nikita Kiryanov <nikita@compulab.co.il>
Cc: Stefano Babic <sbabic@denx.de>
9 years agogw_ventana: Use the generic spl_sd.cfg
Fabio Estevam [Thu, 20 Nov 2014 15:17:56 +0000 (13:17 -0200)]
gw_ventana: Use the generic spl_sd.cfg

gw_ventana can boot from SPI or NAND and both of these interfaces boot from
the same 0x400 offset.

This means that we could simplify the code and replace the custom gw_ventana.cfg
with the generic spl_sd.cfg, as it provides the same boot offset of 0x400.

Cc: Tim Harvey <tharvey@gateworks.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agosandbox: script for testing sandbox/ext4/fat/fs commands
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:39 +0000 (14:39 -0800)]
sandbox: script for testing sandbox/ext4/fat/fs commands

Test size/read/write commands in a sandbox environment.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agofs: API changes enabling extra parameter to return size of type loff_t
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:38 +0000 (14:39 -0800)]
fs: API changes enabling extra parameter to return size of type loff_t

The sandbox/ext4/fat/generic fs commands do not gracefully deal with files
greater than 2GB. Negative values are returned in such cases.

To handle this, the fs functions have been modified to take an additional
parameter of type "* loff_t" which is then populated. The return value
of the fs functions are used only for error conditions.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Update board/gdsys/p1022/controlcenterd-id.c,
drivers/fpga/zynqpl.c for changes]
Signed-off-by: Tom Rini <trini@ti.com>
9 years agosandbox: Prepare API change for files greater than 2GB
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:37 +0000 (14:39 -0800)]
sandbox: Prepare API change for files greater than 2GB

Change the internal sandbox functions to use loff_t for file offsets.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agoext4: Prepare API change for files greater than 2GB
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:36 +0000 (14:39 -0800)]
ext4: Prepare API change for files greater than 2GB

Change the internal EXT4 functions to use loff_t for offsets.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Update common/spl/spl_ext.c]
Signed-off-by: Tom Rini <trini@ti.com>
9 years agofat: Prepare API change for files greater than 2GB
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:35 +0000 (14:39 -0800)]
fat: Prepare API change for files greater than 2GB

Change the internal FAT functions to use loff_t for offsets.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
[trini: Fix fs/fat/fat.c for min3 updates]
Signed-off-by: Tom Rini <trini@ti.com>
9 years agoboard/esd/common/auto_update.c: Use <flash.h>
Tom Rini [Sat, 22 Nov 2014 13:11:08 +0000 (08:11 -0500)]
board/esd/common/auto_update.c: Use <flash.h>

A number of prototypes here are now found in <flash.h>. use.

Signed-off-by: Tom Rini <trini@ti.com>
9 years agosandbox: Use md5sum and fatwrite to enable testing of fs commands
Suriyan Ramasami [Mon, 17 Nov 2014 22:39:34 +0000 (14:39 -0800)]
sandbox: Use md5sum and fatwrite to enable testing of fs commands

Enable md5sum to obtain the MD5 of the read and written files to check
their contents for validity.
Use map_sysmem() to map buffer in a sandbox environment.

Signed-off-by: Suriyan Ramasami <suriyan.r@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agocommon/board_f: fix gcc warning on MIPS64
Daniel Schwierzeck [Sat, 15 Nov 2014 22:46:53 +0000 (23:46 +0100)]
common/board_f: fix gcc warning on MIPS64

This fixes following warning when compiled with MIPS64

common/board_f.c: In function 'display_text_info':
common/board_f.c:150:2: warning: format '%X' expects argument i
  of type 'unsigned int', but argument 2 has type 'long unsigned int' [-Wformat=]
  debug("U-Boot code: %08X -> %08lX  BSS: -> %08lX\n",

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agocommon/board_f: add setup of initial stack frame for MIPS
Daniel Schwierzeck [Sat, 15 Nov 2014 22:46:52 +0000 (23:46 +0100)]
common/board_f: add setup of initial stack frame for MIPS

The MIPS specific setup of the initial stack frame was not
ported to generic board_f.

Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
9 years agospl: fix descending condition to drivers/mtd/nand/
Masahiro Yamada [Thu, 13 Nov 2014 10:29:09 +0000 (19:29 +0900)]
spl: fix descending condition to drivers/mtd/nand/

SPL should not reference CONFIG_CMD_NAND to decide whether or not
it should build drivers/mtd/nand.  CONFIG_CMD_NAND should be only
used to select the NAND utility command on the command parser.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agocommands: add more command entries in Kconfig
Masahiro Yamada [Thu, 13 Nov 2014 10:29:08 +0000 (19:29 +0900)]
commands: add more command entries in Kconfig

This commit adds some of command entries (CONFIG_CMD_*) to
cover include/config_cmd_default.h and a little extra.

Because U-Boot supports lots of commands, they should be categorized
according to their usage.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agohush: add CONFIG_HUSH_PARSER to Kconfig
Masahiro Yamada [Thu, 13 Nov 2014 10:29:07 +0000 (19:29 +0900)]
hush: add CONFIG_HUSH_PARSER to Kconfig

The README file states that the macros beginning with "CONFIG_SYS_"
depend on the hardware etc. and should not be meddled with if you do
not what you're doing.
We have already screwed up with this policy; we have given the prefix
"CONFIG_SYS_" to many user-selectable configurations.
Here, "CONFIG_SYS_HUSH_PARSER" is one of them.  Users can enable it
if they want to use a more powerful command line parser, or disable it
if they only need a simple one.

This commit attempts to rename CONFIG_SYS_HUSH_PARSER to
CONFIG_HUSH_PARSER and move it to Kconfig.

Every board maintainer is expected to enable CONFIG_HUSH_PARSER
(= add "CONFIG_HUSH_PARSER=y" to his defconfig file) and remove
"#define CONFIG_SYS_HUSH_PARSER" from his header file.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agoFIT: add some FIT configurations to Kconfig
Masahiro Yamada [Thu, 13 Nov 2014 10:29:06 +0000 (19:29 +0900)]
FIT: add some FIT configurations to Kconfig

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agoconfig: remove redundant CONFIG_SYS_PROMPT defines
Masahiro Yamada [Thu, 13 Nov 2014 09:43:52 +0000 (18:43 +0900)]
config: remove redundant CONFIG_SYS_PROMPT defines

Since commit 0defddc851ed (config: Add a default CONFIG_SYS_PROMPT),
each board header does not need to define CONFIG_SYS_PROMPT
as long as it uses the default prompt "=> ".

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agotegra: do not descend into empty directories
Masahiro Yamada [Thu, 13 Nov 2014 03:28:43 +0000 (12:28 +0900)]
tegra: do not descend into empty directories

Some tegra makefiles only contain a dummy line to generate
a built-in.o.  Let's do not descend into such directories.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Tom Warren <twarren@nvidia.com>
Cc: Stephen Warren <swarren@nvidia.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agokbuild: use SoC-specific CONFIG to descend into SoC directory
Masahiro Yamada [Thu, 13 Nov 2014 03:28:42 +0000 (12:28 +0900)]
kbuild: use SoC-specific CONFIG to descend into SoC directory

Use "obj-$(CONFIG_FOO) += foo/" where it is possible.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agox86: use CONFIG_SYS_COREBOOT to descend into coreboot/ directory
Masahiro Yamada [Thu, 13 Nov 2014 03:28:41 +0000 (12:28 +0900)]
x86: use CONFIG_SYS_COREBOOT to descend into coreboot/ directory

The references of CONFIG_SYS_COREBOOT in arch/x86/cpu/coreboot/Makefile
are redundant because the build system descends into the directory
only when CONFIG_SYS_COREBOOT is defined.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Cc: Simon Glass <sjg@chromium.org>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agokbuild: Descend into SOC directory from CPU directory
Masahiro Yamada [Thu, 13 Nov 2014 03:28:40 +0000 (12:28 +0900)]
kbuild: Descend into SOC directory from CPU directory

Some CPUs of some architectures have SOC directories.
At present, the build system directly descends into SOC directories
from the top Makefile, but it should generally descend into each
directory from its parent directory.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
9 years agoAdd pr_fmt() macro
Thierry Reding [Thu, 13 Nov 2014 01:26:50 +0000 (18:26 -0700)]
Add pr_fmt() macro

This macro can be overridden in source files (before including common.h)
and can be used to specify a prefix for debug and error messages. An
example of how to use this is shown below:

#define pr_fmt(fmt) "foo: " fmt

#include <common.h>

...
debug("bar");

The resulting message will read:

foo: bar

Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agopci: Honour pci_skip_dev()
Thierry Reding [Thu, 13 Nov 2014 01:26:49 +0000 (18:26 -0700)]
pci: Honour pci_skip_dev()

When enumerating devices, honour the pci_skip_dev() function. This can
be used by PCI controller drivers to restrict which devices will be
probed.

This is required by the NVIDIA Tegra PCIe controller driver, which will
fail with a data abort exception if an access is attempted to a device
number larger than 0 outside of bus 0. pci_skip_dev() is therefore
implemented to prevent any such accesses.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agopci: Abort early if bus does not exist
Thierry Reding [Thu, 13 Nov 2014 01:26:48 +0000 (18:26 -0700)]
pci: Abort early if bus does not exist

When listing the devices on a PCI bus, the current code will blindly try
to access all devices. Internally this causes pci_bus_to_hose() to be
repeatedly called and output an error message every time. Prevent this
by calling pci_bus_to_hose() once and abort early if no bus was found.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agovsprintf: Add modifier for phys_addr_t
Thierry Reding [Thu, 13 Nov 2014 01:26:47 +0000 (18:26 -0700)]
vsprintf: Add modifier for phys_addr_t

Provide a new modifier to vsprintf() to print phys_addr_t variables to
avoid having to cast or #ifdef when printing them out. The %pa modifier
is used for this purpose, so phys_addr_t variables need to be passed by
reference, like so:

phys_addr_t start = 0;

printf("start: %pa\n", &start);

Depending on the size of phys_addr_t this will print out the address
with 8 or 16 hexadecimal digits following a 0x prefix.

Signed-off-by: Thierry Reding <treding@nvidia.com>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agofs: make it possible to read the filesystem UUID
Christian Gmeiner [Wed, 12 Nov 2014 13:35:04 +0000 (14:35 +0100)]
fs: make it possible to read the filesystem UUID

Some filesystems have a UUID stored in its superblock. To
allow using root=UUID=... for the kernel command line we
need a way to read-out the filesystem UUID.

changes rfc -> v1:
 - make the environment variable an option parameter. If not
   given, the UUID is printed out. If given, it is stored in the env
   variable.
 - corrected typos
 - return error codes

changes v1 -> v2:
 - fix return code of do_fs_uuid(..)
 - document do_fs_uuid(..)
 - implement fs_uuid_unsuported(..) be more consistent with the
   way other optional functionality works

changes v2 -> v3:
 - change ext4fs_uuid(..) to make use of #if .. #else .. #endif
   construct to get rid of unreachable code

Hit any key to stop autoboot:  0
=> fsuuid
fsuuid - Look up a filesystem UUID

Usage:
fsuuid <interface> <dev>:<part>
    - print filesystem UUID
fsuuid <interface> <dev>:<part> <varname>
    - set environment variable to filesystem UUID

=> fsuuid mmc 0:1
d9f9fc05-45ae-4a36-a616-fccce0e4f887
=> fsuuid mmc 0:2
eb3db83c-7b28-499f-95ce-9e0bb21cda81
=> fsuuid mmc 0:1 uuid1
=> fsuuid mmc 0:2 uuid2
=> printenv uuid1
uuid1=d9f9fc05-45ae-4a36-a616-fccce0e4f887
=> printenv uuid2
uuid2=eb3db83c-7b28-499f-95ce-9e0bb21cda81
=>

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Acked-by: Stephen Warren <swarren@nvidia.com>
9 years agosata: fix a bug in init_sata() for pci-sata card
li pengbo [Wed, 12 Nov 2014 11:16:40 +0000 (19:16 +0800)]
sata: fix a bug in init_sata() for pci-sata card

Except the first loop, init_sata() should return 0 instead of 1
in the others.

This patch fix the issue of the 2nd sata port not workable on pci-sata card.

Signed-off-by: Pengbo Li <Pengbo.Li@freescale.com>
9 years agoARM: bcm: Enable bcm11130 boards
Steve Rae [Tue, 11 Nov 2014 19:32:19 +0000 (11:32 -0800)]
ARM: bcm: Enable bcm11130 boards

bcm11130
bcm11130_nand

Signed-off-by: Steve Rae <srae@broadcom.com>
9 years agoARM: bcm: Enable five Cygnus boards
Steve Rae [Tue, 11 Nov 2014 19:32:18 +0000 (11:32 -0800)]
ARM: bcm: Enable five Cygnus boards

bcm911360_entphn
bcm911360_entphn-ns
bcm911360k
bcm958300k-ns
bcm958305k

- updates to support Cygnus and NSP board families better
- add functions so CONFIG_ARMV7_NONSEC can be enabled on Cygnus boards

Signed-off-by: Steve Rae <srae@broadcom.com>
9 years agospl: Change debug to printf for "Unsupported boot-device"
Stefan Roese [Tue, 11 Nov 2014 18:03:55 +0000 (19:03 +0100)]
spl: Change debug to printf for "Unsupported boot-device"

We had the problem on an AM33xx platform, that SPL detected an
unsupported boot-device. But since this message is a debug message
it took a bit of time to really know, where the hangup in SPL
resulted from. So let's change this debug message to a printf
and also print the detected boot-device that is not supported.
This makes debugging of such cases much easier.

Signed-off-by: Stefan Roese <sr@denx.de>
Cc: Wolfgang Denk <wd@denx.de>
Cc: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agolinux/kernel.h: sync min, max, min3, max3 macros with Linux
Masahiro Yamada [Thu, 6 Nov 2014 18:03:31 +0000 (03:03 +0900)]
linux/kernel.h: sync min, max, min3, max3 macros with Linux

U-Boot has never cared about the type when we get max/min of two
values, but Linux Kernel does.  This commit gets min, max, min3, max3
macros synced with the kernel introducing type checks.

Many of references of those macros must be fixed to suppress warnings.
We have two options:
 - Use min, max, min3, max3 only when the arguments have the same type
   (or add casts to the arguments)
 - Use min_t/max_t instead with the appropriate type for the first
   argument

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Pavel Machek <pavel@denx.de>
Acked-by: Lukasz Majewski <l.majewski@samsung.com>
Tested-by: Lukasz Majewski <l.majewski@samsung.com>
[trini: Fixup arch/blackfin/lib/string.c]
Signed-off-by: Tom Rini <trini@ti.com>
9 years agodm: core: remove unnecessary return condition in uclass lookup
Masahiro Yamada [Mon, 17 Nov 2014 08:19:41 +0000 (17:19 +0900)]
dm: core: remove unnecessary return condition in uclass lookup

These conditions never happen.
 - There is no real uclass with UCLASS_INVALID id.
 - uclass never becomes NULL because ll_entry_start() always returns
   a valid pointer.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: core: remove unnecessary return condition in driver lookup
Masahiro Yamada [Mon, 17 Nov 2014 08:19:40 +0000 (17:19 +0900)]
dm: core: remove unnecessary return condition in driver lookup

The variable "drv" never becomes NULL because ll_entry_start()
always returns a valid pointer even if there are no entries.

The case "n_ents == 0" is covered by the following "for" loop.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: core: remove meaningless if conditional
Masahiro Yamada [Mon, 17 Nov 2014 08:19:39 +0000 (17:19 +0900)]
dm: core: remove meaningless if conditional

If the variable "ret" is equal to "-ENOENT", it is trapped at [1] and
never reaches [2].  At [3], the condition "ret != -ENOENT" is always
true.

  if (ret == -ENOENT) {                       <------------------ [1]
          continue;
  } else if (ret == -ENODEV) {
          dm_dbg("Device '%s' has no compatible string\n", name);
          break;
  } else if (ret) {                           <------------------ [2]
          dm_warn("Device tree error at offset %d\n", offset);
          if (!result || ret != -ENOENT)      <------------------ [3]
                  result = ret;
          break;
  }

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agodm: core: a trivial clean up
Masahiro Yamada [Mon, 17 Nov 2014 08:19:38 +0000 (17:19 +0900)]
dm: core: a trivial clean up

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
9 years agocros_ec: Fix uninitialised variable in cros_ec.c
Simon Glass [Wed, 12 Nov 2014 01:06:30 +0000 (18:06 -0700)]
cros_ec: Fix uninitialised variable in cros_ec.c

This fixes this cppcheck report:

[drivers/misc/cros_ec.c:704]: (error) Uninitialized variable: req

Signed-off-by: Simon Glass <sjg@chromium.org>
Reported-by: Wolfgang Denk <wd@denx.de>
9 years agodm: spi: Use device_bind_driver() instead of our own function
Simon Glass [Tue, 11 Nov 2014 17:46:23 +0000 (10:46 -0700)]
dm: spi: Use device_bind_driver() instead of our own function

The SPI function does the same thing, so we may as well just use the new
generic function. The 'cs' parameter was not actually used, so can be
dropped.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agodm: spi: Correct handling of SPI chip selects in sandbox
Simon Glass [Tue, 11 Nov 2014 17:46:22 +0000 (10:46 -0700)]
dm: spi: Correct handling of SPI chip selects in sandbox

This code was not updated when the chip select handling was adjusted. Fix
it to call the correct function.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agodm: Add a function to bind a device by driver name
Simon Glass [Tue, 11 Nov 2014 17:46:21 +0000 (10:46 -0700)]
dm: Add a function to bind a device by driver name

In some cases we need to manually bind a device to a particular driver.
Add a function to do this.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Jagannadha Sutradharudu Teki <jagannadh.teki@gmail.com>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agodm: fdt: Correct handling of aliases with embedded digits
Simon Glass [Tue, 11 Nov 2014 17:46:20 +0000 (10:46 -0700)]
dm: fdt: Correct handling of aliases with embedded digits

Since we scan from left to right looking for the first digit, "i2c0" returns
2 instead of 0 for the alias number. Adjust the code to scan from right to
left instead.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Heiko Schocher <hs@denx.de>
Reviewed-by: Tom Rini <trini@ti.com>
9 years agodm: core: Add functions to find parent and OF data
Simon Glass [Tue, 11 Nov 2014 17:46:19 +0000 (10:46 -0700)]
dm: core: Add functions to find parent and OF data

Add dev_get_parent() as a convenience to obtain the parent of a device.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agodm: core: Allow access to the device's driver_id data
Simon Glass [Tue, 11 Nov 2014 17:46:18 +0000 (10:46 -0700)]
dm: core: Allow access to the device's driver_id data

When the device is created from a device tree node, it matches a compatible
string. Allow access to that string and the associated data.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agomx53ard: Fix error handling in board_mmc_init()
Fabio Estevam [Thu, 20 Nov 2014 18:35:20 +0000 (16:35 -0200)]
mx53ard: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agomx53evk: Fix error handling in board_mmc_init()
Fabio Estevam [Thu, 20 Nov 2014 18:35:19 +0000 (16:35 -0200)]
mx53evk: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agomx53smd: Fix error handling in board_mmc_init()
Fabio Estevam [Thu, 20 Nov 2014 18:35:18 +0000 (16:35 -0200)]
mx53smd: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agomx6qarm2: Fix error handling in board_mmc_init()
Fabio Estevam [Thu, 20 Nov 2014 18:35:17 +0000 (16:35 -0200)]
mx6qarm2: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agomx51evk: Fix error handling in board_mmc_init()
Fabio Estevam [Thu, 20 Nov 2014 18:35:16 +0000 (16:35 -0200)]
mx51evk: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.

Also, return the error immediately on fsl_esdhc_initialize() failure.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
9 years agomx6: mx6sabre common: Enable i.MX thermal DM driver
Ye.Li [Thu, 20 Nov 2014 13:14:15 +0000 (21:14 +0800)]
mx6: mx6sabre common: Enable i.MX thermal DM driver

Enable i.MX thermal DM driver to mx6sabre_common.h file. Since the
thermal is used in init_sequence_f, so define the CONFIG_SYS_MALLOC_F_LEN
to support DM driver using in pre relocation phase.

Additional, thermal driver depends on ocotp, make sure to enable
CONFIG_MXC_OCOTP when CONFIG_IMX6_THERMAL is selected.

Signed-off-by: Ye.Li <B37916@freescale.com>
Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
9 years agomx6: thermal: Check cpu temperature via thermal sensor
Ye.Li [Thu, 20 Nov 2014 13:14:14 +0000 (21:14 +0800)]
mx6: thermal: Check cpu temperature via thermal sensor

Add imx6 thermal device to mx6 soc file. Read the cpu temperature
using this device to access onchip thermal sensor.

Signed-off-by: Ye.Li <B37916@freescale.com>
Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
9 years agoDM: thermal: Add imx thermal DM driver
Ye.Li [Thu, 20 Nov 2014 13:14:13 +0000 (21:14 +0800)]
DM: thermal: Add imx thermal DM driver

Add a new thermal uclass for thermal sensor and implement the imx
thermal driver basing on this uclass.

Signed-off-by: Ye.Li <B37916@freescale.com>
Acked-by: Stefano Babic <sbabic@denx.de>
9 years agomx6: clock: Add thermal clock enable function
Nitin Garg [Thu, 20 Nov 2014 13:14:12 +0000 (21:14 +0800)]
mx6: clock: Add thermal clock enable function

Add api to check and enable pll3 as required
for thermal sensor driver.

Signed-off-by: Ye.Li <B37916@freescale.com>
Signed-off-by: Nitin Garg <nitin.garg@freescale.com>
9 years agotbs2910: Fix error handling in board_mmc_init()
Soeren Moch [Thu, 20 Nov 2014 12:03:32 +0000 (13:03 +0100)]
tbs2910: Fix error handling in board_mmc_init()

When an invalid USDHC port is passed we should return -EINVAL instead of 0.
Also, return the error immediately on fsl_esdhc_initialize() failure.

Based on similar patches by Fabio Estevam for mx6sabresd, mx53loco, wandboard

Signed-off-by: Soeren Moch <smoch@web.de>
Acked-by: Stefano Babic <sbabic@denx.de>
9 years agodm: i2c: Move error reporting into a common function
Simon Glass [Tue, 11 Nov 2014 17:46:17 +0000 (10:46 -0700)]
dm: i2c: Move error reporting into a common function

Factor out the common code to make it easier to adjust it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
Acked-by: Heiko Schocher <hs@denx.de>
9 years agodm: Update documentation to include CONFIG_DM... options
Simon Glass [Tue, 11 Nov 2014 00:16:54 +0000 (17:16 -0700)]
dm: Update documentation to include CONFIG_DM... options

Add documentation for the various driver model options that are now
available.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: arm: spl: Make driver model linker lists available
Simon Glass [Tue, 11 Nov 2014 00:16:52 +0000 (17:16 -0700)]
dm: arm: spl: Make driver model linker lists available

The linker lists feature is useful in SPL as it holds the driver model
platform data. So don't throw away the lists.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
9 years agodm: tegra: Add platform data for the GPIO driver
Simon Glass [Tue, 11 Nov 2014 00:16:51 +0000 (17:16 -0700)]
dm: tegra: Add platform data for the GPIO driver

Add platform data for the GPIO driver. It doesn't need to contain anything
since the GPIO driver will actually use information from the CONFIGs for
now. This merely serves to ensure that the GPIO driver is bound.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: tegra: Add platform data for the SPL uart
Simon Glass [Tue, 11 Nov 2014 00:16:50 +0000 (17:16 -0700)]
dm: tegra: Add platform data for the SPL uart

Since we currently don't have device tree available in SPL, add platform
data so the uart works.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: Disable dm_warn() in SPL
Simon Glass [Tue, 11 Nov 2014 00:16:49 +0000 (17:16 -0700)]
dm: Disable dm_warn() in SPL

Since this function can use up quite a bit of space for its strings, disable
it by default in SPL. Use CONFIG_DM_WARN to re-enable it.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
9 years agodm: Allow stdio registration to be dropped
Simon Glass [Tue, 11 Nov 2014 00:16:48 +0000 (17:16 -0700)]
dm: Allow stdio registration to be dropped

Provide a CONFIG_DM_STDIO option to enable registering a serial device
with the stdio library. This is seldom useful in SPL, so disable it by
default when building for SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
9 years agodm: Allow device removal features to be dropped
Simon Glass [Tue, 11 Nov 2014 00:16:47 +0000 (17:16 -0700)]
dm: Allow device removal features to be dropped

For SPL we don't expect to need to remove a device. Save some code space
by dropping this feature. The board config can define
CONFIG_DM_DEVICE_REMOVE if this is in fact needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
Reviewed-by: Tom Rini <trini@ti.com>
9 years agodm: spl: Allow driver model to be used
Simon Glass [Tue, 11 Nov 2014 00:16:46 +0000 (17:16 -0700)]
dm: spl: Allow driver model to be used

When enabled, set up driver model for SPL. This allows SPL to use the same
drivers as the main U-Boot.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Tom Rini <trini@ti.com>
9 years agodm: spl: Make simple malloc() available when enabled
Simon Glass [Tue, 11 Nov 2014 00:16:45 +0000 (17:16 -0700)]
dm: spl: Make simple malloc() available when enabled

Set up the simple malloc() implementation when requested, in preference to
the full malloc().

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: arm: spl: Allow simple malloc() in SPL
Simon Glass [Tue, 11 Nov 2014 00:16:44 +0000 (17:16 -0700)]
dm: arm: spl: Allow simple malloc() in SPL

For SPL it is sometimes useful to have a simple malloc() just to permit
driver model to work, in the cases where the full malloc() is not made
available by the board config.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: Split the simple malloc() implementation into its own file
Simon Glass [Tue, 11 Nov 2014 00:16:43 +0000 (17:16 -0700)]
dm: Split the simple malloc() implementation into its own file

The simple malloc() implementation is used when memory is tight. It provides
a simple buffer with an incrementing pointer.

At present the implementation is inside dlmalloc. Move it into its own file
so that it is easier to find.

Rather than using relocation as a signal that the full malloc() is
available, add a special GD_FLG_FULL_MALLOC_INIT flag. This signals that the
simple malloc() should no longer be used.

In some cases, such as SPL, even the code space used by the full malloc() is
wasteful. Add a CONFIG_SYS_MALLOC_SIMPLE option to provide only the simple
malloc. In this case the full malloc is not available at all. It saves about
1KB of code space and about 0.5KB of data on Thumb 2.

Acked-by: Tom Rini <trini@ti.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: tegra: Avoid using arch-specific memcpy() in SPL
Simon Glass [Tue, 11 Nov 2014 00:16:42 +0000 (17:16 -0700)]
dm: tegra: Avoid using arch-specific memcpy() in SPL

The faster functions are not actually available in SPL and the code size
likely isn't worth it. Use the normal memcpy() in SPL.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: serial: Support changing the baud rate
Simon Glass [Wed, 29 Oct 2014 19:09:03 +0000 (13:09 -0600)]
dm: serial: Support changing the baud rate

Implement this feature in the uclass so that the baudrate can be changed
with 'setenv baudrate <rate>'.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: at91: Add myself as maintainer for snapper9260
Simon Glass [Wed, 29 Oct 2014 19:09:02 +0000 (13:09 -0600)]
dm: at91: Add myself as maintainer for snapper9260

The old maintainer has left, so take this over.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: at91: Convert snapper9260 to use driver model
Simon Glass [Wed, 29 Oct 2014 19:09:01 +0000 (13:09 -0600)]
dm: at91: Convert snapper9260 to use driver model

Convert this at91sam9260-based board to use driver model. This should serve
as an example for other similar boards. Serial and GPIO are supported so
far.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
9 years agodm: at91: Add driver model support for the serial driver
Simon Glass [Wed, 29 Oct 2014 19:09:00 +0000 (13:09 -0600)]
dm: at91: Add driver model support for the serial driver

Add driver model support while retaining the existing legacy code. This
allows the driver to support boards that have converted to driver model
as well as those that have not.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: at91: Refactor serial driver slightly for driver model
Simon Glass [Wed, 29 Oct 2014 19:08:59 +0000 (13:08 -0600)]
dm: at91: Refactor serial driver slightly for driver model

Before adding driver model support, split out a few of the functions so
that they can be used by the driver model code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Acked-by: Andreas Bießmann <andreas.devel@googlemail.com>
9 years agodm: at91: Add platform data for GPIO on at91sam9260-based boards
Simon Glass [Wed, 29 Oct 2014 19:08:58 +0000 (13:08 -0600)]
dm: at91: Add platform data for GPIO on at91sam9260-based boards

These boards all have the same GPIO arrangement, so add some common platform
data that can be used by all boards. Remove the configs which are no longer
required.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: at91: Add driver model support for atmel GPIO driver
Simon Glass [Wed, 29 Oct 2014 19:08:57 +0000 (13:08 -0600)]
dm: at91: Add driver model support for atmel GPIO driver

Modify this driver to support driver model, with platform data required to
determine the GPIOs that it controls.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: at91: Move snapper9260 to generic baord
Simon Glass [Wed, 29 Oct 2014 19:08:56 +0000 (13:08 -0600)]
dm: at91: Move snapper9260 to generic baord

This works correctly, so switch it over before the deadline.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agodm: at91: Correct text base for snapper9260
Simon Glass [Wed, 29 Oct 2014 19:08:55 +0000 (13:08 -0600)]
dm: at91: Correct text base for snapper9260

The value should be 0x21f00000. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Rename chromebook-x86 to coreboot
Simon Glass [Thu, 13 Nov 2014 05:42:29 +0000 (22:42 -0700)]
x86: Rename chromebook-x86 to coreboot

Rename this vendor since it is intended to be used on any platform where
coreboot runs at reset and then loads U-Boot.

So far it is only tested on link. When other boards are supported it is
likely that we will need to move to multiple board names, all under the
'coreboot' vendor. So while it would be possible to remove the vendor for
now, that would be short-sighted.

Suggested-by: Bin Meng <bmeng.cn@gmail.com>
Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Implement SDRAM init
Simon Glass [Thu, 13 Nov 2014 05:42:28 +0000 (22:42 -0700)]
x86: ivybridge: Implement SDRAM init

Implement SDRAM init using the Memory Reference Code (mrc.bin) provided in
the board directory and the SDRAM SPD information in the device tree. This
also needs the Intel Management Engine (me.bin) to work. Binary blobs
everywhere: so far we have MRC, ME and microcode.

SDRAM init works by setting up various parameters and calling the MRC. This
in turn does some sort of magic to work out how much memory there is and
the timing parameters to use. It also sets up the DRAM controllers. When
the MRC returns, we use the information it provides to map out the
available memory in U-Boot.

U-Boot normally moves itself to the top of RAM. On x86 the RAM is not
generally contiguous, and anyway some RAM may be above 4GB which doesn't
work in 32-bit mode. So we relocate to the top of the largest block of
RAM we can find below 4GB. Memory above 4GB is accessible with special
functions (see physmem).

It would be possible to build U-Boot in 64-bit mode but this wouldn't
necessarily provide any more memory, since the largest block is often below
4GB. Anyway U-Boot doesn't need huge amounts of memory - even a very large
ramdisk seldom exceeds 100-200MB. U-Boot has support for booting 64-bit
kernels directly so this does not pose a limitation in that area. Also there
are probably parts of U-Boot that will not work correctly in 64-bit mode.
The MRC is one.

There is some work remaining in this area. Since memory init is very slow
(over 500ms) it is possible to save the parameters in SPI flash to speed it
up next time. Suspend/resume support is not fully implemented, or at least
it is not efficient.

With this patch, link boots to a prompt.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Add LAPIC support
Simon Glass [Thu, 13 Nov 2014 05:42:27 +0000 (22:42 -0700)]
x86: ivybridge: Add LAPIC support

The local advanced programmable interrupt controller is not used much in
U-Boot but we do need to set it up. Add basic support for this, which will
be extended as needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Make show_boot_progress() common
Simon Glass [Thu, 13 Nov 2014 05:42:26 +0000 (22:42 -0700)]
x86: Make show_boot_progress() common

This function can probably be used on all x86 boards, so move it into the
common file.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: chromebook_link: Enable GPIO support
Simon Glass [Thu, 13 Nov 2014 05:42:25 +0000 (22:42 -0700)]
x86: chromebook_link: Enable GPIO support

Enable GPIO support and provide the required GPIO setup information to
the driver.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Add support for early GPIO init
Simon Glass [Thu, 13 Nov 2014 05:42:24 +0000 (22:42 -0700)]
x86: ivybridge: Add support for early GPIO init

When not relying on Coreboot for GPIO init the GPIOs must be set up
correctly. This is currently done statically through a rather ugly method.
As the GPIOs are figured out they can be moved to the device tree and set
up as needed rather than all at the start.

In this implementation, board files should call ich_gpio_set_gpio_map()
before the GPIO driver is used in order to provide the GPIO information.
We use the early PCI interface so that this driver can now be used before
relocation.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Add early init for PCH devices
Simon Glass [Thu, 13 Nov 2014 05:42:23 +0000 (22:42 -0700)]
x86: ivybridge: Add early init for PCH devices

Many PCH devices are hard-coded to a particular PCI address. Set these
up early in case they are needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: dts: Add microcode updates for ivybridge CPU
Simon Glass [Thu, 13 Nov 2014 05:42:22 +0000 (22:42 -0700)]
x86: dts: Add microcode updates for ivybridge CPU

Add two microcode updates that are provided for this CPU. The updates
have been converted to a device tree form.

Note: SPDX submission has been done. If this license is approved I will
convert the files to use SPDX.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Perform Intel microcode update on boot
Simon Glass [Thu, 13 Nov 2014 05:42:21 +0000 (22:42 -0700)]
x86: ivybridge: Perform Intel microcode update on boot

Microcode updates are stored in the device tree. Work through these and
apply any that are needed.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Check BIST value on boot
Simon Glass [Thu, 13 Nov 2014 05:42:20 +0000 (22:42 -0700)]
x86: ivybridge: Check BIST value on boot

The built-in self test value should be checked before we continue booting.
Refuse to continue if there is something wrong.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Perform initial CPU setup
Simon Glass [Thu, 13 Nov 2014 05:42:19 +0000 (22:42 -0700)]
x86: ivybridge: Perform initial CPU setup

Set up the flex ratio (controls speed versus heat output) and a few other
very early things.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add msr read/write functions that use a structure
Simon Glass [Thu, 13 Nov 2014 05:42:18 +0000 (22:42 -0700)]
x86: Add msr read/write functions that use a structure

It is convenient to be able to adjust MSRs with a structure that splits the
two 32-bit halves into separate fields, as they are often dealt with
separately. Add a few functions to support this.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Add clr/setbits functions
Simon Glass [Thu, 13 Nov 2014 05:42:17 +0000 (22:42 -0700)]
x86: Add clr/setbits functions

These are available on other architectures. Make them available on x86 also.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: Tidy up coreboot header usage
Simon Glass [Thu, 13 Nov 2014 05:42:16 +0000 (22:42 -0700)]
x86: Tidy up coreboot header usage

There is no need to explicitly write 'arch-coreboot' when including headers,
as when the arch directory points to coreboot the correct files will be
used.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: ivybridge: Add early LPC init so that serial works
Simon Glass [Thu, 13 Nov 2014 05:42:15 +0000 (22:42 -0700)]
x86: ivybridge: Add early LPC init so that serial works

The PCH (Platform Controller Hub) includes an LPC (Low Pin Count) device
which provides a serial port. This is accessible on Chromebooks, so enable
it early in the boot process.

Signed-off-by: Simon Glass <sjg@chromium.org>
9 years agox86: pci: Allow configuration before relocation
Simon Glass [Thu, 13 Nov 2014 05:42:14 +0000 (22:42 -0700)]
x86: pci: Allow configuration before relocation

Add simple PCI access routines for x86 which permit use before relocation.
The normal PCI stack is still used, but for pre-relocation use there can
only ever be a single hose. After relocation, fall back to the normal
access, although even then on x86 machines there is normally only a single
PCI bus.

Signed-off-by: Simon Glass <sjg@chromium.org>