From b3bbc4b90d9339a841d786c46b3470ef1a4f877a Mon Sep 17 00:00:00 2001 From: Daniel Golle Date: Mon, 8 Apr 2024 17:46:33 +0100 Subject: [PATCH] mediatek: improve reliability of Fidelix SPI-NAND Prior to performing a PROGRAM LOAD RANDOM DATA operation, a WRITE ENABLE (06h) command must be issued to change the contents of the memory array. Following a WRITE ENABLE (06) command, **first a PROGRAM LOAD (02h or 32h) command must be issued to reset the cache**, then issue a PROGRAM LOAD RANDOM DATA (84h or 34h) command This is dirty fix provided to use by MediaTek engineer Sky Huang which may resolve the "OpenWrt Kiss of Death" issue we've been seeing on the Linksys E8450 aka. Belkin RT3200. However, it means that everything has to be re-written with that patch already applied, ie. we need to rebuild the installer once it is part of snapshot builds to have any effect. Users already on FIP-in-UBI layout are advised to re-write 'fip' UBI volume and 'bl2' MTD partition manually once from within Linux after this fix has been applied. A similar fix will also be required for U-Boot. Signed-off-by: Daniel Golle --- ...340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch | 4 ++-- ...340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/target/linux/mediatek/patches-5.15/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch b/target/linux/mediatek/patches-5.15/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch index 4a5d814b3..e6d39c0f1 100644 --- a/target/linux/mediatek/patches-5.15/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch +++ b/target/linux/mediatek/patches-5.15/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch @@ -56,8 +56,8 @@ Signed-off-by: Davide Fioravanti + 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)); ++ SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), ++ SPINAND_PROG_LOAD(true, 0, NULL, 0)); + +static int fm35x1ga_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region) diff --git a/target/linux/mediatek/patches-6.1/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch b/target/linux/mediatek/patches-6.1/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch index ec66363dc..b00c6fc3f 100644 --- a/target/linux/mediatek/patches-6.1/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch +++ b/target/linux/mediatek/patches-6.1/340-mtd-spinand-Add-support-for-the-Fidelix-FM35X1GA.patch @@ -56,8 +56,8 @@ Signed-off-by: Davide Fioravanti + 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)); ++ SPINAND_PROG_LOAD_X4(true, 0, NULL, 0), ++ SPINAND_PROG_LOAD(true, 0, NULL, 0)); + +static int fm35x1ga_ooblayout_ecc(struct mtd_info *mtd, int section, + struct mtd_oob_region *region)