Skip to content

Commit 0d0245b

Browse files
committed
mtd: rawnand: toshiba: Implement ->choose_interface_config() for TC58NVG0S3E
This chip supports ONFI SDR timing mode 2, implement the new hook to advertize it. Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 2f36bae commit 0d0245b

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

drivers/mtd/nand/raw/nand_ids.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,7 @@ struct nand_flash_dev nand_flash_ids[] = {
2828
*/
2929
{"TC58NVG0S3E 1G 3.3V 8-bit",
3030
{ .id = {0x98, 0xd1, 0x90, 0x15, 0x76, 0x14, 0x01, 0x00} },
31-
SZ_2K, SZ_128, SZ_128K, 0, 8, 64, NAND_ECC_INFO(1, SZ_512),
32-
2 },
31+
SZ_2K, SZ_128, SZ_128K, 0, 8, 64, NAND_ECC_INFO(1, SZ_512), },
3332
{"TC58NVG2S0F 4G 3.3V 8-bit",
3433
{ .id = {0x98, 0xdc, 0x90, 0x26, 0x76, 0x15, 0x01, 0x08} },
3534
SZ_4K, SZ_512, SZ_256K, 0, 8, 224, NAND_ECC_INFO(4, SZ_512) },

drivers/mtd/nand/raw/nand_toshiba.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,15 @@ tc58teg5dclta00_choose_interface_config(struct nand_chip *chip,
203203
return nand_choose_best_sdr_timings(chip, iface, NULL);
204204
}
205205

206+
static int
207+
tc58nvg0s3e_choose_interface_config(struct nand_chip *chip,
208+
struct nand_interface_config *iface)
209+
{
210+
onfi_fill_interface_config(chip, iface, NAND_SDR_IFACE, 2);
211+
212+
return nand_choose_best_sdr_timings(chip, iface, NULL);
213+
}
214+
206215
static int tc58teg5dclta00_init(struct nand_chip *chip)
207216
{
208217
struct mtd_info *mtd = nand_to_mtd(chip);
@@ -215,6 +224,14 @@ static int tc58teg5dclta00_init(struct nand_chip *chip)
215224
return 0;
216225
}
217226

227+
static int tc58nvg0s3e_init(struct nand_chip *chip)
228+
{
229+
chip->ops.choose_interface_config =
230+
&tc58nvg0s3e_choose_interface_config;
231+
232+
return 0;
233+
}
234+
218235
static int toshiba_nand_init(struct nand_chip *chip)
219236
{
220237
if (nand_is_slc(chip))
@@ -227,6 +244,9 @@ static int toshiba_nand_init(struct nand_chip *chip)
227244

228245
if (!strcmp("TC58TEG5DCLTA00", chip->parameters.model))
229246
tc58teg5dclta00_init(chip);
247+
if (!strncmp("TC58NVG0S3E", chip->parameters.model,
248+
sizeof("TC58NVG0S3E") - 1))
249+
tc58nvg0s3e_init(chip);
230250

231251
return 0;
232252
}

0 commit comments

Comments
 (0)