blob: 74bab622be63c71cbf1c714c2ccf8c144e131fc1 [file] [log] [blame]
developer5d148cb2023-06-02 13:08:11 +08001From af4301a675f4fcbaa787f1d3bd07df1c08a093c3 Mon Sep 17 00:00:00 2001
2From: Sam Shih <sam.shih@mediatek.com>
3Date: Fri, 2 Jun 2023 13:06:13 +0800
4Subject: [PATCH]
5 [spi-and-storage][999-2326-mtd-spinand-toshiba-Rename-function-name-to-change-suffix-and-prefix-8Gbit.patch]
developer41370d52022-03-16 16:01:59 +08006
developer41370d52022-03-16 16:01:59 +08007---
developer5d148cb2023-06-02 13:08:11 +08008 drivers/mtd/nand/spi/toshiba.c | 65 ++++++++++++++++++++--------------
9 1 file changed, 38 insertions(+), 27 deletions(-)
developer41370d52022-03-16 16:01:59 +080010
developer5d148cb2023-06-02 13:08:11 +080011diff --git a/drivers/mtd/nand/spi/toshiba.c b/drivers/mtd/nand/spi/toshiba.c
12index 35da3c6e9..7ce5997dd 100644
developer41370d52022-03-16 16:01:59 +080013--- a/drivers/mtd/nand/spi/toshiba.c
14+++ b/drivers/mtd/nand/spi/toshiba.c
developer5d148cb2023-06-02 13:08:11 +080015@@ -25,8 +25,8 @@ static SPINAND_OP_VARIANTS(write_cache_variants,
developer41370d52022-03-16 16:01:59 +080016 static SPINAND_OP_VARIANTS(update_cache_variants,
17 SPINAND_PROG_LOAD(false, 0, NULL, 0));
18
19-static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section,
20- struct mtd_oob_region *region)
21+static int tx58cxgxsxraix_ooblayout_ecc(struct mtd_info *mtd, int section,
22+ struct mtd_oob_region *region)
23 {
24 if (section > 0)
25 return -ERANGE;
developer5d148cb2023-06-02 13:08:11 +080026@@ -37,8 +37,8 @@ static int tc58cxgxsx_ooblayout_ecc(struct mtd_info *mtd, int section,
developer41370d52022-03-16 16:01:59 +080027 return 0;
28 }
29
30-static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section,
31- struct mtd_oob_region *region)
32+static int tx58cxgxsxraix_ooblayout_free(struct mtd_info *mtd, int section,
33+ struct mtd_oob_region *region)
34 {
35 if (section > 0)
36 return -ERANGE;
developer5d148cb2023-06-02 13:08:11 +080037@@ -50,13 +50,13 @@ static int tc58cxgxsx_ooblayout_free(struct mtd_info *mtd, int section,
developer41370d52022-03-16 16:01:59 +080038 return 0;
39 }
40
41-static const struct mtd_ooblayout_ops tc58cxgxsx_ooblayout = {
42- .ecc = tc58cxgxsx_ooblayout_ecc,
43- .free = tc58cxgxsx_ooblayout_free,
44+static const struct mtd_ooblayout_ops tx58cxgxsxraix_ooblayout = {
45+ .ecc = tx58cxgxsxraix_ooblayout_ecc,
46+ .free = tx58cxgxsxraix_ooblayout_free,
47 };
48
49-static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand,
50- u8 status)
51+static int tx58cxgxsxraix_ecc_get_status(struct spinand_device *spinand,
52+ u8 status)
53 {
54 struct nand_device *nand = spinand_to_nand(spinand);
55 u8 mbf = 0;
developer5d148cb2023-06-02 13:08:11 +080056@@ -95,7 +95,7 @@ static int tc58cxgxsx_ecc_get_status(struct spinand_device *spinand,
developer41370d52022-03-16 16:01:59 +080057
58 static const struct spinand_info toshiba_spinand_table[] = {
59 /* 3.3V 1Gb */
60- SPINAND_INFO("TC58CVG0S3",
61+ SPINAND_INFO("TC58CVG0S3HRAIG",
62 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xC2),
63 NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
64 NAND_ECCREQ(8, 512),
developer5d148cb2023-06-02 13:08:11 +080065@@ -103,10 +103,10 @@ static const struct spinand_info toshiba_spinand_table[] = {
developer41370d52022-03-16 16:01:59 +080066 &write_cache_variants,
67 &update_cache_variants),
68 0,
69- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
70- tc58cxgxsx_ecc_get_status)),
71+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
72+ tx58cxgxsxraix_ecc_get_status)),
73 /* 3.3V 2Gb */
74- SPINAND_INFO("TC58CVG1S3",
75+ SPINAND_INFO("TC58CVG1S3HRAIG",
76 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCB),
77 NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
78 NAND_ECCREQ(8, 512),
developer5d148cb2023-06-02 13:08:11 +080079@@ -114,10 +114,10 @@ static const struct spinand_info toshiba_spinand_table[] = {
developer41370d52022-03-16 16:01:59 +080080 &write_cache_variants,
81 &update_cache_variants),
82 0,
83- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
84- tc58cxgxsx_ecc_get_status)),
85+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
86+ tx58cxgxsxraix_ecc_get_status)),
87 /* 3.3V 4Gb */
88- SPINAND_INFO("TC58CVG2S0",
89+ SPINAND_INFO("TC58CVG2S0HRAIG",
90 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCD),
91 NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
92 NAND_ECCREQ(8, 512),
developer5d148cb2023-06-02 13:08:11 +080093@@ -125,10 +125,21 @@ static const struct spinand_info toshiba_spinand_table[] = {
developer41370d52022-03-16 16:01:59 +080094 &write_cache_variants,
95 &update_cache_variants),
96 0,
97- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
98- tc58cxgxsx_ecc_get_status)),
99+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
100+ tx58cxgxsxraix_ecc_get_status)),
101+ /* 3.3V 4Gb */
102+ SPINAND_INFO("TC58CVG2S0HRAIJ",
103+ SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xED),
104+ NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
105+ NAND_ECCREQ(8, 512),
106+ SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
107+ &write_cache_variants,
108+ &update_cache_variants),
109+ 0,
110+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
111+ tx58cxgxsxraix_ecc_get_status)),
112 /* 1.8V 1Gb */
113- SPINAND_INFO("TC58CYG0S3",
114+ SPINAND_INFO("TC58CYG0S3HRAIG",
115 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB2),
116 NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
117 NAND_ECCREQ(8, 512),
developer5d148cb2023-06-02 13:08:11 +0800118@@ -136,10 +147,10 @@ static const struct spinand_info toshiba_spinand_table[] = {
developer41370d52022-03-16 16:01:59 +0800119 &write_cache_variants,
120 &update_cache_variants),
121 0,
122- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
123- tc58cxgxsx_ecc_get_status)),
124+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
125+ tx58cxgxsxraix_ecc_get_status)),
126 /* 1.8V 2Gb */
127- SPINAND_INFO("TC58CYG1S3",
128+ SPINAND_INFO("TC58CYG1S3HRAIG",
129 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBB),
130 NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
131 NAND_ECCREQ(8, 512),
developer5d148cb2023-06-02 13:08:11 +0800132@@ -147,10 +158,10 @@ static const struct spinand_info toshiba_spinand_table[] = {
developer41370d52022-03-16 16:01:59 +0800133 &write_cache_variants,
134 &update_cache_variants),
135 0,
136- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
137- tc58cxgxsx_ecc_get_status)),
138+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
139+ tx58cxgxsxraix_ecc_get_status)),
140 /* 1.8V 4Gb */
141- SPINAND_INFO("TC58CYG2S0",
142+ SPINAND_INFO("TC58CYG2S0HRAIG",
143 SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBD),
144 NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
145 NAND_ECCREQ(8, 512),
developer5d148cb2023-06-02 13:08:11 +0800146@@ -158,8 +169,8 @@ static const struct spinand_info toshiba_spinand_table[] = {
developer41370d52022-03-16 16:01:59 +0800147 &write_cache_variants,
148 &update_cache_variants),
149 0,
150- SPINAND_ECCINFO(&tc58cxgxsx_ooblayout,
151- tc58cxgxsx_ecc_get_status)),
152+ SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
153+ tx58cxgxsxraix_ecc_get_status)),
154 };
155
156 static const struct spinand_manufacturer_ops toshiba_spinand_manuf_ops = {
developer5d148cb2023-06-02 13:08:11 +0800157--
1582.34.1
159