David Woodhouse [Fri, 10 Aug 2007 06:40:01 +0000 (14:40 +0800)]
Fine-tine the TX timing for serve_image.
It just busy-waits until it's time to send the next packet now. Which
sucks, but gives us good timing for debugging. Needs work (and actually
if we have hrtimers we probably _can_ sleep and still have proper
timing).
Signed-off-by: David Woodhouse <dwmw2@infradead.org>
Josh Boyer [Fri, 3 Aug 2007 13:55:51 +0000 (08:55 -0500)]
Increment mkfs.jffs2 version number
Several change have gone into mkfs.jffs2 since we switch from CVS, but the
version number never got incremented. Bump the version number up so people
can distinguish between older and newer versions.
Josh Boyer [Fri, 3 Aug 2007 13:49:10 +0000 (08:49 -0500)]
Remove $Id:$ tags
The $Id:$ tags are left over from the old CVS repository. Several files have
since been changed, and they generally have little value in a git repo so they
should be removed.
Josh Boyer [Fri, 3 Aug 2007 13:34:38 +0000 (08:34 -0500)]
Disable LZO compression by default
When the recent LZO compression support went into mtd-utils recently,
it was enabled by default. This means that mkfs.jffs2 will default to
creating images with lzo compression as the default.
Older kernels cannot decompress such images, so lzo should be disabled
by default. The patch below fixes this. To enable lzo compression
from now on, simply pass '-X lzo' as an option to mkfs.jffs2.
Richard Purdie [Tue, 10 Jul 2007 15:03:47 +0000 (16:03 +0100)]
Add favourlzo compression mode
Add a favourlzo compression mode to mtd-utils
This allows lzo compression to be used in the cases where the
compression ratio isn't quite as good zlib. This can make sense in
certain use cases because LZO decompression is much faster than zlib.
Signed-off-by: Richard Purdie <rpurdie@openedhand.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Richard Purdie [Tue, 10 Jul 2007 15:03:31 +0000 (16:03 +0100)]
Add lzo support to mtd-utils
Add LZO support to mtd-utils to generate LZO compressed jffs2 images
Unlike the kernel version, the standard lzo userspace library is used
along with lzo1x_999_compress rather than the lzo1x_1_compress version
since better compression ratios can be obtained (at no significant cost
to decompression time).
Signed-off-by: Richard Purdie <rpurdie@openedhand.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Adrian Hunter [Wed, 18 Jul 2007 08:50:53 +0000 (11:50 +0300)]
Add more information to integrity test error message
When the integrity test encounters a file that does not contain
the expected data, it lists the data that it expected to find
in terms of writes to the file.
Now the test also displays a list of "raw" writes that includes
writes that have been truncated away, or completely overwritten
by other writes.
The test also now displays the pid because it is used as the
initial random seed.
Signed-off-by: Adrian Hunter <ext-adrian.hunter@nokia.com>
Alexander Schmidt [Tue, 10 Jul 2007 15:53:54 +0000 (17:53 +0200)]
UBI-utils: add compare feature
This is a new feature for pfiflash, called "--compare". It allows the user
to simulate a pfiflash session without actually changing the flash
content. If the flash content is equal to the data in the pfif file,
pfiflash returns zero. A positive value is returned when the flash
content differs from the pfi file, which indicates that an update is
necessary. This feature is useful when a controller mounts an NFS share
during boot and has to determine if a pfi file stored on this share
contains a code update. Modified PDD values are also registered by the
compare feature.
Signed-off-by: Alexander Schmidt <alexs@linux.vnet.ibm.com>
Frank Haverkamp [Wed, 14 Mar 2007 13:17:07 +0000 (14:17 +0100)]
MTD-Utils: fix handling of ioctl return value in nand-utils
Older kernel do not implement the MTDFILEMODE ioctl. In this case
nandwrite and nanddump should have used MEMGETOOBSEL in combination
with MEMSETOOBSEL. Unfortunately the return value of the unsucessfull
ioctl is not -ENOTTY, but -1 and errno contains ENOTTY. This change
fixes this issue. I have not tested all cornercases. Would be
good if someone could do more careful testing than I did, or maybe
reviewing is sufficient in this case.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Frank Haverkamp [Wed, 21 Feb 2007 09:40:13 +0000 (10:40 +0100)]
UBI-Utils: Increment version of pfiflash
Incrementing the version number was forgotten in the previous patch. Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com> Signed-off-by: Josh Boyer <jwboyer@gmail.com>
Frank Haverkamp [Mon, 11 Dec 2006 13:34:23 +0000 (14:34 +0100)]
[MTD] UBI Utils: Tools should have individual version numbers
The tools had a mixture of different version numbers. This is changed now.
The internal change to move to remove glibc dependencies should be reflected
by an increase of the version number, so that we can react if trouble is
seen with the new code.
Singed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Drake Dowsett [Mon, 6 Nov 2006 15:54:10 +0000 (16:54 +0100)]
[MTD] UBI: rework of off-line UBI analysis tool
The new version can create a gnuplot graph of the erase count statistics.
It can also extract UBI volumes and single blocks with a preanalysis of
the EC as well as the VID header. It has a manual page too ;-).
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Frank Haverkamp [Wed, 14 Jun 2006 09:53:59 +0000 (11:53 +0200)]
UBI - Unsorted Block Images
UBI (Latin: "where?") manages multiple logical volumes on a single
flash device, specifically supporting NAND flash devices. UBI provides
a flexible partitioning concept which still allows for wear-levelling
across the whole flash device.
In a sense, UBI may be compared to the Logical Volume Manager
(LVM). Whereas LVM maps logical sector numbers to physical HDD sector
numbers, UBI maps logical eraseblocks to physical eraseblocks.
More information may be found in the UBI design documentation:
ubidesign.pdf. Which can be found here:
http://www.linux-mtd.infradead.org/doc/ubi.html
Partitioning/Re-partitioning
An UBI volume occupies a certain number of erase blocks. This is
limited by a configured maximum volume size, which could also be
viewed as the partition size. Each individual UBI volume's size can
be changed independently of the other UBI volumes, provided that the
sum of all volume sizes doesn't exceed a certain limit.
UBI supports dynamic volumes and static volumes. Static volumes are
read-only and their contents are protected by CRC check sums.
Bad eraseblocks handling
UBI transparently handles bad eraseblocks. When a physical
eraseblock becomes bad, it is substituted by a good physical
eraseblock, and the user does not even notice this.
Scrubbing
On a NAND flash bit flips can occur on any write operation,
sometimes also on read. If bit flips persist on the device, at first
they can still be corrected by ECC, but once they accumulate,
correction will become impossible. Thus it is best to actively scrub
the affected eraseblock, by first copying it to a free eraseblock
and then erasing the original. The UBI layer performs this type of
scrubbing under the covers, transparently to the UBI volume users.
Erase Counts
UBI maintains an erase count header per eraseblock. This frees
higher-level layers (like file systems) from doing this and allows
for centralized erase count management instead. The erase counts are
used by the wear-levelling algorithm in the UBI layer. The algorithm
itself is exchangeable.
Booting from NAND
For booting directly from NAND flash the hardware must at least be
capable of fetching and executing a small portion of the NAND
flash. Some NAND flash controllers have this kind of support. They
usually limit the window to a few kilobytes in erase block 0. This
"initial program loader" (IPL) must then contain sufficient logic to
load and execute the next boot phase.
Due to bad eraseblocks, which may be randomly scattered over the
flash device, it is problematic to store the "secondary program
loader" (SPL) statically. Also, due to bit-flips it may become
corrupted over time. UBI allows to solve this problem gracefully by
storing the SPL in a small static UBI volume.
UBI volumes vs. static partitions
UBI volumes are still very similar to static MTD partitions:
* both consist of eraseblocks (logical eraseblocks in case of UBI
volumes, and physical eraseblocks in case of static partitions;
* both support three basic operations - read, write, erase.
But UBI volumes have the following advantages over traditional
static MTD partitions:
* there are no eraseblock wear-leveling constraints in case of UBI
volumes, so the user should not care about this;
* there are no bit-flips and bad eraseblocks in case of UBI volumes.
So, UBI volumes may be considered as flash devices with relaxed
restrictions.
Where can it be found?
Documentation, kernel code and applications can be found in the MTD
gits.
What are the applications for?
The applications help to create binary flash images for two
purposes: pfi files (partial flash images) for in-system update of
UBI volumes, and plain binary images, with or without OOB data in
case of NAND, for a manufacturing step. Furthermore some tools
are/and will be created that allow flash content analysis after a
system has crashed.
Who did UBI?
The original ideas, where UBI is based on, were developed by Andreas
Arnez, Frank Haverkamp and Thomas Gleixner. Josh W. Boyer and
some others were involved too. The implementation of the kernel
layer was done by Artem B. Bityutskiy. The user-space applications
and tools were written by Oliver Lohmann with contributions from
Frank Haverkamp, Andreas Arnez, and Artem. Joern Engel contributed a
patch which modifies JFFS2 so that it can be run on a UBI
volume. Thomas Gleixner did modifications to the NAND layer and also
some to JFFS2 to make it work.
Signed-off-by: Frank Haverkamp <haver@vnet.ibm.com>
Thomas Gleixner [Mon, 29 May 2006 22:41:57 +0000 (00:41 +0200)]
Update mtd-abi.h and use new NAND ECC functionality
The NAND rework exposes more information to userspace and
has a different mechanism to read raw FLASH contents without
ECC. Update nanddump and nandwrite. Use the new ECC statistics
ioctl to inform the user about corrected and uncorrectable
bitflips.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>