summaryrefslogtreecommitdiffstats
path: root/common/Makefile
Commit message (Collapse)AuthorAgeFilesLines
...
| * common: DDR2 SPD checksum.Renaud Barbier2013-06-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | The code calculates the DDR2 SPD checksum as per JEDEC standard No 21-C Appendix X (revision 1.2) The code is based on the equivalent files from U-Boot version git-a71d45d. Signed-off-by: Renaud Barbier <renaud.barbier@ge.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/memtest'Sascha Hauer2013-07-011-0/+1
|\ \
| * | common: add memtest.c with mem_test routineAlexander Aring2013-06-051-0/+1
| |/ | | | | | | | | | | | | | | | | | | | | | | Add mem_test routine. Useful to detect timing problems if someone porting a new device to barebox. This test includes a data bus test, address bus test and integrity check of memory. This mem_test routine has as parameter start and end address of testing space. The last parameter can skip the integrity check. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* / bootm: factor out code to make it usable from CSascha Hauer2013-06-191-0/+1
|/ | | | | | | Much of the bootm code is implemented in the command itself. Move it to a common place to be able to call it from C aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* make: Add barebox_default_env.* to targetsSascha Hauer2013-05-251-0/+2
| | | | | | Otherwise it gets rebuilt everytime. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory commands: move memory_display to separate fileSascha Hauer2013-04-171-0/+1
| | | | | | | | memory_display is a function which should generally be available. Currently it depends on memory command support being compiled in, so move the function to a separate file. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* bootsource: create arch independent bootsource frameworkMarc Kleine-Budde2013-04-041-0/+1
| | | | | | | | | | | | This patch seperates the imx independent from the arch independent code. The following functions and enums are renamed: - imx_bootsource() -> bootsource_get() - imx_set_bootsource() -> bootsource_set() - enum imx_bootsource -> enum bootsource Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/gpt'Sascha Hauer2013-03-041-1/+1
|\
| * partitons: add frameworkJean-Christophe PLAGNIOL-VILLARD2013-02-161-1/+1
| | | | | | | | | | | | | | | | | | | | so we can support multiple format use filetpye to detect the parser to use Cc: Rob Herring <rob.herring@calxeda.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | console: consolidate common console codeSascha Hauer2013-02-131-1/+1
|/ | | | | | | The different console implementations share a good amount of code, share this in console_common.c. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce console none supportJean-Christophe PLAGNIOL-VILLARD2013-01-231-0/+1
| | | | | | | | | | | | this will allow to have no console support Use full for bootstrap as we can save 6.5 KiB (barebox.bin) and 3.8 KiB (zbarebox.bin lzo) on at91sam9263 as example vs console simple As on bootstrap we have often very limited size. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add in-system barebox update infrastructureSascha Hauer2012-10-171-0/+1
| | | | | | | | | | | | | | | Currently in-system update means to write an arbitrary file to an arbitrary device. There is no sanity check if the flashed image is of the right type or will fit onto the device. Furthermore some SoCs need a special preparation step for their images before flashing them. This adds a barebox in-system update infrastructure. Boards can register update handlers which know how to make the board bootable. The available handlers can be listed to be able to select one, different force levels give the user the chance to know it better. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defaultenv: dependencies fixesSascha Hauer2012-10-121-9/+12
| | | | | | | | | | | | | | When a build with a compressed default environment is done and then environment compression is disabled, barebox_default_env.h is not regenerated because its dependency (now barebox_default_env) is still up to date. This results in a corrupt default environment. This patch fixes this by adding a cmd_env_h and changing barebox_default_env.h to FORCE. As a side effect barebox_default_env.h is no longer generated in include/generated/ but in common/ as we have to add barebox_default_env.h to $(targets) (extra-y). Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/defaultenv-deps'Sascha Hauer2012-10-031-12/+20
|\
| * environment generation: Fix dependenciesSascha Hauer2012-09-281-8/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The dependencies for generating the environment do not work properly: - If files are removed from the defaultenv, a subsequent make will not update the default environment. - If CONFIG_DEFAULT_ENVIRONMENT_PATH changes, the default environment also will not be regenerated. This patch fixes this by introducing a cmd_env which has the content of $(ENV_FILES) in the command so that the if_changed mechanism recognizes a change when $(ENV_FILE) changes. This also results in a nice " ENV " string in the build process. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * environment generation: remove unused CLEAN_FILESSascha Hauer2012-09-281-4/+0
| | | | | | | | | | | | | | The CLEAN_FILES in common/Makefile are unused. All generated files are removed from the toplevel Makefile. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | common: split out meminfo output and make it optionalJan Luebbe2012-09-061-0/+1
|/ | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* defautenv: add support of symlinkJean-Christophe PLAGNIOL-VILLARD2012-09-051-1/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Merge branch 'for-next/reset-source'Sascha Hauer2012-08-011-0/+1
|\
| * Enable a way to provide the reason for "being here"Juergen Beisert2012-07-181-0/+1
| | | | | | | | | | | | | | | | | | | | Many architectures support a way to detect why the bootloader is running. This patch adds a global variable to be able to use the cause in some kind of shell code to do special things on demand. For example to do an emergency boot, when the last boot fails and the watchdog reactivate the hanging system. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | uimage: introduce UIMAGE Kconfig symbolSascha Hauer2012-07-251-2/+2
|/ | | | | | | Both the uimage command and the bootm command need uImage support, so add a Kconfig symbol for it to be able to select it properly. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add next generation default environment templateSascha Hauer2012-05-181-0/+7
| | | | | | | | | | | | | | | | | | | | This adds a new environment template which aims to be more flexible and configurable. Instead of having mainly two scripts (a config script and a boot script) this template uses initscripts which control the startup behaviour and configuration. Also we have boot scripts in /env/boot which configure a single boot configuration. Additional boot entries can be added by board specific entries or during runtime by copying and editing a template entry. Some more helpers handle for example network interfaces which can now be brought up with 'ifup'. We use the automount feature to configure mountpoints together with the commands to bring up the devices behind these mountpoints. Optionally menu support is available which hides many details behind a nice looking interface. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* booting: more flexible Linux bootargs generationSascha Hauer2012-05-141-0/+1
| | | | | | | | | | | | | | | | | | | | | | We currently use the environment variable 'bootargs' to get the Linux bootargs. This patch allows for a more flexible bootargs generation using global variables. With it the Linux bootargs are concatenated from multiple variables. This allows to replace parts of the bootargs string without having to reconstruct it completely. With this bootargs can be constructed like: global linux.bootargs.base="console=ttyS0,115200" global linux.bootargs.ip="ip=dhcp" global linux.mtdparts="physmap-flash.0:512K(nor0.barebox),-(root)" This will then automatically be combined into a kernel bootargs string during boot. If the 'linux.bootargs.' variables are all empty the old standard 'bootargs' way will be used. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add 'global' commandSascha Hauer2012-05-141-0/+1
| | | | | | | | | | | This implements global shell variable support. This is done by registering a new device named 'global', so global variables are just plain device parameters. Global variables are useful for storing the global state in the environment. Currently we do this by sourcing scripts instead of executing them which is quite limiting. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Introduce binfmt supportJean-Christophe PLAGNIOL-VILLARD2012-04-181-0/+1
| | | | | | | | | | | | | This will allow to execute any file and detect it's type to handle it. This will allow to use shell for bootp bootfile or dfu. You can register multiple hook for the same filetype. They will be execute in the invert order of register. If a hook does not handle the file you just return -ERESTARTNOHAND; This is only available with hush parser. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Makefile: fix build timestampsSascha Hauer2012-04-151-0/+17
| | | | | | | | | | | This patch adds the scripts/mkcompile_h from the Kernel. This gives us additional information about the build like who built this binary and with which compiler. Currently the only information used is the build timestamp and the generation number. This also fixes the build timestamp in the banner which is now correct even with consecutive builds without making clean in between. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* filetype: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-111-1/+1
| | | | | | remove 160 bytes Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* banner: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-111-1/+1
| | | | | | this will allow to save 144 bytes Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* defaultenv: use a compressed version when embedded in bareboxJean-Christophe PLAGNIOL-VILLARD2012-01-021-1/+26
| | | | | | | | | | | | | | | | | | | enable it only if a compression is enabled support gzip, bzip2 and lzo you will be able to choose which compression to use -rw-r--r-- 1 root root 8436 Dec 15 01:35 barebox_default_env -rw-r--r-- 1 root root 2782 Dec 15 01:35 barebox_default_env.bz2 -rw-r--r-- 1 root root 2691 Dec 15 01:38 barebox_default_env.gz -rw-r--r-- 1 root root 3262 Dec 15 01:38 barebox_default_env.lzo with using gzip and the default env we can save 5.6KiB (5,745 bytes) with using bzip2 and the default env we can save 5.5KiB (5,654 bytes) with using lzo and the default env we can save 5.1KiB (5,174 bytes) Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add tlsf-based malloc implementationAntony Pavlov2011-12-231-0/+2
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* reimplement uImage codeSascha Hauer2011-12-151-0/+1
| | | | | | | | | | | | | Provide a new API for accessing uImages which makes it easy for commands to open images, verify them, load to (free) sdram regions and show information about uImages. - We now do not load the image to malloced space anymore. - The data in the header is now stored in cpu native endianess after uimage_open which makes it easy to access the header data. - uImage can be loaded to dynamically allocated sdram regions. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove old ft_build supportSascha Hauer2011-12-141-1/+0
| | | | | | | This is unused now as its only user (ppc) is switched to libfdt based oftree support" Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add resource management functionsSascha Hauer2011-12-031-0/+1
| | | | | | | It is time to track our memory usage. Add a simple resource management. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add file detection supportSascha Hauer2011-11-291-0/+1
| | | | | | | | | | | | | | | Several filetypes can be autodetected. Barebox could make use of this in several ways: - Add a command to detect filetypes - detect arm zImages and uImages to unify the different boot commands - maybe detect UBI or JFFS2 images to construct parts of the kernel command line - select correct uncompression function based on filetype This patch adds basic support to detect filetypes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* DISK: Add common partition handling for disk like mediaJuergen Beisert2011-11-281-0/+2
| | | | | | | | | This covers disk like media like SD card, CF cards, regular hard disks and also USB mass storage devices. Most common used partition table is still of DOS type. This implementation is prepared to support more partition types in the future. Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* initial oftree command supportSascha Hauer2011-10-191-0/+1
| | | | | | | | | | | This adds basic device tree command support. So far we can parse a flat device tree (-p), which also stores the tree in memory, dump it (-d) and free (-f) the internally stored tree. The chosen node can be updated with barebox bootargs, no other device tree manipulation is implemented yet. 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>
* drivers: move resource generic management to driver/base/resource.cJean-Christophe PLAGNIOL-VILLARD2011-07-211-1/+0
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* add a add_mem_device functionSascha Hauer2011-07-181-0/+1
| | | | | | | | | | | 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>
* add dummy_malloc functionsSascha Hauer2011-04-111-1/+2
| | | | | | | | | | 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-111-0/+1
| | | | | | | These functions are needed independently of the specific malloc implementation, so move them out. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* make command support optionalSascha Hauer2011-04-111-1/+1
| | | | | | | 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-111-1/+1
| | | | | | | 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-111-0/+1
| | | | | | | | 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-111-0/+1
| | | | | | | | | 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>
* 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>
* Add generic poll infrastructureMarc Kleine-Budde2010-12-201-0/+1
| | | | | | | | | | | | | | | | | | | | | 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>
* defaultenv: introduce CONFIG_DEFAULT_ENVIRONMENT_GENERIC to enable itJean-Christophe PLAGNIOL-VILLARD2010-10-121-2/+8
| | | | | | | this will we usefull to enable functionnality if used Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* image: factorise image printing contentsJean-Christophe PLAGNIOL-VILLARD2010-10-081-1/+1
| | | | | | Copied from U-Boot Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* image: factorise string helperJean-Christophe PLAGNIOL-VILLARD2010-10-081-0/+1
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>