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>
sandbox: add get_{tbclk,ticks}

Fixes building after recent readline updates with timeouts.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: u-boot.lds: tweak style

We use tabs for indentation, not spaces.

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

Since we provide all our own library calls, the fortification from
glibc just gets in our way (which some distros enable by default).

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

The state exists through the life of U-Boot. It can be adjusted by command
line options and perhaps later through a config file.  It is available to
U-Boot through state_...() calls (within sandbox code).

The primary purpose of this is to contain the "hardware" state.  It should
only be used by sandbox internal code.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: allow processing before main loop

In order to pass command line arguments to sandbox we need to be able
to act on them. So take control back at the end of board_init_r() from
where we can call the main loop or do something else.

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

This adds simple command-line parsing to sandbox. The idea is that it
sets up the state with options provided, and this state can then be
queried later, as needed.

New flags are declared with the SB_CMDLINE_OPT_SHORT helper macro,
pointers are automatically gathered up in a special section, and
then the core code takes care of gathering them up and processing
at runtime.  This way there is no central place where we have to
store a list of flags with ifdefs.

Signed-off-by: Simon Glass <sjg@chromium.org>
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
sandbox: mark os_exit as noreturn

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
ATMEL: use generic mmc framework

gen_atmel_mci works on AVR32 as well, so no need to use the legacy
mmc driver. This also has the nice side effect of being able to use
SDHC cards an those boards.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
ATMEL: remove old atmel_mci driver

All boards are using the gen_atmel_mci driver now, so no need
to carry the old driver around.

Signed-off-by: Sven Schnelle <svens@stackframe.org>
Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
doc/git-mailrc: add <me> to avr32 alias

Signed-off-by: Andreas Bießmann <andreas.devel@googlemail.com>
atmel_mci.h: remove outdated register macros

New gen_atmel_mci driver does not use the outated register access macros. Since
the old atmel_mci driver is deleted these macros are no longer necessary.

Signed-off-by: Andreas Bießmann <biessmann@corscience.de>