summaryrefslogtreecommitdiffstats
path: root/arch/sandbox/os
Commit message (Collapse)AuthorAgeFilesLines
* Shell: Handle aborting loops betterSascha Hauer2019-04-241-1/+1
| | | | | | | | | | | | | | | | | | It's easy to get stuck in an infinite loop in the hush shell: while true; do sleep 1; done The 'sleep' command will check for ctrl-c with the ctrlc() function. This will abort the sleep command. Hush then checks for ctrl-c again in the loop. The ctrl-c in the buffer has already been eaten by the sleep command, so the loop will continue. With this patch we remember the presence of a ctrl-c character in a variable instead of checking for a new character each time. The variable must be resetted explicitly by calling ctrlc_handled() which will be called by the shell in the outer loop. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: add gpio support with libftdi1Antony Pavlov2018-01-292-0/+157
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: new --stdinout option to enable a bidirectional consoleAleksander Morgado2017-06-061-11/+42
| | | | | | | | | In addition to allowing read-only and write-only consoles with --stdin and --stdout, we now allow bidirectional read/write consoles with FIFO files. This is e.g. to allow doing RATP over the FIFO based consoles. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: Fix registering file/fifo consolesSascha Hauer2017-06-011-19/+19
| | | | | | | | barebox_register_console() uses xzalloc which requires the malloc pool to be initialized, so call it during the second option parsing when this is already done. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: fix registering multiple consolesAleksander Morgado2017-06-011-3/+3
| | | | | | | | | | | | | | | | | | Consoles need to be registered with the "console" device name so that they are probed by the correct driver. The barebox_register_console() was already forcing this as it was overwriting the name that was being passed as argument, but it was failing to provide a unique id for each new console, so the underlying register_device() would just return an error when wanting to re-register a device with device name "console" and id 0. We remove the unused name parameter from barebox_register_console() as it is really nowhere used, and also specify DEVICE_ID_DYNAMIC as id, so that a new unique device id is given to each newly registered console device. Signed-off-by: Aleksander Morgado <aleksander@aleksander.es> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: eliminate sdl_init()Antony Pavlov2016-10-191-6/+1
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* restart: replace reset_cpu with registered restart handlersSascha Hauer2015-08-271-3/+3
| | | | | | | | | | | | | | | | | | | | | | This replaces the reset_cpu() function which every SoC or board must provide with registered handlers. This makes it possible to have multiple reset functions for boards which have multiple ways to reset the machine. Also boards which have no way at all to reset the machine no longer have to provide a dummy reset_cpu() function. The problem this solves is that some machines have external PMICs or similar to reset the system which have to be preferred over the internal SoC reset, because the PMIC can reset not only the SoC but also the external devices. To pick the right way to reset a machine each handler has a priority. The default priority is 100 and all currently existing restart handlers are registered with this priority. of_get_restart_priority() allows to retrieve the priority from the device tree which makes it possible for boards to give certain restart handlers a higher priority in order to use this one instead of the default one. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: hostfile: completely switch to OF based probingMarc Kleine-Budde2015-03-061-1/+1
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: hostfile: improve --image parameter to support "dev=file"Marc Kleine-Budde2015-03-061-3/+12
| | | | | | | | | | | | This patch makes it possible to specify the device name of a file added to the sandbox via the --image paramter, e.g.: barebox --image foo=bar.image This means the file "bar.image" is added as "/dev/foo" to the sandbox. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: move device name generation for image/env into add_image()Marc Kleine-Budde2015-03-061-10/+11
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: hostfile: is always mmpad'edMarc Kleine-Budde2015-03-061-10/+6
| | | | | | | ...so remove conditional code. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: hostfile: clarify variable namesMarc Kleine-Budde2015-03-061-8/+8
| | | | | | | | Use "filename" for the name of the file in the host system, while "devname" for the device in the sandbox. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: add support to pass dtb to bareboxMarc Kleine-Budde2015-03-061-1/+46
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: fix indention in help textMarc Kleine-Budde2015-03-031-1/+1
| | | | | Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: get malloc_size from .configAntony Pavlov2015-01-212-1/+3
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Documentation: remove doxygen documentationSascha Hauer2014-06-261-55/+0
| | | | | | | The doxygen documentation is long outdated. Remove it. It will be replaced with sphinx based documentation later. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* documentation: add sandbox malloc argumentAlexander Aring2012-10-131-0/+4
| | | | | | | Add malloc argument in doxygen comment. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: fix malloc argument stringAlexander Aring2012-10-131-1/+1
| | | | | | | Fix malloc argument string. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: move add_image for env in second getoptAlexander Aring2012-10-131-5/+7
| | | | | | | | Function add_image needs a allocated malloc space. This is only available in the second getopt loop. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/sandbox'Sascha Hauer2012-10-033-3/+140
|\ | | | | | | | | Conflicts: arch/sandbox/mach-sandbox/include/mach/linux.h
| * sandbox: add sdl video supportJean-Christophe PLAGNIOL-VILLARD2012-09-253-2/+133
| | | | | | | | | | | | | | | | | | | | | | | | This will allow speed up the dev on framebuffer. By default the resolution is VGA but this can be changed via cmdline. We use a pthread to Flip the screen every 100ms as we can not detect when barebox update it as barebox simpliy write in a buffer. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * sandbox: add missed case statementAlexander Aring2012-09-111-1/+7
| | | | | | | | | | | | | | | | Add missed case statement to ignore 'i' parameter in first getopt loop. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-032-6/+0
|\ \ | | | | | | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * | Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-172-6/+0
| |/ | | | | | | | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / sandbox: check only image option in the second getoptJean-Christophe PLAGNIOL-VILLARD2012-09-201-11/+1
|/ | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: fix malloc argumentAlexander Aring2012-09-031-30/+57
| | | | | | | Fix malloc argument for sandbox system. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sanbox: add linux_execve and linux_exec commandJean-Christophe PLAGNIOL-VILLARD2011-12-071-0/+22
| | | | | | | this will allow to execute a program of the host from barebox Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix malloc space sizesSascha Hauer2011-12-031-1/+1
| | | | | | end is start + size - 1, not start + size. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove irq support fragmentsSascha Hauer2011-11-281-8/+0
| | | | | | | | We never had interrupt support in barebox and we have no plans to add interrupt support. Even if we do I doubt the current fragments of irq support are helpful, so remove them. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Only pass -P to cpp when generating ld scriptsLoïc Minier2011-10-181-1/+0
| | | | | | | | | | | | | | | | | | | | | | | When building sandbox with ccache, one would hit warnings such as: warning: 'struct mmsghdr' declared inside parameter list on random files; a way to reproduce this issue is to build a simple file doing just: #include <sys/socket.h> int main(void) { return 0; } gcc -Wall -P -c -o foo foo.c But actually the -P flag is only useful when generating non-C files, such as linker scripts in the case of barebox. Removing the -P flag from all the gcc invocations, except when generating .lds files makes the warning go away. It turns out that this is what linux/scripts/Makefile.build also does nowadays. Signed-off-by: Loïc Minier <loic.minier@linaro.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: switch to resourceJean-Christophe PLAGNIOL-VILLARD2011-07-301-2/+2
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* sandbox: remove non used functions linux_getc/putcJean-Christophe PLAGNIOL-VILLARD2011-02-031-20/+0
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reset_cpu: unify declarationRobert Schwebel2010-10-221-1/+1
| | | | | | | | include/common.h declares this as "unsigned long addr", so we unify it. This also silences a doxygen warning. Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove strange flush_cache functionsSascha Hauer2010-10-211-5/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: add longopts and fix segfaultRobert Schwebel2010-09-211-14/+32
| | | | | | | | | | | | | | | Until now, the main function of the sandbox port wants to use the libc getopt(), but as we have a getopt() implementation in barebox as well, it is silently used instead. This works in the usual case, but if an error occurs (i.e. by using an unknown argument) in getopt(), the implementation tries to write to the console, which is not initialized and thus breaks with a null pointer exception. This patch changes the main function to use getopt_long() instead of getopt(). This makes us use the implementation in glibc and while being there, we get long options, which makes us look more professional... Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de>
* make reset_cpu a __noreturn functionSascha Hauer2010-03-301-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* sandbox: common: fix device names for environment files (-e)Peter Korsgaard2009-12-161-1/+1
| | | | | | | | The env%d string got created, but the the hardcoded "env" string was always used instead, causing errors with loading the env. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* [SANDBOX] Move include/asm-sandbox/arch-* to arch/sandbox/*/include/machJean-Christophe PLAGNIOL-VILLARD2009-10-222-3/+13
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* get rid of device idsSascha Hauer2009-07-211-4/+10
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Sandbox: Fix make systemSascha Hauer2008-09-303-0/+488
Sandbox compilation failed with: gcc -Wp,-MD,arch/sandbox/lib/.tap.o.d -nostdinc -isystem /usr/lib/gcc/x86_64-linux-gnu/4.3.1/include -I/usr/include -Iinclude -P -Wall -D"KBUILD_STR(s)=#s" -D"KBUILD_BASENAME=KBUILD_STR(tap)" -D"KBUILD_MODNAME=KBUILD_STR(tap)" -c -o arch/sandbox/lib/tap.o arch/sandbox/lib/tap.c In file included from /usr/include/bits/socket.h:32, from /usr/include/sys/socket.h:36, from arch/sandbox/lib/tap.c:29: /usr/include/limits.h:125:26: error: limits.h: No such file or directory /usr/include/limits.h uses the next_include directive This was because of the -nostdinc Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>