From 1e6955fdb815906bdd2ecbf2c50e5059852f2400 Mon Sep 17 00:00:00 2001 From: Sascha Hauer Date: Wed, 2 Mar 2016 10:16:50 +0100 Subject: commands: Create nand_bitflip command This adds a command to flip bits in a Nand flash. This is useful for testing purposes to check if flipped bits are corrected and if the driver returns the correct number of bitflips. The command writes a configurable number of bitflips to a single Nand page. If the -r option is not given the results are reproducible, so calling the same command twice will revert the bitflips. The command uses the raw read/write Nand operations which are probably less tested than the regular read/write operations, so the command may produce surprising results. As of writing the command has been tested with the GPMI Nand driver and the imx-nand driver with fixes posted. Signed-off-by: Sascha Hauer --- include/mtd/mtd-peb.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include') diff --git a/include/mtd/mtd-peb.h b/include/mtd/mtd-peb.h index 50ac9a5cca..e4fd01df90 100644 --- a/include/mtd/mtd-peb.h +++ b/include/mtd/mtd-peb.h @@ -17,5 +17,8 @@ int mtd_peb_check_all_ff(struct mtd_info *mtd, int pnum, int offset, int len, int mtd_peb_verify(struct mtd_info *mtd, const void *buf, int pnum, int offset, int len); int mtd_num_pebs(struct mtd_info *mtd); +int mtd_peb_create_bitflips(struct mtd_info *mtd, int pnum, int offset, + int len, int num_bitflips, int random, + int info); #endif /* __LINUX_MTD_MTDPEB_H */ -- cgit v1.2.3