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>
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>
TLSF: Two Level Segregated Fit memory allocator implementation.
Written by Matthew Conte (matt@baisoku.org).
Public Domain, no restrictions.
Signed-off-by: Antony Pavlov <antonynpavlov@gmail.com>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Split /dev/mtd and /dev/mtdoob devices.
Remove from mtd structure the mtdoob character device.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Change NAND_WRITE into MTD_WRITE.
Change "page_shift" references in the core, which are purely
NAND, into mtd->writesize which is MTD generic.
Rename all "info" (struct mtd_info) into "mtd".
Also provide a parameter to add_mtd_device() so that legacy
nand devices still appear as nand<N>.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add a general twl device driver twlcore to call i2c send/write
functions.
Abstract twl4030 to call twlcore functions.
Fixed some code-styling issues pointed out by checkpatch.
Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Add sorted insert in stringlist functions.
Also added function to checked if string is already
in string list.
Signed-off-by: Alexander Aring <a.aring@phytec.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
This switches the bootm code to the new uimage code. Also
bootm can now handle other types of images than uImages.
Currently the only architecture making use of this is
arm which allows to boot zImages, raw images and barebox
images.
I intended to make a more bisectable series from this but
I failed becuase there are many dependencies and no matter
how I tried the patches grew bigger and and bigger. So I
decided to put this all in a single patch.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Provide a new API for accessing uImages which makes it easy
for commands to open images, verify them, load to (free) sdram
regions and show information about uImages.
- We now do not load the image to malloced space anymore.
- The data in the header is now stored in cpu native endianess
after uimage_open which makes it easy to access the header data.
- uImage can be loaded to dynamically allocated sdram regions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Currently we have of_get_fixed_tree() which assumes that
there is a global variable holding a oftree. This seems
not very flexible, so for now introduce a of_fix_tree()
which takes an fdt_header as argument and walks the
list of registered of fixup functions.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Support for the old DM9000E device is now part of the new dm9k.c driver. So,
remove the old driver source and switch all users to the new driver.
Signed-off-by: Juergen Beisert <jbe@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Some console are transient, like the USB connected serial
console which should be removed when the USB connection is
severed.
Enable console removal for such devices.
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
cramfs does not compile since we updated zlib to the kernel
version. Fix this by using the kernel version of uncompress.c
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
Several filetypes can be autodetected. Barebox could make use
of this in several ways:
- Add a command to detect filetypes
- detect arm zImages and uImages to unify the different boot commands
- maybe detect UBI or JFFS2 images to construct parts of the kernel
command line
- select correct uncompression function based on filetype
This patch adds basic support to detect filetypes.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
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>
The rests of U-Boots iminfo command are sitting in commands/bootm.c and
are in a nonusable state. Factor it out to its own file and make it work
again.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>