[PATCH 22.03 1/4] ath79: switch some RedBoot based devices to OKLI loader

Thibaut hacks at slashdirt.org
Tue Jul 5 08:19:08 PDT 2022


Hi,

> Le 5 juil. 2022 à 17:09, Tomasz Maciej Nowak <tmn505 at gmail.com> a écrit :
> 
> W dniu 5.07.2022 o 12:21, Thibaut VARÈNE pisze:
>> Hi,
> 
> Hi.
> 
>> Have you considered if CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE[1] could maybe help there?
>> It seems to address a similar issue (write-access to a 4K partition with 64K EB size).
> 
> That's a no-go, as in this particular case we would need to ignore hw capabilities of the flash. The FIS partition (something like partition table) is 1 KiB in size, that is compilation time setting for the bootloader, which can't be changed later, and the smallest erase size for flash chips on these boards is 4 KiB.

OK if you need the equivalent of a 1KB EB, then indeed this won’t help.

> To make matters worse this partition shares same erase block (64KiB) with another partition,

Purely FYI, that’s a problem taken care of by CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE: as long as the target partition lives within a 4KB EB boundary (as supported by the underlying flash), then the variable erase code will do the right thing (it basically internally uses a 4KB erasesize to handle write requests).

On Mikrotik devices, it allows us to write to a 4KB partition that shares a 64KB EB with the secondary bootloader, while using 64KB erasesize system-wide.

> both need to be valid and present for RedBoot not to interrupt the boot. So I couldn't see any faster option as to use OKLI, which could make the kernel partition constant in terms of size, so we don't have to fiddle with FIS partition anymore.

I’m absolutely not familiar with the specifics of this platform, but my point was that if you needed write-access a 4K-EB-aligned partition with 64K EB enabled, then CONFIG_MTD_SPI_NOR_USE_VARIABLE_ERASE would probably work for you. But it seems that in your case the situation is even more complex, alas.

HTH,
T


More information about the openwrt-devel mailing list