[][SW framework][common][snfi][Add MT7981 support for mtk-snand driver]
[Description]
Add MT7981 support for mtk-snand driver
[Release-log]
N/A
Change-Id: I149d9640d61a459895f35cf04888e8c96741f4d8
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6386874
diff --git a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand-ecc.c b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand-ecc.c
index 4094339..885dec3 100644
--- a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand-ecc.c
+++ b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand-ecc.c
@@ -46,6 +46,10 @@
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
};
@@ -54,6 +58,10 @@
[ECC_DECDONE] = 0x11c,
};
+static const uint32_t mt7981_ecc_regs[] = {
+ [ECC_DECDONE] = 0x124,
+};
+
static const uint32_t mt7986_ecc_regs[] = {
[ECC_DECDONE] = 0x124,
};
@@ -75,6 +83,14 @@
.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),