summaryrefslogtreecommitdiff
path: root/lib_generic
AgeCommit message (Collapse)AuthorFilesLines
2009-12-03circbuf: Move to lib_generic and conditionally compilePeter Tyser2-0/+111
circbuf could be used as a generic library and is only currently needed when CONFIG_USB_TTY is defined. Signed-off-by: Peter Tyser <ptyser@xes-inc.com>
2009-10-19lib_generic memset: fill one word at a time if possibleAlessandro Rubini1-3/+19
If the destination is aligned, fill ulong values until possible. Then fill remaining part by byte. Signed-off-by: Alessandro Rubini <rubini@unipv.it> Acked-by: Andrea Gallo <andrea.gallo@stericsson.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
2009-10-19lib_generic memcpy: copy one word at a time if possibleAlessandro Rubini1-4/+15
If source and destination are aligned, this copies ulong values until possible, trailing part is copied by byte. Thanks for the details to Wolfgang Denk, Mike Frysinger, Peter Tyser, Chris Moore. Signed-off-by: Alessandro Rubini <rubini@unipv.it> Acked-by: Andrea Gallo <andrea.gallo@stericsson.com> Acked-by: Mike Frysinger <vapier@gentoo.org>
2009-09-05zlib: fix code when DEBUG is definedGiuseppe CONDORELLI1-2/+3
Removed stdio.h inclusion and moved trace macros to use printf avoiding to write debug informations to standard error. Signed-off-by: Giuseppe Condorelli <giuseppe.condorelli@st.com>
2009-08-12zlib: add watchdog reset callGiuseppe CONDORELLI1-1/+7
This patch adds watchdog reset call to allow its invokation during decompression phase. This control was present on old zlib version and here it is backported for those relevant routines. This patch is sent as a zlib separate one beacuse it was not tested due to specific board lack. zlib patches will be unified just in one when this will be validated through tests. Signed-off-by: Giuseppe Condorelli <giuseppe.condorelli@st.com>
2009-08-12zlib: updated to v.1.2.3Giuseppe CONDORELLI1-1958/+1975
This patch updates zlib to the latest stable version. Only relevant zlib parts were ported to u-boot tree, as already did for the current zlib (0.95). New zlib guarantees a faster inflate performances other then others improvements as explained at www.zlib.net. It also includes Alessandro Rubini's patches to allow 0 as destination pointer and to call watchdog reset if required by architecture. Signed-off-by: Giuseppe Condorelli <giuseppe.condorelli@st.com> Reviewed-by: Angelo Castello <angelo.castello@st.com> Reviewed-by: Alessandro Rubini <rubini-list@gnudd.com>
2009-08-10Fix LZMA string.h header inclusion issue and remove unused variables.Luigi 'Comio' Mantellini3-3/+2
Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>
2009-07-27add WATCHDOG_RESET to allow LZMA kernel decompression on slow machinesrhabarber1848@web.de2-0/+30
Signed-off-by: rhabarber1848@web.de
2009-07-27Use do_div from div64.h for vsprintfDirk Behme1-3/+4
Use do_div from div64.h for vsprintf in case of 64bit division. For 32bit division, do_div from div64.h can't be used as it needs a 64bit parameter. Signed-off-by: Dirk Behme <dirk.behme@googlemail.com> Acked-by: Stefan Roese <sr@denx.de> CC: Simon Kagstrom <simon.kagstrom@netinsight.net>
2009-07-24Revert "zlib: updated to v.1.2.3"Wolfgang Denk1-1959/+1944
This reverts commit b201171f2b4d509f3ad510b214bee70ff902e3d6. The commit caused problems for example when unpacking kernel images: Uncompressing Kernel Image ... Error: inflate() returned -2 GUNZIP: uncompress, out-of-mem or overwrite error - must RESET board to recover Conflicts: include/u-boot/zlib.h lib_generic/zlib.c Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-07-24Coding Style cleanup; update CHANGELOG.Wolfgang Denk1-944/+944
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-07-23zlib: updated to v.1.2.3Giuseppe CONDORELLI1-1958/+1973
This patch updates zlib to the latest stable version. Only relevant zlib parts were ported to u-boot tree, as was done for the previously used version of zlib (0.95). New zlib gives faster inflate performance and other improvements, see www.zlib.net Signed-off-by: Giuseppe Condorelli <giuseppe.condorelli@st.com> Reviewed-by: Angelo Castello <angelo.castello@st.com> Edited commit message Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-07-22Refresh LZMA-lib to v4.65Luigi 'Comio' Mantellini15-1845/+1996
Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>
2009-07-19compiler.h: unify system ifdef cruft hereMike Frysinger1-5/+3
Shove a lot of the HOSTCC and related #ifdef checking crap into the new compiler.h header so that we can keep all other headers nice and clean. Also introduce custom uswap functions so we don't have to rely on the non standard implementations that a host may (or may not in the case of OS X) provide. This allows mkimage to finally build cleanly on an OS X system. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-07-17Remove legacy NAND and disk on chip code.Scott Wood1-3/+1
Legacy NAND had been scheduled for removal. Any boards that use this were already not building in the previous release due to an #error. The disk on chip code in common/cmd_doc.c relies on legacy NAND, and it has also been removed. There is newer disk on chip code in drivers/mtd/nand; someone with access to hardware and sufficient time and motivation can try to get that working, but for now disk on chip is not supported. Signed-off-by: Scott Wood <scottwood@freescale.com>
2009-05-01lib_generic: gunzip: New function zunzipRicardo Ribalda Delgado1-7/+20
Separate gunzip in gunzip: Find the end of the header and call zunzip. zunzip: Inflate gunzip block without header. UBI fs blocks can be compresed in lzo, zlib or no-compression. The current implementation of u-boot supported all the compressions but there was a bug in the implementation of the zlib blocks. UBIFS's Zlib blocks do not have header but they were compressed using gunzip, a function used to decompress gunzip files/sectors with a header. This patch adds a new function zunzip that uncompress a zlib block with no header. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@uam.es>
2009-04-05Update CHANGELOG, coding style cleanup.Wolfgang Denk1-7/+9
2009-04-04rename include/zlib.h to include/u-boot/zlib.hJean-Christophe PLAGNIOL-VILLARD3-3/+3
Some systems have zlib.h installed in /usr/include/. This isn't the desired file for u-boot code - we want the one in include/zlib.h. This rename will avoid the conflict. Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-03-21Add LZO decompressor supportStefan Roese3-0/+334
This patch adds LZO decompression support to U-Boot. It is needed for the upcoming UBIFS support, since UBIFS uses LZO as default compressor/ decompressor. Since we only support read-only in UBIFS, only the decompressor is needed. All this is copied with minor changes from the current Linux kernel version (2.6.28-rc8). This patch only implements this LZO decompressor support for PPC. Other platforms using UBIFS will have to add the required "include/asm/unaligned.h" as well. It should be fairly easy to copy this from the Linux source tree as I have done it for PPC in this patch. Signed-off-by: Stefan Roese <sr@denx.de>
2009-03-21vsprintf: pull updates from Linux kernelMike Frysinger1-106/+373
This brings in support for the %p modifier which allows us to easily print out things like ip addresses, mac addresses, and pointers. It also converts the rarely used 'q' length modifier to the common 'L' modifier when dealing with quad types. While this new code is a bit larger (~1k .text), most of it should be made up by converting the existing ip/mac address code to use format modifiers. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-02-12bzip2: move ifdef handling to Makefile COBJS-$(...)Mike Frysinger6-20/+5
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-27Fix gunzip in case of insufficient output bufferMatthias Fuchs1-1/+2
U-Boot's gunzip() function does not handle the return code of zlib's inflate() function correctly. gunzip() is implemented to uncompress all input data in one run. So the correct return code for the good case is Z_STREAM_END. In case of insufficient output buffer memory inflate returns Z_OK. For gunzip() this is an error. It also makes sense to me to call inflateEnd() also in case of an error. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd-electronics.com>
2008-12-16Introduce addr_map libraryKumar Gala2-0/+82
Add a library that helps in translating between virtual and physical addresses. This library can be useful as a simple means to implement map_physmem() and virt_to_phys() for platforms that need functionality beyond the simple 1:1 mapping. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
2008-11-19UBI: Add basic UBI support to U-Boot (Part 6/8)Kyungmin Park1-0/+23
This patch adds basic UBI (Unsorted Block Image) support to U-Boot. It's based on the Linux UBI version and basically has a "OS" translation wrapper that defines most Linux specific calls (spin_lock() etc.) into no-ops. Some source code parts have been uncommented by "#ifdef UBI_LINUX". This makes it easier to compare this version with the Linux version and simplifies future UBI ports/bug-fixes from the Linux version. Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com> Signed-off-by: Stefan Roese <sr@denx.de>
2008-10-22Fix strmhz(): avoid printing negative fractionsWolfgang Denk1-1/+1
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-10-21strmhz(): Round numbers when printing clock frequenciesWolfgang Denk1-2/+4
Round clock frequencies for printing. Many boards printed off clock frequencies like 399 MHz instead of the exact 400 MHz because numberes were not rounded. This is fixed now. Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-10-18rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD1-6/+6
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18Add Red Black Tree supportKyungmin Park2-0/+391
Now it's used at UBI module. Of course other modules can use it. If you want to use it, please define CONFIG_RBTREE Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
2008-09-13Coding style cleanup, update CHANGELOGWolfgang Denk3-118/+118
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-09-13Add support for LZMA uncompression algorithm.Luigi 'Comio' Mantellini11-0/+2397
Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-29crc16: move to lib_genericJean-Christophe PLAGNIOL-VILLARD2-0/+108
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-29gunzip: move to lib_genericJean-Christophe PLAGNIOL-VILLARD2-0/+114
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-21Consolidate strmhz() implementationHaavard Skinnemoen2-0/+37
ARM, i386, m68k and ppc all have identical implementations of strmhz(). Other architectures don't provide this function at all. This patch moves strmhz() into lib_generic, reducing code duplication and providing a more unified API across architectures. Signed-off-by: Haavard Skinnemoen <haavard.skinnemoen@atmel.com>
2008-08-13drivers/mtd/nand: Move conditional compilation to MakefileJean-Christophe PLAGNIOL-VILLARD1-1/+1
rename CFG_NAND_LEGACY to CONFIG_NAND_LEGACY Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-07-14vsprintf: add z and t optionsJean-Christophe PLAGNIOL-VILLARD1-3/+9
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-07-11Fix some more print() format errors.Wolfgang Denk1-9/+11
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-10Fix LMB type issuesAndy Fleming1-3/+3
The LMB code now uses phys_addr_t and phys_size_t. Also, there were a couple of casting problems in the bootm code that called the LMB functions. Signed-off-by: Andy Fleming <afleming@freescale.com>
2008-07-10Allow print_size to print in GBBecky Bruce1-13/+21
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
2008-07-01add SHA256 supportJean-Christophe PLAGNIOL-VILLARD2-0/+263
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Francesco Albanese <Francesco.Albanese@swisscom.com>
2008-06-29Fix an underflow bug in __lmb_alloc_baseAndy Fleming1-15/+19
__lmb_alloc_base can underflow if it fails to find free space. This was fixed in linux with commit d9024df02ffe74d723d97d552f86de3b34beb8cc. This patch merely updates __lmb_alloc_base to resemble the current version in Linux. Signed-off-by: Andy Fleming <afleming@freescale.com>
2008-06-29Add lmb_freeAndy Fleming1-0/+49
lmb_free allows us to unreserve some memory so we can use lmb_alloc_base or lmb_reserve to temporarily reserve some memory. Signed-off-by: Andy Fleming <afleming@freescale.com>
2008-06-12Fix build issue with string.h and linux/string.hAndy Fleming2-2/+2
This commit: commit 338cc038461a6c7709c5b86fd9a240209338a1ae Author: Wolfgang Denk <wd@denx.de> Date: Fri Jun 6 14:28:14 2008 +0200 tools/mkimage: fix compiler warnings on some systems. Broke building on some systems, because the host's string.h was interfering with u-boot's linux/string.h. It doesn't look like we need the u-boot one if we're building for the host, so now we only include when building inside u-boot. Signed-off-by: Andy Fleming <afleming@freescale.com>
2008-06-12Change lmb to use phys_size_t/phys_addr_tBecky Bruce1-34/+35
This updates the lmb code to use phys_size_t and phys_addr_t instead of unsigned long. Other code which interacts with this code, like getenv_bootm_size() is also updated. Booted on MPC8641HPCN, build-tested ppc, arm, mips. Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
2008-06-12Change print_size to take phys_size_tBecky Bruce1-1/+1
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
2008-06-06tools/mkimage: fix compiler warnings on some systems.Wolfgang Denk2-0/+4
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-21Big white-space cleanup.Wolfgang Denk3-3/+3
This commit gets rid of a huge amount of silly white-space issues. Especially, all sequences of SPACEs followed by TAB characters get removed (unless they appear in print statements). Also remove all embedded "vim:" and "vi:" statements which hide indentation problems. Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-10Fix Compilation Errors with 'tools/env/fw_printenv'Grant Erickson1-0/+2
In the current top-of-tree, 1.3.3.-rc2, the optional tool 'tools/env/fw_printenv' fails to compile for two reasons: 1) The header watchdog.h cannot be found. 2) The header zlib.h is picked up from the tool chain rather than the project causing a prototype conflict for crc32. This patch addresses both of these issues. Platforms Tested On: - AMCC "Kilauea" Signed-off-by: Grant Erickson <gerickson@nuovations.com>
2008-04-26Coding Style cleanup, update CHANGELOGWolfgang Denk1-2/+2
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-25Use watchdog-aware functions when calculating hashes of images - take twoBartlomiej Sieka2-0/+8
Some files didn't get updated properly with the "Use watchdog-aware functions when calculating hashes of images" commit, this commit fixes this. Signed-off-by: Bartlomiej Sieka <tur@semihalf.com> Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-25Use watchdog-aware functions when calculating hashes of imagesBartlomiej Sieka1-1/+1
Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>