[PATCH] cmd: sf: align erase and write on erase block boundary
Ye Li
ye.li at oss.nxp.com
Mon Sep 22 08:48:16 CEST 2025
On 9/20/2025 12:36 AM, Marek Vasut wrote:
> On 9/19/25 5:46 PM, Ye Li wrote:
>>
>>
>> 在 2025/9/19 20:20, Marek Vasut 写道:
>>> On 9/19/25 9:01 AM, Ye Li wrote:
>>>> From: Viorel Suman <viorel.suman at nxp.com>
>>>>
>>>> Align erase and write on erase block boundary in line
>>>> with how read was aligned in commit 622b5d35613.
>>> What is the issue that is being fixed here ?
>>>
>> Previous commit 622b5d35613 tried to fix issue that offset is not
>> sector size aligned. But it only use the aligned offset read_offset
>> for flash read, not use it for erase and write. So still unaligned
>> offset send to spi_flash_erase and spi_flash_write.> What is the
>> reproducer ?
>>>
>> If the address is neither page or sector aligned, we meet issue with
>> flash update
> What exact command do I run to trigger the problem, what is the failing
> result without this patch, what is the passing result with this patch ?
You can use "sf update" command to reproduce the issue.
Without the patch:
u-boot=> sf update 0x94000000 0x10 0x20
device 0 offset 0x10, size 0x20
SPI flash failed in erase step
With the patch:
u-boot=> sf update 0x94000000 0x10 0x20
device 0 offset 0x10, size 0x20
32 bytes written, 0 bytes skipped in 0.20s, speed 1424 B/s
Best regards,
Ye Li
More information about the U-Boot
mailing list