immortalwrt/target/linux
Roger Pueyo Centelles 18b9a20ec8 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>
2022-04-07 11:28:41 +08:00
..
apm821xx [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
archs38 archs38: update kernel version to 5.10 2021-11-10 23:59:07 +08:00
armvirt kernel: add missing Kconfigs for kernel 4.14 2022-01-01 17:35:27 +08:00
at91 at91: add support for sam9x60-ek board 2022-03-17 11:23:53 +08:00
ath25 ath25: disable build for ubnt2/5 2022-01-07 19:40:34 +08:00
ath79 ath79: mikrotik: use 64 KiB SPI NOR erase sectors 2022-04-07 11:28:41 +08:00
bcm27xx [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
bcm47xx bcm47xx: fix bgmac regression present in 5.10 kernel 2021-11-14 23:56:20 +08:00
bcm53xx kernel: add missing Kconfigs for kernel 4.14 2022-01-01 17:35:27 +08:00
bcm63xx kernel: bump 5.4 to 5.4.162 2021-12-20 11:16:52 +08:00
bcm4908 bcm4908: add uboot-envtools to default packages 2021-12-21 23:55:17 +08:00
bmips kernel: Deactivate B53 symbols in generic configuration 2021-12-03 00:03:50 +08:00
gemini kernel: add missing Kconfigs for kernel 4.14 2022-01-01 17:35:27 +08:00
generic kernel: move rtl8152 patches to generic 2022-03-28 16:13:33 +08:00
imx [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
ipq40xx ipq40xx: add support for FRITZ!Box 7520 2022-04-01 11:09:27 +08:00
ipq806x [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
ipq807x kernel: Set CONFIG_RCU_CPU_STALL_TIMEOUT=21 2021-09-10 12:26:08 +08:00
kirkwood kernel: add missing Kconfigs for kernel 4.14 2022-01-01 17:35:27 +08:00
lantiq lantiq: increase fritz-cal-extract output limit 2022-01-17 12:26:45 +08:00
layerscape [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
malta kernel: move two symbols to the generic kconfigs 2021-08-30 12:13:54 +08:00
mediatek [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
mpc85xx kernel: bump 5.10 to 5.10.80 2021-12-08 23:59:43 +08:00
mvebu [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
mxs kernel: add missing Kconfigs for kernel 4.14 2022-01-01 17:35:27 +08:00
octeon [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
octeontx octeontx: Refresh kernel configuration 2022-01-29 19:00:08 +08:00
omap [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
oxnas kernel: bump to 4.9.303, 4.14.268, 4.19.231 2022-02-25 05:03:08 +08:00
pistachio kernel: bump 5.4 to 5.4.156 2021-12-08 23:56:51 +08:00
qoriq qoriq: enable I2C in target kernel config 2022-03-25 10:37:24 +08:00
ramips ramips: fix wifi mac address of HiWiFi series devices 2022-03-28 16:17:03 +08:00
realtek kernel: bump 5.4 to 5.4.162 2021-12-20 11:16:52 +08:00
rockchip [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
sunxi [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
tegra [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
uml uml: make use of 'rootfs-part' feature 2022-02-14 18:29:30 +08:00
x86 [HOT FIX] Merge Mainline 2022-04-03 00:50:22 +08:00
zynq kernel: add missing Kconfigs for kernel 4.14 2022-01-01 17:35:27 +08:00
Makefile