drivers/mtd/mtk-snand/Kconfig | 21 +
drivers/mtd/mtk-snand/Makefile | 11 +
drivers/mtd/mtk-snand/mtk-snand-def.h | 271 ++++
- drivers/mtd/mtk-snand/mtk-snand-ecc.c | 395 +++++
- drivers/mtd/mtk-snand/mtk-snand-ids.c | 511 +++++++
+ drivers/mtd/mtk-snand/mtk-snand-ecc.c | 411 ++++++
+ drivers/mtd/mtk-snand/mtk-snand-ids.c | 515 +++++++
drivers/mtd/mtk-snand/mtk-snand-mtd.c | 535 +++++++
drivers/mtd/mtk-snand/mtk-snand-os.c | 39 +
drivers/mtd/mtk-snand/mtk-snand-os.h | 120 ++
drivers/mtd/mtk-snand/mtk-snand.c | 1933 +++++++++++++++++++++++++
drivers/mtd/mtk-snand/mtk-snand.h | 77 +
- 12 files changed, 3917 insertions(+)
+ 12 files changed, 3937 insertions(+)
create mode 100644 drivers/mtd/mtk-snand/Kconfig
create mode 100644 drivers/mtd/mtk-snand/Makefile
create mode 100644 drivers/mtd/mtk-snand/mtk-snand-def.h
+#endif /* _MTK_SNAND_DEF_H_ */
--- /dev/null
+++ b/drivers/mtd/mtk-snand/mtk-snand-ecc.c
-@@ -0,0 +1,395 @@
+@@ -0,0 +1,411 @@
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
+/*
+ * Copyright (C) 2020 MediaTek Inc. All Rights Reserved.
+
+static const uint8_t mt7622_ecc_caps[] = { 4, 6, 8, 10, 12 };
+
++static const uint8_t mt7981_ecc_caps[] = {
++ 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24
++};
++
+static const uint8_t mt7986_ecc_caps[] = {
+ 4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24
+};
+ [ECC_DECDONE] = 0x11c,
+};
+
++static const uint32_t mt7981_ecc_regs[] = {
++ [ECC_DECDONE] = 0x124,
++};
++
+static const uint32_t mt7986_ecc_regs[] = {
+ [ECC_DECDONE] = 0x124,
+};
+ .errnum_bits = 5,
+ .errnum_shift = 5,
+ },
++ [SNAND_SOC_MT7981] = {
++ .ecc_caps = mt7981_ecc_caps,
++ .num_ecc_cap = ARRAY_SIZE(mt7981_ecc_caps),
++ .regs = mt7981_ecc_regs,
++ .mode_shift = 5,
++ .errnum_bits = 5,
++ .errnum_shift = 8,
++ },
+ [SNAND_SOC_MT7986] = {
+ .ecc_caps = mt7986_ecc_caps,
+ .num_ecc_cap = ARRAY_SIZE(mt7986_ecc_caps),
+}
--- /dev/null
+++ b/drivers/mtd/mtk-snand/mtk-snand-ids.c
-@@ -0,0 +1,511 @@
+@@ -0,0 +1,515 @@
+// SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause
+/*
+ * Copyright (C) 2020 MediaTek Inc. All Rights Reserved.
+ &snand_cap_read_from_cache_quad,
+ &snand_cap_program_load_x4,
+ mtk_snand_winbond_select_die),
++ SNAND_INFO("W25N01KV", SNAND_ID(SNAND_ID_DYMMY, 0xef, 0xae, 0x21),
++ SNAND_MEMORG_1G_2K_64,
++ &snand_cap_read_from_cache_quad,
++ &snand_cap_program_load_x4),
+ SNAND_INFO("W25N02KV", SNAND_ID(SNAND_ID_DYMMY, 0xef, 0xaa, 0x22),
+ SNAND_MEMORG_2G_2K_128,
+ &snand_cap_read_from_cache_quad,
+ &snand_cap_program_load_x4),
+ SNAND_INFO("GD5F2GQ5UExxG", SNAND_ID(SNAND_ID_DYMMY, 0xc8, 0x52),
+ SNAND_MEMORG_2G_2K_128,
-+ &snand_cap_read_from_cache_quad_q2d,
++ &snand_cap_read_from_cache_quad_a8d,
+ &snand_cap_program_load_x4),
+ SNAND_INFO("GD5F4GQ4UCxIG", SNAND_ID(SNAND_ID_DYMMY, 0xc8, 0xb4),
+ SNAND_MEMORG_4G_4K_256,