summaryrefslogtreecommitdiff
path: root/lib_generic
Commit message (Collapse)AuthorAgeLines
* gzip/zlib: make features optionalMike Frysinger2010-01-26-2/+2
| | | | | | | | If you really want to slim down U-Boot and you would rather use a higher compression scheme (like LZMA), it'd be nice to disable gzip/zlib since these code bases take up a significant amount of space. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* lmb: only force on arches that use itMike Frysinger2010-01-21-1/+13
| | | | Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* sha1: add dedicated config optionMike Frysinger2010-01-21-1/+1
| | | | | | | The sha1 code is currently compiled for everyone, but in reality, it's only used by the FIT code. So make it optional just like MD5. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
* Make getenv_IPaddr() globalDirk Behme2010-01-17-0/+51
| | | | | | | | | | | | | | | | | | | There are boards out there that do not have network support in U-Boot (CONFIG_CMD_NET not set), but they do so in Linux. This makes it desirable to be able to port network configuration (like the IP address) to the Linux kernel. We should not make the passing of the IP configuration to Linux dependent on U-Boot features / settings. For this, make getenv_IPaddr() global. This fixes build error u-boot/lib_xxx/board.c:360: undefined reference to `getenv_IPaddr' on various architectures. Signed-off-by: Dirk Behme <dirk.behme@googlemail.com> Acked-by: Ben Warren <biggerbadderben@gmail.com>
* move prototypes for gunzip() and zunzip() to common.hWolfgang Wegner2009-12-21-3/+0
| | | | | | | | Prototype for gunzip/zunzip was only in lib_generic/gunzip.c and thus repeated in every file using it. This patch moves the prototypes to common.h and removes all prototypes distributed anywhere else. Signed-off-by: Wolfgang Wegner <w.wegner@astro-kom.de>
* common: delete CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOULHeiko Schocher2009-12-08-17/+1
| | | | | | | | | There is more and more usage of printing 64bit values, so enable this feature generally, and delete the CONFIG_SYS_64BIT_VSPRINTF and CONFIG_SYS_64BIT_STRTOUL defines. Signed-off-by: Heiko Schocher <hs@denx.de>
* Merge branch 'master' into nextWolfgang Denk2009-12-07-0/+2
|\ | | | | | | | | | | | | Conflicts: lib_generic/zlib.c Signed-off-by: Wolfgang Denk <wd@denx.de>
| * zlib.c: avoid build conflicts for cradle boardWolfgang Denk2009-12-07-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Commit dce3d79710 updated the zlib code to v0.95; this caused conflicts when building for the "cradle" board, because the (pretty generic) preprocessor variable "OFF" was used in multiple files. Make sure to avoid further conflicts by #undef'ing it in zlib.c before redefining it. Signed-off-by: Wolfgang Denk <wd@denx.de> cc: Giuseppe Condorelli <giuseppe.condorelli@st.com> cc: Angelo Castello <angelo.castello@st.com> cc: Alessandro Rubini <rubini-list@gnudd.com>
* | Merge branch 'master' into nextWolfgang Denk2009-12-05-3/+117
|\ \ | |/ | | | | | | | | | | | | Conflicts: board/esd/plu405/plu405.c drivers/rtc/ftrtc010.c Signed-off-by: Wolfgang Denk <wd@denx.de>
| * lzma: ignore unset filesizesMike Frysinger2009-12-05-3/+6
| | | | | | | | | | | | | | | | | | The Linux kernel build system changed how it compresses things with LZMA such that the header no longer contains the filesize (it is instead set to all F's). So if we get a LZMA image that has -1 for the 64bit field, let's just assume that the decompressed size is unknown and continue on. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
| * circbuf: Move to lib_generic and conditionally compilePeter Tyser2009-12-02-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>
* | zlib: Optimize decompressionJoakim Tjernlund2009-12-05-12/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch optimizes the direct copy procedure. Uses get_unaligned() but only in one place. The copy loop just above this one can also use this optimization, but I havn't done so as I have not tested if it is a win there too. On my MPC8321 this is about 17% faster on my JFFS2 root FS than the original. No speed test has been performed in u-boot. Size increase on ppc: 484 bytes Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se> Acked-by: Peter Korsgaard <jacmet@sunsite.dk>
* | add lzop decompression supportPeter Korsgaard2009-12-05-0/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | Add lzop decompression support to the existing lzo bitstream handling (think gzip versus zlib), and support it for uImage decompression if CONFIG_LZO is enabled. Lzop doesn't compress as good as gzip (~10% worse), but decompression is very fast (~0.7s faster here on a slow ppc). The lzop decompression code is based on Albin Tonnerre's recent ARM Linux lzo support patch. Cc: albin.tonnerre@free-electrons.com Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk>
* | Generic udelay() with watchdog supportIngo van Lil2009-12-05-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | According to the PPC reference implementation the udelay() function is responsible for resetting the watchdog timer as frequently as needed. Most other architectures do not meet that requirement, so long-running operations might result in a watchdog reset. This patch adds a generic udelay() function which takes care of resetting the watchdog before calling an architecture-specific __udelay(). Signed-off-by: Ingo van Lil <inguin@gmx.de>
* | crc32: Impl. linux optimized crc32()Joakim Tjernlund2009-12-02-88/+112
|/ | | | | | | | | | | | | | | | | | Ported over the more efficient linux crc32() function. A quick comparsion on ppc: After changing the old crc32 to do 4 bytes in the inner loop to be able to compare with new version one can note: - old inner loop has 61 insn, new has 19 insn. - new crc32 does one 32 bit load of data to crc while the old does four 8 bits loads. - size is bit bigger for the new crc32: 1392(old) 1416(new) of text. The is because the new version shares code with crc32_no_comp() instead of duplicating code. - about 33% faster on ppc: New > crc 0 0xfffffff -> 39 secs Old > crc 0 0xfffffff -> 60 secs Signed-off-by: Joakim Tjernlund <Joakim.Tjernlund@transmode.se>
* lib_generic memset: fill one word at a time if possibleAlessandro Rubini2009-10-18-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>
* lib_generic memcpy: copy one word at a time if possibleAlessandro Rubini2009-10-18-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>
* zlib: fix code when DEBUG is definedGiuseppe CONDORELLI2009-09-04-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>
* zlib: add watchdog reset callGiuseppe CONDORELLI2009-08-11-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>
* zlib: updated to v.1.2.3Giuseppe CONDORELLI2009-08-11-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>
* 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>