summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/cpu
Commit message (Collapse)AuthorAgeFilesLines
* Coding Style cleanup: remove trailing white spaceWolfgang Denk2013-10-141-1/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add GPL-2.0+ SPDX-License-Identifier to source filesWolfgang Denk2013-07-246-102/+6
| | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de> [trini: Fixup common/cmd_io.c] Signed-off-by: Tom Rini <trini@ti.com>
* sandbox: Support trace featureSimon Glass2013-06-262-2/+2
| | | | | | | | | | Support tracing on sandbox by adding suitable CONFIG options. To enable it, compile U-Boot with FTRACE=1. The timer functions are marked to skip tracing, since these are called from the tracing code itself, and we want to avoid an infinite loop. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Allow -c argument to provide a command listSimon Glass2013-05-011-1/+1
| | | | | | | | This allows passing of entire scripts to sandbox with the -c argument, which is useful for testing. Commands can be delimited with a newline or semicolon. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Add CONFIG_OF_HOSTFILE to read FDT from host fileSimon Glass2013-05-011-0/+7
| | | | | | | | | | | | With sandbox it is tricky to add an FDT to the image at build time (or later) since we build an ELF file, not a plain binary, and the address space of the whole U-Boot is not accessible in the emulated memory map of sandbox. Sandbox can read files directly from the host, though, so add an option to read an FDT from a host file on start-up. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Provide a way to map from host RAM to U-Boot RAMSimon Glass2013-05-011-0/+5
| | | | | | | | | | | | | | | | | | | | | In many cases, pointers to memory are passed around, and these pointers refer to U-Boot memory, not host memory. This in itself is not a problem. However, in a few places, we cast that pointer back to a ulong (being a U-Boot memory address). It is possible to convert many of these cases to avoid this. However there are data structures (e.g. struct bootm_headers) which use pointers. We could with a lot of effort adjust the structs and all code that uses them to use ulong instead of pointers. This seems like an unacceptable cost, since our objective with sandbox is to minimise the impact on U-Boot code while maximising the features available to sandbox. Therefore, create a map_to_sysmem() function which converts from a pointer to a U-Boot address. This can be used sparingly when needed. Signed-off-by: Simon Glass <sjg@chromium.org>
* Refactor linker-generated arraysAlbert ARIBAUD2013-03-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Refactor linker-generated array code so that symbols which were previously linker-generated are now compiler- generated. This causes relocation records of type R_ARM_ABS32 to become R_ARM_RELATIVE, which makes code which uses LGA able to run before relocation as well as after. Note: this affects more than ARM targets, as linker- lists span possibly all target architectures, notably PowerPC. Conflicts: arch/arm/cpu/arm926ejs/mxs/u-boot-spl.lds arch/arm/cpu/arm926ejs/spear/u-boot-spl.lds arch/arm/cpu/armv7/omap-common/u-boot-spl.lds board/ait/cam_enc_4xx/u-boot-spl.lds board/davinci/da8xxevm/u-boot-spl-da850evm.lds board/davinci/da8xxevm/u-boot-spl-hawk.lds board/vpac270/u-boot-spl.lds Signed-off-by: Albert ARIBAUD <albert.u.boot@aribaud.net>
* sandbox: Add a way of obtaining directory listingsSimon Glass2013-03-041-0/+101
| | | | | | | | This implementation uses opendir()/readdir() to access the directory information and then puts it in a linked list for the caller's use. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Tom Rini <trini@ti.com>
* sandbox: Improve sandbox serial port keyboard interfaceTaylor Hutt2013-02-281-0/+8
| | | | | | | | | | | Implements the tstc() interface for the serial driver. Multiplexing the console between the serial port and a keyboard uses a polling method of checking if characters are available; this means that the serial console must be non-blocking when attempting to read characters. Signed-off-by: Taylor Hutt <thutt@chromium.org> Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: fix compiler warningAllen Martin2013-02-281-0/+3
| | | | | | | | | | Add back return statement to fix compiler warning about control flow reaching end of non void function that was introduced with: e05e5de arm: move C runtime setup code in crt0.S Signed-off-by: Allen Martin <amartin@nvidia.com> Acked-by: Simon Glass <sjg@chromium.org>
* sandbox: Move ram_buf to arch_global_dataSimon Glass2013-02-041-1/+1
| | | | | | Move this field into arch_global_data and tidy up. Signed-off-by: Simon Glass <sjg@chromium.org>
* common: Discard the __u_boot_cmd sectionMarek Vasut2012-10-221-3/+0
| | | | | | | | | | | The command declaration now uses the new LG-array method to generate list of commands. Thus the __u_boot_cmd section is now superseded and redundant and therefore can be removed. Also, remove externed symbols associated with this section from include/command.h . Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org>
* common: Add .u_boot_list into all linker filesMarek Vasut2012-10-221-0/+5
| | | | | | | | | | Add section for the linker-generated lists into all possible linker files, so that everyone can easily use these lists. This is mostly a mechanical adjustment. Signed-off-by: Marek Vasut <marex@denx.de> Cc: Joe Hershberger <joe.hershberger@gmail.com> Cc: Mike Frysinger <vapier@gentoo.org>
* sandbox: Use the new run_command()Simon Glass2012-04-231-6/+0
| | | | | | | | Now that run_command() handles both parsers, clean up sandbox to use it. This fixes a build error. Signed-off-by: Simon Glass <sjg@chromium.org> Acked-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: add getopt supportSimon Glass2012-03-123-0/+190
| | | | | | | | | | | | | | | 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: allow processing before main loopSimon Glass2012-03-121-0/+5
| | | | | | | | | 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 concept of sandbox stateSimon Glass2012-03-123-2/+60
| | | | | | | | | | | | 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: u-boot.lds: tweak styleMike Frysinger2012-03-121-5/+5
| | | | | | | We use tabs for indentation, not spaces. Acked-by: Simon Glass <sjg@chromium.org> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: add flags for open() callSimon Glass2012-03-121-2/+22
| | | | | | | | 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: add lseek helperMike Frysinger2012-03-121-0/+13
| | | | | | | 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: add required header to os.cSimon Glass2012-03-121-0/+1
| | | | | | | 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: sort header files in os.cSimon Glass2012-03-121-4/+4
| | | | | | | 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: fix compiling of cpu/os.cAndreas Bießmann2011-12-101-3/+4
| | | | | | | | | | | | | | | | | | | | | | | U-boot itself generally builds with -nostdinc. This is because the bootloader needs to be completely standalone. In the sandbox arch though, we need a little bit of code to glue the u-boot world to the host operating system, and we need to be able to access the host libc's headers in order to do so. Currently, we're using -I/usr/include to workaround the global -nostdinc, but that doesn't work for everyone and for all headers. Instead, let's filter out -nostdinc when building the os.c code. Without this patch, some distros hit errors such as: ---8<--- In file included from /usr/include/fcntl.h:27:0, from os.c:22: /usr/include/features.h:323:26: fatal error: bits/predefs.h: No such file or directory --->8--- Signed-off-by: Andreas Bießmann <biessmann@corscience.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: Add timer simulationMatthias Weisser2011-12-102-2/+29
| | | | | | | Making sleep command work Signed-off-by: Matthias Weisser <weisserm@arcor.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: Add improved RAM simulationMatthias Weisser2011-12-101-0/+7
| | | | | | | | | Using mmap to allocate memory from the OS for RAM simulation we can use u-boot own malloc implementation. Tested-by: Simon Glass <sjg@chromium.org> Signed-off-by: Matthias Weisser <weisserm@arcor.de> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sandbox: drop unused returnMike Frysinger2011-11-031-2/+0
| | | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Simon Glass <sjg@chromium.org>
* sandbox: put stdin into raw modeMike Frysinger2011-11-031-0/+34
| | | | | | | | This allows us to act like a serial device: we get tab chars and CTRL+C and respond appropriately. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Tested-by: Simon Glass <sjg@chromium.org>
* sandbox: Add main programSimon Glass2011-10-172-1/+34
| | | | | | Add a main program so that we can run U-Boot. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Add OS dependent layerSimon Glass2011-10-173-5/+62
| | | | | | | We want to keep all OS-dependent code in once place, with a simple interface to U-Boot. For now, this is that place. Signed-off-by: Simon Glass <sjg@chromium.org>
* sandbox: Add cpu filesSimon Glass2011-10-173-0/+144
This is an initial implementation with all functions defined but not working. The lds file is very simple since we can mostly rely on the linker defaults. Signed-off-by: Simon Glass <sjg@chromium.org>
OpenPOWER on IntegriCloud