diff --git a/arch/arm/mach-rockchip/boot_rkimg.c b/arch/arm/mach-rockchip/boot_rkimg.c index cb5db30dba9..729f1c96b0e 100644 --- a/arch/arm/mach-rockchip/boot_rkimg.c +++ b/arch/arm/mach-rockchip/boot_rkimg.c @@ -90,8 +90,10 @@ static void boot_devtype_init(void) char *src = "scan"; static int done; /* static */ int ret; + bool need_reinit; - if (done) + need_reinit = !done || !env_get("devtype") || !env_get("devnum"); + if (!need_reinit) return; #ifdef CONFIG_MP_BOOT diff --git a/drivers/mtd/nand/spi/Kconfig b/drivers/mtd/nand/spi/Kconfig index 1129029211b..129105364a8 100644 --- a/drivers/mtd/nand/spi/Kconfig +++ b/drivers/mtd/nand/spi/Kconfig @@ -39,16 +39,6 @@ config SPI_NAND_WINBOND help Add support for various WINBOND SPI Nand flash chips -if SPI_NAND_WINBOND - -config SPI_NAND_WINBOND_CONT_READ - bool "WINBOND SPI flash continuous read support" - default n - help - Add support for WINBOND SPI Nand flash chips cont read. - -endif - config SPI_NAND_DOSILICON bool "DOSILICON SPI flash support" default y @@ -140,4 +130,35 @@ config SPI_NAND_ZBIT bool "ZBIT SPI flash support" help Add support for various ZBIT SPI Nand flash chips + +config SPI_NAND_HIKSEMI + default y + bool "HIKSEMI SPI flash support" + help + Add support for various HIKSEMI SPI Nand flash chips + +config SPI_NAND_KINGSTON + default y + bool "KINGSTON SPI flash support" + help + Add support for various KINGSTON SPI Nand flash chips + +config SPI_NAND_ISSI + default y + bool "ISSI SPI flash support" + help + Add support for various ISSI SPI Nand flash chips + +config SPI_NAND_TITAN + default y + bool "TITAN SPI flash support" + help + Add support for various TITAN SPI Nand flash chips + +config SPI_NAND_CONT_READ + bool "Enable SPI flash continuous read support" + default n + help + Add support for SPI Nand flash chips cont read. + endif diff --git a/drivers/mtd/nand/spi/Makefile b/drivers/mtd/nand/spi/Makefile index 16e5da43a0b..1e63221f111 100644 --- a/drivers/mtd/nand/spi/Makefile +++ b/drivers/mtd/nand/spi/Makefile @@ -17,8 +17,12 @@ obj-$(CONFIG_SPI_NAND_BIWIN) += biwin.o obj-$(CONFIG_SPI_NAND_ETRON) += etron.o obj-$(CONFIG_SPI_NAND_JSC) += jsc.o obj-$(CONFIG_SPI_NAND_SILICONGO) += silicongo.o +obj-$(CONFIG_SPI_NAND_TITAN) += titan.o obj-$(CONFIG_SPI_NAND_UNIM) += unim.o obj-$(CONFIG_SPI_NAND_SKYHIGH) += skyhigh.o obj-$(CONFIG_SPI_NAND_GSTO) += gsto.o obj-$(CONFIG_SPI_NAND_ZBIT) += zbit.o +obj-$(CONFIG_SPI_NAND_HIKSEMI) += hiksemi.o +obj-$(CONFIG_SPI_NAND_KINGSTON) += kingston.o +obj-$(CONFIG_SPI_NAND_ISSI) += issi.o obj-$(CONFIG_MTD_SPI_NAND) += spinand.o diff --git a/drivers/mtd/nand/spi/core.c b/drivers/mtd/nand/spi/core.c index d1bb1bbc70a..cb2749c6c36 100644 --- a/drivers/mtd/nand/spi/core.c +++ b/drivers/mtd/nand/spi/core.c @@ -289,8 +289,6 @@ static int spinand_read_from_cache_op(struct spinand_device *spinand, if (ret) return ret; - if (spinand->support_cont_read) - op.addr.nbytes = 3; ret = spi_mem_exec_op(spinand->slave, &op); if (ret) return ret; @@ -524,33 +522,66 @@ static int spinand_check_ecc_status(struct spinand_device *spinand, u8 status) return -EINVAL; } +static int spinand_read_page_wait(struct spinand_device *spinand, u8 *s) +{ + unsigned long start, stop; + u8 status; + int ret; + + start = get_timer(0); + stop = 400; + do { + ret = spinand_read_status(spinand, &status); + if (ret) + return ret; + + if (status & STATUS_BUSY) + continue; + + ret = spinand_read_status(spinand, &status); + if (ret) + return ret; + + if (!(status & STATUS_BUSY)) + break; + + } while (get_timer(start) < stop); + + *s = status; + + return status & STATUS_BUSY ? -ETIMEDOUT : 0; +} + static int spinand_read_page(struct spinand_device *spinand, const struct nand_page_io_req *req, bool ecc_enabled) { - u8 status = 0; + u8 status; int ret; ret = spinand_load_page_op(spinand, req); if (ret) return ret; - ret = spinand_wait(spinand, &status); - /* - * When there is data outside of OIP in the status, the status data is - * inaccurate and needs to be reconfirmed - */ - if (spinand->id.data[0] == 0x01 && status && !ret) + /* Workaround for Skyhigh */ + if (spinand->id.data[0] == 0x01) { + ret = spinand_read_page_wait(spinand, &status); + if (ret) + return ret; + } else { ret = spinand_wait(spinand, &status); - if (ret < 0) - return ret; + if (ret) + return ret; + } ret = spinand_read_from_cache_op(spinand, req); if (ret) return ret; - if (spinand->support_cont_read && !(spinand->slave->mode & SPI_DMA_PREPARE)) +#ifdef CONFIG_SPI_NAND_CONT_READ + if (!(spinand->slave->mode & SPI_DMA_PREPARE)) spinand_wait(spinand, &status); +#endif if (!ecc_enabled) return 0; @@ -594,6 +625,11 @@ static int spinand_mtd_read(struct mtd_info *mtd, loff_t from, bool ecc_failed = false; int ret = 0; + if (spinand->support_cont_read && (from & mtd->writesize_mask)) { + printf("spinand cont read at unaligned offset %llx %x\n", from, mtd->writesize_mask); + return -EINVAL; + } + if (ops->mode != MTD_OPS_RAW && spinand->eccinfo.ooblayout) enable_ecc = true; @@ -877,9 +913,11 @@ static const struct spinand_manufacturer *spinand_manufacturers[] = { #endif #ifdef CONFIG_SPI_NAND_ESMT &esmt_spinand_manufacturer, + &esmt_elite_spinand_manufacturer, #endif #ifdef CONFIG_SPI_NAND_XINCUN &xincun_spinand_manufacturer, + &xincun_6c_spinand_manufacturer, #endif #ifdef CONFIG_SPI_NAND_XTX &xtx_spinand_manufacturer, @@ -905,6 +943,9 @@ static const struct spinand_manufacturer *spinand_manufacturers[] = { #ifdef CONFIG_SPI_NAND_SILICONGO &silicongo_spinand_manufacturer, #endif +#ifdef CONFIG_SPI_NAND_TITAN + &titan_spinand_manufacturer, +#endif #ifdef CONFIG_SPI_NAND_UNIM &unim_spinand_manufacturer, &unim_zl_spinand_manufacturer, @@ -918,6 +959,15 @@ static const struct spinand_manufacturer *spinand_manufacturers[] = { #ifdef CONFIG_SPI_NAND_ZBIT &zbit_spinand_manufacturer, #endif +#ifdef CONFIG_SPI_NAND_HIKSEMI + &hiksemi_spinand_manufacturer, +#endif +#ifdef CONFIG_SPI_NAND_KINGSTON + &kingston_spinand_manufacturer, +#endif +#ifdef CONFIG_SPI_NAND_ISSI + &issi_spinand_manufacturer, +#endif }; static int spinand_manufacturer_match(struct spinand_device *spinand, diff --git a/drivers/mtd/nand/spi/dosilicon.c b/drivers/mtd/nand/spi/dosilicon.c index 3dec9c3dec8..ee61f026cf8 100644 --- a/drivers/mtd/nand/spi/dosilicon.c +++ b/drivers/mtd/nand/spi/dosilicon.c @@ -121,6 +121,36 @@ static int ds35xxgb_ecc_get_status(struct spinand_device *spinand, return -EINVAL; } +static int ds35xxge_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = 128; + region->length = 128; + + return 0; +} + +static int ds35xxge_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + /* Reserve 1 bytes for the BBM. */ + region->offset = 1; + region->length = 127; + + return 0; +} + +static const struct mtd_ooblayout_ops ds35xxge_ooblayout = { + .ecc = ds35xxge_ooblayout_ecc, + .rfree = ds35xxge_ooblayout_free, +}; + static const struct spinand_info dosilicon_spinand_table[] = { SPINAND_INFO("DS35X1GA", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x71), @@ -263,6 +293,52 @@ static const struct spinand_info dosilicon_spinand_table[] = { &update_cache_variants), SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&ds35xxgb_ooblayout, ds35xxgb_ecc_get_status)), + SPINAND_INFO("DS35Q2GBS", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB2), + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&ds35xxgb_ooblayout, ds35xxgb_ecc_get_status)), + SPINAND_INFO("DS35Q4GE-IB", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD4), + NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&ds35xxge_ooblayout, ds35xxgb_ecc_get_status)), + SPINAND_INFO("DS35Q8GM-IG", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB8), + NAND_MEMORG(1, 2048, 128, 64, 8192, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&ds35xxgb_ooblayout, ds35xxgb_ecc_get_status)), + SPINAND_INFO("DS35Q2GD-IB", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x52), + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&ds35xxgb_ooblayout, ds35xxgb_ecc_get_status)), + SPINAND_INFO("DS35M4GM-IB", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xA4), + NAND_MEMORG(1, 2048, 128, 64, 4096, 2, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&ds35xxgb_ooblayout, + ds35xxgb_ecc_get_status)), }; static const struct spinand_manufacturer_ops dosilicon_spinand_manuf_ops = { diff --git a/drivers/mtd/nand/spi/esmt.c b/drivers/mtd/nand/spi/esmt.c index ec1b06976f7..cb0b3a7be2f 100644 --- a/drivers/mtd/nand/spi/esmt.c +++ b/drivers/mtd/nand/spi/esmt.c @@ -13,6 +13,7 @@ #include #define SPINAND_MFR_ESMT 0xC8 +#define SPINAND_MFR_ESMT_ELITE 0x8C static SPINAND_OP_VARIANTS(read_cache_variants, SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), @@ -134,6 +135,18 @@ static const struct spinand_info esmt_spinand_table[] = { SPINAND_ECCINFO(&f50l2g41ka_ooblayout, f50l2g41ka_ecc_ecc_get_status)), }; +static const struct spinand_info esmt_elite_spinand_table[] = { + SPINAND_INFO("F50L1G41LC", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x2C), + NAND_MEMORG(1, 2048, 64, 64, 2048, 1, 1, 1), + NAND_ECCREQ(1, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + 0, + SPINAND_ECCINFO(&f50lxx41x_ooblayout, NULL)), +}; + static const struct spinand_manufacturer_ops esmt_spinand_manuf_ops = { }; @@ -144,3 +157,11 @@ const struct spinand_manufacturer esmt_spinand_manufacturer = { .nchips = ARRAY_SIZE(esmt_spinand_table), .ops = &esmt_spinand_manuf_ops, }; + +const struct spinand_manufacturer esmt_elite_spinand_manufacturer = { + .id = SPINAND_MFR_ESMT_ELITE, + .name = "esmt_elite", + .chips = esmt_elite_spinand_table, + .nchips = ARRAY_SIZE(esmt_elite_spinand_table), + .ops = &esmt_spinand_manuf_ops, +}; diff --git a/drivers/mtd/nand/spi/etron.c b/drivers/mtd/nand/spi/etron.c index 03a23abad25..9c5172fc5af 100644 --- a/drivers/mtd/nand/spi/etron.c +++ b/drivers/mtd/nand/spi/etron.c @@ -78,6 +78,64 @@ static int em73c044vcf_oh_ecc_get_status(struct spinand_device *spinand, return -EINVAL; } +static int em73e044vce_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = mtd->oobsize / 2; + region->length = mtd->oobsize / 2; + + return 0; +} + +static int em73e044vce_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = 2; + region->length = mtd->oobsize / 2 - 2; + + return 0; +} + +static const struct mtd_ooblayout_ops em73e044vce_ooblayout = { + .ecc = em73e044vce_ooblayout_ecc, + .rfree = em73e044vce_ooblayout_free, +}; + +static int em73e044vce_oh_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section > 3) + return -ERANGE; + + region->offset = (32 * section) + 18; + region->length = 14; + + return 0; +} + +static int em73e044vce_oh_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section > 3) + return -ERANGE; + + region->offset = (32 * section) + 2; + region->length = 16; + + return 0; +} + +static const struct mtd_ooblayout_ops em73e044vce_oh_ooblayout = { + .ecc = em73e044vce_oh_ooblayout_ecc, + .rfree = em73e044vce_oh_ooblayout_free, +}; + static const struct spinand_info etron_spinand_table[] = { SPINAND_INFO("EM73C044VCF-0H", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x36), @@ -89,6 +147,33 @@ static const struct spinand_info etron_spinand_table[] = { SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&em73c044vcf_oh_ooblayout, em73c044vcf_oh_ecc_get_status)), + SPINAND_INFO("EM73E044VCE-H", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x3B), + NAND_MEMORG(1, 2048, 128, 64, 4096, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&em73e044vce_ooblayout, em73c044vcf_oh_ecc_get_status)), + SPINAND_INFO("EM73E044VCE-OH", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x40), + NAND_MEMORG(1, 2048, 128, 64, 4096, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&em73e044vce_oh_ooblayout, em73c044vcf_oh_ecc_get_status)), + SPINAND_INFO("EM73C044VCD-H", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x1C), + NAND_MEMORG(1, 2048, 64, 64, 1024, 1, 1, 1), + NAND_ECCREQ(4, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&em73c044vcf_oh_ooblayout, em73c044vcf_oh_ecc_get_status)), }; static const struct spinand_manufacturer_ops etron_spinand_manuf_ops = { diff --git a/drivers/mtd/nand/spi/fmsh.c b/drivers/mtd/nand/spi/fmsh.c index 4e1bb2df7ea..f0231d108b4 100644 --- a/drivers/mtd/nand/spi/fmsh.c +++ b/drivers/mtd/nand/spi/fmsh.c @@ -161,6 +161,27 @@ static int fm25g0xd_ecc_get_status(struct spinand_device *spinand, return -EBADMSG; } +/* + * ecc bits: 0xC0[4,6] + * [0b000], No bit errors were detected; + * [0b001, 0b101], 3~7 Bit errors were detected and corrected. Not + * reach Flipping Bits; + * [0b110], Bit error count equals the bit flip detection threshold + * [0b111], Bit errors greater than ECC capability(8 bits) and not corrected; + */ +static int fm25g02bi3_ecc_get_status(struct spinand_device *spinand, u8 status) +{ + struct nand_device *nand = spinand_to_nand(spinand); + u8 eccsr = (status & GENMASK(6, 4)) >> 4; + + if (eccsr < 6) + return 0; + else if (eccsr == 6) + return nand->eccreq.strength; + else + return -EBADMSG; +} + static const struct spinand_info fmsh_spinand_table[] = { SPINAND_INFO("FM25S01A", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xE4), @@ -225,6 +246,15 @@ static const struct spinand_info fmsh_spinand_table[] = { &update_cache_variants), SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&fm25g0xd_ooblayout, fm25g0xd_ecc_get_status)), + SPINAND_INFO("FM25G02BI3", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD2), + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&fm25s01_ooblayout, fm25g02bi3_ecc_get_status)), }; static const struct spinand_manufacturer_ops fmsh_spinand_manuf_ops = { diff --git a/drivers/mtd/nand/spi/foresee.c b/drivers/mtd/nand/spi/foresee.c index b750a15793d..cac76b9b776 100644 --- a/drivers/mtd/nand/spi/foresee.c +++ b/drivers/mtd/nand/spi/foresee.c @@ -195,6 +195,24 @@ static const struct spinand_info foresee_spinand_table[] = { &update_cache_variants), SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&f35sqb00xg_ooblayout, f35sqb00xg_ecc_get_status)), + SPINAND_INFO("F35SQB002G", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x52), + NAND_MEMORG(1, 2048, 64, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&fsxxndxxg_ooblayout, f35sqb00xg_ecc_get_status)), + SPINAND_INFO("F35SQB001G", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x71), + NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), + NAND_ECCREQ(1, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&f35sqb00xg_ooblayout, NULL)), }; static const struct spinand_manufacturer_ops foresee_spinand_manuf_ops = { diff --git a/drivers/mtd/nand/spi/gigadevice.c b/drivers/mtd/nand/spi/gigadevice.c index 2f649199e24..f2f2b85eb60 100644 --- a/drivers/mtd/nand/spi/gigadevice.c +++ b/drivers/mtd/nand/spi/gigadevice.c @@ -59,6 +59,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants_2gq5, SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); +#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPI_NAND_CONT_READ) +static SPINAND_OP_VARIANTS(read_cache_variants_cont, + SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(0, 1, NULL, 0)); +#endif + static SPINAND_OP_VARIANTS(write_cache_variants, SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), SPINAND_PROG_LOAD(true, 0, NULL, 0)); @@ -539,6 +544,24 @@ static const struct spinand_info gigadevice_spinand_table[] = { SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&gd5fxgqx_variant3_ooblayout, gd5fxgq4xa_ecc_get_status)), + SPINAND_INFO("GD5F1GM9UEYIGY", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x91), + NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&gd5fxgqx_variant2_ooblayout, gd5fxgq4xa_ecc_get_status)), + SPINAND_INFO("GD5F8GM8REYIGR", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x89), + NAND_MEMORG(1, 4096, 256, 64, 4096, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&gd5fxgq4xc_oob_256_ops, gd5fxgq4uexxg_ecc_get_status)), }; static int gigadevice_spinand_set_ds(struct spinand_device *spinand, u8 ds_io) @@ -556,6 +579,19 @@ static int gigadevice_spinand_init(struct spinand_device *spinand) if (spinand->id.data[1] == 0x51) gigadevice_spinand_set_ds(spinand, 3); + /* Enable continuous read */ +#ifdef CONFIG_SPI_NAND_CONT_READ + if (spinand->id.data[1] == 0x91 || spinand->id.data[1] == 0x81) { +#ifdef CONFIG_SPL_BUILD + spinand->support_cont_read = true; + spinand_upd_cfg(spinand, CFG_BUF_ENABLE, 0); + spinand->op_templates.read_cache = &read_cache_variants_cont.ops[0]; + printf("Support cont_read\n"); +#else + spinand_upd_cfg(spinand, CFG_BUF_ENABLE, CFG_BUF_ENABLE); +#endif + } +#endif return 0; } diff --git a/drivers/mtd/nand/spi/gsto.c b/drivers/mtd/nand/spi/gsto.c index 73952876738..0482a3e3753 100644 --- a/drivers/mtd/nand/spi/gsto.c +++ b/drivers/mtd/nand/spi/gsto.c @@ -106,9 +106,9 @@ static const struct spinand_info gsto_spinand_table[] = { &write_cache_variants, &update_cache_variants), 0, - SPINAND_ECCINFO(&gss0xgsak1_ooblayout, NULL)), + SPINAND_ECCINFO(&gss0xgsax1_ooblayout, NULL)), SPINAND_INFO("GSS02GSAX1", - SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCA), + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCA, 0x23), NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), NAND_ECCREQ(8, 512), SPINAND_INFO_OP_VARIANTS(&read_cache_variants, @@ -117,7 +117,16 @@ static const struct spinand_info gsto_spinand_table[] = { 0, SPINAND_ECCINFO(&gss0xgsax1_ooblayout, NULL)), SPINAND_INFO("GSS01GSAX1", - SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCA), + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCA, 0x13), + NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + 0, + SPINAND_ECCINFO(&gss0xgsax1_ooblayout, NULL)), + SPINAND_INFO("GSS01GSBX1", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xCB, 0x13), NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), NAND_ECCREQ(8, 512), SPINAND_INFO_OP_VARIANTS(&read_cache_variants, diff --git a/drivers/mtd/nand/spi/hiksemi.c b/drivers/mtd/nand/spi/hiksemi.c new file mode 100644 index 00000000000..ee409704027 --- /dev/null +++ b/drivers/mtd/nand/spi/hiksemi.c @@ -0,0 +1,101 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2024 Rockchip Electronics Co., Ltd + * + * Authors: + * Dingqiang Lin + */ + +#ifndef __UBOOT__ +#include +#include +#endif +#include + +#define SPINAND_MFR_HIKSEMI 0x3C + +static SPINAND_OP_VARIANTS(read_cache_variants, + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); + +static SPINAND_OP_VARIANTS(write_cache_variants, + SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), + SPINAND_PROG_LOAD(true, 0, NULL, 0)); + +static SPINAND_OP_VARIANTS(update_cache_variants, + SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), + SPINAND_PROG_LOAD(false, 0, NULL, 0)); + +static int hsesyhdswxg_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = mtd->oobsize / 2; + region->length = mtd->oobsize / 2; + + return 0; +} + +static int hsesyhdswxg_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = 2; + region->length = mtd->oobsize / 2 - 2; + + return 0; +} + +static const struct mtd_ooblayout_ops hsesyhdswxg_ooblayout = { + .ecc = hsesyhdswxg_ooblayout_ecc, + .rfree = hsesyhdswxg_ooblayout_free, +}; + +static const struct spinand_info hiksemi_spinand_table[] = { + SPINAND_INFO("HSESYHDSW2G", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD2), + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(4, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + 0, + SPINAND_ECCINFO(&hsesyhdswxg_ooblayout, NULL)), + SPINAND_INFO("HSESDFDSW4G", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD4), + NAND_MEMORG(1, 2048, 128, 64, 4096, 1, 1, 1), + NAND_ECCREQ(4, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + 0, + SPINAND_ECCINFO(&hsesyhdswxg_ooblayout, NULL)), + SPINAND_INFO("HSESYHDSW1G", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xD1, 0xD1), + NAND_MEMORG(1, 2048, 64, 64, 1024, 1, 1, 1), + NAND_ECCREQ(4, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + 0, + SPINAND_ECCINFO(&hsesyhdswxg_ooblayout, NULL)), +}; + +static const struct spinand_manufacturer_ops hiksemi_spinand_manuf_ops = { +}; + +const struct spinand_manufacturer hiksemi_spinand_manufacturer = { + .id = SPINAND_MFR_HIKSEMI, + .name = "HIKSEMI", + .chips = hiksemi_spinand_table, + .nchips = ARRAY_SIZE(hiksemi_spinand_table), + .ops = &hiksemi_spinand_manuf_ops, +}; diff --git a/drivers/mtd/nand/spi/hyf.c b/drivers/mtd/nand/spi/hyf.c index 3a6029688d4..698c3d4df09 100644 --- a/drivers/mtd/nand/spi/hyf.c +++ b/drivers/mtd/nand/spi/hyf.c @@ -117,6 +117,35 @@ static const struct mtd_ooblayout_ops hyf2gq4uaacae_ooblayout = { .rfree = hyf2gq4uaacae_ooblayout_free, }; +static int hyf4gq4uaacbe_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section > 7) + return -ERANGE; + + region->offset = (32 * section) + 8; + region->length = 24; + + return 0; +} + +static int hyf4gq4uaacbe_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section > 7) + return -ERANGE; + + region->offset = 32 * section; + region->length = 8; + + return 0; +} + +static const struct mtd_ooblayout_ops hyf4gq4uaacbe_ooblayout = { + .ecc = hyf4gq4uaacbe_ooblayout_ecc, + .rfree = hyf4gq4uaacbe_ooblayout_free, +}; + static int hyf1gq4udacae_ecc_get_status(struct spinand_device *spinand, u8 status) { @@ -197,7 +226,7 @@ static const struct spinand_info hyf_spinand_table[] = { &write_cache_variants, &update_cache_variants), SPINAND_HAS_QE_BIT, - SPINAND_ECCINFO(&hyf2gq4uaacae_ooblayout, + SPINAND_ECCINFO(&hyf4gq4uaacbe_ooblayout, hyf1gq4udacae_ecc_get_status)), SPINAND_INFO("HYF2GQ4IAACAE", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x82), @@ -219,6 +248,15 @@ static const struct spinand_info hyf_spinand_table[] = { SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&hyf1gq4udacae_ooblayout, hyf1gq4udacae_ecc_get_status)), + SPINAND_INFO("HYF4GQ4IAACBE", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x86), + NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1), + NAND_ECCREQ(14, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&hyf4gq4uaacbe_ooblayout, hyf1gq4udacae_ecc_get_status)), }; static const struct spinand_manufacturer_ops hyf_spinand_manuf_ops = { diff --git a/drivers/mtd/nand/spi/issi.c b/drivers/mtd/nand/spi/issi.c new file mode 100644 index 00000000000..c50fbad80a1 --- /dev/null +++ b/drivers/mtd/nand/spi/issi.c @@ -0,0 +1,108 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2025 Rockchip Electronics Co., Ltd + * + * Authors: + * Dingqiang Lin + */ + +#ifndef __UBOOT__ +#include +#include +#endif +#include + +#define SPINAND_MFR_ISSI 0x9D + +static SPINAND_OP_VARIANTS(read_cache_variants, + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); + +static SPINAND_OP_VARIANTS(write_cache_variants, + SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), + SPINAND_PROG_LOAD(true, 0, NULL, 0)); + +static SPINAND_OP_VARIANTS(update_cache_variants, + SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), + SPINAND_PROG_LOAD(false, 0, NULL, 0)); + +static int is37sml0xgb_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = mtd->oobsize / 2; + region->length = mtd->oobsize / 2; + + return 0; +} + +static int is37sml0xgb_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = 2; + region->length = mtd->oobsize / 2 - 2; + + return 0; +} + +static const struct mtd_ooblayout_ops is37sml0xgb_ooblayout = { + .ecc = is37sml0xgb_ooblayout_ecc, + .rfree = is37sml0xgb_ooblayout_free, +}; + +/* + * ecc bits: 0xC0[4,6] + * [0b000], No bit errors were detected; + * [0b001] and [0b011], 1~6 Bit errors were detected and corrected. Not + * reach Flipping Bits; + * [0b101], Bit error count equals the bit flip + * detection threshold + * [0b010], Multiple bit errors were detected and + * not corrected. + * others, Reserved. + */ +static int is37sml0xgb_ecc_get_status(struct spinand_device *spinand, + u8 status) +{ + struct nand_device *nand = spinand_to_nand(spinand); + u8 eccsr = (status & GENMASK(6, 4)) >> 4; + + if (eccsr <= 1 || eccsr == 3) + return eccsr; + else if (eccsr == 5) + return nand->eccreq.strength; + else + return -EBADMSG; +} + +static const struct spinand_info issi_spinand_table[] = { + SPINAND_INFO("IS37SML02G8B", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x24), + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&is37sml0xgb_ooblayout, is37sml0xgb_ecc_get_status)), +}; + +static const struct spinand_manufacturer_ops issi_spinand_manuf_ops = { +}; + +const struct spinand_manufacturer issi_spinand_manufacturer = { + .id = SPINAND_MFR_ISSI, + .name = "ISSI", + .chips = issi_spinand_table, + .nchips = ARRAY_SIZE(issi_spinand_table), + .ops = &issi_spinand_manuf_ops, +}; diff --git a/drivers/mtd/nand/spi/kingston.c b/drivers/mtd/nand/spi/kingston.c new file mode 100644 index 00000000000..366523f2c8a --- /dev/null +++ b/drivers/mtd/nand/spi/kingston.c @@ -0,0 +1,107 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (c) 2025 Rockchip Electronics Co., Ltd + * + * Authors: + * Dingqiang Lin + */ + +#ifndef __UBOOT__ +#include +#include +#endif +#include + +#define SPINAND_MFR_KINGSTON 0x98 + +static SPINAND_OP_VARIANTS(read_cache_variants, + SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 2, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); + +static SPINAND_OP_VARIANTS(write_cache_variants, + SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), + SPINAND_PROG_LOAD(true, 0, NULL, 0)); + +static SPINAND_OP_VARIANTS(update_cache_variants, + SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), + SPINAND_PROG_LOAD(false, 0, NULL, 0)); + +static int spi004_sdeg_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section > 0) + return -ERANGE; + + region->offset = mtd->oobsize / 2; + region->length = mtd->oobsize / 2; + + return 0; +} + +static int spi004_sdeg_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + /* 2 bytes reserved for BBM */ + region->offset = 2; + region->length = mtd->oobsize / 2 - 2; + + return 0; +} + +static const struct mtd_ooblayout_ops spi004_sdeg_ooblayout = { + .ecc = spi004_sdeg_ooblayout_ecc, + .rfree = spi004_sdeg_ooblayout_free, +}; + +/* + * ecc bits: 0xC0[4,6] + * [0b000], No bit errors were detected; + * [0b001, 0b101], 3~7 Bit errors were detected and corrected. Not + * reach Flipping Bits; + * [0b110], Bit error count equals the bit flip detection threshold + * [0b111], Bit errors greater than ECC capability(8 bits) and not corrected; + */ +static int spi004_sdeg_ecc_get_status(struct spinand_device *spinand, u8 status) +{ + struct nand_device *nand = spinand_to_nand(spinand); + u8 eccsr = (status & GENMASK(6, 4)) >> 4; + + if (eccsr == 0) + return 0; + else if (eccsr < 6) + return eccsr + 2; + else if (eccsr == 6) + return nand->eccreq.strength; + else + return -EBADMSG; +} + +static const struct spinand_info kingston_spinand_table[] = { + SPINAND_INFO("SPI004-SDEG", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x53), + NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&spi004_sdeg_ooblayout, spi004_sdeg_ecc_get_status)), +}; + +static const struct spinand_manufacturer_ops kingston_spinand_manuf_ops = { +}; + +const struct spinand_manufacturer kingston_spinand_manufacturer = { + .id = SPINAND_MFR_KINGSTON, + .name = "kingston", + .chips = kingston_spinand_table, + .nchips = ARRAY_SIZE(kingston_spinand_table), + .ops = &kingston_spinand_manuf_ops, +}; diff --git a/drivers/mtd/nand/spi/macronix.c b/drivers/mtd/nand/spi/macronix.c index 46e19b805ff..7f0bb67eff9 100644 --- a/drivers/mtd/nand/spi/macronix.c +++ b/drivers/mtd/nand/spi/macronix.c @@ -330,7 +330,26 @@ static const struct spinand_info macronix_spinand_table[] = { mx35lf1ge4ab_ecc_get_status)), }; +static int macronix_spinand_init(struct spinand_device *spinand) +{ + /* Enable continuous read */ +#ifdef CONFIG_SPI_NAND_CONT_READ + if (spinand->id.data[1] == 0x96 || spinand->id.data[1] == 0xa6 || spinand->id.data[1] == 0xb7) { +#ifdef CONFIG_SPL_BUILD + spinand->support_cont_read = true; + spinand_upd_cfg(spinand, CFG_CONT_ENABLE, CFG_CONT_ENABLE); + printf("Support cont_read\n"); +#else + spinand_upd_cfg(spinand, CFG_CONT_ENABLE, 0); +#endif + } +#endif + + return 0; +} + static const struct spinand_manufacturer_ops macronix_spinand_manuf_ops = { + .init = macronix_spinand_init, }; const struct spinand_manufacturer macronix_spinand_manufacturer = { diff --git a/drivers/mtd/nand/spi/micron.c b/drivers/mtd/nand/spi/micron.c index 849d5b44385..512a12798f5 100644 --- a/drivers/mtd/nand/spi/micron.c +++ b/drivers/mtd/nand/spi/micron.c @@ -92,6 +92,60 @@ static int mt29f2g01abagd_ecc_get_status(struct spinand_device *spinand, return -EINVAL; } +static int mt29f4g01abafd_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = mtd->oobsize / 2; + region->length = mtd->oobsize / 2; + + return 0; +} + +static int mt29f4g01abafd_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = 2; + region->length = mtd->oobsize / 2 - 2; + + return 0; +} + +static const struct mtd_ooblayout_ops mt29f4g01abafd_ooblayout = { + .ecc = mt29f4g01abafd_ooblayout_ecc, + .rfree = mt29f4g01abafd_ooblayout_free, +}; + +/* + * ecc bits: 0xC0[4,6] + * [0b000], No bit errors were detected; + * [0b001] and [0b011], 1~6 Bit errors were detected and corrected. Not + * reach Flipping Bits; + * [0b101], Bit error count equals the bit flip + * detection threshold + * [0b010], Multiple bit errors were detected and + * not corrected. + * others, Reserved. + */ +static int mt29f4g01abafd_ecc_ecc_get_status(struct spinand_device *spinand, + u8 status) +{ + struct nand_device *nand = spinand_to_nand(spinand); + u8 eccsr = (status & GENMASK(6, 4)) >> 4; + + if (eccsr <= 1 || eccsr == 3) + return eccsr; + else if (eccsr == 5) + return nand->eccreq.strength; + else + return -EBADMSG; +} + static const struct spinand_info micron_spinand_table[] = { SPINAND_INFO("MT29F2G01ABAGD", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x24), @@ -113,6 +167,15 @@ static const struct spinand_info micron_spinand_table[] = { 0, SPINAND_ECCINFO(&mt29f2g01abagd_ooblayout, mt29f2g01abagd_ecc_get_status)), + SPINAND_INFO("MT29F4G01ABAFD", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x34), + NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + 0, + SPINAND_ECCINFO(&mt29f4g01abafd_ooblayout, mt29f4g01abafd_ecc_ecc_get_status)), }; static const struct spinand_manufacturer_ops micron_spinand_manuf_ops = { diff --git a/drivers/mtd/nand/spi/titan.c b/drivers/mtd/nand/spi/titan.c new file mode 100644 index 00000000000..96a1704136c --- /dev/null +++ b/drivers/mtd/nand/spi/titan.c @@ -0,0 +1,105 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Copyright (c) 2026 Rockchip Electronics Co., Ltd + * + * Authors: + * Dingqiang Lin + */ + +#ifndef __UBOOT__ +#include +#include +#endif +#include + +#define SPINAND_MFR_TITAN 0x3D + +static SPINAND_OP_VARIANTS(read_cache_variants, + SPINAND_PAGE_READ_FROM_CACHE_X4_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_DUALIO_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_X2_OP(0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), + SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); + +static SPINAND_OP_VARIANTS(write_cache_variants, + SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), + SPINAND_PROG_LOAD(true, 0, NULL, 0)); + +static SPINAND_OP_VARIANTS(update_cache_variants, + SPINAND_PROG_LOAD_X4(false, 0, NULL, 0), + SPINAND_PROG_LOAD(false, 0, NULL, 0)); + +static int tm1f0xguai_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = mtd->oobsize / 2; + region->length = mtd->oobsize / 2; + + return 0; +} + +static int tm1f0xguai_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + /* Reserve 2 bytes for the BBM. */ + region->offset = 2; + region->length = mtd->oobsize / 2 - 2; + + return 0; +} + +static const struct mtd_ooblayout_ops tm1f0xguai_ooblayout = { + .ecc = tm1f0xguai_ooblayout_ecc, + .rfree = tm1f0xguai_ooblayout_free, +}; + +static int tm1f0xguai_ecc_get_status(struct spinand_device *spinand, + u8 status) +{ + struct nand_device *nand = spinand_to_nand(spinand); + + switch (status & STATUS_ECC_MASK) { + case STATUS_ECC_NO_BITFLIPS: + return 0; + + case STATUS_ECC_UNCOR_ERROR: + return -EBADMSG; + + case STATUS_ECC_HAS_BITFLIPS: + return 0; + default: + return nand->eccreq.strength; + } + + return -EINVAL; +} + +static const struct spinand_info titan_spinand_table[] = { + SPINAND_INFO("TM1F02GBUAI", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x00, 0x32), + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&tm1f0xguai_ooblayout, tm1f0xguai_ecc_get_status)), +}; + +static const struct spinand_manufacturer_ops titan_spinand_manuf_ops = { +}; + +const struct spinand_manufacturer titan_spinand_manufacturer = { + .id = SPINAND_MFR_TITAN, + .name = "TITAN", + .chips = titan_spinand_table, + .nchips = ARRAY_SIZE(titan_spinand_table), + .ops = &titan_spinand_manuf_ops, +}; + diff --git a/drivers/mtd/nand/spi/unim.c b/drivers/mtd/nand/spi/unim.c index dadc9f4ae82..cd7aa9b765b 100644 --- a/drivers/mtd/nand/spi/unim.c +++ b/drivers/mtd/nand/spi/unim.c @@ -90,8 +90,8 @@ static int um19a1xisw_ooblayout_ecc(struct mtd_info *mtd, int section, if (section) return -ERANGE; - region->offset = 64; - region->length = 64; + region->offset = mtd->oobsize / 2; + region->length = mtd->oobsize / 2; return 0; } @@ -103,7 +103,7 @@ static int um19a1xisw_ooblayout_free(struct mtd_info *mtd, int section, return -ERANGE; region->offset = 2; - region->length = 62; + region->length = mtd->oobsize / 2 - 2; return 0; } @@ -147,7 +147,7 @@ static int tx25g01_ecc_get_status(struct spinand_device *spinand, * not corrected. * others, Reserved. */ -static int um19axxisw_ecc_ecc_get_status(struct spinand_device *spinand, +static int um19axxisw_ecc_get_status(struct spinand_device *spinand, u8 status) { struct nand_device *nand = spinand_to_nand(spinand); @@ -206,7 +206,7 @@ static const struct spinand_info unim_spinand_table[] = { &write_cache_variants, &update_cache_variants), SPINAND_HAS_QE_BIT, - SPINAND_ECCINFO(&um19a1xisw_ooblayout, um19axxisw_ecc_ecc_get_status)), + SPINAND_ECCINFO(&um19a1xisw_ooblayout, um19axxisw_ecc_get_status)), SPINAND_INFO("UM19A0HCSW", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x14), NAND_MEMORG(1, 2048, 64, 64, 1024, 1, 1, 1), @@ -215,7 +215,7 @@ static const struct spinand_info unim_spinand_table[] = { &write_cache_variants, &update_cache_variants), SPINAND_HAS_QE_BIT, - SPINAND_ECCINFO(&um19a0xisw_ooblayout, um19axxisw_ecc_ecc_get_status)), + SPINAND_ECCINFO(&um19a0xisw_ooblayout, um19axxisw_ecc_get_status)), SPINAND_INFO("UM19A0LCSW", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x15), NAND_MEMORG(1, 2048, 64, 64, 1024, 1, 1, 1), @@ -224,7 +224,7 @@ static const struct spinand_info unim_spinand_table[] = { &write_cache_variants, &update_cache_variants), SPINAND_HAS_QE_BIT, - SPINAND_ECCINFO(&um19a0xisw_ooblayout, um19axxisw_ecc_ecc_get_status)), + SPINAND_ECCINFO(&um19a0xisw_ooblayout, um19axxisw_ecc_get_status)), SPINAND_INFO("UM19A1LISW", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x25), NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), @@ -233,7 +233,7 @@ static const struct spinand_info unim_spinand_table[] = { &write_cache_variants, &update_cache_variants), SPINAND_HAS_QE_BIT, - SPINAND_ECCINFO(&um19a1xisw_ooblayout, um19axxisw_ecc_ecc_get_status)), + SPINAND_ECCINFO(&um19a1xisw_ooblayout, um19axxisw_ecc_get_status)), SPINAND_INFO("UM19A9LISW", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x0D), NAND_MEMORG(1, 2048, 128, 64, 512, 1, 1, 1), @@ -252,6 +252,24 @@ static const struct spinand_info unim_spinand_table[] = { &update_cache_variants), SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&um19a1xisw_ooblayout, um19a9xisw_ecc_get_status)), + SPINAND_INFO("UM19B2HISW", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x34), + NAND_MEMORG(1, 4096, 256, 128, 1024, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&um19a1xisw_ooblayout, um19axxisw_ecc_get_status)), + SPINAND_INFO("UM19C0HISW", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x1C), + NAND_MEMORG(1, 2048, 64, 64, 1024, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&um19a0xisw_ooblayout, um19axxisw_ecc_get_status)), }; static const struct spinand_manufacturer_ops unim_spinand_manuf_ops = { diff --git a/drivers/mtd/nand/spi/winbond.c b/drivers/mtd/nand/spi/winbond.c index babd999ec2d..3c2b7a4f0d2 100644 --- a/drivers/mtd/nand/spi/winbond.c +++ b/drivers/mtd/nand/spi/winbond.c @@ -15,6 +15,7 @@ #define SPINAND_MFR_WINBOND 0xEF +#define WINBOND_CFG_BRC_READ BIT(1) #define WINBOND_CFG_BUF_READ BIT(3) static SPINAND_OP_VARIANTS(read_cache_variants, @@ -25,6 +26,11 @@ static SPINAND_OP_VARIANTS(read_cache_variants, SPINAND_PAGE_READ_FROM_CACHE_OP(true, 0, 1, NULL, 0), SPINAND_PAGE_READ_FROM_CACHE_OP(false, 0, 1, NULL, 0)); +#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPI_NAND_CONT_READ) +static SPINAND_OP_VARIANTS(read_cache_variants_cont, + SPINAND_PAGE_READ_FROM_CACHE_X4_OP_3A(0, 1, NULL, 0)); +#endif + static SPINAND_OP_VARIANTS(write_cache_variants, SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), SPINAND_PROG_LOAD(true, 0, NULL, 0)); @@ -128,6 +134,35 @@ static int w25n02kv_ecc_get_status(struct spinand_device *spinand, return -EINVAL; } +static int w25n04lw_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = mtd->oobsize / 2; + region->length = mtd->oobsize / 2; + + return 0; +} + +static int w25n04lw_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = 2; + region->length = mtd->oobsize / 2 - 2; + + return 0; +} + +static const struct mtd_ooblayout_ops w25n04lw_ooblayout = { + .ecc = w25n04lw_ooblayout_ecc, + .rfree = w25n04lw_ooblayout_free, +}; + /* Another set for the same id[2] devices in one series */ static const struct spinand_info winbond_spinand_table[] = { SPINAND_INFO("W25M02GV", @@ -211,7 +246,7 @@ static const struct spinand_info winbond_spinand_table[] = { SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)), SPINAND_INFO("W25N01JWZEIG", - SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBC), + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBC, 0x21), NAND_MEMORG(1, 2048, 64, 64, 1024, 1, 1, 1), NAND_ECCREQ(1, 512), SPINAND_INFO_OP_VARIANTS(&read_cache_variants, @@ -220,7 +255,7 @@ static const struct spinand_info winbond_spinand_table[] = { SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)), SPINAND_INFO("W25N01KWZPIG", - SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBE), + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBE, 0x21), NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), NAND_ECCREQ(4, 512), SPINAND_INFO_OP_VARIANTS(&read_cache_variants, @@ -228,6 +263,42 @@ static const struct spinand_info winbond_spinand_table[] = { &update_cache_variants), 0, SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)), + SPINAND_INFO("W25N04LW2EIG", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB2, 0x23), + NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + 0, + SPINAND_ECCINFO(&w25n04lw_ooblayout, w25n02kv_ecc_get_status)), + SPINAND_INFO("W25N08LW2EIG", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB3, 0x24), + NAND_MEMORG(1, 4096, 128, 64, 4096, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + 0, + SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)), + SPINAND_INFO("W25N02JW2EIF", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xBF, 0x22), + NAND_MEMORG(1, 2048, 64, 64, 2048, 1, 1, 1), + NAND_ECCREQ(1, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&w25m02gv_ooblayout, NULL)), + SPINAND_INFO("W25N02LVCEIG", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x8A, 0x22), + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + 0, + SPINAND_ECCINFO(&w25n02kv_ooblayout, w25n02kv_ecc_get_status)), }; static int winbond_spinand_init(struct spinand_device *spinand) @@ -246,14 +317,29 @@ static int winbond_spinand_init(struct spinand_device *spinand) } /* W25N01JWZEIG enable continuous read */ -#ifdef CONFIG_SPI_NAND_WINBOND_CONT_READ - if (spinand->id.data[1] == 0xaa && spinand->id.data[2] == 0x21) { +#ifdef CONFIG_SPI_NAND_CONT_READ + if (((spinand->id.data[1] == 0xaa || spinand->id.data[1] == 0xba || + spinand->id.data[1] == 0xbc || spinand->id.data[1] == 0xbe) && + spinand->id.data[2] == 0x21) || + (spinand->id.data[1] == 0xbf && spinand->id.data[2] == 0x22)) { +#ifdef CONFIG_SPL_BUILD spinand->support_cont_read = true; spinand_upd_cfg(spinand, CFG_BUF_ENABLE, 0); + spinand->op_templates.read_cache = &read_cache_variants_cont.ops[0]; printf("Support cont_read\n"); +#else + spinand_upd_cfg(spinand, CFG_BUF_ENABLE, CFG_BUF_ENABLE); +#endif } #endif + /* W25N0xLV disable BRC in default */ + if ((spinand->id.data[1] == 0x8b && spinand->id.data[2] == 0x23) || + (spinand->id.data[1] == 0x8a && spinand->id.data[2] == 0x22)) { + spinand_upd_cfg(spinand, WINBOND_CFG_BRC_READ, 0); + dev_info(&spinand->spimem->spi->dev, "Disable BRC in default\n"); + } + return 0; } diff --git a/drivers/mtd/nand/spi/xincun.c b/drivers/mtd/nand/spi/xincun.c index e8eadf565b6..c7d122bcfb0 100644 --- a/drivers/mtd/nand/spi/xincun.c +++ b/drivers/mtd/nand/spi/xincun.c @@ -13,6 +13,7 @@ #include #define SPINAND_MFR_XINCUN 0x8C +#define SPINAND_MFR_XINCUN_6C 0x6C #define XINCUN_STATUS_ECC_HAS_BITFLIPS_T (3 << 4) static SPINAND_OP_VARIANTS(read_cache_variants, @@ -103,6 +104,45 @@ static const struct spinand_info xincun_spinand_table[] = { &update_cache_variants), SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&xcsp2aapk_ooblayout, xcsp2aapk_ecc_get_status)), + SPINAND_INFO("XCSP4AAPK-IT", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xB1), + NAND_MEMORG(1, 2048, 128, 128, 4096, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xcsp2aapk_ooblayout, xcsp2aapk_ecc_get_status)), +}; + +static const struct spinand_info xincun_6c_spinand_table[] = { + SPINAND_INFO("XCSP4AXPK-IT", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xB1, 0x0A), + NAND_MEMORG(1, 4096, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(9, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xcsp2aapk_ooblayout, xcsp2aapk_ecc_get_status)), + SPINAND_INFO("XCSP1AXPK-IT", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0x01), + NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), + NAND_ECCREQ(9, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xcsp2aapk_ooblayout, xcsp2aapk_ecc_get_status)), + SPINAND_INFO("XCSP2AXPK-IT", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xA1), + NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), + NAND_ECCREQ(9, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xcsp2aapk_ooblayout, xcsp2aapk_ecc_get_status)), }; static const struct spinand_manufacturer_ops xincun_spinand_manuf_ops = { @@ -115,3 +155,11 @@ const struct spinand_manufacturer xincun_spinand_manufacturer = { .nchips = ARRAY_SIZE(xincun_spinand_table), .ops = &xincun_spinand_manuf_ops, }; + +const struct spinand_manufacturer xincun_6c_spinand_manufacturer = { + .id = SPINAND_MFR_XINCUN_6C, + .name = "XINCUN", + .chips = xincun_6c_spinand_table, + .nchips = ARRAY_SIZE(xincun_6c_spinand_table), + .ops = &xincun_spinand_manuf_ops, +}; diff --git a/drivers/mtd/nand/spi/xtx.c b/drivers/mtd/nand/spi/xtx.c index 6275ddddb5c..6f30f90cf06 100644 --- a/drivers/mtd/nand/spi/xtx.c +++ b/drivers/mtd/nand/spi/xtx.c @@ -390,6 +390,60 @@ static const struct spinand_info xtx_spinand_table[] = { &update_cache_variants), SPINAND_HAS_QE_BIT, SPINAND_ECCINFO(&xt26g01c_ooblayout, xt26g11c_ecc_get_status)), + SPINAND_INFO("XT26G12DWSIGA", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x35), + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xt26g01c_ooblayout, xt26g11c_ecc_get_status)), + SPINAND_INFO("XT26Q12DWSIGA", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x55), + NAND_MEMORG(1, 2048, 128, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xt26g01c_ooblayout, xt26g11c_ecc_get_status)), + SPINAND_INFO("XT26G11DWSIGA", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x34), + NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xt26g01c_ooblayout, xt26g11c_ecc_get_status)), + SPINAND_INFO("XT26Q14DWSIGA", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x56), + NAND_MEMORG(1, 4096, 256, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xt26g01c_ooblayout, xt26g11c_ecc_get_status)), + SPINAND_INFO("XT26G08DWSIGA", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x37), + NAND_MEMORG(1, 4096, 256, 64, 4096, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xt26g01c_ooblayout, xt26g11c_ecc_get_status)), + SPINAND_INFO("XT26G01FWSIGA", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0x71), + NAND_MEMORG(1, 2048, 128, 64, 1024, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&xt26g01c_ooblayout, xt26g01c_ecc_get_status)), }; static const struct spinand_manufacturer_ops xtx_spinand_manuf_ops = { diff --git a/drivers/mtd/nand/spi/zbit.c b/drivers/mtd/nand/spi/zbit.c index 3c249a7825e..a7501d2a3bc 100644 --- a/drivers/mtd/nand/spi/zbit.c +++ b/drivers/mtd/nand/spi/zbit.c @@ -13,6 +13,7 @@ #include #define SPINAND_MFR_ZBIT 0x5E +#define ZBIT_STATUS_ECC_HAS_BITFLIPS_T (3 << 4) static SPINAND_OP_VARIANTS(read_cache_variants, SPINAND_PAGE_READ_FROM_CACHE_QUADIO_OP(0, 1, NULL, 0), @@ -54,6 +55,59 @@ static const struct mtd_ooblayout_ops zb35q01b_ooblayout = { .rfree = zb35q01b_ooblayout_free, }; +static int zb35q04byig_ecc_get_status(struct spinand_device *spinand, + u8 status) +{ + struct nand_device *nand = spinand_to_nand(spinand); + + switch (status & STATUS_ECC_MASK) { + case STATUS_ECC_NO_BITFLIPS: + return 0; + + case STATUS_ECC_UNCOR_ERROR: + return -EBADMSG; + + case STATUS_ECC_HAS_BITFLIPS: + return 0; + case ZBIT_STATUS_ECC_HAS_BITFLIPS_T: + return nand->eccreq.strength; + default: + break; + } + + return -EINVAL; +} + +static int zb35q0xc_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + region->offset = mtd->oobsize / 2; + region->length = mtd->oobsize / 2; + + return 0; +} + +static int zb35q0xc_ooblayout_free(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) +{ + if (section) + return -ERANGE; + + /* Reserve 2 bytes for the BBM. */ + region->offset = 2; + region->length = mtd->oobsize / 2 - 2; + + return 0; +} + +static const struct mtd_ooblayout_ops zb35q0xc_ooblayout = { + .ecc = zb35q0xc_ooblayout_ecc, + .rfree = zb35q0xc_ooblayout_free, +}; + static const struct spinand_info zbit_spinand_table[] = { SPINAND_INFO("ZB35Q01BYIG", SPINAND_ID(SPINAND_READID_METHOD_OPCODE_DUMMY, 0xA1), @@ -64,6 +118,42 @@ static const struct spinand_info zbit_spinand_table[] = { &update_cache_variants), 0, SPINAND_ECCINFO(&zb35q01b_ooblayout, NULL)), + SPINAND_INFO("ZB35Q04BYIG", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xA3), + NAND_MEMORG(1, 2048, 128, 128, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&zb35q01b_ooblayout, zb35q04byig_ecc_get_status)), + SPINAND_INFO("ZB35Q01CYIG", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xC1), + NAND_MEMORG(1, 2048, 64, 64, 1024, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&zb35q0xc_ooblayout, zb35q04byig_ecc_get_status)), + SPINAND_INFO("ZB35Q02CYIG", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xC2), + NAND_MEMORG(1, 2048, 64, 64, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&zb35q0xc_ooblayout, zb35q04byig_ecc_get_status)), + SPINAND_INFO("ZB35Q04CYIG", + SPINAND_ID(SPINAND_READID_METHOD_OPCODE_ADDR, 0xC3), + NAND_MEMORG(1, 2048, 128, 128, 2048, 1, 1, 1), + NAND_ECCREQ(8, 512), + SPINAND_INFO_OP_VARIANTS(&read_cache_variants, + &write_cache_variants, + &update_cache_variants), + SPINAND_HAS_QE_BIT, + SPINAND_ECCINFO(&zb35q01b_ooblayout, zb35q04byig_ecc_get_status)), }; static const struct spinand_manufacturer_ops zbit_spinand_manuf_ops = { diff --git a/drivers/mtd/spi/Kconfig b/drivers/mtd/spi/Kconfig index 48f02a22973..fd5c8946998 100644 --- a/drivers/mtd/spi/Kconfig +++ b/drivers/mtd/spi/Kconfig @@ -181,6 +181,12 @@ config SPI_FLASH_BOYA Add support for various BOYA (BOYA Co., Ltd) SPI flash chips (BY25Qxxxx). +config SPI_FLASH_ZBIT + bool "ZBIT SPI flash support" + help + Add support for various ZBIT (ZBIT Co., Ltd) + SPI flash chips (ZB25Qxxxx). + config SPI_FLASH_NORMEM bool "NORMEM SPI flash support" help diff --git a/drivers/mtd/spi/spi-nor-ids.c b/drivers/mtd/spi/spi-nor-ids.c index ffe174c8c3d..65a3191c064 100644 --- a/drivers/mtd/spi/spi-nor-ids.c +++ b/drivers/mtd/spi/spi-nor-ids.c @@ -83,11 +83,12 @@ const struct flash_info spi_nor_ids[] = { { INFO("en25q32b", 0x1c3016, 0, 64 * 1024, 64, 0) }, { INFO("en25q64", 0x1c3017, 0, 64 * 1024, 128, SECT_4K) }, { INFO("en25qh64", 0x1c7017, 0, 64 * 1024, 128, SECT_4K) }, - { INFO("en25qh128", 0x1c7018, 0, 64 * 1024, 256, SECT_4K) }, + { INFO("en25qh128", 0x1c7018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { INFO("en25s64", 0x1c3817, 0, 64 * 1024, 128, SECT_4K) }, { INFO("en25qh256a", 0x1c7019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, { INFO("en25qx256a", 0x1c7119, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, { INFO("en25qx128a", 0x1c7118, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("en25qx64a", 0x1c7117, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, #endif #ifdef CONFIG_SPI_FLASH_GIGADEVICE /* GIGADEVICE */ /* GigaDevice */ @@ -146,6 +147,11 @@ const struct flash_info spi_nor_ids[] = { SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES | SPI_NOR_HAS_LOCK) }, + { + INFO("gd25lt512m", 0xc8661a, 0, 64 * 1024, 1024, + SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | + SPI_NOR_4B_OPCODES | SPI_NOR_HAS_LOCK) + }, /* adding these 3V QSPI flash parts */ {INFO("gd25b256", 0xc84019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_4B_OPCODES) }, @@ -461,11 +467,6 @@ const struct flash_info spi_nor_ids[] = { SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) }, - { - INFO("w25q128jw", 0xef8018, 0, 64 * 1024, 256, - SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | - SPI_NOR_HAS_LOCK | SPI_NOR_HAS_TB) - }, { INFO("w25q256fw", 0xef6019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | @@ -531,6 +532,7 @@ const struct flash_info spi_nor_ids[] = { { INFO("XM25QH128C", 0x204018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { INFO("XM25QH256C", 0x204019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { INFO("XM25QU128C", 0x204118, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("XM25QU256C", 0x204119, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, #endif #ifdef CONFIG_SPI_FLASH_XTX /* XTX Technology (Shenzhen) Limited */ @@ -549,7 +551,10 @@ const struct flash_info spi_nor_ids[] = { { INFO("PY25Q64HA", 0x852017, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { INFO("PY25Q128HA", 0x852018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { INFO("PY25Q256HB", 0x852019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, + { INFO("PY25Q64LB", 0x856517, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { INFO("PY25Q128LA", 0x856518, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("PY25Q256LC", 0x856519, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, + { INFO("PY25F128LA", 0x856318, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, #endif #ifdef CONFIG_SPI_FLASH_FMSH /* FUDAN MICRO (Shanghai) Co., Ltd. */ @@ -562,14 +567,27 @@ const struct flash_info spi_nor_ids[] = { { INFO("FM25Q64A", 0xf83217, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { INFO("FM25M4AA", 0xf84218, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, { INFO("FM25M64C", 0xf84317, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("DS25Q4CB", 0xe5301A, 0, 64 * 1024, 1024, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, + { INFO("DS25Q4DN", 0xe5301B, 0, 64 * 1024, 2048, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, + { INFO("DS25Q64A", 0xe53117, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, #endif #ifdef CONFIG_SPI_FLASH_BOYA /* Boya Microelectronics Co., Ltd. */ { INFO("BY25Q256FSEIG", 0x684919, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, + { INFO("BY25Q64ESSIG", 0x684017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("BY25FQ256ESSIG", 0x684019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, + { INFO("BY25FQ256ELSIG", 0x686019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, #endif #ifdef CONFIG_SPI_FLASH_NORMEM /* NORMEM Microelectronics Co., Ltd. */ { INFO("NM25Q128EVB", 0x522118, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, +#endif +#ifdef CONFIG_SPI_FLASH_ZBIT + /* Zbit Microelectronics Co., Ltd. */ + { INFO("ZB25Q256A", 0x5E4019, 0, 64 * 1024, 512, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ | SPI_NOR_4B_OPCODES) }, + { INFO("ZB25VQ64", 0x5e4017, 0, 64 * 1024, 128, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("ZB25VQ128", 0x5e4018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, + { INFO("ZB25LQ128", 0x5e5018, 0, 64 * 1024, 256, SECT_4K | SPI_NOR_DUAL_READ | SPI_NOR_QUAD_READ) }, #endif { }, }; diff --git a/drivers/rkflash/sfc_nand.c b/drivers/rkflash/sfc_nand.c index 4de03a68168..3282f91b7d6 100644 --- a/drivers/rkflash/sfc_nand.c +++ b/drivers/rkflash/sfc_nand.c @@ -24,6 +24,8 @@ static u32 sfc_nand_get_ecc_status6(void); static u32 sfc_nand_get_ecc_status7(void); static u32 sfc_nand_get_ecc_status8(void); static u32 sfc_nand_get_ecc_status9(void); +static u32 sfc_nand_get_ecc_status10(void); +static u32 sfc_nand_get_ecc_status11(void); static struct nand_info spi_nand_tbl[] = { /* TC58CVG0S0HxAIx */ @@ -89,7 +91,7 @@ static struct nand_info spi_nand_tbl[] = { /* GD5F1GM7REYIGR */ { 0xC8, 0x81, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, /* GD5F4GM8UEYIGR */ - { 0xC8, 0x95, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, + { 0xC8, 0x95, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status3 }, /* W25N01GV */ { 0xEF, 0xAA, 0x21, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 0, { 0x04, 0x14, 0x24, 0xFF }, &sfc_nand_get_ecc_status1 }, @@ -105,6 +107,10 @@ static struct nand_info spi_nand_tbl[] = { { 0xEF, 0xAA, 0x20, 4, 0x40, 1, 512, 0x4C, 17, 0x1, 0, { 0x04, 0x14, 0x24, 0xFF }, &sfc_nand_get_ecc_status1 }, /* W25N01KV */ { 0xEF, 0xAE, 0x21, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* W25N01JWZEIG */ + { 0xEF, 0xBC, 0x21, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* W25N01KWZPIG */ + { 0xEF, 0xBE, 0x21, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, /* HYF2GQ4UAACAE */ { 0xC9, 0x52, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0xE, 1, { 0x04, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, @@ -119,9 +125,9 @@ static struct nand_info spi_nand_tbl[] = { /* HYF4GQ4UAACBE */ { 0xC9, 0xD4, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0xE, 1, { 0x20, 0x40, 0x24, 0x44 }, &sfc_nand_get_ecc_status0 }, /* HYF2GQ4IAACAE */ - { 0xC9, 0x82, 0x00, 4, 0x40, 1, 2048, 0x4C, 20, 0xE, 1, { 0x04, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + { 0xC9, 0x82, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0xE, 1, { 0x04, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, /* HYF1GQ4IDACAE */ - { 0xC9, 0x81, 0x00, 4, 0x40, 1, 1024, 0x4C, 20, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + { 0xC9, 0x81, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, /* FS35ND01G-S1 */ { 0xCD, 0xB1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x10, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status5 }, @@ -132,7 +138,7 @@ static struct nand_info spi_nand_tbl[] = { /* FS35ND02G-S3Y2 */ { 0xCD, 0xEB, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, /* FS35ND04G-S2Y2 1*4096 */ - { 0xCD, 0xEC, 0x00, 4, 0x40, 2, 2048, 0x4C, 20, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + { 0xCD, 0xEC, 0x00, 4, 0x40, 2, 2048, 0x4C, 20, 0x4, 0, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status1 }, /* F35SQA001G */ { 0xCD, 0x71, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, /* F35SQA002G */ @@ -143,8 +149,12 @@ static struct nand_info spi_nand_tbl[] = { { 0xCD, 0x60, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, /* F35UQA002G-WWT */ { 0xCD, 0x62, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, - /* F35UQA001G-WWT */ + /* F35SQB004G-WWT */ { 0xCD, 0x61, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* F35SQB004G */ + { 0xCD, 0x53, 0x00, 8, 0x40, 1, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status10 }, + /* F35SQB002G */ + { 0xCD, 0x52, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status10 }, /* DS35Q1GA-IB */ { 0xE5, 0x71, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, @@ -159,7 +169,7 @@ static struct nand_info spi_nand_tbl[] = { /* DS35Q2GB-IB */ { 0xE5, 0xF2, 0x00, 4, 0x40, 2, 1024, 0x0C, 19, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, /* DS35Q4GM */ - { 0xE5, 0xF4, 0x00, 4, 0x40, 2, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + { 0xE5, 0xF4, 0x00, 4, 0x40, 2, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x14, 0x0C, 0x10 }, &sfc_nand_get_ecc_status6 }, /* DS35M1GB-IB */ { 0xE5, 0xA1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, /* DS35Q12B-IB */ @@ -168,6 +178,16 @@ static struct nand_info spi_nand_tbl[] = { { 0xE5, 0xA5, 0x00, 4, 0x40, 1, 512, 0x0C, 17, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, /* DS35Q1GD-IB */ { 0xE5, 0x51, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35M4GB-IB */ + { 0xE5, 0x64, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status6 }, + /* DS35Q4GB-IB */ + { 0xE5, 0xB4, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status6 }, + /* DS35M12C-IB */ + { 0xE5, 0x25, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q12C-IB */ + { 0xE5, 0x75, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q2GBS */ + { 0xE5, 0xB2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, /* EM73C044VCC-H */ { 0xD5, 0x22, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, @@ -177,13 +197,15 @@ static struct nand_info spi_nand_tbl[] = { { 0xD5, 0x03, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x28, 0x08, 0x2C }, &sfc_nand_get_ecc_status0 }, /* EM73C044VCF-H */ { 0xD5, 0x25, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* EM73E044VCE-H */ + { 0xD5, 0x3B, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, /* XT26G02A */ { 0x0B, 0xE2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status4 }, /* XT26G01A */ { 0x0B, 0xE1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status4 }, /* XT26G04A */ - { 0x0B, 0xE3, 0x00, 4, 0x80, 1, 2048, 0x4C, 20, 0x8, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status4 }, + { 0x0B, 0xE3, 0x00, 4, 0x80, 1, 2048, 0x4C, 20, 0x8, 1, { 0x08, 0x0C, 0x0C, 0x10 }, &sfc_nand_get_ecc_status4 }, /* XT26G01B */ { 0x0B, 0xF1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status4 }, /* XT26G02B */ @@ -208,6 +230,10 @@ static struct nand_info spi_nand_tbl[] = { { 0x0B, 0x32, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, /* XT26G04DWSIGA */ { 0x0B, 0x33, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* XT26Q04DWSIGT-B */ + { 0x0B, 0x53, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x14, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* XT26Q01DWSIGA */ + { 0x0B, 0x51, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, /* MT29F2G01ABA, XT26G02E, F50L2G41XA */ { 0x2C, 0x24, 0x00, 4, 0x40, 2, 1024, 0x4C, 19, 0x8, 0, { 0x20, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, @@ -226,6 +252,10 @@ static struct nand_info spi_nand_tbl[] = { { 0xA1, 0xD4, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, /* FM25G02BI3 */ { 0xA1, 0xD2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* FM25S02BI3-DND-A-G3 */ + { 0xA1, 0xD6, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* FM25G02D */ + { 0xA1, 0xF2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status5 }, /* IS37SML01G1 */ { 0xC8, 0x21, 0x00, 4, 0x40, 1, 1024, 0x00, 18, 0x1, 0, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, @@ -242,6 +272,14 @@ static struct nand_info spi_nand_tbl[] = { { 0xB0, 0x15, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, /* UM19A1LISW */ { 0xB0, 0x25, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* UM19A9LISW */ + { 0xB0, 0x0D, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* UM19A9HISW */ + { 0xB0, 0x0C, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* UM19A0HISW */ + { 0xB0, 0x14, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status11 }, + /* UM19A0LISW */ + { 0xB0, 0x15, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status11 }, /* ATO25D1GA */ { 0x9B, 0x12, 0x00, 4, 0x40, 1, 1024, 0x40, 18, 0x1, 1, { 0x14, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, @@ -254,7 +292,7 @@ static struct nand_info spi_nand_tbl[] = { /* TX25G01 */ { 0xA1, 0xF1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status8 }, - /* S35ML01G3, ANV1GCP0CLG, HYF1GQ4UTXCAE, YX25G1E */ + /* S35ML01G3, ANV1GCP0CLG, HYF1GQ4UTXCAE, YX25G1E, GSS01GSAM0 */ { 0x01, 0x15, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status9 }, /* S35ML02G3, ANV2GCP0CLG, HYF2GQ4UTXCAE, YX25G2E */ { 0x01, 0x25, 0x00, 4, 0x40, 2, 1024, 0x4C, 19, 0x4, 0, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status9 }, @@ -265,11 +303,25 @@ static struct nand_info spi_nand_tbl[] = { { 0x52, 0xBA, 0x13, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, /* GSS02GSAK1 */ { 0x52, 0xBA, 0x23, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* GSS02GSAX1 */ + { 0x52, 0xCA, 0x23, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* GSS01GSAX1 */ + { 0x52, 0xCA, 0x13, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, /* XCSP2AAPK */ { 0x8C, 0xA1, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, /* XCSP1AAPK */ { 0x8C, 0x01, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* F50L1G41LC */ + { 0x8C, 0x2C, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x1, 0, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + + /* ZB35Q01BYIG */ + { 0x5E, 0xA1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* ZB35Q04BYIG */ + { 0x5E, 0xA3, 0x00, 4, 0x80, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + + /* HSESYHDSW2G */ + { 0x3C, 0xD2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, }; static struct nand_info *p_nand_info; @@ -834,6 +886,88 @@ static u32 sfc_nand_get_ecc_status9(void) return ret; } +/* + * ecc spectial type10: + * ecc bits: 0xC0[4,6] + * [0b000], No bit errors were detected; + * [0b001, 0b101], 3~7 Bit errors were detected and corrected. Not + * reach Flipping Bits; + * [0b110], Bit error count equals the bit flip detection threshold + * [0b111], Bit errors greater than ECC capability(8 bits) and not corrected; + */ +static u32 sfc_nand_get_ecc_status10(void) +{ + u32 ret; + u32 i; + u8 ecc; + u8 status; + u32 timeout = 1000 * 1000; + + for (i = 0; i < timeout; i++) { + ret = sfc_nand_read_feature(0xC0, &status); + + if (ret != SFC_OK) + return SFC_NAND_ECC_ERROR; + + if (!(status & (1 << 0))) + break; + + sfc_delay(1); + } + + ecc = (status >> 4) & 0x07; + + if (ecc < 6) + ret = SFC_NAND_ECC_OK; + else if (ecc == 6) + ret = SFC_NAND_ECC_REFRESH; + else + ret = (u32)SFC_NAND_ECC_ERROR; + + return ret; +} + +/* + * ecc spectial type11: + * ecc bits: 0xC0[4,6] + * [0b000], No bit errors were detected; + * [0b001, 0b101], 3~7 Bit errors were detected and corrected. Not + * reach Flipping Bits; + * [0b110], Bit error count equals the bit flip detection threshold + * [0b111], Bit errors greater than ECC capability(8 bits) and not corrected; + */ +static u32 sfc_nand_get_ecc_status11(void) +{ + u32 ret; + u32 i; + u8 ecc; + u8 status; + u32 timeout = 1000 * 1000; + + for (i = 0; i < timeout; i++) { + ret = sfc_nand_read_feature(0xC0, &status); + + if (ret != SFC_OK) + return SFC_NAND_ECC_ERROR; + + if (!(status & (1 << 0))) + break; + + sfc_delay(1); + } + + ecc = (status >> 4) & 0x07; + + if (ecc <= 1) + ret = SFC_NAND_ECC_OK; + else if (ecc == 3 || ecc == 5) + ret = SFC_NAND_ECC_REFRESH; + else + ret = (u32)SFC_NAND_ECC_ERROR; + + return ret; +} + u32 sfc_nand_erase_block(u8 cs, u32 addr) { int ret; diff --git a/drivers/rkflash/sfc_nand.c.flashinfo b/drivers/rkflash/sfc_nand.c.flashinfo new file mode 100644 index 00000000000..ca3defee64e --- /dev/null +++ b/drivers/rkflash/sfc_nand.c.flashinfo @@ -0,0 +1,376 @@ +static struct nand_info spi_nand_tbl[] = { + /* TC58CVG0S0HxAIx */ + { 0x98, 0xC2, 0x00, 4, 0x40, 1, 1024, 0x00, 18, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* TC58CVG1S0HxAIx */ + { 0x98, 0xCB, 0x00, 4, 0x40, 2, 1024, 0x00, 19, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* TC58CVG2S0HRAIJ */ + { 0x98, 0xED, 0x00, 8, 0x40, 1, 2048, 0x0C, 20, 0x8, 0, { 0x04, 0x0C, 0x08, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* TC58CVG1S3HRAIJ */ + { 0x98, 0xEB, 0x00, 4, 0x40, 1, 2048, 0x0C, 19, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* TC58CVG0S3HRAIJ */ + { 0x98, 0xE2, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + + /* MX35LF1GE4AB */ + { 0xC2, 0x12, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* MX35LF2GE4AB */ + { 0xC2, 0x22, 0x00, 4, 0x40, 2, 1024, 0x0C, 19, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* MX35LF2GE4AD */ + { 0xC2, 0x26, 0x00, 4, 0x40, 1, 2048, 0x0C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* MX35LF4GE4AD */ + { 0xC2, 0x37, 0x00, 8, 0x40, 1, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x08, 0x14, 0x18 }, &sfc_nand_get_ecc_status0 }, + /* MX35UF1GE4AC */ + { 0xC2, 0x92, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* MX35UF2GE4AC */ + { 0xC2, 0xA2, 0x00, 4, 0x40, 1, 2048, 0x0C, 19, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* MX35UF1GE4AD */ + { 0xC2, 0x96, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* MX35UF2GE4AD */ + { 0xC2, 0xA6, 0x00, 4, 0x40, 1, 2048, 0x0C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* MX35UF4GE4AD */ + { 0xC2, 0xB7, 0x00, 8, 0x40, 1, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x08, 0x14, 0x18 }, &sfc_nand_get_ecc_status0 }, + + /* GD5F1GQ4UAYIG */ + { 0xC8, 0xF1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* GD5F1GQ4RB9IGR */ + { 0xC8, 0xD1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, + /* GD5F2GQ40BY2GR */ + { 0xC8, 0xD2, 0x00, 4, 0x40, 2, 1024, 0x0C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, + /* GD5F1GQ5UEYIG */ + { 0xC8, 0x51, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status2 }, + /* GD5F2GQ5UEYIG */ + { 0xC8, 0x52, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status2 }, + /* GD5F1GQ4R */ + { 0xC8, 0xC1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, + /* GD5F4GQ6RExxG 1*4096 */ + { 0xC8, 0x45, 0x00, 4, 0x40, 2, 2048, 0x4C, 20, 0x4, 1, { 0x04, 0x08, 0x14, 0x18 }, &sfc_nand_get_ecc_status2 }, + /* GD5F4GQ6UExxG 1*4096 */ + { 0xC8, 0x55, 0x00, 4, 0x40, 2, 2048, 0x4C, 20, 0x4, 1, { 0x04, 0x08, 0x14, 0x18 }, &sfc_nand_get_ecc_status2 }, + /* GD5F1GQ4UExxH */ + { 0xC8, 0xD9, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, + /* GD5F1GQ5REYIG Add 3rd code to distingush with F50L2G41KA */ + { 0xC8, 0x41, 0xC8, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status2 }, + /* GD5F2GQ5REYIG */ + { 0xC8, 0x42, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status2 }, + /* GD5F2GM7RxG */ + { 0xC8, 0x82, 0x00, 4, 0x40, 1, 2048, 0x0C, 19, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, + /* GD5F2GM7UxG */ + { 0xC8, 0x92, 0x00, 4, 0x40, 1, 2048, 0x0C, 19, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, + /* GD5F1GM7UxG */ + { 0xC8, 0x91, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, + /* GD5F4GQ4UAYIG 1*4096 */ + { 0xC8, 0xF4, 0x00, 4, 0x40, 2, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x08, 0x14, 0x18 }, &sfc_nand_get_ecc_status0 }, + /* GD5F1GM7REYIGR */ + { 0xC8, 0x81, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status3 }, + /* GD5F4GM8UEYIGR */ + { 0xC8, 0x95, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status3 }, + /* GD5F4GM8REY2GY */ + { 0xC8, 0x85, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status3 }, + /* GD5F1GM9UEYIGY */ + { 0xC8, 0x91, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* GD5F8GM8REYIGR */ + { 0xC8, 0x89, 0x00, 8, 0x40, 1, 4096, 0x4C, 21, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status3 }, + /* GD5F4GM7UEYIGR */ + { 0xC8, 0x94, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + + /* W25N01GV-CONT */ + { 0xEF, 0xAA, 0x21, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 0, { 0x04, 0x14, 0x24, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* W25N02KVZEIR */ + { 0xEF, 0xAA, 0x22, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 0, { 0x04, 0x14, 0x24, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* W25N04KVZEIR */ + { 0xEF, 0xAA, 0x23, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 0, { 0x04, 0x14, 0x24, 0x34 }, &sfc_nand_get_ecc_status0 }, + /* W25N01GW-CONT */ + { 0xEF, 0xBA, 0x21, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 0, { 0x04, 0x14, 0x24, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* W25N02KW */ + { 0xEF, 0xBA, 0x22, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 0, { 0x04, 0x14, 0x24, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* W25N512GVEIG */ + { 0xEF, 0xAA, 0x20, 4, 0x40, 1, 512, 0x4C, 17, 0x1, 0, { 0x04, 0x14, 0x24, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* W25N01KV */ + { 0xEF, 0xAE, 0x21, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* W25N01JW-CONT */ + { 0xEF, 0xBC, 0x21, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* W25N01KW-CONT */ + { 0xEF, 0xBE, 0x21, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* W25N04LW2EIG */ + { 0xEF, 0xB2, 0x23, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* W25N08LW2EIG */ + { 0xEF, 0xB3, 0x24, 8, 0x40, 1, 4096, 0x4C, 21, 0x8, 0, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* W25N02JW2EIF */ + { 0xEF, 0xBF, 0x22, 4, 0x40, 1, 2048, 0x4C, 19, 0x1, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* W25N02LVCEIG */ + { 0xEF, 0x8A, 0x22, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + + /* HYF2GQ4UAACAE */ + { 0xC9, 0x52, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0xE, 1, { 0x04, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* HYF1GQ4UDACAE */ + { 0xC9, 0x21, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* HYF1GQ4UPACAE */ + { 0xC9, 0xA1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* HYF2GQ4UDACAE */ + { 0xC9, 0x22, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* HYF2GQ4UHCCAE */ + { 0xC9, 0x5A, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0xE, 1, { 0x04, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* HYF4GQ4UAACBE */ + { 0xC9, 0xD4, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0xE, 1, { 0x20, 0x40, 0x24, 0x44 }, &sfc_nand_get_ecc_status0 }, + /* HYF2GQ4IAACAE */ + { 0xC9, 0x82, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0xE, 1, { 0x04, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* HYF1GQ4IDACAE */ + { 0xC9, 0x81, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* HYF4GQ4IAACBE */ + { 0xC9, 0x86, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0xE, 1, { 0x04, 0x20, 0x24, 0x30 }, &sfc_nand_get_ecc_status0 }, + + /* FS35ND01G-S1 */ + { 0xCD, 0xB1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x10, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status5 }, + /* FS35ND02G-S2 */ + { 0xCD, 0xA2, 0x00, 4, 0x40, 1, 2048, 0x00, 19, 0x4, 0, { 0x10, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status5 }, + /* FS35ND01G-S1Y2 */ + { 0xCD, 0xEA, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* FS35ND02G-S3Y2 */ + { 0xCD, 0xEB, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* FS35ND04G-S2Y2 1*4096 */ + { 0xCD, 0xEC, 0x00, 4, 0x40, 2, 2048, 0x4C, 20, 0x4, 0, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status1 }, + /* F35SQA001G */ + { 0xCD, 0x71, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* F35SQA002G */ + { 0xCD, 0x72, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* F35SQA512M */ + { 0xCD, 0x70, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* F35UQA512M */ + { 0xCD, 0x60, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* F35UQA002G-WWT */ + { 0xCD, 0x62, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* F35SQB004G-WWT */ + { 0xCD, 0x61, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* F35SQB004G */ + { 0xCD, 0x53, 0x00, 8, 0x40, 1, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status10 }, + /* F35SQB002G */ + { 0xCD, 0x52, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status10 }, + /* F35SQB001G */ + { 0xCD, 0x71, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + + /* DS35Q1GA-IB */ + { 0xE5, 0x71, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* DS35Q2GA-IB */ + { 0xE5, 0x72, 0x00, 4, 0x40, 2, 1024, 0x0C, 19, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* DS35M1GA-1B */ + { 0xE5, 0x21, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* DS35M2GA-IB */ + { 0xE5, 0x22, 0x00, 4, 0x40, 2, 1024, 0x0C, 19, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* DS35Q1GB-IB */ + { 0xE5, 0xF1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q2GB-IB */ + { 0xE5, 0xF2, 0x00, 4, 0x40, 2, 1024, 0x0C, 19, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q4GM */ + { 0xE5, 0xF4, 0x00, 4, 0x40, 2, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x14, 0x0C, 0x10 }, &sfc_nand_get_ecc_status6 }, + /* DS35M1GB-IB */ + { 0xE5, 0xA1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q12B-IB */ + { 0xE5, 0xF5, 0x00, 4, 0x40, 1, 512, 0x0C, 17, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35M12B-IB */ + { 0xE5, 0xA5, 0x00, 4, 0x40, 1, 512, 0x0C, 17, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q1GD-IB */ + { 0xE5, 0x51, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35M4GB-IB */ + { 0xE5, 0x64, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status6 }, + /* DS35Q4GB-IB */ + { 0xE5, 0xB4, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status6 }, + /* DS35M12C-IB */ + { 0xE5, 0x25, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q12C-IB */ + { 0xE5, 0x75, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q2GBS */ + { 0xE5, 0xB2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q4GE-IB */ + { 0xE5, 0xD4, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status6 }, + /* DS35Q8GM-IG */ + { 0xE5, 0xB8, 0x00, 4, 0x40, 1, 8192, 0x4C, 21, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35Q2GD-IB */ + { 0xE5, 0x52, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* DS35M4GM-IB */ + { 0xE5, 0xA4, 0x00, 4, 0x40, 2, 2048, 0x0C, 20, 0x8, 1, { 0x04, 0x14, 0x0C, 0x10 }, &sfc_nand_get_ecc_status6 }, + + /* EM73C044VCC-H */ + { 0xD5, 0x22, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* EM73D044VCE-H */ + { 0xD5, 0x20, 0x00, 4, 0x40, 1, 2048, 0x0C, 19, 0x8, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* EM73E044SNA-G */ + { 0xD5, 0x03, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x28, 0x08, 0x2C }, &sfc_nand_get_ecc_status0 }, + /* EM73C044VCF-H */ + { 0xD5, 0x25, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* EM73E044VCE-H */ + { 0xD5, 0x3B, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* EM73E044VCE-OH */ + { 0xD5, 0x40, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x20, 0x24 }, &sfc_nand_get_ecc_status0 }, + /* EM73C044VCD-H */ + { 0xD5, 0x1C, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* EM73D044VCU */ + { 0xD5, 0x4A, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + + /* XT26G02A */ + { 0x0B, 0xE2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status4 }, + /* XT26G01A */ + { 0x0B, 0xE1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status4 }, + /* XT26G04A */ + { 0x0B, 0xE3, 0x00, 4, 0x80, 1, 2048, 0x4C, 20, 0x8, 1, { 0x08, 0x0C, 0x0C, 0x10 }, &sfc_nand_get_ecc_status4 }, + /* XT26G01B */ + { 0x0B, 0xF1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status4 }, + /* XT26G02B */ + { 0x0B, 0xF2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status5 }, + /* XT26G01C */ + { 0x0B, 0x11, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status7 }, + /* XT26G02C */ + { 0x0B, 0x12, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status7 }, + /* XT26G04C */ + { 0x0B, 0x13, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status7 }, + /* XT26G11C */ + { 0x0B, 0x15, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XT26Q02DWSIGA */ + { 0x0B, 0x52, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XT26Q01DWSIGA */ + { 0x0B, 0x51, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XT26Q04DWSIGA */ + { 0x0B, 0x53, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* XT26G01DWSIGA */ + { 0x0B, 0x31, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XT26G02DWSIGA */ + { 0x0B, 0x32, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XT26G04DWSIGA */ + { 0x0B, 0x33, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* XT26Q04DWSIGT-B */ + { 0x0B, 0x53, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x14, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* XT26Q01DWSIGA */ + { 0x0B, 0x51, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XT26G12DWSIGA */ + { 0x0B, 0x35, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XT26Q12DWSIGA */ + { 0x0B, 0x55, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XT26G11DWSIGA */ + { 0x0B, 0x34, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XT26Q14DWSIGA */ + { 0x0B, 0x56, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* XT26G08DWSIGA */ + { 0x0B, 0x37, 0x00, 8, 0x40, 1, 4096, 0x4C, 21, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* XT26G01FWSIGA */ + { 0x0B, 0x71, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status7 }, + + /* MT29F2G01ABA, XT26G02E, F50L2G41XA */ + { 0x2C, 0x24, 0x00, 4, 0x40, 2, 1024, 0x4C, 19, 0x8, 0, { 0x20, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* MT29F1G01ABA, F50L1G41XA */ + { 0x2C, 0x14, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 0, { 0x20, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* MT29F4G01ABAFD, F50L4G41XBX1CL */ + { 0x2C, 0x34, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 0, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status6 }, + + /* FM25S01 */ + { 0xA1, 0xA1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 0, { 0x00, 0x04, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* FM25S01A */ + { 0xA1, 0xE4, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* FM25S02A */ + { 0xA1, 0xE5, 0x00, 4, 0x40, 2, 1024, 0x4C, 19, 0x1, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* FM25LS01 */ + { 0xA1, 0xA5, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* FM25S01BI3 */ + { 0xA1, 0xD4, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* FM25S02BI3-DND-A-G3 */ + { 0xA1, 0xD6, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* FM25G02D */ + { 0xA1, 0xF2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status5 }, + /* FM25G02BI3 */ + { 0xA1, 0xD2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status10 }, + + /* IS37SML01G1 */ + { 0xC8, 0x21, 0x00, 4, 0x40, 1, 1024, 0x00, 18, 0x1, 0, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* F50L1G41LB */ + { 0xC8, 0x01, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x1, 0, { 0x14, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* F50L2G41KA */ + { 0xC8, 0x41, 0x7F, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + + /* UM19A1HISW */ + { 0xB0, 0x24, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* UM19A0HCSW */ + { 0xB0, 0x14, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status11 }, + /* UM19A0LCSW */ + { 0xB0, 0x15, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status11 }, + /* UM19A1LISW */ + { 0xB0, 0x25, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + /* UM19A9LISW */ + { 0xB0, 0x0D, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* UM19A9HISW */ + { 0xB0, 0x0C, 0x00, 4, 0x40, 1, 512, 0x4C, 17, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* UM19B2HISW */ + { 0xB0, 0x34, 0x00, 8, 0x80, 1, 1024, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status11 }, + /* UM19C0HISW */ + { 0xB0, 0x1C, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status11 }, + + /* ATO25D1GA */ + { 0x9B, 0x12, 0x00, 4, 0x40, 1, 1024, 0x40, 18, 0x1, 1, { 0x14, 0x24, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* BWJX08K-2Gb */ + { 0xBC, 0xB3, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x10, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* JS28U1GQSCAHG-83 */ + { 0xBF, 0x21, 0x00, 4, 0x40, 1, 1024, 0x40, 18, 0x4, 1, { 0x08, 0x0C, 0xFF, 0xFF }, &sfc_nand_get_ecc_status8 }, + /* SGM7000I-S24W1GH */ + { 0xEA, 0xC1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* TX25G01 */ + { 0xA1, 0xF1, 0x00, 4, 0x40, 1, 1024, 0x0C, 18, 0x4, 1, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status8 }, + + /* S35ML01G3, ANV1GCP0CLG, HYF1GQ4UTXCAE, YX25G1E, GSS01GSAM0, EM73C044VCE-H */ + { 0x01, 0x15, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status9 }, + /* S35ML02G3, ANV2GCP0CLG, HYF2GQ4UTXCAE, YX25G2E, EM73D044VCE-H */ + { 0x01, 0x25, 0x00, 4, 0x40, 2, 1024, 0x4C, 19, 0x4, 0, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status9 }, + /* S35ML04G3, ANV4GCP0CLG-BI */ + { 0x01, 0x35, 0x00, 4, 0x40, 2, 2048, 0x4C, 20, 0x4, 0, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status9 }, + + /* GSS01GSAK1 */ + { 0x52, 0xBA, 0x13, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* GSS02GSAK1 */ + { 0x52, 0xBA, 0x23, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* GSS02GSAX1 */ + { 0x52, 0xCA, 0x23, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* GSS01GSAX1 */ + { 0x52, 0xCA, 0x13, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* GSS01GSBX1 */ + { 0x52, 0xCB, 0x13, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + + /* XCSP2AAPK */ + { 0x8C, 0xA1, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XCSP1AAPK */ + { 0x8C, 0x01, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* F50L1G41LC */ + { 0x8C, 0x2C, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x1, 0, { 0x04, 0x14, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* XCSP4AXPK-IT */ + { 0x6C, 0xB1, 0x0A, 8, 0x40, 1, 2048, 0x4C, 20, 0x9, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status0 }, + /* XCSP4AAPK-IT */ + { 0x8C, 0xB1, 0x00, 4, 0x80, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XCSP1AXPK-IT */ + { 0x6C, 0x01, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x9, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* XCSP2AXPK-IT */ + { 0x6C, 0xA1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x9, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + + /* ZB35Q01BYIG */ + { 0x5E, 0xA1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* ZB35Q04BYIG */ + { 0x5E, 0xA3, 0x00, 4, 0x80, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status1 }, + /* ZB35Q02CYIG */ + { 0x5E, 0xC2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* ZB35Q01CYIG */ + { 0x5E, 0xC1, 0x00, 4, 0x40, 1, 1024, 0x4C, 18, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + /* ZB35Q04CYIG */ + { 0x5E, 0xC3, 0x00, 4, 0x80, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, + + /* HSESYHDSW2G */ + { 0x3C, 0xD2, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* HSESDFDSW4G */ + { 0x3C, 0xD4, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + /* HSESYHDSW1G */ + { 0x3C, 0xD1, 0xD1, 4, 0x40, 1, 1024, 0x4C, 18, 0x4, 0, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status1 }, + + /* IS37SMW04G8B */ + { 0x9D, 0x35, 0x00, 4, 0x40, 1, 4096, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status11 }, + /* IS37SML02G8B */ + { 0x9D, 0x24, 0x00, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status6 }, + + /* SPI004-SDEG */ + { 0x98, 0x53, 0x00, 8, 0x40, 1, 2048, 0x4C, 20, 0x8, 1, { 0x04, 0x08, 0x0C, 0x10 }, &sfc_nand_get_ecc_status10 }, + + /* TM1F02GBUAI */ + { 0x3D, 0x00, 0x32, 4, 0x40, 1, 2048, 0x4C, 19, 0x8, 1, { 0x04, 0x08, 0xFF, 0xFF }, &sfc_nand_get_ecc_status0 }, +}; +/*flash_info_end*/ diff --git a/drivers/rkflash/sfc_nor.c.flashinfo b/drivers/rkflash/sfc_nor.c.flashinfo new file mode 100644 index 00000000000..15871bb22b4 --- /dev/null +++ b/drivers/rkflash/sfc_nor.c.flashinfo @@ -0,0 +1,267 @@ +static struct flash_info spi_flash_tbl[] = { + /* GD25Q40B */ + { 0xc84013, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x05, 10, 9, 0 }, + /* GD25Q16E */ + { 0xc84015, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 12, 9, 0 }, + /* GD25Q32B */ + { 0xc84016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 13, 9, 0 }, + /* GD25Q64B/C/E */ + { 0xc84017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* GD25Q127C and GD25Q128C/E */ + { 0xc84018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* GD25Q256B/C/D/E */ + { 0xc84019, 128, 8, 0x13, 0x12, 0x6C, 0x3E, 0x21, 0xDC, 0x1C, 16, 6, 0 }, + /* GD25Q512MC */ + { 0xc84020, 128, 8, 0x13, 0x12, 0x6C, 0x3E, 0x21, 0xDC, 0x1C, 17, 6, 0 }, + /* GD25LQ64C */ + { 0xc86017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 14, 9, 0 }, + /* GD25LQ128 */ + { 0xc86018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 15, 9, 0 }, + /* GD25LQ32E */ + { 0xc86016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 13, 9, 0 }, + /* GD25B512MEYIG */ + { 0xc8471A, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 17, 0, 0 }, + /* GD55B01GE */ + { 0xc8471B, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 18, 0, 0 }, + /* GD25LQ255E and GD25LQ256C */ + { 0xc86019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1D, 16, 9, 0 }, + /* GD25LB512MEYIG */ + { 0xc8671A, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 17, 0, 0 }, + /* GD55LB01GEFIRR */ + { 0xc8671B, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 18, 0, 0 }, + /* GD25LT512MEY2G */ + { 0xc8661A, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 17, 0, 0 }, + /* GD55LT01GEFIRT */ + { 0xc8661B, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 18, 0, 0 }, + /* GD25LB256EYIGR */ + { 0xc86719, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 0, 0 }, + /* GD25LE80E */ + { 0xc86014, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 11, 9, 0 }, + /* GD55LB02GF */ + { 0xc8601C, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1D, 19, 0, 0 }, + /* GD25LQ64E */ + { 0xc86017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 14, 9, 0 }, + /* GD25F256F */ + { 0xc84319, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* GD55LB02GE */ + { 0xc8671C, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1D, 19, 0, 0 }, + + /* W25Q32JV */ + { 0xef4016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 13, 9, 0 }, + /* W25Q64JVSSIQ */ + { 0xef4017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* W25Q128FV and W25Q128JV*/ + { 0xef4018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* W25Q256F/J */ + { 0xef4019, 128, 8, 0x13, 0x02, 0x6C, 0x32, 0x20, 0xD8, 0x3C, 16, 9, 0 }, + /* W25Q32JW */ + { 0xef6016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 13, 9, 0 }, + /* W25Q64FWSSIG */ + { 0xef6017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* W25Q128JWSQ */ + { 0xef6018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* W25Q256JWEQ*/ + { 0xef6019, 128, 8, 0x13, 0x02, 0x6C, 0x32, 0x20, 0xD8, 0x3C, 16, 9, 0 }, + /* W25Q128JVSIM */ + { 0xef7018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* W25Q256JVEM */ + { 0xef7019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x3C, 16, 9, 0 }, + /* W25Q12PWSSIM */ + { 0xef8018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* W25Q01JVIM */ + { 0xef7021, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x3C, 18, 9, 0 }, + /* W25Q512JV */ + { 0xef4020, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 17, 9, 0 }, + /* W25H512JV */ + { 0xef9020, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 17, 9, 0 }, + + /* MX25L3233FM2I-08G */ + { 0xc22016, 128, 8, 0x03, 0x02, 0x6B, 0x38, 0x20, 0xD8, 0x0E, 13, 6, 0 }, + /* MX25L6433F */ + { 0xc22017, 128, 8, 0x03, 0x02, 0x6B, 0x38, 0x20, 0xD8, 0x0E, 14, 6, 0 }, + /* MX25L12835E/F MX25L12833FMI-10G */ + { 0xc22018, 128, 8, 0x03, 0x02, 0x6B, 0x38, 0x20, 0xD8, 0x0E, 15, 6, 0 }, + /* MX25L25635E/F MX25L25645G MX25L25645GMI-08G */ + { 0xc22019, 128, 8, 0x13, 0x12, 0x6C, 0x3E, 0x21, 0xDC, 0x1E, 16, 6, 0 }, + /* MX25L51245GMI */ + { 0xc2201a, 128, 8, 0x13, 0x12, 0x6C, 0x3E, 0x21, 0xDC, 0x1E, 17, 6, 0 }, + /* MX25U51245G */ + { 0xc2253a, 128, 8, 0x0C, 0x12, 0x6C, 0x3E, 0x21, 0xDC, 0x1E, 17, 6, 0 }, + /* MX25U3232F */ + { 0xc22536, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0E, 13, 6, 0 }, + /* MX25U6432F */ + { 0xc22537, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0E, 14, 6, 0 }, + /* MX25U12832F */ + { 0xc22538, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0E, 15, 6, 0 }, + /* MX25U25645GZ4I-00 */ + { 0xc22539, 128, 8, 0x13, 0x12, 0x6C, 0x3E, 0x21, 0xDC, 0x1E, 16, 6, 0 }, + /* MX25LM25645G */ + { 0xc2813a, 128, 8, 0x13, 0x12, 0x00, 0x00, 0x21, 0xDC, 0x10, 17, 0, 0x1D }, + + /* XM25QH32C/D */ + { 0x204016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 13, 9, 0 }, + /* XM25QH64C/D */ + { 0x204017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* XM25QH128C/D */ + { 0x204018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x05, 15, 9, 0 }, + /* XM25QH256C/D */ + { 0x204019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* XM25QH64B */ + { 0x206017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 14, 6, 0 }, + /* XM25QH128B */ + { 0x206018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 15, 6, 0 }, + /* XM25QH(QU)256B */ + { 0x206019, 128, 8, 0x13, 0x12, 0x6C, 0x3E, 0x21, 0xDC, 0x1D, 16, 6, 0 }, + /* XM25QH64A */ + { 0x207017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 0, 0 }, + /* XM25QU256C */ + { 0x204119, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* XM25QU128C */ + { 0x204118, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* XM25QU64C/XM25LU64C */ + { 0x204117, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* XM25QH512D */ + { 0x204020, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 17, 9, 0 }, + + /* XT25F128A XM25QH128A */ + { 0x207018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 0, 0 }, + /* XT25F64BSSIGU-5 XT25F64F */ + { 0x0b4017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 14, 9, 0 }, + /* XT25F128BSSIGU */ + { 0x0b4018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 15, 9, 0 }, + /* XT25F256BSFIGU */ + { 0x0b4019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* XT25F32BS XT25F32F */ + { 0x0b4016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 13, 9, 0 }, + /* XT25F16BS */ + { 0x0b4015, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 12, 9, 0 }, + /* XT25Q64D */ + { 0x0b6017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* XT25Q128D */ + { 0x0b6018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* XT25Q256F */ + { 0x0b6019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* XTD25W64A */ + { 0x0b7517, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + + /* EN25QH64A */ + { 0x1c7017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 0, 0 }, + /* EN25QH128A */ + { 0x1c7018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 0, 0 }, + /* EN25QH32B */ + { 0x1c7016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 13, 0, 0 }, + /* EN25S32A */ + { 0x1c3816, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 13, 0, 0 }, + /* EN25S64A */ + { 0x1c3817, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 0, 0 }, + /* EN25QH256A */ + { 0x1c7019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 0, 0 }, + /* EN25QX256A */ + { 0x1c7119, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* EN25QX128A */ + { 0x1c7118, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* EN25QX64A */ + { 0x1c7117, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + + /* P25Q64H P25Q64SU */ + { 0x856017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* P25Q128H */ + { 0x856018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* P25Q16H-SUH-IT */ + { 0x856015, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 12, 9, 0 }, + /* P25Q32SL P25Q32SH-SSH-IT */ + { 0x856016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 13, 9, 0 }, + /* PY25Q32SH */ + { 0x852016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 13, 9, 0 }, + /* PY25Q64HA */ + { 0x852017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* PY25Q128H */ + { 0x852018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* PY25Q256H */ + { 0x852019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* PY25Q512HB */ + { 0x85201A, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 17, 9, 0 }, + /* PY25Q64LB */ + { 0x856517, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* PY25Q128LA */ + { 0x856518, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* PY25Q256LC */ + { 0x856519, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* PY25F128LA */ + { 0x856318, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + + /* ZB25VQ64 */ + { 0x5e4017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* ZB25VQ128 */ + { 0x5e4018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* ZB25LQ128 */ + { 0x5e5018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* ZB25Q256A */ + { 0x5e4019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x3C, 16, 9, 0 }, + + /* BH25Q128AS, BY25Q128AS */ + { 0x684018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* BH25Q64BS */ + { 0x684017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + + /* FM25Q128A */ + { 0xA14018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* FM25Q64-SOB-T-G */ + { 0xA14017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* FM25Q256I3 */ + { 0xA14019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + + /* FM25Q64A */ + { 0xf83217, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 14, 9, 0 }, + /* FM25M4AA */ + { 0xf84218, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 15, 9, 0 }, + /* FM25M64C */ + { 0xf84317, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0D, 14, 9, 0 }, + + /* DS25M4AB-1AIB4 */ + { 0xe54218, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* DS25M64E */ + { 0xe54117, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* DS25Q4AA */ + { 0xe53118, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* DS25Q4CB */ + { 0xe5301A, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 17, 9, 0 }, + /* DS25Q4DN */ + { 0xe5301B, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 18, 9, 0 }, + /* DS25Q64A */ + { 0xe53117, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + + /* GM25Q128A */ + { 0x1c4018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + + /* IS25LP128 */ + { 0x9D6018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 6, 0 }, + /* IS25LP512M */ + { 0x9D601A, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x3C, 17, 6, 0 }, + /* IS25WP512M */ + { 0x9D701A, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x3C, 17, 6, 0 }, + /* IS25LP01GJ */ + { 0x9D6021, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x3C, 18, 6, 0 }, + + /* BY25Q256FSEIG */ + { 0x684919, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* BY25FQ32EL */ + { 0x686016, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 13, 9, 0 }, + /* BY25FQ64EL */ + { 0x686017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* BY25FQ128EL */ + { 0x686018, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 9, 0 }, + /* BY25FQ256ESSIG */ + { 0x684019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + /* BY25FQ64ESSIG */ + { 0x684017, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 14, 9, 0 }, + /* BY25FQ256ELSIG */ + { 0x686019, 128, 8, 0x13, 0x12, 0x6C, 0x34, 0x21, 0xDC, 0x1C, 16, 9, 0 }, + + /* NM25Q128EVB */ + { 0x522118, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 15, 10, 0 }, + + /* GT25Q40D */ + { 0xc44013, 128, 8, 0x03, 0x02, 0x6B, 0x32, 0x20, 0xD8, 0x0C, 10, 9, 0 }, +}; +/*flash_info_end*/ diff --git a/include/linux/mtd/spinand.h b/include/linux/mtd/spinand.h index 40ffe77c3c6..44c3ee7cdcf 100644 --- a/include/linux/mtd/spinand.h +++ b/include/linux/mtd/spinand.h @@ -163,6 +163,7 @@ #define CFG_OTP_ENABLE BIT(6) #define CFG_ECC_ENABLE BIT(4) #define CFG_BUF_ENABLE BIT(3) +#define CFG_CONT_ENABLE BIT(2) #define CFG_QUAD_ENABLE BIT(0) /* status register */ @@ -254,7 +255,9 @@ extern const struct spinand_manufacturer toshiba_spinand_manufacturer; extern const struct spinand_manufacturer winbond_spinand_manufacturer; extern const struct spinand_manufacturer dosilicon_spinand_manufacturer; extern const struct spinand_manufacturer esmt_spinand_manufacturer; +extern const struct spinand_manufacturer esmt_elite_spinand_manufacturer; extern const struct spinand_manufacturer xincun_spinand_manufacturer; +extern const struct spinand_manufacturer xincun_6c_spinand_manufacturer; extern const struct spinand_manufacturer xtx_spinand_manufacturer; extern const struct spinand_manufacturer hyf_spinand_manufacturer; extern const struct spinand_manufacturer fmsh_spinand_manufacturer; @@ -268,6 +271,10 @@ extern const struct spinand_manufacturer unim_zl_spinand_manufacturer; extern const struct spinand_manufacturer skyhigh_spinand_manufacturer; extern const struct spinand_manufacturer gsto_spinand_manufacturer; extern const struct spinand_manufacturer zbit_spinand_manufacturer; +extern const struct spinand_manufacturer hiksemi_spinand_manufacturer; +extern const struct spinand_manufacturer kingston_spinand_manufacturer; +extern const struct spinand_manufacturer issi_spinand_manufacturer; +extern const struct spinand_manufacturer titan_spinand_manufacturer; /** * struct spinand_op_variants - SPI NAND operation variants