openwrt/target/linux
Roger Pueyo Centelles 23cd9fafa8 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>
(cherry picked from commit 68d91f08ed)
2021-10-22 16:34:11 -10:00
..
apm821xx kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
arc770 arc770: set device vendor and model variables 2021-05-26 23:36:40 +02:00
archs38 kernel: Add missing kernel config options 2021-09-13 18:49:15 +02:00
armvirt kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
at91 treewide: make AddDepends/usb-serial selective 2021-06-08 22:50:32 +02:00
ath25 kernel: bump 5.4 to 5.4.132 2021-07-19 22:47:17 +02:00
ath79 ath79: mikrotik: use 64 KiB SPI NOR erase sectors 2021-10-22 16:34:11 -10:00
bcm27xx kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
bcm47xx bcm47xx: make WGT634U NVRAM patch apply again 2021-03-17 23:38:46 +01:00
bcm53xx kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
bcm63xx kernel: bump 5.4 to 5.4.132 2021-07-19 22:47:17 +02:00
bcm4908 kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
gemini kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
generic kernel: bump 5.4 to 5.4.154 2021-10-20 00:37:51 +02:00
imx6 kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
ipq40xx kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
ipq806x kernel: bump 5.4 to 5.4.128 2021-06-27 00:58:50 +02:00
kirkwood kirkwood: increase kernel partition of Linksyses 2021-09-13 15:24:35 +02:00
lantiq ltq-deu: Mark lantiq DEU broken 2021-07-02 19:22:13 +02:00
layerscape layerscape: Add missing config option 2021-10-22 22:26:02 +02:00
malta target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
mediatek kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
mpc85xx mpc85xx: add missing Kconfig symbols 2021-07-13 22:19:23 +02:00
mvebu mvebu: add support for iEi Puzzle-M901/Puzzle-M902 2021-10-14 13:09:57 +01:00
mxs target: use SPDX license identifiers on scripts 2021-02-10 15:47:23 +01:00
octeon kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
octeontx kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
omap kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
oxnas kernel: bump 5.4 to 5.4.154 2021-10-20 00:37:51 +02:00
pistachio kernel: add pending mtd patches adding NVMEM support 2021-03-17 21:24:22 +01:00
ramips ramips: add support for minew g1-c 2021-09-21 14:08:51 +02:00
realtek realtek: Fix failsafe mode 2021-06-22 23:52:09 +02:00
rockchip rockchip: fix broken squashfs sysupgrade 2021-09-24 12:29:22 +02:00
sunxi sunxi: disable LPAE on cortexa8 2021-04-11 00:00:49 +02:00
tegra kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
uml target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00
x86 kernel: bump 5.4 to 5.4.150 2021-10-02 16:05:34 +02:00
zynq kernel: move some disabled symbols to generic 2021-04-11 16:54:22 +02:00
Makefile target: use SPDX license identifiers on Makefiles 2021-02-10 15:47:18 +01:00