nandsim.c (93db446a424cee9387b532995e6b516667079555) nandsim.c (63fa37f0c512481bd942e84b596ad58e1d4c84e2)
1/*
2 * NAND flash simulator.
3 *
4 * Author: Artem B. Bityuckiy <dedekind@oktetlabs.ru>, <dedekind@infradead.org>
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 *
8 * Note: NS means "NAND Simulator".

--- 9 unchanged lines hidden (view full) ---

18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
24 */
25
1/*
2 * NAND flash simulator.
3 *
4 * Author: Artem B. Bityuckiy <dedekind@oktetlabs.ru>, <dedekind@infradead.org>
5 *
6 * Copyright (C) 2004 Nokia Corporation
7 *
8 * Note: NS means "NAND Simulator".

--- 9 unchanged lines hidden (view full) ---

18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19 * Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA
24 */
25
26#define pr_fmt(fmt) "[nandsim]" fmt
27
26#include <linux/init.h>
27#include <linux/types.h>
28#include <linux/module.h>
29#include <linux/moduleparam.h>
30#include <linux/vmalloc.h>
31#include <linux/math64.h>
32#include <linux/slab.h>
33#include <linux/errno.h>

--- 140 unchanged lines hidden (view full) ---

174MODULE_PARM_DESC(cache_file, "File to use to cache nand pages instead of memory");
175MODULE_PARM_DESC(bbt, "0 OOB, 1 BBT with marker in OOB, 2 BBT with marker in data area");
176MODULE_PARM_DESC(bch, "Enable BCH ecc and set how many bits should "
177 "be correctable in 512-byte blocks");
178
179/* The largest possible page size */
180#define NS_LARGEST_PAGE_SIZE 4096
181
28#include <linux/init.h>
29#include <linux/types.h>
30#include <linux/module.h>
31#include <linux/moduleparam.h>
32#include <linux/vmalloc.h>
33#include <linux/math64.h>
34#include <linux/slab.h>
35#include <linux/errno.h>

--- 140 unchanged lines hidden (view full) ---

176MODULE_PARM_DESC(cache_file, "File to use to cache nand pages instead of memory");
177MODULE_PARM_DESC(bbt, "0 OOB, 1 BBT with marker in OOB, 2 BBT with marker in data area");
178MODULE_PARM_DESC(bch, "Enable BCH ecc and set how many bits should "
179 "be correctable in 512-byte blocks");
180
181/* The largest possible page size */
182#define NS_LARGEST_PAGE_SIZE 4096
183
182/* The prefix for simulator output */
183#define NS_OUTPUT_PREFIX "[nandsim]"
184
185/* Simulator's output macros (logging, debugging, warning, error) */
186#define NS_LOG(args...) \
184/* Simulator's output macros (logging, debugging, warning, error) */
185#define NS_LOG(args...) \
187 do { if (log) printk(KERN_DEBUG NS_OUTPUT_PREFIX " log: " args); } while(0)
186 do { if (log) pr_debug(" log: " args); } while(0)
188#define NS_DBG(args...) \
187#define NS_DBG(args...) \
189 do { if (dbg) printk(KERN_DEBUG NS_OUTPUT_PREFIX " debug: " args); } while(0)
188 do { if (dbg) pr_debug(" debug: " args); } while(0)
190#define NS_WARN(args...) \
189#define NS_WARN(args...) \
191 do { printk(KERN_WARNING NS_OUTPUT_PREFIX " warning: " args); } while(0)
190 do { pr_warn(" warning: " args); } while(0)
192#define NS_ERR(args...) \
191#define NS_ERR(args...) \
193 do { printk(KERN_ERR NS_OUTPUT_PREFIX " error: " args); } while(0)
192 do { pr_err(" error: " args); } while(0)
194#define NS_INFO(args...) \
193#define NS_INFO(args...) \
195 do { printk(KERN_INFO NS_OUTPUT_PREFIX " " args); } while(0)
194 do { pr_info(" " args); } while(0)
196
197/* Busy-wait delay macros (microseconds, milliseconds) */
198#define NS_UDELAY(us) \
199 do { if (do_delays) udelay(us); } while(0)
200#define NS_MDELAY(us) \
201 do { if (do_delays) mdelay(us); } while(0)
202
203/* Is the nandsim structure initialized ? */

--- 2189 unchanged lines hidden ---
195
196/* Busy-wait delay macros (microseconds, milliseconds) */
197#define NS_UDELAY(us) \
198 do { if (do_delays) udelay(us); } while(0)
199#define NS_MDELAY(us) \
200 do { if (do_delays) mdelay(us); } while(0)
201
202/* Is the nandsim structure initialized ? */

--- 2189 unchanged lines hidden ---