2 * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
4 * Copyright (C) 2002-2007 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Charles Manning <charles@aleph1.co.uk>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
14 const char *yaffs_mtdif_c_version =
15 "$Id: yaffs_mtdif.c,v 1.25 2010-02-19 01:06:31 charles Exp $";
20 #include "yaffs_mtdif.h"
22 #include "linux/mtd/mtd.h"
23 #include "linux/types.h"
24 #include "linux/time.h"
25 #include "linux/mtd/nand.h"
27 #include "yaffs_linux.h"
29 int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber)
31 struct mtd_info *mtd = yaffs_DeviceToContext(dev)->mtd;
33 ((loff_t) blockNumber) * dev->param.totalBytesPerChunk
34 * dev->param.nChunksPerBlock;
41 ei.len = dev->param.totalBytesPerChunk * dev->param.nChunksPerBlock;
45 ei.priv = (u_long) dev;
47 retval = mtd->erase(mtd, &ei);
55 int nandmtd_InitialiseNAND(yaffs_Device *dev)