summaryrefslogtreecommitdiffstats
path: root/common
Commit message (Collapse)AuthorAgeFilesLines
* digest: factorise file digest to common/digest.cJean-Christophe PLAGNIOL-VILLARD2011-10-121-0/+101
| | | | | | | | | | rename it to digest_file_window introduce digest_file to digest a file and digest_file_by_name where we specify the algo by name Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: move map_image amd unmap_image to image.cJean-Christophe PLAGNIOL-VILLARD2011-09-281-0/+121
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: use data base addr for image_print_contents, image_multi_count/getimgJean-Christophe PLAGNIOL-VILLARD2011-09-281-16/+15
| | | | | | | | as in barebox the data could be the mapped file or a allocated memory with just the data (non header) Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove EARLY_INIT and EARLY_CONSOLE supportSascha Hauer2011-09-274-81/+5
| | | | | | Bitrotted over time and nearly unused, so remove it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce generic memory bank handlingSascha Hauer2011-09-231-0/+18
| | | | | | | | | On arm we have the concept of memory banks which can be registered and iterated over. This is useful for other architectures aswell, so add some generic infrastructure for this. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename include/mem_malloc.h to include/memory.hSascha Hauer2011-09-232-2/+2
| | | | | | | Which is a better name and also better to collect other things. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add option LOCALVERSION to common/KconfigJan Weitzel2011-09-201-0/+9
| | | | | | | | Add Kconfig option LOCALVERSION so you can set a customizable suffix to the barebox version string. Signed-off-by: Jan Weitzel <j.weitzel@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/loads.c: make it compile againAntony Pavlov2011-08-231-0/+1
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* put env_push_context into postcore_initcallSascha Hauer2011-08-171-1/+1
| | | | | | env_push_context only needs malloc, so initialize it earlier. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* console: make console device a child of the hardware deviceSascha Hauer2011-08-151-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* login: add timeout supportJean-Christophe PLAGNIOL-VILLARD2011-08-111-39/+48
| | | | | | | | If a timeout is specified and expired the command will be executed by default boot Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove now unnecessary HAVE_MMU from KconfigSascha Hauer2011-08-031-4/+0
| | | | | | | MMU now can be enabled on every ARM board, so remove the dependency. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add option DEBUG_LL to common/KconfigAntony Pavlov2011-07-271-0/+10
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* drivers: move resource generic management to driver/base/resource.cJean-Christophe PLAGNIOL-VILLARD2011-07-212-47/+0
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* add a add_mem_device functionSascha Hauer2011-07-183-13/+50
| | | | | | | | | | | Add a helper function for boards to register their memory devices. This makes the board code smaller and also helps getting rid of map_base and struct memory_platform_data. And switch all of the memory to it Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* startup.c: make DEBUG_LL output more usefulAntony Pavlov2011-07-181-1/+5
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2011-07-061-0/+55
|\
| * shift and clocksourceCarlo Caione2011-06-221-0/+55
| | | | | | | | | | | | | | Added clocks_calc_mult_shift() Signed-off-by: Carlo Caione <carlo.caione@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | password: fix command support as moduleJean-Christophe PLAGNIOL-VILLARD2011-07-051-0/+7
| | | | | | | | | | | | | | add missing EXPORT_SYMBOL for nan static function Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | menu: fix command support as moduleJean-Christophe PLAGNIOL-VILLARD2011-07-051-1/+16
|/ | | | | | | add missing EXPORT_SYMBOL for nan static function Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix console fifo (and loadb/loady commands)Alexey Galakhov2011-05-161-11/+16
| | | | | | | | This patch fixes loadb and loady commands. tstc() should return true if console_input_buffer is not empty. Signed-off-by: Alexey Galakhov <agalakhov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* setenv: be robust against setenv(<var>, NULL)Peter Korsgaard2011-05-161-1/+1
| | | | | | | | Handle value == NULL similiar to how value == '' is currently handled. hush's builtin_getopt() seems to trigger this for OPTARG. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move simple_itoa to libbb so that others can use itSascha Hauer2011-04-121-14/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* environment: make default env path configurableSascha Hauer2011-04-122-3/+6
| | | | | | | | Normally the default path to save the environment is /dev/env0. However, we can't map a file in a fat filesystem to /dev/env0. So if we want to store the environment in a file in fat we have to make it configurable. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add dummy_malloc functionsSascha Hauer2011-04-113-1/+44
| | | | | | | | | | For some environments the dummy malloc functions offer a very small alternative implementation. malloc will get its memory from sbrk() and never frees memory again. This of course is not suitable for interactive environments and thus depends on CONFIG_SHELL_NONE Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* malloc: put common memory functions to seperate fileSascha Hauer2011-04-113-50/+72
| | | | | | | These functions are needed independently of the specific malloc implementation, so move them out. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add noshell supportSascha Hauer2011-04-111-1/+12
| | | | | | | | Some scenarios like initial bootloaders do not need interactive shell support, so make this optional. Without a shell a board must provide its own run_shell function. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* make command support optionalSascha Hauer2011-04-113-2/+7
| | | | | | | In a noninveractive environment we do not need commands. So make them optional. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* env: Make environment variable support optionalSascha Hauer2011-04-112-1/+6
| | | | | | | Environment variables are only useful in interactive environments. Make it optional on our way to support a noninteractive barebox. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add block supportSascha Hauer2011-04-113-0/+270
| | | | | | | | This adds a simple block layer to barebox. Reading and writing to block devices can be painfully slow without caching, so add a simple caching layer here. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* move version_string to seperate fileSascha Hauer2011-04-115-12/+18
| | | | | | | | | In a noninteractive environment barebox will be compiled without command support. So move version_string to a seperate file which is compiled unconditionally. Also, display the banner when the simple console support is used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* startup: we can only mount root and devfs when compiled inSascha Hauer2011-04-111-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2011-04-042-4/+147
|\
| * Merge branch 'master' into nextSascha Hauer2011-03-101-2/+0
| |\
| * | kallsyms/printk: enable symbol printing support (%pS)Sascha Hauer2011-03-102-4/+147
| | | | | | | | | | | | | | | | | | | | | | | | | | | With this kallsyms finally start working at least on ARM. This enables us resolving addresses into symbols which is particularly useful in combination with stack unwinding support. As kallsyms now compile and work we can remove the depends on BROKEN. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | defaultenv: fix empty CONFIG_DEFAULT_ENVIRONMENT_PATHJon Ringle2011-03-231-1/+3
| |/ |/| | | | | | | | | | | | | | | | | | | | | if CONFIG_DEFAULT_ENVIRONMENT_PATH="" then $(DEFAULT_ENVIRONMENT_PATH) expands to 'defaultenv "" ' The "" would cause every single file found in $(srctree) to be included in $(ENV_FILES). This would then cause scripts/mod/sumversions.c to get recompiled using $(CC) and fail compilation if $(CC) points to a newlib cross compiler Signed-off-by: Jon Ringle <jon@ringle.org> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | module: CONFIG_COMMAND does not exist anymore, remove ifdefsSascha Hauer2011-03-101-2/+0
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'next'Sascha Hauer2011-02-032-3/+4
|\
| * startup: make debug printing of linker variables work againSascha Hauer2011-01-171-2/+3
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * Merge branch 'master' into nextSascha Hauer2011-01-171-1/+1
| |\
| * | Init env context a bit earlier in initalization sequence.Marc Reilly2011-01-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Ensures subsequent init functions to export environment variables during init without having to rely on linking order being correct. Signed-off-by: Marc Reilly <marc@cpdesign.com.au> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | | Fix default baudrate settingJuergen Beisert2011-01-181-1/+2
| |/ |/| | | | | | | | | | | | | | | The menu entry to set the default baudrate (CONFIG_BAUDRATE) makes no sense, as long as its content is not used. This patch makes barebox using the setting again. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | device tree: fix printf compiler warningsSascha Hauer2011-01-071-1/+1
|/ | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Silence few warnings.Krzysztof Halasa2010-12-211-1/+1
| | | | | Signed-off-by: Krzysztof HaƂasa <khc@pm.waw.pl> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'led' into nextSascha Hauer2010-12-214-0/+54
|\
| * Add generic poll infrastructureMarc Kleine-Budde2010-12-204-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Barebox does not have interrupt functionality. Nevertheless it's sometimes useful to periodically call functions, like for example a heartbeat LED or watchdog reset. Instead of cluttering the code with calls to these functions this patch adds a generic polling infrastructure. Code which might run for longer now can call poller_call() periodically which in turn will call all registered pollers. This patch adds a call to poller_call in two generic pathes. First of them is getc() which covers waiting for uart input. Second is ctrlc() which should be called anyway from code which might run for longer. So instead adding poller_call directly to your code, consider checking ctrlc instead which also gives additional convenience to the user. The poller code is safe against reentrancy which means that it's safe to call poller_call inside a poller. Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console_simple: add fprintf / console_list for commands/loadb.cPeter Korsgaard2010-12-121-1/+25
|/ | | | | | | | | | commands/loadb.c doesn't build with CONFIG_CONSOLE_SIMPLE, because it uses fprintf / for_each_console (which uses console_list). Fix it by adding trivial implementations of both in console_simple. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* parser: use debug macrosRobert Schwebel2010-11-011-28/+23
| | | | | Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* doc: silence doxygen warningsRobert Schwebel2010-10-221-0/+4
| | | | | | | | | | | | Silence these warnings: common/kallsyms.c:8: Warning: documented function `const u8 kallsyms_names' was not declared or defined. common/kallsyms.c:10: Warning: documented function `const u8 kallsyms_token_table' was not declared or defined. common/kallsyms.c:11: Warning: documented function `const u16 kallsyms_token_index' was not declared or defined. common/kallsyms.c:13: Warning: documented function `const unsigned long kallsyms_markers' was not declared or defined. Signed-off-by: Robert Schwebel <r.schwebel@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common/memsize.c: add missing includeSascha Hauer2010-10-211-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>