summaryrefslogtreecommitdiffstats
path: root/commands/nand.c
Commit message (Collapse)AuthorAgeFilesLines
* commands: nand: add missing parameters to helpWolfram Sang2023-03-211-1/+1
| | | | | | Signed-off-by: Wolfram Sang <wsa@kernel.org> Link: https://lore.barebox.org/20230319153931.23867-1-wsa@kernel.org Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand command: Print OOB informationSascha Hauer2020-11-101-0/+5
| | | | | | | | NAND mtd devices carry information how the OOB area is used. So far there is no way to visualize it, so print it along with other NAND informations. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/*: Replace license and copyright boilerplate by SPDX identfiersUwe Kleine-König2020-04-271-16/+3
| | | | | | | | | | | | | While at it also drop references to the non-existing CREDITS file and do some small rearrangements for some uniform formatting. (SPDX-License-Identifier first, then copyright texts and then an empty line.) The advantage is that these specifiers are machine-parseable which helps license conformance. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand command: fix null pointer when adding/deleting a bb deviceOleg.Karfich@wago.com2018-08-171-3/+8
| | | | | | | | | | | Commit 40ee300 introduces info option about bad blocks. The open() function call is therefore moved out from mark good/bad block to use the filedescriptor in info option too. If someone tries to add/delete a bb device the optind variable is incremented and the open() call gets a null pointer. Fix this issue by returning when the bb device is added/deleted. Signed-off-by: Oleg Karfich <oleg.karfich@wago.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: nand: Add option to print bbt in nand commandSascha Hauer2016-03-151-11/+40
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: Add support for marking blocks as goodSascha Hauer2016-03-151-5/+29
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: core: check offset in mtd_block_markbadStefan Christ2016-02-231-2/+7
| | | | | | | | Check if the given offset is valid for the mtd device. Print an error message if not to inform the user in the command 'nand'. Signed-off-by: Stefan Christ <s.christ@phytec.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: harmonize in-barebox documentationHolger Schurig2014-05-141-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch does probably too much, but it's hard (and very cumbersome/time consuming) to break it out. What is does is this: * each command has one short description, e.g. "list MUX configuration" * made sure the short descriptions start lowercase * each command has one usage. That string contains just the options, e.g. "[-npn]". It's not part of the long help text. * that is, it doesn't say "[OPTIONS]" anymore, every usable option is listed by character in this (short) option string (the long description is in the long help text, as before) * help texts have been reworked, to make them - sometimes smaller - sometimes describe the options better - more often present themselves in a nicer format * all long help texts are now created with BUSYBOX_CMD_HELP_ macros, no more 'static const __maybe_unused char cmd_foobar_help[]' * made sure the long help texts starts uppercase * because cmdtp->name and cmdtp->opts together provide the new usage, all "Usage: foobar" texts have been removed from the long help texts * BUSYBOX_CMD_HELP_TEXT() provides the trailing newline by itself, this is nicer in the source code * BUSYBOX_CMD_HELP_OPT() provides the trailing newline by itself * made sure no line gets longer than 77 characters * delibertely renamed cmdtp->usage, so that we can get compile-time errors (e.g. in out-of-tree modules that use register_command() * the 'help' command can now always emit the usage, even without compiled long help texts * 'help -v' gives a list of commands with their short description, this is similar like the old "help" command before my patchset * 'help -a' gives out help of all commands Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: group 'help' outputHolger Schurig2014-05-141-0/+1
| | | | | | | | | | | | | | | | | | | The old output of "help" was just producing a long list, that usually scrolled of the screen (even on a X11 terminal). This list is more compact, and also sorted by groups. The old output format (plus grouping) is now available with 'help -v'. Example: Information commands: ?, devinfo, help, iomem, meminfo, version Boot commands: boot, bootm, go, loadb, loads, loadx, loady, saves, uimage ... Signed-off-by: Holger Schurig <holgerschurig@gmail.com> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand command: check for <dev> directly after option parsingSascha Hauer2013-03-041-15/+16
| | | | | | | | Allo subcommands need at least one nonopt arg, so check for it right after parsing the options and drop the check in the MARKBAD command. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand command: use enumeration for command instead of bitmaskSascha Hauer2013-03-041-6/+6
| | | | | | | A command can only be one of NAND_*, so use an enumeration instead of a bitmask. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand command: use loff_t for block offsetSascha Hauer2013-03-041-5/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Treewide: remove address of the Free Software FoundationSascha Hauer2012-09-171-3/+0
| | | | | | | The FSF address has changed in the past. Instead of updating it each time the address changes, just drop it completely treewide. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* mtd: fix bad block ioctlsSascha Hauer2012-07-101-1/+2
| | | | | | | | | | | | | | | | | | | | | | Since this commit we interpret the argument to the bad block ioctls as a pointer to a 64bit number: |commit e71c34366808bbe3ce0b166d8710749513af6d81 |Author: Sascha Hauer <s.hauer@pengutronix.de> |Date: Fri Oct 14 11:57:55 2011 +0200 | | mtd: fix arguments to bad block ioctls | | In the Kernel the mtd ioctls expect a pointer to the offset, whereas | barebox interprets the pointer itself as an offset. Since we want | to add 64bit support for file sizes a pointer may not be sufficient, | so align with the kernel and convert it to a pointer to the offset. | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> This missed some places, fix them aswell. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove struct command pointer from commandsSascha Hauer2012-02-271-1/+1
| | | | | | This is unused in all commands and thus can be removed. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand bb: add proper bb remove functionSascha Hauer2011-04-121-12/+1
| | | | | | | | The old way happily removed cdev entries which were no bb dev at all. Fix this by checking if the given device actually is a bb device. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand bb: switch to cdev operationsSascha Hauer2011-04-121-1/+1
| | | | | | | The cdev operations are available without the complete file API, so they are more suitable for internal usage. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: move bb handling code to drivers/mtd/nandSascha Hauer2011-04-121-248/+0
| | | | | | | It's good to seperate the code which others can use from commands. This way other users do not depend on the command being compiled in. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* devfs: remove unused struct filep* argument from open/closeSascha Hauer2011-04-111-2/+2
| | | | | | | the cdev layer is under the file layer, so it should not use struct filep*. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: Make write support optionalSascha Hauer2011-04-041-1/+6
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: fix printf compiler warningsSascha Hauer2011-01-071-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Make some help comments less confusingJuergen Beisert2010-03-181-1/+1
| | | | | Signed-off-by: Juergen Beisert <jbe@pengutronix.de> Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* remove typedef cmd_tbl_t and replace it with struct commandSascha Hauer2010-02-011-1/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands/nand.c: Fix memory holeSascha Hauer2009-12-211-5/+17
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* rename U-Boot-v2 project to bareboxSascha Hauer2009-12-151-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | This has been done with the following script: find -path ./.git -prune -o -type f -print0 | xargs -0 -r sed -i \ -e 's/u2boot/barebox/g' \ -e 's/U2Boot/barebox/g' \ -e 's/U-boot V2/barebox/g' \ -e 's/u-boot v2/barebox/g' \ -e 's/U-Boot V2/barebox/g' \ -e 's/U-Boot-v2/barebox/g' \ -e 's/U_BOOT/BAREBOX/g' \ -e 's/UBOOT/BAREBOX/g' \ -e 's/uboot/barebox/g' \ -e 's/u-boot/barebox/g' \ -e 's/u_boot/barebox/g' \ -e 's/U-Boot/barebox/g' \ -e 's/U-boot/barebox/g' \ -e 's/U-BOOT/barebox/g' find -path ./.git -prune -o \( -name "*u-boot*" -o -name "*uboot*" -o -name "*u_boot*" \) -print0 | \ xargs -0 -r rename 's/u[-_]?boot/barebox/' It needs some manual fixup following in the next patch Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand bb: Be sure that fd is at the beginning when erasingSascha Hauer2009-12-101-0/+2
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* commands: remove maxargsSascha Hauer2009-10-191-1/+0
| | | | | | | No need to check for maximum argument counts. The commands are safe to be called with more arguments, so lets safe some bytes. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* call getopt_reset only onceSascha Hauer2009-10-191-2/+0
| | | | | | | instead of calling getopt_reset in each command, call it only once before calling the command. Signed-off-by: Sascha Hauer <sha@pengutronix.de>
* nand bb: fix handling of two subsequent bad blocksSascha Hauer2009-10-121-0/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand bb: fix removal of bb devicesSascha Hauer2009-09-111-5/+3
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand bb: fix check when erasing a bb deviceSascha Hauer2009-09-111-2/+2
| | | | | | We can actually partly erase a bb device, so fix the check. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand bb: Fix writing of nand page unaligned dataSascha Hauer2009-08-131-14/+53
| | | | | | | | | | | We used to write the data in nand_bb_write directly to the NAND flash. If we do not write a whole NAND page at once, this resulted in multiple writes of one page which corrupted the ecc data. Fix this by collecting 4096 bytes of data before actually writing the data to the flash. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Get rid of remaining DEVICE_TYPE_* usageSascha Hauer2009-07-211-4/+0
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* introduce cdevSascha Hauer2009-07-211-77/+67
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* fix compiler warningSascha Hauer2009-03-191-2/+1
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* Commands:NAND: Rmove unwanted prints remove unwanted prints which can ↵Nishanth Menon2008-09-151-2/+2
| | | | | | interfere with protocols such as kermit downloads Signed-off-by: Nishanth Menon <x0nishan@ti.com>
* NAND: Calculate size of bb devicesSascha Hauer2008-09-031-2/+24
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* NAND: fix reading of bad block aware devicesSascha Hauer2008-09-031-2/+4
| | | | | | | When reading from bad block aware devices we must make sure not to read beyond eraseblock boundaries. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: add nand -b for marking blocks as badSascha Hauer2008-09-021-13/+43
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* nand: Allow adding/removing of more than one bad block aware device at onceSascha Hauer2008-08-131-63/+107
| | | | Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* NAND: nand command updatesSascha Hauer2008-08-131-16/+43
| | | | | | | - allow removal of bad block aware devices - turn printfs into debug Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
* [NAND] continue to make it work. Now works partly on at91sam9260Sascha Hauer2008-06-061-15/+19
|
* add basic at91sam9260 support. Currently only second stageSascha Hauer2008-06-061-0/+205
bootloader is supported: - No SDRAM initialisation - No UART init / baudrate change