summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'for-next/poller'Sascha Hauer2014-01-071-0/+58
|\
| * poller: Allow to call functions asynchronouslySascha Hauer2013-12-181-0/+58
| | | | | | | | | | | | | | | | | | Sometimes execution of a function has to be delayed, for example when a backlight can only be turned on when the picture has stabilized. To help in such situations add a convenience function around the poller stuff to call a function after a delay. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/omap-devicetree-prepare'Sascha Hauer2013-12-061-0/+34
|\ \
| * | ARM: OMAP: Make debug_ll UART Kconfig selectableSascha Hauer2013-11-221-0/+34
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2013-12-068-12/+106
|\ \ | | | | | | | | | | | | Conflicts: scripts/Makefile
| * | scripts: bareboxcrc32 as host and target userspacetoolMichael Grzeschik2013-12-041-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | This patch adds the crc32 command to be build as host and optionally as target tool. Signed-off-by: Michael Grzeschik <m.grzeschik@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common Kconfig: disable unused options for SHELL_NONESascha Hauer2013-11-261-0/+2
| | | | | | | | | | | | | | | | | | Let commandline editing and long help depend on !SHELL_NONE. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | common Kconfig: Add missing depends onSascha Hauer2013-11-261-5/+6
| | | | | | | | | | | | | | | | | | | | | CONFIG_MAXARGS is only used with the simple console support, so add a 'depends on'. While at it, move it below the shell selection. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | treewide: Add missing includesSascha Hauer2013-11-086-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | A lot of files rely on include/driver.h including include/of.h (and this including include/errno.h. include the files explicitly so we can eventually get rid of including of.h from driver.h Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | partitions: dos: parse extended partitionUwe Kleine-König2013-11-081-1/+75
| | | | | | | | | | | | | | | | | | | | | | | | DOS MBRs might contain an extended partition that holds several logical partitions. Add these to the partitions of the block device. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | partitions: dos: don't open code get_unaligned_le32Uwe Kleine-König2013-11-081-1/+1
| | | | | | | | | | | | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | partitions: dos: improve guess of disk sizeUwe Kleine-König2013-11-081-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code used to ineffectively take the end of the last partition as guess for the disk size. Better use the end of the partition that has its end rearmost. Also return an unsigned type instead of int as the result is always non-negative. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Merge branch 'for-next/hush'Sascha Hauer2013-12-061-81/+107
|\ \ \ | |_|/ |/| |
| * | hush: refactor reserved_word()Sascha Hauer2013-11-121-32/+32
| | | | | | | | | | | | | | | | | | Save indentation level for easier readability. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hush: use standard ARRAY_SIZESascha Hauer2013-11-121-2/+4
| | | | | | | | | | | | | | | | | | Use standard ARRAY_SIZE instead of handcrafted NRES. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hush: Be more informative on syntax errorSascha Hauer2013-11-121-3/+22
| | | | | | | | | | | | | | | | | | | | | Print the token that led to a syntax error, at least for the common case. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | consolidate syntax() and syntax_err()Sascha Hauer2013-11-121-4/+3
| | | | | | | | | | | | | | | | | | syntax is defined as syntax_err. Drop syntax_err and call syntax instead. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hush: rename __promptme to interruptSascha Hauer2013-11-121-10/+8
| | | | | | | | | | | | | | | | | | | | | the name '__promptme' does not make clear what the variable means. rename it to 'interrupt' which is set to true when the user has hit ctrl-c. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hush: refactor file_get()Sascha Hauer2013-11-121-13/+15
| | | | | | | | | | | | | | | | | | Save indentation level by returning early. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hush: refactor get_user_input()Sascha Hauer2013-11-121-15/+17
| | | | | | | | | | | | | | | | | | Save indentation level by returning early. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hush: refactor readline callSascha Hauer2013-11-121-5/+6
| | | | | | | | | | | | | | | | | | | | | Don't call readline in if/else, instead setup a variable and call it once. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | hush: fix exit on syntax error behaviourSascha Hauer2013-11-121-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | input.__promptme is no valid indicator that run_shell should be left. It should be left on executing the 'exit' builtin which is indicated by a return code < 0 from parse_stream_outer(). Track this with an extra variable and use it as a condition to return from an interactive shell. This fixes the weird behaviour that hush exits (and the user finds itself in the menu) when a syntax error occured. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | common: add dependency !SANDBOX on target toolsAlexander Aring2013-11-201-0/+2
|/ / | | | | | | | | | | | | | | The build of target tools fails on sandbox architecture. We don't need any target tools in this case, so add a dependency. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / blspec: fix documention of blspec_scan_directory's return codeUwe Kleine-König2013-11-081-2/+1
|/ | | | | Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rpi'Sascha Hauer2013-11-072-7/+9
|\
| * of: Add a context pointer to fixup functionsSascha Hauer2013-11-062-7/+9
| | | | | | | | | | | | | | If drivers want to fixup their specific instance they need some context to know which instance they have to fixup. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/bootspec'Sascha Hauer2013-11-071-37/+69
|\ \
| * | blspec: Make error message more clearSascha Hauer2013-11-051-1/+1
| | | | | | | | | | | | | | | | | | | | | "Nothing found on" is a bit unspecific. Make clear that no bootspec entry is found. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: make cdev optionalSascha Hauer2013-11-051-11/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | the cdev for a given directory can be determined by get_cdev_by_mountpath(). Use this function and remove the cdev argument from blspec_scan_directory(). Also, export the function to make code possible which boots the bootloader spec entries found in directories. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: Let scan functions return the number of entries foundSascha Hauer2013-11-051-20/+33
| | | | | | | | | | | | | | | | | | So that callers can detect whether entries are found or not. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: Allow to boot partitionsSascha Hauer2013-11-051-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of only allowing complete devices we now also allow single partitions to look for bootloader spec entries. Normally the bootloader spec defines a way to find a partition containing /boot on a device. On embedded systems it's often useful instead to have only a single partition image which contains both the kernel and the root filesystems. This partition image may be written to the device multiple times. With this patch they can be booted with 'boot emmc0.<partno>' Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: rename _hwdevice functions to _devicenameSascha Hauer2013-11-051-5/+5
| | | | | | | | | | | | | | | | | | | | | Since it's not necessarily the hardware device this seems to be a more appropriate name. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | blspec: Push device_detect into blspec_scan_deviceSascha Hauer2013-11-051-2/+2
| | | | | | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | dlmalloc: fix compiler warningAlexander Aring2013-11-071-1/+2
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | This patch fix a compiler warning while building sandbox barebox with gcc version 4.8.2. common/dlmalloc.c: In function ‘barebox_calloc’: common/dlmalloc.c:1756:2: warning: ISO C90 forbids mixed declarations and code [-Wdeclaration-after-statement] void *mem = malloc(sz); ^ Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | calloc: Fix possible memory leakAlexander Shiyan2013-10-221-2/+2
| | | | | | | | | | Signed-off-by: Alexander Shiyan <shc_work@mail.ru> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | blspec: Fix once/default bootingSascha Hauer2013-10-211-3/+5
|/ | | | | | | The default/once files contain the full path to the entries, not only the filename. This fixes booting the once and default entries. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: fix possible build problem without password supportJan Luebbe2013-10-151-0/+2
| | | | | | | | | | In the case where CONFIG_PASSWORD is off, CONFIG_PASSWORD_DEFAULT is undefined. As undefined is not "", this causes make to call find -type f. If there is a filename containing a :, make will complain about having "multiple target patterns" Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add kernel-install tool for bootloader SpecSascha Hauer2013-10-141-0/+8
| | | | | | | | | | | | This adds a tool for installing kernels according to the bootloader spec. systemd already has a similar tool, but it is limited to installing kernels on the currently running system. The barebox kernel-install tool instead can also be used to install kernels on removable media on a development host for cross development. It is compiled in two variants, as 'kernel-install' for the host and as 'kernel-install-target' using $CROSS_COMPILE. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Implement bootloader spec support for bareboxSascha Hauer2013-10-143-0/+531
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Bootloader Specification describes a way how kernels can be installed on devices and how they can be started by the bootloader. The bootloader spec is currently supported by (x86) gummiboot and by systemd which provides a kernel-install script. With the bootloader spec it's possible for the Operating system to install a new kernel without knowing about the bootloader and for the bootloader it's possible to discover and start Operating Systems on a media without being configured. For more details about the spec see: http://www.freedesktop.org/wiki/Specifications/BootLoaderSpec/ This patch adds barebox support for the spec. It enhances the 'boot' command so that not only boot script names can be given, but also devices containing bootloader spec entries. With this it's possible to call the 'boot' command like: 'boot sd emmc net'. It would then first look for bootloader spec entries on the (removable) sd card, then, is nothing is found, on the internal emmc and if still unsuccessful would call the 'net' bootscript. The bootloader Spec currently doesn't specify which entry should be default if multiple entries are found on a single device. Therefore barebox currently has two extensions of the spec. The $BOOT diretory can contain a file named 'default'. If present, the content of the file is treated as a filename under $BOOT/loader/entries/ which is used as default. Similarly if a file named 'once' is present, the entry is started once and the file is removed afterwards. This is useful for testing if a newly installed kernel works before making it the default. As on ARM and other Architectures a devicetree has to be specified for the kernel, the 'devicetree' property is used to specify a devicetree. Like 'kernel' and 'initrd' this also contains a pth relative to $BOOT. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* cdev: store dos partition type in struct cdevSascha Hauer2013-10-143-3/+9
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/rs485'Sascha Hauer2013-10-072-0/+17
|\ | | | | | | | | Conflicts: common/console_common.c
| * console: introduce console_get_by_devJean-Christophe PLAGNIOL-VILLARD2013-09-241-0/+13
| | | | | | | | | | | | | | so we can get console by it's device Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * shutdown: add board call backJean-Christophe PLAGNIOL-VILLARD2013-09-241-0/+4
| | | | | | | | | | | | | | | | so if we need to do something switch in the board we can fill this function pointer (as example on Animeo IP shutdown some rs232 & rs485) Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/mount'Sascha Hauer2013-10-071-0/+5
|\ \
| * | block: Collect block devices on listSascha Hauer2013-09-301-0/+5
| |/ | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/misc'Sascha Hauer2013-10-073-0/+18
|\ \ | | | | | | | | | | | | Conflicts: commands/Makefile
| * | globalvar: Do not modify already existing variablesSascha Hauer2013-09-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | When globalvar_add_simple was called on previously existing variables then the value was overwritten, even when value was passed as NULL. Do not overwrite the value in this case which allows us to do a 'global' on the same variable multiple times without loosing the values. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * | process_escape_sequence: add support to \$?Jean-Christophe PLAGNIOL-VILLARD2013-09-182-0/+15
| |/ | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/login'Sascha Hauer2013-10-078-15/+199
|\ \ | | | | | | | | | | | | Conflicts: include/console.h
| * | introduce runtime loglevelSascha Hauer2013-09-292-1/+44
| | | | | | | | | | | | | | | | | | | | | With this the verbosity of barebox can be controlled during runtime using the 'loglevel' globalvar. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>