summaryrefslogtreecommitdiff
path: root/lib_generic
Commit message (Collapse)AuthorAgeLines
* 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>
* [new uImage] Introduce lmb from linux kernel for memory mgmt of boot imagesKumar Gala2008-02-29-0/+281
| | | | | | | | Introduce the LMB lib used on PPC in the kernel as a clean way to manage the memory spaces used by various boot images and structures. This code will allow us to simplify the code in bootm and its support functions. Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
* [new uImage] Move gunzip() common code to common/gunzip.cMarian Balakowicz2008-02-07-0/+4
| | | | | | | Move gunzip(), zalloc() and zfree() to a separate file. Share zalloc() and zfree() with cramfs uncompress routine. Signed-off-by: Marian Balakowicz <m8@semihalf.com>
* Fix 64-bit vsprintf.James Yang2008-01-12-4/+17
| | | | | | | | There were some size and unsigned problems. Also add support for "ll" size modifier in format string like glibc Signed-off-by: James Yang <James.Yang@freescale.com> Acked-by: Jon Loeliger <jdl@freescale.com>
* Build: split COBJS value into multiple linesGrant Likely2007-11-15-5/+16
| | | | | | | | | This change is in preparation for condtitionial compile support in the build system. By spliting them all into seperate lines now, subsequent patches that change 'COBJS-y += ' into 'COBJS-$(CONFIG_<blah>) += ' will be less invasive and easier to review Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* Move 64bit division from avr32 to generic libDirk Behme2007-08-10-1/+53
| | | | | | | | | Move the 64bit division from lib_avr32 to lib_generic. With this, all boards can do_div/__div64_32 if needed, not only avr one. Code is put to lib_generic, so no larger memory footprint if not used. No code modifications. Thanks for proposal by Håvard Skinnemoen. Signed-off-by: Dirk Behme <dirk.behme@gmail.com>
* Merge branch 'testing' into workingAndy Fleming2007-08-03-4/+5
|\ | | | | | | | | | | | | | | | | | | Conflicts: CHANGELOG fs/fat/fat.c include/configs/MPC8560ADS.h include/configs/pcs440ep.h net/eth.c
| * disk/ doc/ lib_*/ and tools/: Remove lingering references to CFG_CMD_* symbols.Jon Loeliger2007-07-10-2/+2
| | | | | | | | | | | | | | | | Fixed some broken instances of "#ifdef CMD_CFG_IDE" too. Those always evaluated TRUE, and thus were always compiled even when IDE really wasn't defined/wanted. Signed-off-by: Jon Loeliger <jdl@freescale.com>
| * lib_{arm,avr32,blackfin,generic,i386}/: Remove obsolete references to ↵Jon Loeliger2007-07-09-2/+2
| | | | | | | | | | | | CONFIG_COMMANDS Signed-off-by: Jon Loeliger <jdl@freescale.com>
| * lib_*/: Augment CONFIG_COMMANDS tests with defined(CONFIG_CMD_*).Jon Loeliger2007-07-04-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a compatibility step that allows both the older form and the new form to co-exist for a while until the older can be removed entirely. All transformations are of the form: Before: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) After: #if (CONFIG_COMMANDS & CFG_CMD_AUTOSCRIPT) || defined(CONFIG_CMD_AUTOSCRIPT) Signed-off-by: Jon Loeliger <jdl@freescale.com>
* | Coding style cleanup; update CHANGELOG.Wolfgang Denk2007-07-10-293/+276
| | | | | | | | Signed-off-by: Wolfgang Denk <wd@denx.de>
* | [PCS440EP] upgrade the PCS440EP board:Heiko Schocher2007-06-22-1/+431
|/ | | | | | | | | | | | - Show on the Status LEDs, some States of the board. - Get the MAC addresses from the EEProm - use PREBOOT - use the CF on the board. - check the U-Boot image in the Flash with a SHA1 checksum. - use dynamic TLB entries generation for the SDRAM Signed-off-by: Heiko Schocher <hs@denx.de>
* [PATCH 3_9] Move buffer print code from md command to common functionGrant Likely2007-02-20-0/+70
| | | | | | | Printing a buffer is a darn useful thing. Move the buffer print code into print_buffer() in lib_generic/ Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
* Fix JFFS2 compilation problemStefan Roese2006-10-12-2/+2
| | | | Patch by Stefan Roese, 12 Oct 2006
* Cleanup of NAND update patch (remove changelog from cmd_nand.c)Stefan Roese2006-10-11-3/+2
| | | | Patch by Guido Classen, 10 Oct 2006
* * Several improvements to the new NAND subsystem:Stefan Roese2006-10-10-1/+3
| | | | | | | | | - JFFS2 related commands implemented in mtd-utils style - Support for bad blocks - Bad block testing commands - NAND lock commands Please take a look at doc/README.nand for more details Patch by Guido Classen, 10 Oct 2006