[PATCH v2] mtd: cfi: add fixup to support MT28FW02GBBA1HPC

Andreas Oetken ennoerlangen at gmail.com
Thu Oct 20 04:03:44 PDT 2022


The cfi flash device MT28FW02GBBA1HPC is a stacked device with two 1Gb
dies. Yet it is recognized as one device. Added early fixup to adjust
devsize and erase region info appropriately. The same issue was addressed
for the S70GL02GS in
Commit 0fe3ede7941d ("mtd: cfi: Add early fixup for S70GL02GS").

Signed-off-by: Andreas Oetken <ennoerlangen at gmail.com>
---
 drivers/mtd/chips/cfi_probe.c | 15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/drivers/mtd/chips/cfi_probe.c b/drivers/mtd/chips/cfi_probe.c
index cf426956454c..102c1ffb9aad 100644
--- a/drivers/mtd/chips/cfi_probe.c
+++ b/drivers/mtd/chips/cfi_probe.c
@@ -186,9 +186,22 @@ static void fixup_s70gl02gs_chips(struct cfi_private *cfi)
 	pr_warn("Bad S70GL02GS CFI data; adjust to detect 2 chips\n");
 }
 
+
+static void fixup_mt28fw02gbba1hpc_chips(struct cfi_private *cfi)
+{
+	/*
+	 * MT28FW02GBBA1HPC flash reports a single 256 MiB chip, but is really made up
+	 * of two 128 MiB chips with 1024 sectors each.
+	 */
+	cfi->cfiq->DevSize = 27;
+	cfi->cfiq->EraseRegionInfo[0] = 0x20003ff;
+	pr_warn("Bad MT28FW02GBBA1HPC CFI data; adjust to detect 2 chips\n");
+}
+
 static const struct cfi_early_fixup cfi_early_fixup_table[] = {
 	{ CFI_MFR_AMD, 0x4801, fixup_s70gl02gs_chips },
-	{ },
+	{ CFI_MFR_INTEL, 0x227e, fixup_mt28fw02gbba1hpc_chips},
+	{ }
 };
 
 static int __xipram cfi_chip_setup(struct map_info *map,
-- 
2.30.2




More information about the linux-mtd mailing list