aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid A. Marlin <dmarlin@redhat.com>2005-01-17 13:29:21 -0500
committerThomas Gleixner <tglx@mtd.linutronix.de>2005-05-23 05:22:05 -0400
commit28a48de72b876af794853593cc1412119ada9efc (patch)
treefb1e6e5f98bf348d019d586d47be0e89466c98cf
parent8ea2e06fc8d2f03b49cef7732ae8e290e2f0b183 (diff)
[MTD] NAND extended commands, badb block table autorefresh
Added extended commands for AG-AND device and added option for BBT_AUTO_REFRESH. Signed-off-by: David A. Marlin <dmarlin@redhat.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
-rw-r--r--drivers/mtd/nand/nand_ids.c4
-rw-r--r--include/linux/mtd/nand.h27
2 files changed, 28 insertions, 3 deletions
diff --git a/drivers/mtd/nand/nand_ids.c b/drivers/mtd/nand/nand_ids.c
index 2d8c4321275b..9756797c92f8 100644
--- a/drivers/mtd/nand/nand_ids.c
+++ b/drivers/mtd/nand/nand_ids.c
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2002 Thomas Gleixner (tglx@linutronix.de) 4 * Copyright (C) 2002 Thomas Gleixner (tglx@linutronix.de)
5 * 5 *
6 * $Id: nand_ids.c,v 1.10 2004/05/26 13:40:12 gleixner Exp $ 6 * $Id: nand_ids.c,v 1.11 2005/01/17 18:26:27 dmarlin Exp $
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as 9 * it under the terms of the GNU General Public License version 2 as
@@ -103,7 +103,7 @@ struct nand_flash_dev nand_flash_ids[] = {
103 * Anyway JFFS2 would increase the eraseblock size so we chose a combined one which can be erased in one go 103 * Anyway JFFS2 would increase the eraseblock size so we chose a combined one which can be erased in one go
104 * There are more speed improvements for reads and writes possible, but not implemented now 104 * There are more speed improvements for reads and writes possible, but not implemented now
105 */ 105 */
106 {"AND 128MiB 3,3V 8-bit", 0x01, 2048, 128, 0x4000, NAND_IS_AND | NAND_NO_AUTOINCR | NAND_4PAGE_ARRAY}, 106 {"AND 128MiB 3,3V 8-bit", 0x01, 2048, 128, 0x4000, NAND_IS_AND | NAND_NO_AUTOINCR | NAND_4PAGE_ARRAY | BBT_AUTO_REFRESH},
107 107
108 {NULL,} 108 {NULL,}
109}; 109};
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index 9a19c65abd74..0118128ae384 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -5,7 +5,7 @@
5 * Steven J. Hill <sjhill@realitydiluted.com> 5 * Steven J. Hill <sjhill@realitydiluted.com>
6 * Thomas Gleixner <tglx@linutronix.de> 6 * Thomas Gleixner <tglx@linutronix.de>
7 * 7 *
8 * $Id: nand.h,v 1.68 2004/11/12 10:40:37 gleixner Exp $ 8 * $Id: nand.h,v 1.69 2005/01/17 18:29:18 dmarlin Exp $
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as 11 * it under the terms of the GNU General Public License version 2 as
@@ -48,6 +48,8 @@
48 * 02-08-2004 tglx added option field to nand structure for chip anomalities 48 * 02-08-2004 tglx added option field to nand structure for chip anomalities
49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id 49 * 05-25-2004 tglx added bad block table support, ST-MICRO manufacturer id
50 * update of nand_chip structure description 50 * update of nand_chip structure description
51 * 01-17-2005 dmarlin added extended commands for AG-AND device and added option
52 * for BBT_AUTO_REFRESH.
51 */ 53 */
52#ifndef __LINUX_MTD_NAND_H 54#ifndef __LINUX_MTD_NAND_H
53#define __LINUX_MTD_NAND_H 55#define __LINUX_MTD_NAND_H
@@ -115,6 +117,25 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
115#define NAND_CMD_READSTART 0x30 117#define NAND_CMD_READSTART 0x30
116#define NAND_CMD_CACHEDPROG 0x15 118#define NAND_CMD_CACHEDPROG 0x15
117 119
120/* Extended commands for AG-AND device */
121/*
122 * Note: the command for NAND_CMD_DEPLETE1 is really 0x00 but
123 * there is no way to distinguish that from NAND_CMD_READ0
124 * until the remaining sequence of commands has been completed
125 * so add a high order bit and mask it off in the command.
126 */
127#define NAND_CMD_DEPLETE1 0x100
128#define NAND_CMD_DEPLETE2 0x38
129#define NAND_CMD_STATUS_MULTI 0x71
130#define NAND_CMD_STATUS_ERROR 0x72
131/* multi-bank error status (banks 0-3) */
132#define NAND_CMD_STATUS_ERROR0 0x73
133#define NAND_CMD_STATUS_ERROR1 0x74
134#define NAND_CMD_STATUS_ERROR2 0x75
135#define NAND_CMD_STATUS_ERROR3 0x76
136#define NAND_CMD_STATUS_RESET 0x7f
137#define NAND_CMD_STATUS_CLEAR 0xff
138
118/* Status bits */ 139/* Status bits */
119#define NAND_STATUS_FAIL 0x01 140#define NAND_STATUS_FAIL 0x01
120#define NAND_STATUS_FAIL_N1 0x02 141#define NAND_STATUS_FAIL_N1 0x02
@@ -170,6 +191,10 @@ extern int nand_read_raw (struct mtd_info *mtd, uint8_t *buf, loff_t from, size_
170/* Chip has a array of 4 pages which can be read without 191/* Chip has a array of 4 pages which can be read without
171 * additional ready /busy waits */ 192 * additional ready /busy waits */
172#define NAND_4PAGE_ARRAY 0x00000040 193#define NAND_4PAGE_ARRAY 0x00000040
194/* Chip requires that BBT is periodically rewritten to prevent
195 * bits from adjacent blocks from 'leaking' in altering data.
196 * This happens with the Renesas AG-AND chips, possibly others. */
197#define BBT_AUTO_REFRESH 0x00000080
173 198
174/* Options valid for Samsung large page devices */ 199/* Options valid for Samsung large page devices */
175#define NAND_SAMSUNG_LP_OPTIONS \ 200#define NAND_SAMSUNG_LP_OPTIONS \