summaryrefslogtreecommitdiffstats
path: root/include/common.h
Commit message (Collapse)AuthorAgeFilesLines
* 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>
* common.h: remove unused function declarationsSascha Hauer2011-12-151-5/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* add kernel gunzip implementationSascha Hauer2011-11-291-2/+0
| | | | | | | The kernel uncompression functions have a unified API so use this implementation to get it. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* compile in simple_strtoullSascha Hauer2011-11-291-2/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove irq support fragmentsSascha Hauer2011-11-281-19/+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>
* pcm030: use new functionalitySascha Hauer2011-09-271-1/+1
| | | | | | | | | | We introduced several new functions to ease our life on ppc, use themn on the pcm030: - setup iomux and bus clocks in board code - add sdram memory according to detected size Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* ARM: rework MMU supportSascha Hauer2011-08-031-0/+1
| | | | | | | | | | | | | | | | | | In barebox we used 1MiB sections to map our SDRAM cachable. This has the drawback that we have to map our sdram twice: cached for normal sdram and uncached for DMA operations. As address space gets sparse on newer systems we are sometines unable to find a suitably big enough area for the dma coherent space. This patch changes the MMU code to use second level page tables. With it we can implement dma_alloc_coherent as normal malloc, we just have to remap the allocated area uncached afterwards and map it cached again after free(). This makes arm_create_section(), setup_dma_coherent() and mmu_enable() noops. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix: commands/bootm.c:346:2: warning: statement with no effectJean-Christophe PLAGNIOL-VILLARD2011-07-171-2/+8
| | | | | | | | convert enable_interrupts() and disable_interrupts() to static inline if no IRQ supoprt enable Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> 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>