ARM: atmel: sama5d3_xplained: import smc timing from U-Boot

The configuration for NAND has been aligned with values
from U-Boot and completed with TIMINGS initialization

Signed-off-by: Matteo Fortini <matteo.fortini@gmail.com>
[voice.shen@atmel.com: apply this patch from Matteo Fortini for
		       sama5d3xek to sama5d3_xplained board]
Signed-off-by: Bo Shen <voice.shen@atmel.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Merge branch 'for-next/i2c' into HEAD
rtc: import ds1307 driver from linux-3.15

Current ds1307 rtc driver supports only ds1307 and ds1338 chips;
it has no nvram support at the moment.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
commands: add hwclock

The hwclock command allows to query or set the hardware clock (RTC).

Barebox' 'hwclock' command uses busybox' 'date' compatible
time format ccyymmddHHMM[.SS]:

  # /bin/busybox date -s 201407292005.41 ; /bin/date
  Tue Jul 29 20:05:41 MSK 2014
  Tue Jul 29 20:05:41 MSK 2014

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ARM: versatilepb_defconfig: enable RTC support

Use this qemu cmdline to test hwclock

  $ qemu-system-arm -M versatilepb -nographic \
      -monitor null -kernel barebox -serial stdio

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
rtc-lib: import rtc_time_to_tm() from linux-3.15

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
rtc: add jz4740 driver

Add support for the RTC unit on Ingenic JZ4740, JZ475x and JZ477x SoCs.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
MIPS: dts: jz4755.dtsi: add jz4740-rtc

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
MIPS: ritmix-rzx50_defconfig: enable RTC support

Also enable CONFIG_LONGHELP.

Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
trivial: Correct word spelling, s/miscelleanous/miscellaneous

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
bus: mvebu: fix ranges fixup

The current fixup code is slightly wrong, and only works when the
root address cell number is one.

However, Armada XP has a root address cell number of two. In this case
we are currently applying the fixup on the child high base address,
while it should be applied on the child low base address.

Fix it and add some detailed explanation to avoid having to figure this
out each time.

Signed-off-by: Ezequiel Garcia <ezequiel.garcia@free-electrons.com>
Acked-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
of_mtd: add soft_bch and hw_oob_first ecc modes

Signed-off-by: Raphaël Poggi <poggi.raph@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
ARM: AM335x: Beaglebone: enable ethernet

The ethernet mac and mdio nodes must be explicitly enabled to override
the disabled setting in am33xx.dtsi.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Release v2014.08.0

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Revert "common: resource: print conflicts as warning"

On several i.MX boards we register SDRAM with the values
from the SDRAM controller and also with values from the
device tree. This now issues a warning each time the board
is started. Revert the commit for now.

A better solution might be to check if the same SDRAM region
already exists before trying to register it again.

This reverts commit c9e2e08edcdce4205821226817686e62dc349eab.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
dts: update to v3.16

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
move file helper functions to separate file

We have our file helper functions in several places. Move them
all to lib/libfile.c.
With this we no longer have file helpers in fs/fs.c which contains
the core fs functions and no functions in lib/libbb.c which are
not from busybox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
read_file: introduce read_file_2

read_file has some limitations:

- It is not possible to check the error code since read_file returns
  NULL for failure
- It is not possible to limit the buffer size to sensible limits.

This patch introduces read_file_2 which doesn't have these limitations.
read_file becomes a wrapper around read_file_2.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
make: build device trees with obj-dtb-y and pbl-dtb-y

To build an object file from a device tree currently we currently
have to add them to the Makefile twice, once to dtb-y and once to
obj-y. This patch introduces obj-dtb-y and pbl-dtb-y to directly
compile a device tree object file for inclusion in the barebox binary
or the pbl respectively.
The now unneeded dtb-y targets are removed.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
dtc: compile fdtget

We need fdtget in subsequent patches, so compile it.
Unfortunately this is not straight forward. fdtget needs libfdt,
but the Kernel Build System is not prepared for compiling
libraries for the host or binaries from files in multiple directories.
This patch moves the libfdt files to the dtc toplevel directory and
compiles fdtget as a binary from multiple source files but from
the same directory.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>