[PATCH 1/1] mtd-utils: flash_erase: Add flash erase chip

Michael Walle michael at walle.cc
Fri Apr 23 17:54:12 BST 2021


Hi,

Am 2021-04-23 17:07, schrieb Larisa Ileana Grigore:
> 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 at nxp.com>
> ---
>  include/libmtd.h         | 15 +++++++
>  lib/libmtd.c             | 26 ++++++++---
>  misc-utils/flash_erase.c | 95 ++++++++++++++++++++++++++++++----------
>  3 files changed, 106 insertions(+), 30 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

really? because of one prototype?

Just out of curiousity, is there any incentive that you NXP guys add 
these
copyrights all over the place, even for one line changes.

>   *
>   * 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);
> +

-michael



More information about the linux-mtd mailing list