blob: 852ae4d26512316ce9b8875c07e4c4326a786899 [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/*
2 * drivers/mtd/nandids.c
3 *
4 * Copyright (C) 2002 Thomas Gleixner (tglx@linutronix.de)
Thomas Gleixnerbd7bcf52005-06-23 10:38:54 +01005 *
Linus Torvalds1da177e2005-04-16 15:20:36 -07006 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 */
11#include <linux/module.h>
12#include <linux/mtd/nand.h>
Artem Bityutskiy7d321ec2013-03-04 13:39:30 +020013
14#define LP_OPTIONS NAND_SAMSUNG_LP_OPTIONS
15#define LP_OPTIONS16 (LP_OPTIONS | NAND_BUSWIDTH_16)
16
Brian Norris5bc7c332013-03-13 09:51:31 -070017#define SP_OPTIONS NAND_NEED_READRDY
18#define SP_OPTIONS16 (SP_OPTIONS | NAND_BUSWIDTH_16)
Thomas Gleixner1cf98272007-04-17 18:30:57 +010019
Artem Bityutskiy7d321ec2013-03-04 13:39:30 +020020/*
21 * The chip ID list:
22 * name, device ID, page size, chip size in MiB, eraseblock size, options
23 *
24 * If page size and eraseblock size are 0, the sizes are taken from the
25 * extended chip ID.
26 */
27struct nand_flash_dev nand_flash_ids[] = {
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020028 LEGACY_ID_NAND("NAND 4MiB 5V 8-bit", 0x6B, 512, 4, 0x2000, SP_OPTIONS),
29 LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE3, 512, 4, 0x2000, SP_OPTIONS),
30 LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE5, 512, 4, 0x2000, SP_OPTIONS),
31 LEGACY_ID_NAND("NAND 8MiB 3,3V 8-bit", 0xD6, 512, 8, 0x2000, SP_OPTIONS),
32 LEGACY_ID_NAND("NAND 8MiB 3,3V 8-bit", 0xE6, 512, 8, 0x2000, SP_OPTIONS),
Thomas Gleixner61b03bd2005-11-07 11:15:49 +000033
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020034 LEGACY_ID_NAND("NAND 16MiB 1,8V 8-bit", 0x33, 512, 16, 0x4000, SP_OPTIONS),
35 LEGACY_ID_NAND("NAND 16MiB 3,3V 8-bit", 0x73, 512, 16, 0x4000, SP_OPTIONS),
36 LEGACY_ID_NAND("NAND 16MiB 1,8V 16-bit", 0x43, 512, 16, 0x4000, SP_OPTIONS16),
37 LEGACY_ID_NAND("NAND 16MiB 3,3V 16-bit", 0x53, 512, 16, 0x4000, SP_OPTIONS16),
Thomas Gleixner61b03bd2005-11-07 11:15:49 +000038
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020039 LEGACY_ID_NAND("NAND 32MiB 1,8V 8-bit", 0x35, 512, 32, 0x4000, SP_OPTIONS),
40 LEGACY_ID_NAND("NAND 32MiB 3,3V 8-bit", 0x75, 512, 32, 0x4000, SP_OPTIONS),
41 LEGACY_ID_NAND("NAND 32MiB 1,8V 16-bit", 0x45, 512, 32, 0x4000, SP_OPTIONS16),
42 LEGACY_ID_NAND("NAND 32MiB 3,3V 16-bit", 0x55, 512, 32, 0x4000, SP_OPTIONS16),
Thomas Gleixner61b03bd2005-11-07 11:15:49 +000043
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020044 LEGACY_ID_NAND("NAND 64MiB 1,8V 8-bit", 0x36, 512, 64, 0x4000, SP_OPTIONS),
45 LEGACY_ID_NAND("NAND 64MiB 3,3V 8-bit", 0x76, 512, 64, 0x4000, SP_OPTIONS),
46 LEGACY_ID_NAND("NAND 64MiB 1,8V 16-bit", 0x46, 512, 64, 0x4000, SP_OPTIONS16),
47 LEGACY_ID_NAND("NAND 64MiB 3,3V 16-bit", 0x56, 512, 64, 0x4000, SP_OPTIONS16),
Thomas Gleixner61b03bd2005-11-07 11:15:49 +000048
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020049 LEGACY_ID_NAND("NAND 128MiB 1,8V 8-bit", 0x78, 512, 128, 0x4000, SP_OPTIONS),
50 LEGACY_ID_NAND("NAND 128MiB 1,8V 8-bit", 0x39, 512, 128, 0x4000, SP_OPTIONS),
51 LEGACY_ID_NAND("NAND 128MiB 3,3V 8-bit", 0x79, 512, 128, 0x4000, SP_OPTIONS),
52 LEGACY_ID_NAND("NAND 128MiB 1,8V 16-bit", 0x72, 512, 128, 0x4000, SP_OPTIONS16),
53 LEGACY_ID_NAND("NAND 128MiB 1,8V 16-bit", 0x49, 512, 128, 0x4000, SP_OPTIONS16),
54 LEGACY_ID_NAND("NAND 128MiB 3,3V 16-bit", 0x74, 512, 128, 0x4000, SP_OPTIONS16),
55 LEGACY_ID_NAND("NAND 128MiB 3,3V 16-bit", 0x59, 512, 128, 0x4000, SP_OPTIONS16),
Thomas Gleixner61b03bd2005-11-07 11:15:49 +000056
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020057 LEGACY_ID_NAND("NAND 256MiB 3,3V 8-bit", 0x71, 512, 256, 0x4000, SP_OPTIONS),
Linus Torvalds1da177e2005-04-16 15:20:36 -070058
Thomas Gleixner7a306012006-05-25 09:50:16 +020059 /*
Artem Bityutskiy7d321ec2013-03-04 13:39:30 +020060 * These are the new chips with large page size. Their page size and
61 * eraseblock size are determined from the extended ID bytes.
Thomas Gleixner7a306012006-05-25 09:50:16 +020062 */
Thomas Gleixner7a306012006-05-25 09:50:16 +020063
Brian Norrisc01804e2011-11-02 13:34:43 -070064 /* 512 Megabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020065 EXTENDED_ID_NAND("NAND 64MiB 1,8V 8-bit", 0xA2, 64, LP_OPTIONS),
66 EXTENDED_ID_NAND("NAND 64MiB 1,8V 8-bit", 0xA0, 64, LP_OPTIONS),
67 EXTENDED_ID_NAND("NAND 64MiB 3,3V 8-bit", 0xF2, 64, LP_OPTIONS),
68 EXTENDED_ID_NAND("NAND 64MiB 3,3V 8-bit", 0xD0, 64, LP_OPTIONS),
69 EXTENDED_ID_NAND("NAND 64MiB 3,3V 8-bit", 0xF0, 64, LP_OPTIONS),
70 EXTENDED_ID_NAND("NAND 64MiB 1,8V 16-bit", 0xB2, 64, LP_OPTIONS16),
71 EXTENDED_ID_NAND("NAND 64MiB 1,8V 16-bit", 0xB0, 64, LP_OPTIONS16),
72 EXTENDED_ID_NAND("NAND 64MiB 3,3V 16-bit", 0xC2, 64, LP_OPTIONS16),
73 EXTENDED_ID_NAND("NAND 64MiB 3,3V 16-bit", 0xC0, 64, LP_OPTIONS16),
Thomas Gleixner61b03bd2005-11-07 11:15:49 +000074
Linus Torvalds1da177e2005-04-16 15:20:36 -070075 /* 1 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020076 EXTENDED_ID_NAND("NAND 128MiB 1,8V 8-bit", 0xA1, 128, LP_OPTIONS),
77 EXTENDED_ID_NAND("NAND 128MiB 3,3V 8-bit", 0xF1, 128, LP_OPTIONS),
78 EXTENDED_ID_NAND("NAND 128MiB 3,3V 8-bit", 0xD1, 128, LP_OPTIONS),
79 EXTENDED_ID_NAND("NAND 128MiB 1,8V 16-bit", 0xB1, 128, LP_OPTIONS16),
80 EXTENDED_ID_NAND("NAND 128MiB 3,3V 16-bit", 0xC1, 128, LP_OPTIONS16),
81 EXTENDED_ID_NAND("NAND 128MiB 1,8V 16-bit", 0xAD, 128, LP_OPTIONS16),
Linus Torvalds1da177e2005-04-16 15:20:36 -070082
83 /* 2 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020084 EXTENDED_ID_NAND("NAND 256MiB 1,8V 8-bit", 0xAA, 256, LP_OPTIONS),
85 EXTENDED_ID_NAND("NAND 256MiB 3,3V 8-bit", 0xDA, 256, LP_OPTIONS),
86 EXTENDED_ID_NAND("NAND 256MiB 1,8V 16-bit", 0xBA, 256, LP_OPTIONS16),
87 EXTENDED_ID_NAND("NAND 256MiB 3,3V 16-bit", 0xCA, 256, LP_OPTIONS16),
Thomas Gleixner61b03bd2005-11-07 11:15:49 +000088
Linus Torvalds1da177e2005-04-16 15:20:36 -070089 /* 4 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020090 EXTENDED_ID_NAND("NAND 512MiB 1,8V 8-bit", 0xAC, 512, LP_OPTIONS),
91 EXTENDED_ID_NAND("NAND 512MiB 3,3V 8-bit", 0xDC, 512, LP_OPTIONS),
92 EXTENDED_ID_NAND("NAND 512MiB 1,8V 16-bit", 0xBC, 512, LP_OPTIONS16),
93 EXTENDED_ID_NAND("NAND 512MiB 3,3V 16-bit", 0xCC, 512, LP_OPTIONS16),
Thomas Gleixner61b03bd2005-11-07 11:15:49 +000094
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 /* 8 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +020096 EXTENDED_ID_NAND("NAND 1GiB 1,8V 8-bit", 0xA3, 1024, LP_OPTIONS),
97 EXTENDED_ID_NAND("NAND 1GiB 3,3V 8-bit", 0xD3, 1024, LP_OPTIONS),
98 EXTENDED_ID_NAND("NAND 1GiB 1,8V 16-bit", 0xB3, 1024, LP_OPTIONS16),
99 EXTENDED_ID_NAND("NAND 1GiB 3,3V 16-bit", 0xC3, 1024, LP_OPTIONS16),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700100
101 /* 16 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +0200102 EXTENDED_ID_NAND("NAND 2GiB 1,8V 8-bit", 0xA5, 2048, LP_OPTIONS),
103 EXTENDED_ID_NAND("NAND 2GiB 3,3V 8-bit", 0xD5, 2048, LP_OPTIONS),
104 EXTENDED_ID_NAND("NAND 2GiB 1,8V 16-bit", 0xB5, 2048, LP_OPTIONS16),
105 EXTENDED_ID_NAND("NAND 2GiB 3,3V 16-bit", 0xC5, 2048, LP_OPTIONS16),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106
Brian Norris24cc7b82010-06-17 12:35:11 -0700107 /* 32 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +0200108 EXTENDED_ID_NAND("NAND 4GiB 1,8V 8-bit", 0xA7, 4096, LP_OPTIONS),
109 EXTENDED_ID_NAND("NAND 4GiB 3,3V 8-bit", 0xD7, 4096, LP_OPTIONS),
110 EXTENDED_ID_NAND("NAND 4GiB 1,8V 16-bit", 0xB7, 4096, LP_OPTIONS16),
111 EXTENDED_ID_NAND("NAND 4GiB 3,3V 16-bit", 0xC7, 4096, LP_OPTIONS16),
Brian Norris13ed7ae2010-08-20 12:36:12 -0700112
113 /* 64 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +0200114 EXTENDED_ID_NAND("NAND 8GiB 1,8V 8-bit", 0xAE, 8192, LP_OPTIONS),
115 EXTENDED_ID_NAND("NAND 8GiB 3,3V 8-bit", 0xDE, 8192, LP_OPTIONS),
116 EXTENDED_ID_NAND("NAND 8GiB 1,8V 16-bit", 0xBE, 8192, LP_OPTIONS16),
117 EXTENDED_ID_NAND("NAND 8GiB 3,3V 16-bit", 0xCE, 8192, LP_OPTIONS16),
Brian Norris13ed7ae2010-08-20 12:36:12 -0700118
119 /* 128 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +0200120 EXTENDED_ID_NAND("NAND 16GiB 1,8V 8-bit", 0x1A, 16384, LP_OPTIONS),
121 EXTENDED_ID_NAND("NAND 16GiB 3,3V 8-bit", 0x3A, 16384, LP_OPTIONS),
122 EXTENDED_ID_NAND("NAND 16GiB 1,8V 16-bit", 0x2A, 16384, LP_OPTIONS16),
123 EXTENDED_ID_NAND("NAND 16GiB 3,3V 16-bit", 0x4A, 16384, LP_OPTIONS16),
Brian Norris13ed7ae2010-08-20 12:36:12 -0700124
125 /* 256 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +0200126 EXTENDED_ID_NAND("NAND 32GiB 1,8V 8-bit", 0x1C, 32768, LP_OPTIONS),
127 EXTENDED_ID_NAND("NAND 32GiB 3,3V 8-bit", 0x3C, 32768, LP_OPTIONS),
128 EXTENDED_ID_NAND("NAND 32GiB 1,8V 16-bit", 0x2C, 32768, LP_OPTIONS16),
129 EXTENDED_ID_NAND("NAND 32GiB 3,3V 16-bit", 0x4C, 32768, LP_OPTIONS16),
Brian Norris13ed7ae2010-08-20 12:36:12 -0700130
131 /* 512 Gigabit */
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +0200132 EXTENDED_ID_NAND("NAND 64GiB 1,8V 8-bit", 0x1E, 65536, LP_OPTIONS),
133 EXTENDED_ID_NAND("NAND 64GiB 3,3V 8-bit", 0x3E, 65536, LP_OPTIONS),
134 EXTENDED_ID_NAND("NAND 64GiB 1,8V 16-bit", 0x2E, 65536, LP_OPTIONS16),
135 EXTENDED_ID_NAND("NAND 64GiB 3,3V 16-bit", 0x4E, 65536, LP_OPTIONS16),
Brian Norris24cc7b82010-06-17 12:35:11 -0700136
Artem Bityutskiy8dbfae12013-03-04 15:39:18 +0200137 {NULL}
Linus Torvalds1da177e2005-04-16 15:20:36 -0700138};
139
Artem Bityutskiy7d321ec2013-03-04 13:39:30 +0200140/* Manufacturer IDs */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700141struct nand_manufacturers nand_manuf_ids[] = {
142 {NAND_MFR_TOSHIBA, "Toshiba"},
143 {NAND_MFR_SAMSUNG, "Samsung"},
144 {NAND_MFR_FUJITSU, "Fujitsu"},
145 {NAND_MFR_NATIONAL, "National"},
146 {NAND_MFR_RENESAS, "Renesas"},
147 {NAND_MFR_STMICRO, "ST Micro"},
David Woodhousee0c7d762006-05-13 18:07:53 +0100148 {NAND_MFR_HYNIX, "Hynix"},
sshahrom@micron.com8c60e542007-03-21 18:48:02 -0700149 {NAND_MFR_MICRON, "Micron"},
Brian Norris9d9a8812012-06-20 16:14:02 -0700150 {NAND_MFR_AMD, "AMD/Spansion"},
Brian Norrisc1257b42011-11-02 13:34:42 -0700151 {NAND_MFR_MACRONIX, "Macronix"},
Brian Norrisb1ccfab2012-05-22 07:30:47 -0700152 {NAND_MFR_EON, "Eon"},
Linus Torvalds1da177e2005-04-16 15:20:36 -0700153 {0x0, "Unknown"}
154};
155
David Woodhousee0c7d762006-05-13 18:07:53 +0100156EXPORT_SYMBOL(nand_manuf_ids);
157EXPORT_SYMBOL(nand_flash_ids);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700158
David Woodhousee0c7d762006-05-13 18:07:53 +0100159MODULE_LICENSE("GPL");
160MODULE_AUTHOR("Thomas Gleixner <tglx@linutronix.de>");
161MODULE_DESCRIPTION("Nand device & manufacturer IDs");