spi: airoha: avoid usage of flash specific parameters
authorMikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
Sun, 9 Nov 2025 07:06:57 +0000 (10:06 +0300)
committerMichael Trimarchi <michael@amarulasolutions.com>
Tue, 18 Nov 2025 19:07:41 +0000 (20:07 +0100)
commitb49b859ecb76bbee8d1eb82f8a8909a5e72e1b50
tree48442a881870f4899a31cb82fb9cb9be49f8a43a
parent269a4d65566a1f3f593f979d5d784c1a7fce4b19
spi: airoha: avoid usage of flash specific parameters

The spinand driver do 3 type of dirmap requests:
 * read/write whole flash page without oob
   (offs = 0, len = page_size)
 * read/write whole flash page including oob
   (offs = 0, len = page_size + oob_size)
 * read/write oob area only
   (offs = page_size, len = oob_size)

The trick is:
 * read/write a single "sector"
 * set a custom sector size equal to offs + len. It's a bit safer to
   round up "sector size" value 64.
 * set the transfer length equal to custom sector size

And it works!

Thus we can find all data directly from dirmap request, so flash specific
parameters is not needed anymore. Also
 * airoha_snand_nfi_config(),
 * airoha_snand_nfi_setup()
functions becomes unnecessary.

Signed-off-by: Mikhail Kshevetskiy <mikhail.kshevetskiy@iopsys.eu>
drivers/spi/airoha_snfi_spi.c