forked from ~ljy/RK356X_SDK_RELEASE

hc
2023-12-09 95099d4622f8cb224d94e314c7a8e0df60b13f87
kernel/drivers/mtd/nand/raw/nand_ids.c
....@@ -1,13 +1,11 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * Copyright (C) 2002 Thomas Gleixner (tglx@linutronix.de)
3
- *
4
- * This program is free software; you can redistribute it and/or modify
5
- * it under the terms of the GNU General Public License version 2 as
6
- * published by the Free Software Foundation.
7
- *
84 */
9
-#include <linux/mtd/rawnand.h>
5
+
106 #include <linux/sizes.h>
7
+
8
+#include "internals.h"
119
1210 #define LP_OPTIONS 0
1311 #define LP_OPTIONS16 (LP_OPTIONS | NAND_BUSWIDTH_16)
....@@ -30,8 +28,7 @@
3028 */
3129 {"TC58NVG0S3E 1G 3.3V 8-bit",
3230 { .id = {0x98, 0xd1, 0x90, 0x15, 0x76, 0x14, 0x01, 0x00} },
33
- SZ_2K, SZ_128, SZ_128K, 0, 8, 64, NAND_ECC_INFO(1, SZ_512),
34
- 2 },
31
+ SZ_2K, SZ_128, SZ_128K, 0, 8, 64, NAND_ECC_INFO(1, SZ_512), },
3532 {"TC58NVG2S0F 4G 3.3V 8-bit",
3633 { .id = {0x98, 0xdc, 0x90, 0x26, 0x76, 0x15, 0x01, 0x08} },
3734 SZ_4K, SZ_512, SZ_256K, 0, 8, 224, NAND_ECC_INFO(4, SZ_512) },
....@@ -44,9 +41,6 @@
4441 {"TC58NVG5D2 32G 3.3V 8-bit",
4542 { .id = {0x98, 0xd7, 0x94, 0x32, 0x76, 0x56, 0x09, 0x00} },
4643 SZ_8K, SZ_4K, SZ_1M, 0, 8, 640, NAND_ECC_INFO(40, SZ_1K) },
47
- {"TC58NVG5H2 32G 3.3V 24-bit",
48
- { .id = {0x98, 0xd7, 0xa0, 0x32, 0x76, 0x56, 0x08, 0x08} },
49
- SZ_8K, SZ_4K, SZ_1M, 0, 8, 1024, NAND_ECC_INFO(24, SZ_1K) },
5044 {"TC58NVG6D2 64G 3.3V 8-bit",
5145 { .id = {0x98, 0xde, 0x94, 0x82, 0x76, 0x56, 0x04, 0x20} },
5246 SZ_8K, SZ_8K, SZ_2M, 0, 8, 640, NAND_ECC_INFO(40, SZ_1K) },
....@@ -56,7 +50,10 @@
5650 {"H27UCG8T2ATR-BC 64G 3.3V 8-bit",
5751 { .id = {0xad, 0xde, 0x94, 0xda, 0x74, 0xc4} },
5852 SZ_8K, SZ_8K, SZ_2M, NAND_NEED_SCRAMBLING, 6, 640,
59
- NAND_ECC_INFO(40, SZ_1K), 4 },
53
+ NAND_ECC_INFO(40, SZ_1K) },
54
+ {"TH58NVG2S3HBAI4 4G 3.3V 8-bit",
55
+ { .id = {0x98, 0xdc, 0x91, 0x15, 0x76} },
56
+ SZ_2K, SZ_512, SZ_128K, 0, 5, 128, NAND_ECC_INFO(8, SZ_512) },
6057
6158 LEGACY_ID_NAND("NAND 4MiB 5V 8-bit", 0x6B, 4, SZ_8K, SP_OPTIONS),
6259 LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE3, 4, SZ_8K, SP_OPTIONS),
....@@ -171,40 +168,40 @@
171168 };
172169
173170 /* Manufacturer IDs */
174
-static const struct nand_manufacturer nand_manufacturers[] = {
175
- {NAND_MFR_TOSHIBA, "Toshiba", &toshiba_nand_manuf_ops},
176
- {NAND_MFR_ESMT, "ESMT"},
177
- {NAND_MFR_SAMSUNG, "Samsung", &samsung_nand_manuf_ops},
171
+static const struct nand_manufacturer_desc nand_manufacturer_descs[] = {
172
+ {NAND_MFR_AMD, "AMD/Spansion", &amd_nand_manuf_ops},
173
+ {NAND_MFR_ATO, "ATO"},
174
+ {NAND_MFR_EON, "Eon"},
175
+ {NAND_MFR_ESMT, "ESMT", &esmt_nand_manuf_ops},
178176 {NAND_MFR_FUJITSU, "Fujitsu"},
177
+ {NAND_MFR_HYNIX, "Hynix", &hynix_nand_manuf_ops},
178
+ {NAND_MFR_INTEL, "Intel"},
179
+ {NAND_MFR_MACRONIX, "Macronix", &macronix_nand_manuf_ops},
180
+ {NAND_MFR_MICRON, "Micron", &micron_nand_manuf_ops},
179181 {NAND_MFR_NATIONAL, "National"},
180182 {NAND_MFR_RENESAS, "Renesas"},
181
- {NAND_MFR_STMICRO, "ST Micro"},
182
- {NAND_MFR_HYNIX, "Hynix", &hynix_nand_manuf_ops},
183
- {NAND_MFR_MICRON, "Micron", &micron_nand_manuf_ops},
184
- {NAND_MFR_AMD, "AMD/Spansion", &amd_nand_manuf_ops},
185
- {NAND_MFR_MACRONIX, "Macronix", &macronix_nand_manuf_ops},
186
- {NAND_MFR_EON, "Eon"},
183
+ {NAND_MFR_SAMSUNG, "Samsung", &samsung_nand_manuf_ops},
187184 {NAND_MFR_SANDISK, "SanDisk"},
188
- {NAND_MFR_INTEL, "Intel"},
189
- {NAND_MFR_ATO, "ATO"},
185
+ {NAND_MFR_STMICRO, "ST Micro"},
186
+ {NAND_MFR_TOSHIBA, "Toshiba", &toshiba_nand_manuf_ops},
190187 {NAND_MFR_WINBOND, "Winbond"},
191188 };
192189
193190 /**
194
- * nand_get_manufacturer - Get manufacturer information from the manufacturer
195
- * ID
191
+ * nand_get_manufacturer_desc - Get manufacturer information from the
192
+ * manufacturer ID
196193 * @id: manufacturer ID
197194 *
198
- * Returns a pointer a nand_manufacturer object if the manufacturer is defined
195
+ * Returns a nand_manufacturer_desc object if the manufacturer is defined
199196 * in the NAND manufacturers database, NULL otherwise.
200197 */
201
-const struct nand_manufacturer *nand_get_manufacturer(u8 id)
198
+const struct nand_manufacturer_desc *nand_get_manufacturer_desc(u8 id)
202199 {
203200 int i;
204201
205
- for (i = 0; i < ARRAY_SIZE(nand_manufacturers); i++)
206
- if (nand_manufacturers[i].id == id)
207
- return &nand_manufacturers[i];
202
+ for (i = 0; i < ARRAY_SIZE(nand_manufacturer_descs); i++)
203
+ if (nand_manufacturer_descs[i].id == id)
204
+ return &nand_manufacturer_descs[i];
208205
209206 return NULL;
210207 }