diff options
author | Larisa Ileana Grigore <larisa.grigore@nxp.com> | 2021-04-23 18:07:04 +0300 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2021-05-05 08:29:50 +0200 |
commit | 2ca0bbf296d6f7ce51b8255347c7fd08afa33651 (patch) | |
tree | 3eeaad477971d8bb1764c46be4b3f67e7e87afdb /include/libmtd.h | |
parent | 1709a628dfc8983f7718e978676cafc3c0399a70 (diff) |
mtd-utils: flash_erase: Add flash erase chip
Some flash types support full erase chip command which can reduce the
flash erase time. Try first to erase the entire flash and fall back
to the old method if the operation fails.
Signed-off-by: Larisa Ileana Grigore <larisa.grigore@nxp.com>
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'include/libmtd.h')
-rw-r--r-- | include/libmtd.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/libmtd.h b/include/libmtd.h index cc24af8..6ab0de5 100644 --- a/include/libmtd.h +++ b/include/libmtd.h @@ -1,5 +1,6 @@ /* * Copyright (C) 2008, 2009 Nokia Corporation + * Copyright 2021 NXP * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -175,6 +176,20 @@ int mtd_lock(const struct mtd_dev_info *mtd, int fd, int eb); int mtd_unlock(const struct mtd_dev_info *mtd, int fd, int eb); /** + * mtd_unlock_multi - unlock eraseblocks. + * @desc: MTD library descriptor + * @mtd: MTD device description object + * @fd: MTD device node file descriptor + * @eb: index of first eraseblock to unlock + * @blocks: the number of eraseblocks to unlock + * + * This function unlocks @blocks starting at eraseblock @eb. + * Returns %0 in case of success and %-1 in case of failure. + */ +int mtd_unlock_multi(const struct mtd_dev_info *mtd, int fd, int eb, + int blocks); + +/** * mtd_erase - erase multiple eraseblocks. * @desc: MTD library descriptor * @mtd: MTD device description object |