[][kernel][MT7988][snand][Add compatible snand id for mt7988 soc]
[Description]
Add mt7988 mtk_snand_ids for mt7988 soc instead of mt7986 snand device id,
Because mt7986-snand device id is shared with mt7981 soc and mt7986 soc,
mt7988 can not enable or disable clock randomly .
[Release-log]
N/A
Change-Id: Iebda7a10e233ab18bc62568e4ce7833adb2e2810
Reviewed-on: https://gerrit.mediatek.inc/c/openwrt/feeds/mtk_openwrt_feeds/+/6836270
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 885dec3..450e662 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
@@ -99,6 +99,14 @@
.errnum_bits = 5,
.errnum_shift = 8,
},
+ [SNAND_SOC_MT7988] = {
+ .ecc_caps = mt7986_ecc_caps,
+ .num_ecc_cap = ARRAY_SIZE(mt7986_ecc_caps),
+ .regs = mt7986_ecc_regs,
+ .mode_shift = 5,
+ .errnum_bits = 5,
+ .errnum_shift = 8,
+ },
};
static inline uint32_t ecc_read32(struct mtk_snand *snf, uint32_t reg)
diff --git a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand-mtd.c b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand-mtd.c
index e1e0317..09dc34d 100644
--- a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand-mtd.c
+++ b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand-mtd.c
@@ -494,10 +494,17 @@
.en_nfi_hclk = true
};
+static struct mtk_snand_of_id mt7988_soc_id = {
+ .soc = SNAND_SOC_MT7988,
+ .en_ecc_clk = false,
+ .en_nfi_hclk = false
+};
+
static const struct of_device_id mtk_snand_ids[] = {
{ .compatible = "mediatek,mt7622-snand", .data = &mt7622_soc_id },
{ .compatible = "mediatek,mt7629-snand", .data = &mt7629_soc_id },
{ .compatible = "mediatek,mt7986-snand", .data = &mt7986_soc_id },
+ { .compatible = "mediatek,mt7988-snand", .data = &mt7988_soc_id },
{ },
};
diff --git a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.c b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.c
index a0a50f7..341e8c8 100644
--- a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.c
+++ b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.c
@@ -215,6 +215,20 @@
.latch_lat = 0,
.sample_delay = 40
},
+ [SNAND_SOC_MT7988] = {
+ .sector_size = 1024,
+ .max_sectors = 16,
+ .fdm_size = 8,
+ .fdm_ecc_size = 1,
+ .fifo_size = 64,
+ .bbm_swap = true,
+ .empty_page_check = true,
+ .mastersta_mask = NFI_MASTERSTA_MASK_7986,
+ .spare_sizes = mt7986_spare_sizes,
+ .num_spare_size = ARRAY_SIZE(mt7986_spare_sizes),
+ .latch_lat = 0,
+ .sample_delay = 40
+ },
};
static inline uint32_t nfi_read32(struct mtk_snand *snf, uint32_t reg)
diff --git a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.h b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.h
index 37bb6e6..a508ea5 100644
--- a/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.h
+++ b/target/linux/mediatek/files-5.4/drivers/mtd/mtk-snand/mtk-snand.h
@@ -19,6 +19,7 @@
SNAND_SOC_MT7629,
SNAND_SOC_MT7981,
SNAND_SOC_MT7986,
+ SNAND_SOC_MT7988,
__SNAND_SOC_MAX
};