nios2: add flush_dcache_range function

exposes functionality to flush dcache according to
the common.h API

Signed-off-by: Stefan Kristiansson <stefan.kristiansson@saunalahti.fi>
Cc: Thomas Chou <thomas@wytron.com.tw>
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
nios2: implement get_ticks and get_tbclk

 * Copy over Blackfin's get_ticks and get_tbclk - they work just fine on
   Nios2.

Signed-off-by: Alex Hornung <alex@alexhornung.com>
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
nios2 - adjust gbl data off to account for bd_info

 * Adjust the GBL_DATA_OFFSET to account for the fact that we'll be
   using the space between that offset and the start of the malloc
   region to allocate both a gd structure and a board info structure.

 * This fixes a memory corruption bug due to overlap of the malloc
   region and the bd_info structure.

Signed-off-by: Alex Hornung <alex@alexhornung.com>
Signed-off-by: Thomas Chou <thomas@wytron.com.tw>
sh: sh_eth: Add support SH7724

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
sh: ecovec: Add support PHY of SMSC

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
net: sh_eth: Remove SH_ETH_PHY_DELAY

SH_ETH_PHY_DELAY is not used.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
net: sh_eth: Collect up EDMR_INIT_CNT to TIMEOUT_CNT

EDMR_INIT_CNT holds the check count of initialization.
Since there were more same values (1000), this collected as TIMEOUT_CNT.

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
net: sh_eth: Remove unnecessary return

Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
sh: Fix sh7264 clock speed and related serial setting

The generalised calculation of the serial bit rate reg also applies
to sh7264, it was just the clock speed that was set incorrectly.

Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
sh: timer: Remove unnecessary variable 'ticks'

Signed-off-by: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
Reported-by: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Nobuhiro Iwamatsu <iwamatsu@nigauri.org>
Revert "post/Makefile: Only build FP post tests if enabled via CONFIG_SYS_POST_FPU"

This reverts commit 3e16abe0e468c568b30acb7d8583e3dbed6f177b.

The logic of this patch is broken - testing for CONFIG_SYS_POST_FPU in
the Makefile cannot work, as this is only a bit that may (or may not)
be set in the CONFIG_POST variable.

The patch cases build errors on a number of boards, so we revert it.

Signed-off-by: Wolfgang Denk <wd@denx.de>
sandbox: sort header files in os.c

Tidy this up as the list is long and likely to get longer.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: add required header to os.c

We should include the sys/time.h header to avoid warnings.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: add ifdef protection to os.h

Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: add lseek helper

Follow up patches want to be able to seek fd's.

Acked-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: fdt: add support for CONFIG_OF_CONTROL

This adds support for a controlling fdt, mirroring the ARM implementation.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: config: enable fdt and snprintf() options

Enable fdt code and safe snprintf() options for sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: add flags for open() call

This provides a way for callers to create files for writing. The flags
are translated at runtime, for the ones we support.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: gpio: add basic driver for simulating GPIOs

This provides a way of simulating GPIOs by setting values which are seen
by the normal gpio_get/set_value() calls.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: enable GPIO driver

Enable the new GPIO driver for sandbox.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>