2 * YAFFS: Yet Another Flash File System. A NAND-flash specific file system.
4 * Copyright (C) 2002-2010 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.
17 #include "yaffs_mtdif.h"
19 #include "linux/mtd/mtd.h"
20 #include "linux/types.h"
21 #include "linux/time.h"
22 #include "linux/mtd/nand.h"
24 #include "yaffs_linux.h"
26 int nandmtd_EraseBlockInNAND(yaffs_Device *dev, int blockNumber)
28 struct mtd_info *mtd = yaffs_DeviceToContext(dev)->mtd;
30 ((loff_t) blockNumber) * dev->param.totalBytesPerChunk
31 * dev->param.nChunksPerBlock;
38 ei.len = dev->param.totalBytesPerChunk * dev->param.nChunksPerBlock;
42 ei.priv = (u_long) dev;
44 retval = mtd->erase(mtd, &ei);
52 int nandmtd_InitialiseNAND(yaffs_Device *dev)