[PATCH v5 2/3] mtd-utils: support >4GiB devices

Artem Bityutskiy dedekind1 at gmail.com
Thu May 13 06:11:11 EDT 2010


On Wed, 2010-05-12 at 19:23 -0700, Kevin Cernekee wrote:
> This patch updates the following programs to handle >4GiB flash devices:
> 
> flash_erase
> flash_eraseall
> flashcp
> mtd_debug
> nanddump
> nandtest
> nandwrite
> 
> It also lays the groundwork for >4GiB support in:
> 
> flash_lock
> flash_unlock
> 
> The latter two utilities would require MEMLOCK64 / MEMUNLOCK64
> functionality on the kernel side (currently unimplemented).  For now
> they still use MEMLOCK / MEMUNLOCK and cannot access blocks above 4GiB.
> 
> By default, the compatibility layer (mtd_ioctl.c) will attempt to use
> the MTD sysfs interface and MEM*64 ioctls in 2.6.31+.  It will fall back
> to the older ABI if it determines that the running kernel does not
> support the new calls.
> 
> Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
> ---
>  Makefile              |   19 +++-
>  flash_erase.c         |   59 ++++++----
>  flash_eraseall.c      |   31 +++--
>  flash_lock.c          |   21 ++--
>  flash_unlock.c        |    9 +-
>  flashcp.c             |   22 ++--
>  mtd_debug.c           |  114 ++++++++++---------
>  mtd_ioctl.c           |  307 +++++++++++++++++++++++++++++++++++++++++++++++++
>  mtd_ioctl.h           |   39 ++++++
>  nanddump.c            |   23 +++--
>  nandtest.c            |   35 +++---
>  nandwrite.c           |   60 +++++-----
>  13 files changed, 570 insertions(+), 171 deletions(-)
>  create mode 100644 mtd_ioctl.c
>  create mode 100644 mtd_ioctl.h

Any chance to extend and use mtd-utils/ubi-utils/src/libmtd.c instead of
mtd_ioctl.c?

-- 
Best Regards,
Artem Bityutskiy (Артём Битюцкий)




More information about the linux-mtd mailing list