Skip to content

Commit 246a06f

Browse files
committed
mtd: rawnand: hynix: Implement ->choose_interface_config() for H27UCG8T2ATR-BC
This chip supports ONFI SDR timing mode 4, 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 0d0245b commit 246a06f

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

drivers/mtd/nand/raw/nand_hynix.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -673,6 +673,15 @@ static void hynix_nand_cleanup(struct nand_chip *chip)
673673
nand_set_manufacturer_data(chip, NULL);
674674
}
675675

676+
static int
677+
h27ucg8t2atrbc_choose_interface_config(struct nand_chip *chip,
678+
struct nand_interface_config *iface)
679+
{
680+
onfi_fill_interface_config(chip, iface, NAND_SDR_IFACE, 4);
681+
682+
return nand_choose_best_sdr_timings(chip, iface, NULL);
683+
}
684+
676685
static int hynix_nand_init(struct nand_chip *chip)
677686
{
678687
struct hynix_nand *hynix;
@@ -689,6 +698,11 @@ static int hynix_nand_init(struct nand_chip *chip)
689698

690699
nand_set_manufacturer_data(chip, hynix);
691700

701+
if (!strncmp("H27UCG8T2ATR-BC", chip->parameters.model,
702+
sizeof("H27UCG8T2ATR-BC") - 1))
703+
chip->ops.choose_interface_config =
704+
h27ucg8t2atrbc_choose_interface_config;
705+
692706
ret = hynix_nand_rr_init(chip);
693707
if (ret)
694708
hynix_nand_cleanup(chip);

drivers/mtd/nand/raw/nand_ids.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct nand_flash_dev nand_flash_ids[] = {
5050
{"H27UCG8T2ATR-BC 64G 3.3V 8-bit",
5151
{ .id = {0xad, 0xde, 0x94, 0xda, 0x74, 0xc4} },
5252
SZ_8K, SZ_8K, SZ_2M, NAND_NEED_SCRAMBLING, 6, 640,
53-
NAND_ECC_INFO(40, SZ_1K), 4 },
53+
NAND_ECC_INFO(40, SZ_1K) },
5454

5555
LEGACY_ID_NAND("NAND 4MiB 5V 8-bit", 0x6B, 4, SZ_8K, SP_OPTIONS),
5656
LEGACY_ID_NAND("NAND 4MiB 3,3V 8-bit", 0xE3, 4, SZ_8K, SP_OPTIONS),

0 commit comments

Comments
 (0)