From 2ca0bbf296d6f7ce51b8255347c7fd08afa33651 Mon Sep 17 00:00:00 2001 From: Larisa Ileana Grigore Date: Fri, 23 Apr 2021 18:07:04 +0300 Subject: 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 Signed-off-by: David Oberhollenzer --- include/libmtd.h | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'include') 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 @@ -174,6 +175,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 -- cgit v1.2.3