summaryrefslogtreecommitdiff
path: root/lib_generic
Commit message (Collapse)AuthorAgeLines
* Fix LZMA string.h header inclusion issue and remove unused variables.Luigi 'Comio' Mantellini2009-08-09-3/+2
| | | | Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>
* add WATCHDOG_RESET to allow LZMA kernel decompression on slow machinesrhabarber1848@web.de2009-07-27-0/+30
| | | | Signed-off-by: rhabarber1848@web.de
* Use do_div from div64.h for vsprintfDirk Behme2009-07-27-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>
* Revert "zlib: updated to v.1.2.3"Wolfgang Denk2009-07-24-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>
* Coding Style cleanup; update CHANGELOG.Wolfgang Denk2009-07-23-944/+944
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* zlib: updated to v.1.2.3Giuseppe CONDORELLI2009-07-23-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>
* Refresh LZMA-lib to v4.65Luigi 'Comio' Mantellini2009-07-22-1845/+1996
| | | | Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com>
* compiler.h: unify system ifdef cruft hereMike Frysinger2009-07-19-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>
* Remove legacy NAND and disk on chip code.Scott Wood2009-07-16-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>
* lib_generic: gunzip: New function zunzipRicardo Ribalda Delgado2009-04-30-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>
* Update CHANGELOG, coding style cleanup.Wolfgang Denk2009-04-05-7/+9
|
* rename include/zlib.h to include/u-boot/zlib.hJean-Christophe PLAGNIOL-VILLARD2009-04-04-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>
* Add LZO decompressor supportStefan Roese2009-03-20-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>
* vsprintf: pull updates from Linux kernelMike Frysinger2009-03-20-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>
* bzip2: move ifdef handling to Makefile COBJS-$(...)Mike Frysinger2009-02-11-20/+5
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Fix gunzip in case of insufficient output bufferMatthias Fuchs2009-01-27-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>
* Introduce addr_map libraryKumar Gala2008-12-15-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>
* UBI: Add basic UBI support to U-Boot (Part 6/8)Kyungmin Park2008-11-19-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>
* Fix strmhz(): avoid printing negative fractionsWolfgang Denk2008-10-22-1/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* strmhz(): Round numbers when printing clock frequenciesWolfgang Denk2008-10-21-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>
* rename CFG_ macros to CONFIG_SYSJean-Christophe PLAGNIOL-VILLARD2008-10-18-6/+6
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Add Red Black Tree supportKyungmin Park2008-10-18-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>
* Coding style cleanup, update CHANGELOGWolfgang Denk2008-09-13-118/+118
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add support for LZMA uncompression algorithm.Luigi 'Comio' Mantellini2008-09-13-0/+2397
| | | | | Signed-off-by: Luigi 'Comio' Mantellini <luigi.mantellini@idf-hit.com> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* crc16: move to lib_genericJean-Christophe PLAGNIOL-VILLARD2008-08-29-0/+108
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* gunzip: move to lib_genericJean-Christophe PLAGNIOL-VILLARD2008-08-29-0/+114
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Consolidate strmhz() implementationHaavard Skinnemoen2008-08-21-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>
* drivers/mtd/nand: Move conditional compilation to MakefileJean-Christophe PLAGNIOL-VILLARD2008-08-13-1/+1
| | | | | | rename CFG_NAND_LEGACY to CONFIG_NAND_LEGACY Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* vsprintf: add z and t optionsJean-Christophe PLAGNIOL-VILLARD2008-07-14-3/+9
| | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Fix some more print() format errors.Wolfgang Denk2008-07-11-9/+11
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Fix LMB type issuesAndy Fleming2008-07-10-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>
* Allow print_size to print in GBBecky Bruce2008-07-09-13/+21
| | | | Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
* add SHA256 supportJean-Christophe PLAGNIOL-VILLARD2008-06-30-0/+263
| | | | | Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com> Signed-off-by: Francesco Albanese <Francesco.Albanese@swisscom.com>
* Fix an underflow bug in __lmb_alloc_baseAndy Fleming2008-06-28-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>
* Add lmb_freeAndy Fleming2008-06-28-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>
* Fix build issue with string.h and linux/string.hAndy Fleming2008-06-12-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>
* Change lmb to use phys_size_t/phys_addr_tBecky Bruce2008-06-12-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>
* Change print_size to take phys_size_tBecky Bruce2008-06-12-1/+1
| | | | Signed-off-by: Becky Bruce <becky.bruce@freescale.com>
* tools/mkimage: fix compiler warnings on some systems.Wolfgang Denk2008-06-06-0/+4
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Big white-space cleanup.Wolfgang Denk2008-05-21-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>
* Fix Compilation Errors with 'tools/env/fw_printenv'Grant Erickson2008-05-09-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>
* Coding Style cleanup, update CHANGELOGWolfgang Denk2008-04-26-2/+2
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Use watchdog-aware functions when calculating hashes of images - take twoBartlomiej Sieka2008-04-25-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>
* Use watchdog-aware functions when calculating hashes of imagesBartlomiej Sieka2008-04-25-1/+1
| | | | Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>
* lib_generic/crc32.c: add missing #include <watchdog.h>Wolfgang Denk2008-04-25-0/+1
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* lib_generic/crc32.c: fix compile problemWolfgang Denk2008-04-25-5/+4
| | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* Add support for calculating hashes with watchdog triggeringBartlomiej Sieka2008-04-25-0/+96
| | | | | | | | | | | | 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>
* crc32: use uint32_t rather than unsigned longMike Frysinger2008-04-24-9/+10
| | | | | | | | | | | | | The envcrc.c does sizeof(unsigned long) when calculating the crc, but this is done with the build toolchain instead of the target tool chain, so if the build is a 64bit system but the target is 32bits, the size will obviously be wrong. This converts all unsigned long stuff related to crc32 to uint32_t types. Compile tested only: output of ./tools/envcrc when run on a 32bit build system matches that of a 64bit build system. Signed-off-by: Mike Frysinger <vapier@gentoo.org> Acked-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
* Rename include/md5.h to include/u-boot/md5.hAndy Fleming2008-04-13-1/+1
| | | | | | | | | | | | | | Some systems have md5.h installed in /usr/include/. This isn't the desired file (we want the one in include/md5.h). This will avoid the conflict. This fixes the host tools building problem by creating a new directory for U-Boot specific header files. [Patch by Andy Fleming, modified to use separate directory by Wolfgang Denk] Signed-off-by: Wolfgang Denk <wd@denx.de> Signed-off-by: Andy Fleming <afleming@freescale.com> Acked-by: Timur Tabi <timur@freescale.com>
* Add the MD5 algorithmBartlomiej Sieka2008-03-14-0/+275
| | | | | | | MD5 supoprt is turned on by defining CONFIG_MD5, the digest can be then calculated using the md5() function -- see include/md5.h for details. Signed-off-by: Bartlomiej Sieka <tur@semihalf.com>