aboutsummaryrefslogtreecommitdiffstats
path: root/target
diff options
context:
space:
mode:
authorKoen Vandeputte <koen.vandeputte@ncentric.com>2019-03-27 10:36:41 +0100
committerKoen Vandeputte <koen.vandeputte@ncentric.com>2019-07-12 09:39:33 +0200
commitb947de25a6ffa79e7a0c723d605f0174cd5dd610 (patch)
tree3033e6335f9b07f0162a23b481cea47598e35081 /target
parent519cdf377a523161b5abc540dbe9f8245cd47e1c (diff)
downloadupstream-b947de25a6ffa79e7a0c723d605f0174cd5dd610.tar.gz
upstream-b947de25a6ffa79e7a0c723d605f0174cd5dd610.tar.bz2
upstream-b947de25a6ffa79e7a0c723d605f0174cd5dd610.zip
ar71xx: fix nand init issues on some rb2011 devices
While flashing lots of RB2011 devices, I noticed that some of them refused to boot properly, failing over the NAND parameters. Checking in detail shows that some device seem to use another NAND flash which only support standard 2048-byte pages, without 512-byte subpage support. This commit disables usage of these small subpage completely. Advantages: - Both NAND's with(out) subpage support are working now - The nand speed increases a bit (measured roughly 1%) in typical usecases Disadvantages: - The maximum storage capacity decreases by ~0.2% as small changes can consume a full page (2048 bytes) now. Signed-off-by: Koen Vandeputte <koen.vandeputte@ncentric.com>
Diffstat (limited to 'target')
-rw-r--r--target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
index 7bf64905c6..aee0fb2014 100644
--- a/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
+++ b/target/linux/ar71xx/files/arch/mips/ath79/mach-rb2011.c
@@ -256,7 +256,9 @@ static int rb2011_nand_scan_fixup(struct mtd_info *mtd)
{
#if LINUX_VERSION_CODE < KERNEL_VERSION(4,6,0)
struct nand_chip *chip = mtd->priv;
-#endif
+#else
+ struct nand_chip *chip = mtd_to_nand(mtd);
+#endif /* < 4.6.0 */
if (mtd->writesize == 512) {
/*
@@ -270,6 +272,8 @@ static int rb2011_nand_scan_fixup(struct mtd_info *mtd)
#endif
}
+ chip->options = NAND_NO_SUBPAGE_WRITE;
+
return 0;
}