aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2010-06-14libmtd: add mtd_write_imgArtem Bityutskiy
Add another helper interface which can be used to write an image to an mtd device. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-06-14ubi-tests: add normsgArtem Bityutskiy
Just like we have in ubi-utils. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-06-14ubi-tests: teach errmsg and failed return error codeArtem Bityutskiy
Just like we do in ubi-utils. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-06-14ubi-tests: rename err_msg to errmsgArtem Bityutskiy
For consistency with ubi-utils. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-06-14libubi: provide mtd number in UBI device informationArtem Bityutskiy
Add an 'mtd_num' field to the UBI device information structure. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-06-14libubi: remove few fields from volume infoArtem Bityutskiy
Remove the 'dev_major' and 'dev_minor' fields from the volume information structure, because these fields should be provided by the device information structure. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-06-12mtd-utils: support 4096+64 page sizesEnric Balletbo i Serra
Add support for oobsize 64 and writesize 4096 in nanddump & nandwrite. Artem: some more info from further e-mail exchange: > Are there flashes with the 4096 page / 64 spare combination? Could you > refer to one? May be any URL? I thought 4096 comes with 128. Much to my regret I can't provide a URL because is not public. IGEP v2 board has a Onenand with two dice of 2048/64 spare combination but mtd views 4096/64. The minimal write page is 4K (2K from first dice and 2K from second dice). Signed-off-by: Enric Balletbo i Serra <eballetbo@iseebcn.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-05-22nandwrite: check if the start address is page-alignedStanley.Miao
Only page-aligned address is permitted in NAND subsystem. Signed-off-by: Stanley.Miao <stanley.miao@windriver.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-05-22nandwrite: fix the bug of writing a yaffs2 image to NANDStanley.Miao
The tool mkyaffs2image doesn't know the oob layout of a NAND flash, so it puts the yaffs2 tags at the offset 0 of oob area, as a result, the image generated by mkyaffs2image is different with the image dumped by nanddump. Now adding a parameter "-r" for nandwrite to differentiate these images. Write a image generated by mkyaffs2image: $> nandwrite -a -o /dev/mtd3 yaffs2.bin Write a image dumped by nanddump: $> nandwrite -a -r /dev/mtd3 image.bin Signed-off-by: Stanley.Miao <stanley.miao@windriver.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-05-22Merge branch 'master' of git://git.infradead.org/mtd-utilsArtem Bityutskiy
2010-05-05nanddump: Support 4096+218 and 4096+224 page sizesKevin Cernekee
Tested with Samsung K9GAG08U0D. Signed-off-by: Kevin Cernekee <cernekee@gmail.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-05-05Merge branch 'master' of ssh://git.infradead.org/srv/git/mtd-utilsArtem Bityutskiy
2010-04-27Revert "UBI: sync ubi-user.h with the lates kernel verion"Artem Bityutskiy
This reverts commit 13b77ef356e876f42f489f6a08840e12847135c5. We do not support block devices. This patch was pushed by accident.
2010-04-08ubiattach/ubidetach: add support to attach/detach by pathMika Westerberg
Now there is a new option '-p' (or '--dev-path') that can be used to pass path to a MTD device node. Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-04-08libubi: add support to attach/detach by MTD device pathMika Westerberg
struct ubi_attach_request now has additional field 'dev' that can contain path to the MTD device node in the filesystem. Also there are two new functions that are able to handle path to the MTD device node: ubi_attach() - attach MTD device by number or by path ubi_detach() - detach MTD device by path ubi_attach() works like ubi_attach_mtd() when it is passed empty req->dev, otherwise it looks up correct MTD device number based on the given device node path. Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-04-08UBI: sync ubi-user.h with the lates kernel verionMika Westerberg
Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-04-08ubinfo: document the new -N optionArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-04-08ubinfo: add -N option to get info by name of ubi volumeJon Ringle
Signed-off-by: Jon Ringle <jon@ringle.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-04-01mtd_debug: fix creation mode parameterFerenc Wagner
creat(2) expects a creation mode parameter, not an open flag. Signed-off-by: Ferenc Wagner <wferi@niif.hu> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-03-31nandtest: fix --keep argumentRadoslav Kolev
When called with the --keep argument nandtest is supposed to restore the original content after testing, but currently it doesn't. The patch below fixes the problem. Signed-off-by: Radoslav Kolev <radoslav.kolev@rnd.bg> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-03-31mkfs.jffs2: fix --enable-compressorAdrian Bunk
The short option -X was working, but the documented long option --enable-compressor was missing. Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-02-18ubiattach/ubidetach: add support to attach/detach by pathMika Westerberg
Now there is a new option '-p' (or '--dev-path') that can be used to pass path to a MTD device node. Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-02-18libubi: add support to attach/detach by MTD device pathMika Westerberg
struct ubi_attach_request now has additional field 'dev' that can contain path to the MTD device node in the filesystem. Also there are two new functions that are able to handle path to the MTD device node: ubi_attach() - attach MTD device by number or by path ubi_detach() - detach MTD device by path ubi_attach() works like ubi_attach_mtd() when it is passed empty req->dev, otherwise it looks up correct MTD device number based on the given device node path. Signed-off-by: Mika Westerberg <ext-mika.1.westerberg@nokia.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-02-15build: add option to not force largefile supportPeter Korsgaard
Not all systems have largefile support (E.G. uClibc depending on config), so unconditionally enforcing largefile breaks the build. Work around it by adding a WITHOUT_LARGEFILE flag, similar to the existing WITHOUT_XATTR. Signed-off-by: Peter Korsgaard <jacmet@sunsite.dk> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-01-15ubiformat: boost version to 1.5v1.3.1Artem Bityutskiy
We fixed the sequence numbers bug, which is quite serious. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-01-15ubiformat: be consistent with sequence numbersArtem Bityutskiy
This commit fixes a stupid an nasty bug. When we flash an UBI image, we do not change its sequence numbers. But when we format the rest of the PEBs (beyond the flashed image), we use a random (or specified via cmdline) sequence number. As a result, we have a broken flash format and UBI refuses it, because half of it has one sequence number, another half has a different one. What we have to do instead, we have to substitute image's sequence number with ours. Reported-by: Jeff Angielski <jeff@theptrgroup.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com> Tested-by: Jeff Angielski <jeff@theptrgroup.com>
2010-01-15ubiformat: always initialize seq numberArtem Bityutskiy
For some reasons sequence number was set to 0 in some case, which is wrong. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-01-10ubiformat: be consistent with sequence numbersArtem Bityutskiy
This commit fixes a stupid an nasty bug. When we flash an UBI image, we do not change its sequence numbers. But when we format the rest of the PEBs (beyond the flashed image), we use a random (or specified via cmdline) sequence number. As a result, we have a broken flash format and UBI refuses it, because half of it has one sequence number, another half has a different one. What we have to do instead, we have to substitute image's sequence number with ours. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2010-01-10ubiformat: always initialize seq numberArtem Bityutskiy
For some reasons sequence number was set to 0 in some case, which is wrong. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-12-09ubiformat: fix error messagev1.3.0Artem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-12-09ubiformat: check that min IO size is power of 2Artem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-12-09flash_unlock: enhancing for unlocking of specified number of blocksVimal Singh
This patch enhances the flash_unlock utility to be able to do unlocking for specified blocks range. This patch also fixes calculation of 'length' as in previous patch. Say there are 240 blocks present in the device. Then: offset starts from: 0x0 and full size of device: 0x1E00000 doing: 240 * 0x20000 gives -> 0x1E00000 But last block address should be 0x1DE0000 (which spans for 0x20000 bytes, adding up to size of 0x1E00000) Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-12-08flash_lock: fix length being passedVimal Singh
This patch fixes the 'length' calculation. Making it: + mtdLockInfo.length = (num_sectors - 1) * mtdInfo.erasesize; Rather: - mtdLockInfo.length = num_sectors * mtdInfo.erasesize; Say there are 240 blocks present in the device. Then: offset starts from: 0x0 and full size of device: 0x1E00000 doing: 240 * 0x20000 gives -> 0x1E00000 But last block address should be 0x1DE0000 (which spans for 0x20000 bytes, adding upto size of 0x1E00000) Signed-off-by: Vimal Singh <vimalsingh@ti.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-11-26ubi-utils: add ubirsvol to .gitignoreArtem Bityutskiy
Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-11-26ubiformat: fix --erase-counter handlingArtem Bityutskiy
The --erase-counter option did not work and this was reproted by Darwin Rambo <drambo@broadcom.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-10-24mkfs.ubifs: fix crosscompilation issuesMatthias Fuchs
This patch adds support for passing the location of the lzo library and headers. Also BUILDDIR must be referenced to find the libubi.a archive. Signed-off-by: Matthias Fuchs <matthias.fuchs@esd.eu> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-10-05ubi-utils: add ubirsvol tool to resize UBI volumesArnaud Mouiche
This is nearly a copy/paste from ubirmvol. Signed-off-by: Arnaud Mouiche <arnaud.mouiche@thomson.net> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-09-28ubinize/ubiformat: improve random number seedingArtem Bityutskiy
Add current time to the PID to improve the pseudo-random number generator seeding. Also, use 'rand()' instead of 'random()', because 'srand()' is for 'rand()'. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-09-28ubiformat/ubinize: Don't randomize 0xFFFFFFFF sequence numberMichael Roth
args.image_seq is of type uint32_t and was initialized to -1 which becomes 0xFFFFFFFF in this case. Later the value -1 was used as a flag that args.image_seq should be replaced with a randomized value. With the option --image-seq (-Q) a user could provide any sequence number at will. But when the user provided sequence number was 0xFFFFFFFF this was understood effectivly as -1 and got overridden by a randomized sequence number. So this patch change the programm flow to respect the principle of least surprise and never use a randomized sequence number when the user provide one at own will. Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-09-28ubiformat/ubinize: fix more 64-bit image sequence number confusionMichael Roth
The sequence number is only 32 bit as the strtoul() function. Signed-off-by: Michael Roth <mroth@nessie.de> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-24ubiformat: add image sequence supportArtem Bityutskiy
Similarly to ubinize, add image sequence number support. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-24ubinize: fix 64-bit image sequence number confusionArtem Bityutskiy
UBI image sequence number which we store in EC headers is 32 bits, not 64-bits. I was confused when noticed that the 'image_seq' variable had type 'unsigned long long'. Turn it into a 'uint32_t' type. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-24ubiformat: fix typo in the help outputArtem Bityutskiy
The UBI image sequence number is a 64-bit integer, not 32-bit integer. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-24mkfs.ubifs: do not forget to torture PEBArtem Bityutskiy
We added PEB torturing for the case when we fail during flashing an image, but forgot to add it for the case when we are formating the flash. Add the forgottent torturing call. Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-12nandwrite: allow writing the OOB when using the standard inputJehan Bing
Signed-off-by: Jehan Bing <jehan@orb.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-11nandwrite: fix incorrect use of errno.Jehan Bing
Signed-off-by: Jehan Bing <jehan@orb.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-11nandwrite: unified reading from standard input and from file - part 3Jehan Bing
Nandwrite tries to use lseek() when failing to write on a page. lseek() will fail when used on the standard input so nandwrite fails. This code replaces lseek with a buffer. When the data is read, it is put in a buffer (filebuf). This buffer is reset at each block boundary. So a "seek" just means reading from the beginning of the buffer. writebuf and oobreadbuf are now just pointers to locations in filebuf. Signed-off-by: Jehan Bing <jehan@orb.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-11nandwrite: unified reading from standard input and from file - part2Jehan Bing
Use the same code structure when reading the OOB than when reading the regular data. Signed-off-by: Jehan Bing <jehan@orb.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-11nandwrite: unified reading from standard input and from file - part 1Jehan Bing
Use same code path for reading data (not the OOB) from either the standard input or a regular file. Signed-off-by: Jehan Bing <jehan@orb.com> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
2009-08-11mkfs.ubifs: correct devtable increment handlingDaniel Neukomm
With the device table one can add /dev entries to the root file system image. The device table file contains among others the fields minor, start, increment and count. If there is an entry with minor=0 start=0 increment=32 and count=4 the mkfs.ubifs makes 128 device entries, with minor numbers from 0 to 127. The correct version makes 4 entries with minor number 0,32,64,96. /dev/mtd c 640 0 0 90 0 0 2 7 This gives 14 devices /dev/mtdXX instead of 7 devices. Due to this error mtd_debug info /dev/mtd3 delivers the information of /dev/mtd1 instead of. Signed-off-by: Daniel Neukomm <Neukomm@vtxmail.ch> Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>