[LEDE-DEV] Info about MTD_SPI_NOR_USE_4K_SECTORS

Rafał Miłecki zajec5 at gmail.com
Mon Aug 28 05:50:30 PDT 2017


Few people asked me about the MTD_SPI_NOR_USE_4K_SECTORS. Somehow I
got responsible for it ;) It doesn't seem like a big thing, but since
I was asked, let me describe it.


So initially this feature was added by Gabor in:
generic: disable 'small sector' erase in m25p80 driver
https://dev.openwrt.org/changeset/29521/
https://git.lede-project.org/?p=source.git;a=commit;h=5afedc67e2fa7ad440516a64534acc28f3a61500
It was named CONFIG_M25PXX_PREFER_SMALL_SECTOR_ERASE and it wasn't
enabled for any target back then (yet).

I believe the first time it was enabled was:
ar71xx/mikrotik: enable small sector erase in the m25p80 driver
https://dev.openwrt.org/changeset/39696/
https://git.lede-project.org/?p=source.git;a=commit;h=be18a3849b613d956edd0d3d83b11de26b83e6ab

Later it was also enabled for at91 in:
Update AT91 kernel to 3.10.34
https://dev.openwrt.org/changeset/40596/
https://git.lede-project.org/?p=source.git;a=commit;h=f6cd23364b022108bf565dc3ef7173719765f167
I suspected it could be unintentional though (and doesn't seem to be
set anymore).


So that is when I indeed steped in. I upstreamed this OpenWrt's
solution in Linux commit:
mtd: spi-nor: add Kconfig option to disable 4K sectors
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=57cf26c1b28572976c57f6dec9818be38bf37cbb
(it went into the kernel 3.18).

Just as expected this config is disabled by default:
> ( cd target/linux/generic/; grep 4K_SECTORS config* )
config-3.18:# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
config-4.4:# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set
config-4.9:# CONFIG_MTD_SPI_NOR_USE_4K_SECTORS is not set

It got re-enabled by Gabor for ar71xx in:
ar71xx/mikrotik: re-enable 4KiB flash sector erase
https://dev.openwrt.org/changeset/45161/
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=3129f0c6f21e31fde17851a08ee18b2b2286ff57

Other than that it seems to be used by targets pistachio, ramips and
zynq. I'm not sure about layerscape.

If you think it shouldn't be enabled on some of above targets, please
ping its maintainer.

-- 
Rafał



More information about the Lede-dev mailing list