162306a36Sopenharmony_ci// SPDX-License-Identifier: GPL-2.0
262306a36Sopenharmony_ci/*
362306a36Sopenharmony_ci * Copyright (c) 2018 exceet electronics GmbH
462306a36Sopenharmony_ci * Copyright (c) 2018 Kontron Electronics GmbH
562306a36Sopenharmony_ci *
662306a36Sopenharmony_ci * Author: Frieder Schrempf <frieder.schrempf@kontron.de>
762306a36Sopenharmony_ci */
862306a36Sopenharmony_ci
962306a36Sopenharmony_ci#include <linux/device.h>
1062306a36Sopenharmony_ci#include <linux/kernel.h>
1162306a36Sopenharmony_ci#include <linux/mtd/spinand.h>
1262306a36Sopenharmony_ci
1362306a36Sopenharmony_ci/* Kioxia is new name of Toshiba memory. */
1462306a36Sopenharmony_ci#define SPINAND_MFR_TOSHIBA		0x98
1562306a36Sopenharmony_ci#define TOSH_STATUS_ECC_HAS_BITFLIPS_T	(3 << 4)
1662306a36Sopenharmony_ci
1762306a36Sopenharmony_cistatic SPINAND_OP_VARIANTS(read_cache_variants,
1862306a36Sopenharmony_ci		SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0),
1962306a36Sopenharmony_ci		SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0),
2062306a36Sopenharmony_ci		SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0),
2162306a36Sopenharmony_ci		SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0));
2262306a36Sopenharmony_ci
2362306a36Sopenharmony_cistatic SPINAND_OP_VARIANTS(write_cache_x4_variants,
2462306a36Sopenharmony_ci		SPINAND_PROG_LOAD_X4(true, 0, NULL, 0),
2562306a36Sopenharmony_ci		SPINAND_PROG_LOAD(true, 0, NULL, 0));
2662306a36Sopenharmony_ci
2762306a36Sopenharmony_cistatic SPINAND_OP_VARIANTS(update_cache_x4_variants,
2862306a36Sopenharmony_ci		SPINAND_PROG_LOAD_X4(false, 0, NULL, 0),
2962306a36Sopenharmony_ci		SPINAND_PROG_LOAD(false, 0, NULL, 0));
3062306a36Sopenharmony_ci
3162306a36Sopenharmony_ci/*
3262306a36Sopenharmony_ci * Backward compatibility for 1st generation Serial NAND devices
3362306a36Sopenharmony_ci * which don't support Quad Program Load operation.
3462306a36Sopenharmony_ci */
3562306a36Sopenharmony_cistatic SPINAND_OP_VARIANTS(write_cache_variants,
3662306a36Sopenharmony_ci		SPINAND_PROG_LOAD(true, 0, NULL, 0));
3762306a36Sopenharmony_ci
3862306a36Sopenharmony_cistatic SPINAND_OP_VARIANTS(update_cache_variants,
3962306a36Sopenharmony_ci		SPINAND_PROG_LOAD(false, 0, NULL, 0));
4062306a36Sopenharmony_ci
4162306a36Sopenharmony_cistatic int tx58cxgxsxraix_ooblayout_ecc(struct mtd_info *mtd, int section,
4262306a36Sopenharmony_ci					struct mtd_oob_region *region)
4362306a36Sopenharmony_ci{
4462306a36Sopenharmony_ci	if (section > 0)
4562306a36Sopenharmony_ci		return -ERANGE;
4662306a36Sopenharmony_ci
4762306a36Sopenharmony_ci	region->offset = mtd->oobsize / 2;
4862306a36Sopenharmony_ci	region->length = mtd->oobsize / 2;
4962306a36Sopenharmony_ci
5062306a36Sopenharmony_ci	return 0;
5162306a36Sopenharmony_ci}
5262306a36Sopenharmony_ci
5362306a36Sopenharmony_cistatic int tx58cxgxsxraix_ooblayout_free(struct mtd_info *mtd, int section,
5462306a36Sopenharmony_ci					 struct mtd_oob_region *region)
5562306a36Sopenharmony_ci{
5662306a36Sopenharmony_ci	if (section > 0)
5762306a36Sopenharmony_ci		return -ERANGE;
5862306a36Sopenharmony_ci
5962306a36Sopenharmony_ci	/* 2 bytes reserved for BBM */
6062306a36Sopenharmony_ci	region->offset = 2;
6162306a36Sopenharmony_ci	region->length = (mtd->oobsize / 2) - 2;
6262306a36Sopenharmony_ci
6362306a36Sopenharmony_ci	return 0;
6462306a36Sopenharmony_ci}
6562306a36Sopenharmony_ci
6662306a36Sopenharmony_cistatic const struct mtd_ooblayout_ops tx58cxgxsxraix_ooblayout = {
6762306a36Sopenharmony_ci	.ecc = tx58cxgxsxraix_ooblayout_ecc,
6862306a36Sopenharmony_ci	.free = tx58cxgxsxraix_ooblayout_free,
6962306a36Sopenharmony_ci};
7062306a36Sopenharmony_ci
7162306a36Sopenharmony_cistatic int tx58cxgxsxraix_ecc_get_status(struct spinand_device *spinand,
7262306a36Sopenharmony_ci					 u8 status)
7362306a36Sopenharmony_ci{
7462306a36Sopenharmony_ci	struct nand_device *nand = spinand_to_nand(spinand);
7562306a36Sopenharmony_ci	u8 mbf = 0;
7662306a36Sopenharmony_ci	struct spi_mem_op op = SPINAND_GET_FEATURE_OP(0x30, spinand->scratchbuf);
7762306a36Sopenharmony_ci
7862306a36Sopenharmony_ci	switch (status & STATUS_ECC_MASK) {
7962306a36Sopenharmony_ci	case STATUS_ECC_NO_BITFLIPS:
8062306a36Sopenharmony_ci		return 0;
8162306a36Sopenharmony_ci
8262306a36Sopenharmony_ci	case STATUS_ECC_UNCOR_ERROR:
8362306a36Sopenharmony_ci		return -EBADMSG;
8462306a36Sopenharmony_ci
8562306a36Sopenharmony_ci	case STATUS_ECC_HAS_BITFLIPS:
8662306a36Sopenharmony_ci	case TOSH_STATUS_ECC_HAS_BITFLIPS_T:
8762306a36Sopenharmony_ci		/*
8862306a36Sopenharmony_ci		 * Let's try to retrieve the real maximum number of bitflips
8962306a36Sopenharmony_ci		 * in order to avoid forcing the wear-leveling layer to move
9062306a36Sopenharmony_ci		 * data around if it's not necessary.
9162306a36Sopenharmony_ci		 */
9262306a36Sopenharmony_ci		if (spi_mem_exec_op(spinand->spimem, &op))
9362306a36Sopenharmony_ci			return nanddev_get_ecc_conf(nand)->strength;
9462306a36Sopenharmony_ci
9562306a36Sopenharmony_ci		mbf = *(spinand->scratchbuf) >> 4;
9662306a36Sopenharmony_ci
9762306a36Sopenharmony_ci		if (WARN_ON(mbf > nanddev_get_ecc_conf(nand)->strength || !mbf))
9862306a36Sopenharmony_ci			return nanddev_get_ecc_conf(nand)->strength;
9962306a36Sopenharmony_ci
10062306a36Sopenharmony_ci		return mbf;
10162306a36Sopenharmony_ci
10262306a36Sopenharmony_ci	default:
10362306a36Sopenharmony_ci		break;
10462306a36Sopenharmony_ci	}
10562306a36Sopenharmony_ci
10662306a36Sopenharmony_ci	return -EINVAL;
10762306a36Sopenharmony_ci}
10862306a36Sopenharmony_ci
10962306a36Sopenharmony_cistatic const struct spinand_info toshiba_spinand_table[] = {
11062306a36Sopenharmony_ci	/* 3.3V 1Gb (1st generation) */
11162306a36Sopenharmony_ci	SPINAND_INFO("TC58CVG0S3HRAIG",
11262306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xC2),
11362306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
11462306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
11562306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
11662306a36Sopenharmony_ci					      &write_cache_variants,
11762306a36Sopenharmony_ci					      &update_cache_variants),
11862306a36Sopenharmony_ci		     0,
11962306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
12062306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
12162306a36Sopenharmony_ci	/* 3.3V 2Gb (1st generation) */
12262306a36Sopenharmony_ci	SPINAND_INFO("TC58CVG1S3HRAIG",
12362306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCB),
12462306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
12562306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
12662306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
12762306a36Sopenharmony_ci					      &write_cache_variants,
12862306a36Sopenharmony_ci					      &update_cache_variants),
12962306a36Sopenharmony_ci		     0,
13062306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
13162306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
13262306a36Sopenharmony_ci	/* 3.3V 4Gb (1st generation) */
13362306a36Sopenharmony_ci	SPINAND_INFO("TC58CVG2S0HRAIG",
13462306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCD),
13562306a36Sopenharmony_ci		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
13662306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
13762306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
13862306a36Sopenharmony_ci					      &write_cache_variants,
13962306a36Sopenharmony_ci					      &update_cache_variants),
14062306a36Sopenharmony_ci		     0,
14162306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
14262306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
14362306a36Sopenharmony_ci	/* 1.8V 1Gb (1st generation) */
14462306a36Sopenharmony_ci	SPINAND_INFO("TC58CYG0S3HRAIG",
14562306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB2),
14662306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
14762306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
14862306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
14962306a36Sopenharmony_ci					      &write_cache_variants,
15062306a36Sopenharmony_ci					      &update_cache_variants),
15162306a36Sopenharmony_ci		     0,
15262306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
15362306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
15462306a36Sopenharmony_ci	/* 1.8V 2Gb (1st generation) */
15562306a36Sopenharmony_ci	SPINAND_INFO("TC58CYG1S3HRAIG",
15662306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBB),
15762306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
15862306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
15962306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
16062306a36Sopenharmony_ci					      &write_cache_variants,
16162306a36Sopenharmony_ci					      &update_cache_variants),
16262306a36Sopenharmony_ci		     0,
16362306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
16462306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
16562306a36Sopenharmony_ci	/* 1.8V 4Gb (1st generation) */
16662306a36Sopenharmony_ci	SPINAND_INFO("TC58CYG2S0HRAIG",
16762306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBD),
16862306a36Sopenharmony_ci		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
16962306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
17062306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
17162306a36Sopenharmony_ci					      &write_cache_variants,
17262306a36Sopenharmony_ci					      &update_cache_variants),
17362306a36Sopenharmony_ci		     0,
17462306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
17562306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
17662306a36Sopenharmony_ci
17762306a36Sopenharmony_ci	/*
17862306a36Sopenharmony_ci	 * 2nd generation serial nand has HOLD_D which is equivalent to
17962306a36Sopenharmony_ci	 * QE_BIT.
18062306a36Sopenharmony_ci	 */
18162306a36Sopenharmony_ci	/* 3.3V 1Gb (2nd generation) */
18262306a36Sopenharmony_ci	SPINAND_INFO("TC58CVG0S3HRAIJ",
18362306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xE2),
18462306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
18562306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
18662306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
18762306a36Sopenharmony_ci					      &write_cache_x4_variants,
18862306a36Sopenharmony_ci					      &update_cache_x4_variants),
18962306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
19062306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
19162306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
19262306a36Sopenharmony_ci	/* 3.3V 2Gb (2nd generation) */
19362306a36Sopenharmony_ci	SPINAND_INFO("TC58CVG1S3HRAIJ",
19462306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xEB),
19562306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
19662306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
19762306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
19862306a36Sopenharmony_ci					      &write_cache_x4_variants,
19962306a36Sopenharmony_ci					      &update_cache_x4_variants),
20062306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
20162306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
20262306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
20362306a36Sopenharmony_ci	/* 3.3V 4Gb (2nd generation) */
20462306a36Sopenharmony_ci	SPINAND_INFO("TC58CVG2S0HRAIJ",
20562306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xED),
20662306a36Sopenharmony_ci		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
20762306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
20862306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
20962306a36Sopenharmony_ci					      &write_cache_x4_variants,
21062306a36Sopenharmony_ci					      &update_cache_x4_variants),
21162306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
21262306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
21362306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
21462306a36Sopenharmony_ci	/* 3.3V 8Gb (2nd generation) */
21562306a36Sopenharmony_ci	SPINAND_INFO("TH58CVG3S0HRAIJ",
21662306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xE4),
21762306a36Sopenharmony_ci		     NAND_MEMORG(1, 4096, 256, 64, 4096, 80, 1, 1, 1),
21862306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
21962306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
22062306a36Sopenharmony_ci					      &write_cache_x4_variants,
22162306a36Sopenharmony_ci					      &update_cache_x4_variants),
22262306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
22362306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
22462306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
22562306a36Sopenharmony_ci	/* 1.8V 1Gb (2nd generation) */
22662306a36Sopenharmony_ci	SPINAND_INFO("TC58CYG0S3HRAIJ",
22762306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD2),
22862306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
22962306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
23062306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
23162306a36Sopenharmony_ci					      &write_cache_x4_variants,
23262306a36Sopenharmony_ci					      &update_cache_x4_variants),
23362306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
23462306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
23562306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
23662306a36Sopenharmony_ci	/* 1.8V 2Gb (2nd generation) */
23762306a36Sopenharmony_ci	SPINAND_INFO("TC58CYG1S3HRAIJ",
23862306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xDB),
23962306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 2048, 40, 1, 1, 1),
24062306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
24162306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
24262306a36Sopenharmony_ci					      &write_cache_x4_variants,
24362306a36Sopenharmony_ci					      &update_cache_x4_variants),
24462306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
24562306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
24662306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
24762306a36Sopenharmony_ci	/* 1.8V 4Gb (2nd generation) */
24862306a36Sopenharmony_ci	SPINAND_INFO("TC58CYG2S0HRAIJ",
24962306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xDD),
25062306a36Sopenharmony_ci		     NAND_MEMORG(1, 4096, 256, 64, 2048, 40, 1, 1, 1),
25162306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
25262306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
25362306a36Sopenharmony_ci					      &write_cache_x4_variants,
25462306a36Sopenharmony_ci					      &update_cache_x4_variants),
25562306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
25662306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
25762306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
25862306a36Sopenharmony_ci	/* 1.8V 8Gb (2nd generation) */
25962306a36Sopenharmony_ci	SPINAND_INFO("TH58CYG3S0HRAIJ",
26062306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD4),
26162306a36Sopenharmony_ci		     NAND_MEMORG(1, 4096, 256, 64, 4096, 80, 1, 1, 1),
26262306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
26362306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
26462306a36Sopenharmony_ci					      &write_cache_x4_variants,
26562306a36Sopenharmony_ci					      &update_cache_x4_variants),
26662306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
26762306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
26862306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
26962306a36Sopenharmony_ci	/* 1.8V 1Gb (1st generation) */
27062306a36Sopenharmony_ci	SPINAND_INFO("TC58NYG0S3HBAI4",
27162306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xA1),
27262306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 1024, 20, 1, 1, 1),
27362306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
27462306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
27562306a36Sopenharmony_ci					      &write_cache_variants,
27662306a36Sopenharmony_ci					      &update_cache_variants),
27762306a36Sopenharmony_ci		     0,
27862306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
27962306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
28062306a36Sopenharmony_ci	/* 1.8V 4Gb (1st generation) */
28162306a36Sopenharmony_ci	SPINAND_INFO("TH58NYG2S3HBAI4",
28262306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xAC),
28362306a36Sopenharmony_ci		     NAND_MEMORG(1, 2048, 128, 64, 4096, 80, 1, 2, 1),
28462306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
28562306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
28662306a36Sopenharmony_ci					      &write_cache_x4_variants,
28762306a36Sopenharmony_ci					      &update_cache_x4_variants),
28862306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
28962306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
29062306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
29162306a36Sopenharmony_ci	/* 1.8V 8Gb (1st generation) */
29262306a36Sopenharmony_ci	SPINAND_INFO("TH58NYG3S0HBAI6",
29362306a36Sopenharmony_ci		     SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xA3),
29462306a36Sopenharmony_ci		     NAND_MEMORG(1, 4096, 256, 64, 4096, 80, 1, 1, 1),
29562306a36Sopenharmony_ci		     NAND_ECCREQ(8, 512),
29662306a36Sopenharmony_ci		     SPINAND_INFO_OP_VARIANTS(&read_cache_variants,
29762306a36Sopenharmony_ci					      &write_cache_x4_variants,
29862306a36Sopenharmony_ci					      &update_cache_x4_variants),
29962306a36Sopenharmony_ci		     SPINAND_HAS_QE_BIT,
30062306a36Sopenharmony_ci		     SPINAND_ECCINFO(&tx58cxgxsxraix_ooblayout,
30162306a36Sopenharmony_ci				     tx58cxgxsxraix_ecc_get_status)),
30262306a36Sopenharmony_ci};
30362306a36Sopenharmony_ci
30462306a36Sopenharmony_cistatic const struct spinand_manufacturer_ops toshiba_spinand_manuf_ops = {
30562306a36Sopenharmony_ci};
30662306a36Sopenharmony_ci
30762306a36Sopenharmony_ciconst struct spinand_manufacturer toshiba_spinand_manufacturer = {
30862306a36Sopenharmony_ci	.id = SPINAND_MFR_TOSHIBA,
30962306a36Sopenharmony_ci	.name = "Toshiba",
31062306a36Sopenharmony_ci	.chips = toshiba_spinand_table,
31162306a36Sopenharmony_ci	.nchips = ARRAY_SIZE(toshiba_spinand_table),
31262306a36Sopenharmony_ci	.ops = &toshiba_spinand_manuf_ops,
31362306a36Sopenharmony_ci};
314