summaryrefslogtreecommitdiffstats
path: root/include/common.h
Commit message (Collapse)AuthorAgeFilesLines
* linux/kernel.h: move some macros and prototypesMasahiro Yamada2015-01-291-58/+0
| | | | | | | | | | The include/common.h is still cluttered (although much better than U-Boot). It contains various utility macros that originates in Linux. Move them to the original place, include/linux/kernel.h, to slim down include/common.h. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* asm-generic/bug.h: move BUG(), BUG_ON(), WARN(), WARN_ON() macrosMasahiro Yamada2015-01-291-32/+0
| | | | | | | | In Linux, these macros are defined in include/asm-generic/bug.h. To tidy up common.h, move BUG(), BUG_ON(), WARN(), WARN_ON() there. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* linux/bug.h: move BUILD_BUG_ON*() macrosMasahiro Yamada2015-01-291-19/+1
| | | | | | | | | | | In Linux, the macros BUILD_BUG_ON* are defined in include/linux/bug.h. To tidy up common.h, move BUILD_BUG_* there. MAYBE_BUILD_BUG_ON is not used in barebox and it was removed from Linux long time ago. Drop it from barebox, too. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* linux/kernel.h: move *_MAX, *_MIN macrosMasahiro Yamada2015-01-211-13/+0
| | | | | | | | | | | Linux defines *_MAX, *_MIN macros in include/linux/kernel.h. Let's follow this way to slim down the common.h. This change should have no impact because include/common.h already includes <linux/kernel.h>. Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common.h: use special IOMEM() for MIPSAntony Pavlov2014-09-111-0/+6
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/usb-host'Sascha Hauer2014-08-071-0/+16
|\ | | | | | | | | Conflicts: drivers/usb/core/Makefile
| * include: import {lower,upper}_32_bits helpersSebastian Hesselbarth2014-07-281-0/+16
| | | | | | | | | | | | | | | | This imports {lower,upper}_32_bits defines to allow to get upper and lower 32b part of a 64b number. Signed-off-by: Sebastian Hesselbarth <sebastian.hesselbarth@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Add release stringSascha Hauer2014-07-221-0/+1
|/ | | | | | | | | Currently we only have version_string which contains information about the date the binary was compiled and by whom it has been compiled. This adds a release_string which only contains the plain release version. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* common: fix macro WARNChristoph Fritz2014-05-131-1/+2
| | | | | Signed-off-by: Christoph Fritz <chf.fritz@googlemail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Add shell_expand functionSascha Hauer2014-03-281-0/+9
| | | | | | shell_expand expands shell variables in a string. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* run_command: remove unused flag parameterSascha Hauer2014-03-071-2/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* scripts: bareboxcrc32 as host and target userspacetoolMichael Grzeschik2013-12-041-0/+2
| | | | | | | | 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: add a macro to align an array on the stackAndre Heider2013-10-221-0/+11
| | | | | | | | | | | The macro can be used for temporary stack buffers which need to meet a minimum alignment requirement. This will be used by bcm2835 mailbox users, where all buffers need to be aligned. Signed-off-by: Andre Heider <a.heider@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* shutdown: add board call backJean-Christophe PLAGNIOL-VILLARD2013-09-241-0/+1
| | | | | | | | 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/boardinfo'Sascha Hauer2013-09-051-1/+4
|\ | | | | | | | | | | | | Conflicts: arch/mips/boards/qemu-malta/init.c commands/bootm.c drivers/of/base.c
| * Make hostname available to C CodeSascha Hauer2013-08-161-0/+2
| | | | | | | | | | | | | | The boards often have a sane default for the hostname. Provide a C function for setting/getting it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * introduce barebox_set_modelSascha Hauer2013-08-161-0/+1
| | | | | | | | | | | | | | | | Instead of calling of_get_model() in barebox_get_model() add a barebox_set_model() and use it to set the boardinfo once it's available from the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * remove remaining references of CONFIG_BOARDINFOSascha Hauer2013-08-161-1/+1
| | | | | | | | | | | | | | | | | | | | | | With this all code uses barebox_get_model() and no longer a compile time generated string. Also this renames barebox_boardinfo() to barebox_get_model() since we are going to add the corresponding _set_ function and 'model' corresponds to the devicetree notion. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | move print_hex_dump function to include/common.hSascha Hauer2013-08-071-0/+8
|/ | | | | | | | print_hex_dump is a standard kernel function, so move it outside the ubi header files to make it usable for other code derived from the kernel aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory_display: Change address pointer to type const void *Sascha Hauer2013-07-221-1/+1
| | | | | | | No need to force a width of the pointer, so use void *. Also it's not modified in memory_display, so also add a const. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2013-07-011-0/+2
|\
| * add function to get boardinfo stringSascha Hauer2013-06-241-0/+2
| | | | | | | | | | | | | | | | When using devicetrees the boardinfo (or model) can be obtained from the devicetree. Add a function to get the boardinfo so that we have a chance to add information from the devicetree. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | common: add ALIGN_DOWN macroAlexander Aring2013-06-051-0/+1
| | | | | | | | | | Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | common: fix codestyle in ALIGN macrosAlexander Aring2013-06-051-2/+2
|/ | | | | Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Use a common define for RW_BUF_SIZESascha Hauer2013-04-171-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* memory commands: move memory_display to separate fileSascha Hauer2013-04-171-1/+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>
* memory commands: export common functionsSascha Hauer2013-04-171-0/+4
| | | | | | | The memory commands all use open_and_lseek and mem_parse_options. Export them to be able to split the memory commands into separate files. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/misc'Sascha Hauer2013-02-041-0/+2
|\
| * common: add PAGE_ALIGN_DOWN macroAlexander Aring2013-01-181-0/+1
| | | | | | | | | | | | | | | | Add PAGE_ALIGN_DOWN macro, which is like PAGE_ALIGN macro but returns the lower page boundary of address. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
| * arm-mmu: move PAGE_ALIGN macro to common.hAlexander Aring2013-01-181-0/+1
| | | | | | | | | | | | | | | | | | | | PAGE_ALIGN macro is needed to align addresses to page boundaries. Move this macro to another PAGE_* defines. Commands which uses remap_range function needs this macro. Signed-off-by: Alexander Aring <alex.aring@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Merge branch 'for-next/compile-log-level'Sascha Hauer2013-02-041-16/+1
|\ \ | | | | | | | | | | | | Conflicts: drivers/usb/host/ehci-hcd.c
| * | consolidate print* in a single headerJean-Christophe PLAGNIOL-VILLARD2013-01-271-16/+1
| |/ | | | | | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | startup: add __noreturn to start_bareboxSascha Hauer2013-01-201-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | startup: call a barebox_main function pointer at the end of the startupSascha Hauer2013-01-201-0/+6
|/ | | | | | | | | | | | | | | | | Currently Kconfig dependencies are used to allow non-interactive builds. This leads to problems in Kconfig getting the dependencies right. This patch adds a barebox_main function pointer which is called at the end of the startup process. This defaults to run_shell when a shell is enabled. With this the HAVE_NOSHELL Kconfig variable can be removed. Non interactive builds can now be enabled for every board allowing to compile a binary without further Kconfig dependencies. This also allows for more flexibility, for example boards may decide to try non-interactive startup first and call run_shell if that fails. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* lib: update size_human_readable to latest versionWolfram Sang2012-12-191-1/+1
| | | | | | | | Copy over the latest version from u-boot which handles bigger sizes now and does arithmetic with shifts instead of divisions. Signed-off-by: Wolfram Sang <w.sang@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mem: add the swab (swap bytes) option to memory_display()Antony Pavlov2012-11-261-1/+1
| | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce region_overlap() functionSascha Hauer2012-10-051-0/+13
| | | | | | To check if two regions overlap Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/remove-fsf-address'Sascha Hauer2012-10-031-4/+0
|\ | | | | | | | | | | Conflicts: drivers/net/miidev.c include/miidev.h
| * Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-4/+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>
* | common: split out meminfo output and make it optionalJan Luebbe2012-09-061-2/+2
|/ | | | | Signed-off-by: Jan Luebbe <jlu@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'for-next/poweroff'Sascha Hauer2012-07-021-0/+1
|\
| * add 'poweroff' commandAntony Pavlov2012-06-301-0/+1
| | | | | | | | | | Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | make memory display 64bit capableSascha Hauer2012-06-301-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | make parse_area_spec arguments loff_tSascha Hauer2012-06-301-1/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | introduce strtoull_suffix functionSascha Hauer2012-06-301-0/+1
| | | | | | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | Change byte order detection mechanism to kernel styleSascha Hauer2012-06-281-0/+18
|/ | | | | | | | | | | | | | | The Linux Kernel defines only one of __LITTLE_ENDIAN and __BIG_ENDIAN. Endianess can then be tested with #ifdef __xx_ENDIAN. Userspace always defined both __LITTLE_ENDIAN and __BIG_ENDIAN and byteorder can then be tested with #if __BYTE_ORDER == __xx_ENDIAN. As we tend to use a lot of Kernel code in barebox we switch to use the kernel way of determing the byte order. As this always causes a lot of confusion add a check to include/common.h to make sure only one of __LITTLE_ENDIAN and __BIG_ENDIAN is defined. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: Allow to compile in thumb-2 modeSascha Hauer2012-03-061-0/+6
| | | | | | | | | This shrinks the resulting binary size by ~25%. Exceptions are still handled in arm mode, so we have to explicitely put .arm directives into the exception code. Thumb-2 mode has been tested on i.MX51 Babbage board. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Merge branch 'pu/debug' into nextSascha Hauer2012-01-271-0/+9
|\
| * Add dump_stack functionSascha Hauer2012-01-261-0/+9
| | | | | | | | | | | | | | | | | | | | At least ARM allows us to dump the stack, but we currently have no prototype for this. Add a dump_stack prototype and provide a static inline function for architectures without stack dump support. Also, call dump_stack() in panic() to provide more information in the case of a panic. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* | banner: add config to disable itJean-Christophe PLAGNIOL-VILLARD2012-01-111-0/+4
|/ | | | | | this will allow to save 144 bytes Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>