9
0
Fork 0
Commit Graph

71 Commits

Author SHA1 Message Date
Sascha Hauer 5dd5884801 lib: Add hex2bin and bin2hex implementations
Taken from the Kernel, put into the same place as in the kernel,
although the hexdump.c does not actually contain hexdum functions.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-13 08:22:27 +01:00
Sascha Hauer 55ab01c7ff Merge branch 'for-next/rockchip'
Conflicts:
	arch/arm/Kconfig
2015-03-09 08:30:35 +01:00
Andrey Panov 78d030226d lib: Add gcd() function
It calculates greatest common divisor.

Signed-off-by: Andrey Panov <rockford@yandex.ru>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-03-05 09:11:33 +01:00
Sascha Hauer 39f6392d93 move cmdline partition parsing code to separate file
So it's no longer local to the addpart/delpart code and can be used
from other code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-02-12 09:33:43 +01:00
Sascha Hauer a9d7b3d00e Add PBL console support
This adds simple console support to the PBL which makes it
possible to print more complex messages in the PBL than just
strings or hex numbers. For now puts_ll is used to print the
messages, so it depends on CONFIG_DEBUG_LL which makes it
more a debugging option. However, this could be extended later
to get regular output from the PBL if desired.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 11:30:59 +01:00
Sascha Hauer 8a7335f8b5 printf: move simple_strto*() functions to separate file
These are not needed in the PBL, so move them to a separate file.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2015-01-05 11:30:58 +01:00
Sascha Hauer ccb2816477 Add xz decompression support
This adds xz decompression support from the kernel. Both compressing
the barebox binary with xz and decompressing xz files on the commandline
is supported.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-11-04 12:18:55 +01:00
Sascha Hauer 9cce00617b Merge branch 'for-next/rtc'
Conflicts:
	arch/mips/dts/jz4755.dtsi
	commands/Makefile
2014-08-07 13:13:45 +02:00
Sascha Hauer 38c3b2455e Merge branch 'for-next/misc'
Conflicts:
	lib/Makefile
2014-08-07 13:13:31 +02:00
Sascha Hauer 5b7b7ee5d9 Merge branch 'for-next/metadata'
Conflicts:
	arch/arm/dts/Makefile
	common/Makefile
	lib/Makefile
2014-08-07 06:15:16 +02:00
Sascha Hauer 3cfa4bc00c move file helper functions to separate file
We have our file helper functions in several places. Move them
all to lib/libfile.c.
With this we no longer have file helpers in fs/fs.c which contains
the core fs functions and no functions in lib/libbb.c which are
not from busybox.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-08-07 06:13:51 +02:00
Antony Pavlov 6d3fc76b77 lib: import 'bcd' from linux-3.15
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-31 07:30:51 +02:00
Sascha Hauer 757377a9ab lib: Add bitmap functions from kernel
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-17 23:01:15 +02:00
Sascha Hauer 2e82822d08 Add beginning wchar support
EFI uses 16 bit character strings. Add beginning support for this.
Since barebox uses 8 bit strings internally we need conversion functions
to convert between 16 bit and 8 bit strings.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-07-14 08:01:06 +02:00
Antony Pavlov c2ffad8855 lib: fix whitespace, drop blank lines at EOF
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2014-01-06 09:24:22 +01:00
Sascha Hauer feefc3ef3b Merge branch 'for-next/mtd' 2013-08-05 12:49:58 +02:00
Sascha Hauer ca13a84ac2 ARM: MXS: introduce stmp device support
MXS specific devices have some common infrastructure in the kernel
known as STMP devices. We have the same in barebox, but with a
mxs_ prefix instead of a stmp_ prefix. As some STMP devices are
also found on i.MX6 move the common infrastructure out of MXS
specific files and use the stmp_ prefix.

This is done in preparation for i.MX6 NAND support.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-23 16:25:13 +02:00
Kyungsik Lee cdc837f4d9 lib: Add support for LZ4-compressed kernel
This patch adds support for extracting LZ4-compressed kernel images,
as well as LZ4-compressed ramdisk images in the kernel boot process.

This depends on the patch below
decompressor: Add LZ4 decompressor module

Signed-off-by: Kyungsik Lee <kyungsik.lee@lge.com>
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-07-16 08:24:30 +02:00
Sascha Hauer a51d06d679 of: remove unused libfdt
Now that we are completely independent of libfdt remove the unused
code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-03-06 11:41:29 +01:00
Sascha Hauer db63bd8e10 Merge branch 'for-next/commands' 2013-02-04 15:48:45 +01:00
Jean-Christophe PLAGNIOL-VILLARD df132b9d78 introduce common bootstrap code
This will allow to have a generic code to create different bootstrap

As example
Barebox as TI Xloader
Barebox as AT91 Bootstrap

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-22 22:03:44 +01:00
Jan Luebbe 964893b34b commands: add let command which supports proper arithmetic
This command works like the corresponding Unix shell command and
is used for adding, multiplying and much more.

Signed-off-by: Jan Luebbe <jlu@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2013-01-09 10:32:54 +01:00
Wolfram Sang cb4b4eb32e lib: add barebox version of libmtd
Based on mtd-utils and stripped down to needed functionality and
reworked to barebox interfaces.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-19 10:31:24 +01:00
Wolfram Sang b44d0e4528 lib: add libubigen
Imported from mtd-utils and stripped down to needed functionality.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-19 10:31:24 +01:00
Wolfram Sang 0b23b9159d lib: add libscan
Imported from mtd-utils and stripped down to needed functionality.
Add prefix to functions so we have a clean namespace.

Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-12-19 10:31:23 +01:00
Sascha Hauer 5a9d53c47e rm: implement -r
To recursively remove files and directories.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-29 20:21:29 +01:00
Robert Jarzmik 2a38aa83f7 commands: change Y-Modem implementation
The current Y-Modem implementation has some limitations:
 - Y-Modem/G protocol is not supported
 - Multiple files (aka. batch) transfers are not supported
 - Transfer speed over fast lines (USB console) is slow
 - Code is not trivial to maintain (personnal opinion)

This implementation tries to address all these points by
introducing loady2 command.

The effects are :
 - transfer speed for Y-Modem over USB jumps from 2kBytes/s
   to 180kBytes/s
 - transfer speed for Y-Modem/G jumps to 200kBytes/s
 - multiple file transfers are possible

This command was tested on a USB console and UART 9600bps
serial line :
 - NAKs (and retransmissions) were tested for faulty
   serial lines
 - multiple file transfers were tested
 - Y-Modem, Y-Modem/G and X-Modem transfers were tested

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Tested-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-11-12 09:35:53 +01:00
Jean-Christophe PLAGNIOL-VILLARD da0d61770a gui: move gui file to include/gui and lib/gui
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-10-04 17:22:09 +02:00
Jean-Christophe PLAGNIOL-VILLARD f65c991d41 png: add picoPNG lib support
This is an alternative to LodePNG take from http://forge.voodooprojects.org/
which is base on picoPNG C++ wrote by Lode Vandevenne. The same author as
LodePNG.

PicoPNG only support RGBA PNG8

The source code of picopng.c was just adapted to be compliant with C89 and drop
the internal ZLIB support. Coding style untouched.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:23:38 +02:00
Jean-Christophe PLAGNIOL-VILLARD 1f16f058e4 add PNG support
use LodePNG version 20120729 from http://lodev.org/lodepng/

The original coding style is keeped to simplify update.

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:23:38 +02:00
Jean-Christophe PLAGNIOL-VILLARD 2dbdd40d57 splash/bmp: switch to image_renderer
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:22:47 +02:00
Jean-Christophe PLAGNIOL-VILLARD 09a1a28233 introduce image_renderer framework
This will allow to support bmp and png

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:21:55 +02:00
Jean-Christophe PLAGNIOL-VILLARD 78b7818fba Introduce graphic utils
to Factorise pixel rendering

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:21:53 +02:00
Jean-Christophe PLAGNIOL-VILLARD 6ce5bc4624 bmp: Move bmp rendering to lib/bmp.c
So we can add other format support

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-09-12 17:21:10 +02:00
Sascha Hauer cbdf1e6dfa add qsort support
This is based on U-Boot code which in turn is based on uclibc
code.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-05-14 20:16:26 +02:00
Jean-Christophe PLAGNIOL-VILLARD 971d164f62 param: add config to disable it
this will allow to save 992 Bytes for TI xlaoder or AT91 bootstrap

Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Jean-Christophe PLAGNIOL-VILLARD e7aa252938 uncompress: add config to disable it
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2012-01-11 21:22:34 +08:00
Robert Jarzmik fa4d33d146 lib: add bitrev utility
Add bit reversing utility, taken from the linux kernel.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 12:34:58 +01:00
Robert Jarzmik 1bfde3cea9 lib: add BCH encoding/decoding
As flash memories need BCH correcting codes, add the BCH
library, taken from the linux kernel.

Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2012-01-02 12:34:58 +01:00
Sascha Hauer 0ee6847f7b Merge branch 'next' 2011-12-07 12:03:13 +01:00
Sascha Hauer d24e4fcb99 lib: remove nonexistest files from Makefile
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-12-01 15:11:15 +01:00
Sascha Hauer eb1c2e7de6 Add generic uncompress function
uncompress() has the same prototype as the various kernel decompress
functions. It automatically detects the compression type and selects
the correct uncompress function.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 4b09cdc798 add kernel gunzip implementation
The kernel uncompression functions have a unified API so use this
implementation to get it.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:42 +01:00
Sascha Hauer 5930f100aa use kernel bunzip implementation
The kernel uncompression functions have a unified API. Switch
to the kernel implementation to unify the different uncompression
APIs. As a bonus the kernel implementation is much smaller.

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-11-29 21:12:27 +01:00
Sascha Hauer 9135dd5f67 initial libfdt support
vanilla libfdt 1.3.0 from the dtc git:

git://git.jdl.com/software/dtc.git

Only small adjustments to compile with barebox

Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-19 10:08:48 +02:00
Jean-Christophe PLAGNIOL-VILLARD 4ac3a1f9e0 move digest to crypto/
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2011-10-12 08:52:48 +02:00
Jean-Christophe PLAGNIOL-VILLARD 85283965dc drivers/bus: move to drivers/base
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2011-07-21 13:44:04 +08:00
Sascha Hauer 6bc37ca831 remove dead ldiv code
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
2010-10-21 22:21:25 +02:00
Jean-Christophe PLAGNIOL-VILLARD c3ad283b8b add sha256 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-20 08:57:22 +02:00
Jean-Christophe PLAGNIOL-VILLARD 3b0850e515 add sha1 support
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
2010-09-20 08:57:21 +02:00