airoha: spi: remove snfi driver dirty hack
authorMikhail Kshevetskiy <[email protected]>
Sat, 4 Oct 2025 06:36:32 +0000 (09:36 +0300)
committerRobert Marko <[email protected]>
Thu, 9 Oct 2025 14:37:25 +0000 (16:37 +0200)
commita406e38077313bf9af63e6348fbe260a31aa4393
tree7607daa6094bde6843b4ed04748dd10702118776
parent5ff0e7093081dcb255b94f1f7714ca5f6c08be1a
airoha: spi: remove snfi driver dirty hack

This patch series removes dirty hack that reads flash page settings from
SNFI registers during driver startup.

Before these patches the airoha spi snfi driver needs to know spinand
flash page size. The driver can't get it from spinand subsystem, so the
following approach was implemented:
 * bootloader know the flash page size (and some other parameters)
 * to operate properly the bootloader writes flash page size (and some
   other parameters) to SNFI registers
 * bootloader starts linux
 * after linux start SNFI registers keeps the values stored by bootloader
 * linux snfi driver reads flash parameters from SNFI registers.

This works, but we can do better. It has been proven that flash page size
is actually unnecessary. We can get all required data from dirmap requests.

This patch series drops the hack and do things properly.

Signed-off-by: Mikhail Kshevetskiy <[email protected]>
Link: https://github.com/openwrt/openwrt/pull/20295
Signed-off-by: Robert Marko <[email protected]>
target/linux/airoha/patches-6.12/029-10-spi-airoha-avoid-setting-of-page-oob-sizes-in-REG.patch [new file with mode: 0644]
target/linux/airoha/patches-6.12/029-11-spi-airoha-reduce-the-number-of-modification-of-R.patch [new file with mode: 0644]
target/linux/airoha/patches-6.12/029-12-spi-airoha-set-custom-sector-size-equal-to-flash-.patch [new file with mode: 0644]
target/linux/airoha/patches-6.12/029-13-spi-airoha-avoid-reading-flash-page-settings-from.patch [new file with mode: 0644]