summaryrefslogtreecommitdiff
path: root/lib_generic
AgeCommit message (Collapse)Author
2009-09-04zlib: fix code when DEBUG is definedGiuseppe CONDORELLI
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-11zlib: add watchdog reset callGiuseppe CONDORELLI
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-11zlib: updated to v.1.2.3Giuseppe CONDORELLI
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-09Fix LZMA string.h header inclusion issue and remove unused variables.Luigi 'Comio' Mantellini
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.de
Signed-off-by: rhabarber1848@web.de
2009-07-27Use do_div from div64.h for vsprintfDirk Behme
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 Denk
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-23Coding Style cleanup; update CHANGELOG.Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2009-07-23zlib: updated to v.1.2.3Giuseppe CONDORELLI
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' Mantellini
Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>
2009-07-19compiler.h: unify system ifdef cruft hereMike Frysinger
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-16Remove legacy NAND and disk on chip code.Scott Wood
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-04-30lib_generic: gunzip: New function zunzipRicardo Ribalda Delgado
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 Denk
2009-04-04rename include/zlib.h to include/u-boot/zlib.hJean-Christophe PLAGNIOL-VILLARD
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-20Add LZO decompressor supportStefan Roese
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-20vsprintf: pull updates from Linux kernelMike Frysinger
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-11bzip2: move ifdef handling to Makefile COBJS-$(...)Mike Frysinger
Signed-off-by: Mike Frysinger <vapier@gentoo.org>
2009-01-27Fix gunzip in case of insufficient output bufferMatthias Fuchs
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-15Introduce addr_map libraryKumar Gala
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 Park
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 Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-10-21strmhz(): Round numbers when printing clock frequenciesWolfgang Denk
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-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-10-18Add Red Black Tree supportKyungmin Park
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 Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-09-13Add support for LZMA uncompression algorithm.Luigi 'Comio' Mantellini
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-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-29gunzip: move to lib_genericJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-08-21Consolidate strmhz() implementationHaavard Skinnemoen
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-VILLARD
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-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2008-07-11Fix some more print() format errors.Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-07-10Fix LMB type issuesAndy Fleming
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-09Allow print_size to print in GBBecky Bruce
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
2008-06-30add SHA256 supportJean-Christophe PLAGNIOL-VILLARD
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Francesco Albanese <Francesco.Albanese@swisscom.com>
2008-06-28Fix an underflow bug in __lmb_alloc_baseAndy Fleming
__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-28Add lmb_freeAndy Fleming
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 Fleming
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 Bruce
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 Bruce
Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
2008-06-06tools/mkimage: fix compiler warnings on some systems.Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-05-21Big white-space cleanup.Wolfgang Denk
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-09Fix Compilation Errors with 'tools/env/fw_printenv'Grant Erickson
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 Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-25Use watchdog-aware functions when calculating hashes of images - take twoBartlomiej Sieka
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 Sieka
Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
2008-04-25lib_generic/crc32.c: add missing #include <watchdog.h>Wolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-25lib_generic/crc32.c: fix compile problemWolfgang Denk
Signed-off-by: Wolfgang Denk <wd@denx.de>
2008-04-25Add support for calculating hashes with watchdog triggeringBartlomiej Sieka
Implement watchodg-aware variants of hash calculation functions: - crc32_wd() - md5_wd() - sha1_csum_wd() The above functions calculate the hash of the input buffer in chunks, triggering the watchdog after processing each chunk. The chunk size is given as a function call parameter. Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>