openwrt/target/linux/ath79
Roger Pueyo Centelles 68d91f08ed ath79: mikrotik: use 64 KiB SPI NOR erase sectors
This patch removes CONFIG_MTD_SPI_NOR_USE_4K_SECTORS from the default
symbols for the ath79/mikrotik target.

MikroTik devices hold some of their user-configurable settings in the
soft_config partition, which is typically sized 4 KiB, of the SPI NOR
flash memory. Previously, in the ar71xx target, it was possible to use
64 KiB erase sectors but also smaller 4 KiB ones when needed. This is
no longer the case in ath79 with newer kernels so, to be able to write
to these 4 KiB small partitions without erasing 60 KiB around, the
CONFIG_MTD_SPI_NOR_USE_4K_SECTORS symbol was added to the defaults.
However, this ended up making sysupgrade images which were built with
64 KiB size blocks not to keep settings (e.g., the files under
/etc/config/) over the flashing process.

Using 4 KiB erase sector size on the sysupgrade images (by setting
BLOCKSIZE = 4k) allows keeping settings over a flashing process, but
renders the process terribly slow, possibly causing a user to
mistakenly force a manual device reboot while the process is still on-
going. Instead, ditching the 4 KiB erase sectors for the default
64 KiB erase size provides normal SPI write speed and sysupgrade times,
at the expense of not being able to modify the soft_config partition
(which is rarely a required thing).

An OpenWrt patch for MTD_SPI_NOR_USE_4K_SECTORS_LIMIT may once have
allowed to use different per-partition erase sector sizes. Due to
changes on recent kernels it now only works on a per-device basis.
Also, partial eraseblock write can be performed in ath79 with kernels
5.4 and lower, by copying the blocks from the 64 KiB, erasing the whole
sector and restoring those blocks not meant to be modified. A kernel
bump had that patch broken for a long time, but got fixed in bf2870c.

Note: the settings in the soft_config partition can be reset to their
defaults by holding the reset button for 5 seconds (and less than 10
seconds) at device boot.

Fixes: FS#3492 (sysupgrade […] loses settings...)
Fixes: a66eee6336 (ath79: add mikrotik subtarget)

Signed-off-by: Roger Pueyo Centelles <roger.pueyo@guifi.net>
2021-10-22 08:15:40 -10:00
..
base-files/etc/hotplug.d/ieee80211 ath79: add WiFi migration for AR913x 2020-09-28 16:23:03 +02:00
dts ath79: add support for TP-Link CPE710-v1 2021-09-25 19:28:54 +02:00
files ath79: remove obsolete pci-ath9k-fixup.[c,h] files 2021-08-26 21:00:26 +02:00
generic ath79: add support for TP-Link CPE710-v1 2021-09-25 19:28:54 +02:00
image ath79: use correct USB package for DIR-505 2021-10-21 15:52:49 +02:00
mikrotik ath79: mikrotik: use 64 KiB SPI NOR erase sectors 2021-10-22 08:15:40 -10:00
nand treewide: remove "+" sign for increment with macaddr_add 2021-06-05 23:54:37 +02:00
patches-5.4 kernel: bump 5.4 to 5.4.154 2021-10-21 00:17:36 +02:00
patches-5.10 kernel: bump 5.10 to 5.10.74 2021-10-21 00:17:36 +02:00
tiny ath79: consolidate testing kernel 2021-04-10 19:28:04 +02:00
config-5.4 ath79: add missing MTD_NAND_RB91X symbol 2021-07-09 17:11:12 +02:00
config-5.10 ath79: add missing GPIO_LATCH symbol 2021-06-22 00:39:48 +02:00
Makefile ath79: consolidate testing kernel 2021-04-10 19:28:04 +02:00
modules.mk ath79: add new OF only target for QCA MIPS silicon 2018-05-07 08:06:51 +02:00