Skip to content

Commit eec417f

Browse files
macromorganmiquelraynal
authored andcommitted
mtd: rawnand: hynix: Add support for H27UCG8T2ETR-BC MLC NAND
Add support for the H27UCG8T2ETR-BC MLC NAND. The NAND is used widely in the NTC CHIP, is an MLC type NAND, and is 8GB in size. Neither JEDEC nor ONFI detection identifies it correctly, so the ID is added to the nand_ids.c file. Additionally, per the datasheet this NAND appears to use the same paired pages scheme as the Toshiba TC58TEG5DCLTA00 (dist3), so add support for that to enable use in SLC emulation mode. Tested on a NTC CHIP the device is able to write to a ubifs formatted partition, and then have U-Boot (with proposed patches) boot from a kernel located on that ubifs formatted partition. Signed-off-by: Chris Morgan <[email protected]> Signed-off-by: Miquel Raynal <[email protected]> Link: https://lore.kernel.org/linux-mtd/[email protected]
1 parent 6bcd296 commit eec417f

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

drivers/mtd/nand/raw/nand_hynix.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -686,6 +686,16 @@ h27ucg8t2atrbc_choose_interface_config(struct nand_chip *chip,
686686
return nand_choose_best_sdr_timings(chip, iface, NULL);
687687
}
688688

689+
static int h27ucg8t2etrbc_init(struct nand_chip *chip)
690+
{
691+
struct mtd_info *mtd = nand_to_mtd(chip);
692+
693+
chip->options |= NAND_NEED_SCRAMBLING;
694+
mtd_set_pairing_scheme(mtd, &dist3_pairing_scheme);
695+
696+
return 0;
697+
}
698+
689699
static int hynix_nand_init(struct nand_chip *chip)
690700
{
691701
struct hynix_nand *hynix;
@@ -707,6 +717,10 @@ static int hynix_nand_init(struct nand_chip *chip)
707717
chip->ops.choose_interface_config =
708718
h27ucg8t2atrbc_choose_interface_config;
709719

720+
if (!strncmp("H27UCG8T2ETR-BC", chip->parameters.model,
721+
sizeof("H27UCG8T2ETR-BC") - 1))
722+
h27ucg8t2etrbc_init(chip);
723+
710724
ret = hynix_nand_rr_init(chip);
711725
if (ret)
712726
hynix_nand_cleanup(chip);

drivers/mtd/nand/raw/nand_ids.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,10 @@ struct nand_flash_dev nand_flash_ids[] = {
5151
{ .id = {0xad, 0xde, 0x94, 0xda, 0x74, 0xc4} },
5252
SZ_8K, SZ_8K, SZ_2M, NAND_NEED_SCRAMBLING, 6, 640,
5353
NAND_ECC_INFO(40, SZ_1K) },
54+
{"H27UCG8T2ETR-BC 64G 3.3V 8-bit",
55+
{ .id = {0xad, 0xde, 0x14, 0xa7, 0x42, 0x4a} },
56+
SZ_16K, SZ_8K, SZ_4M, NAND_NEED_SCRAMBLING, 6, 1664,
57+
NAND_ECC_INFO(40, SZ_1K) },
5458
{"TH58NVG2S3HBAI4 4G 3.3V 8-bit",
5559
{ .id = {0x98, 0xdc, 0x91, 0x15, 0x76} },
5660
SZ_2K, SZ_512, SZ_128K, 0, 5, 128, NAND_ECC_INFO(8, SZ_512) },

0 commit comments

Comments
 (0)