]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - include/linux/mtd/nand.h
a3a7ec352952599b3c6ddf7d319a83096208328f
[karo-tx-uboot.git] / include / linux / mtd / nand.h
1 /*
2  *  u-boot/include/linux/mtd/nand.h
3  *
4  *  Copyright (c) 2000 David Woodhouse <dwmw2@mvhi.com>
5  *                     Steven J. Hill <sjhill@cotw.com>
6  *
7  * $Id: nand.h,v 1.8 2000/10/30 17:16:17 sjhill Exp $
8  *
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.
12  *
13  *  Info:
14  *   Contains standard defines and IDs for NAND flash devices
15  *
16  *  Changelog:
17  *   01-31-2000 DMW     Created
18  *   09-18-2000 SJH     Moved structure out of the Disk-On-Chip drivers
19  *                      so it can be used by other NAND flash device
20  *                      drivers. I also changed the copyright since none
21  *                      of the original contents of this file are specific
22  *                      to DoC devices. David can whack me with a baseball
23  *                      bat later if I did something naughty.
24  *   10-11-2000 SJH     Added private NAND flash structure for driver
25  *   10-24-2000 SJH     Added prototype for 'nand_scan' function
26  */
27 #ifndef __LINUX_MTD_NAND_H
28 #define __LINUX_MTD_NAND_H
29
30 /*
31  * Standard NAND flash commands
32  */
33 #define NAND_CMD_READ0          0
34 #define NAND_CMD_READ1          1
35 #define NAND_CMD_PAGEPROG       0x10
36 #define NAND_CMD_READOOB        0x50
37 #define NAND_CMD_ERASE1         0x60
38 #define NAND_CMD_STATUS         0x70
39 #define NAND_CMD_SEQIN          0x80
40 #define NAND_CMD_READID         0x90
41 #define NAND_CMD_ERASE2         0xd0
42 #define NAND_CMD_RESET          0xff
43
44 /*
45  * NAND Flash Manufacturer ID Codes
46  */
47 #define NAND_MFR_TOSHIBA        0x98
48 #define NAND_MFR_SAMSUNG        0xec
49
50 /*
51  * NAND Flash Device ID Structure
52  *
53  * Structure overview:
54  *
55  *  name - Complete name of device
56  *
57  *  manufacture_id - manufacturer ID code of device.
58  *
59  *  model_id - model ID code of device.
60  *
61  *  chipshift - total number of address bits for the device which
62  *              is used to calculate address offsets and the total
63  *              number of bytes the device is capable of.
64  *
65  *  page256 - denotes if flash device has 256 byte pages or not.
66  *
67  *  pageadrlen - number of bytes minus one needed to hold the
68  *               complete address into the flash array. Keep in
69  *               mind that when a read or write is done to a
70  *               specific address, the address is input serially
71  *               8 bits at a time. This structure member is used
72  *               by the read/write routines as a loop index for
73  *               shifting the address out 8 bits at a time.
74  *
75  *  erasesize - size of an erase block in the flash device.
76  */
77 struct nand_flash_dev {
78         char * name;
79         int manufacture_id;
80         int model_id;
81         int chipshift;
82         char page256;
83         char pageadrlen;
84         unsigned long erasesize;
85 };
86
87 #endif /* __LINUX_MTD_NAND_H */