drivers: flash: fix hyperflash write operations
Hyperflash write operations resulted in invalid writes. This commit fixes the issue by temporarily lowering the clock during writes. This aligns with the mcux-sdk-examples. Fixes https://github.com/zephyrproject-rtos/zephyr/issues/53855 Signed-off-by: Jeppe Odgaard <jeppe.odgaard@prevas.dk>
This commit is contained in:
parent
cd59e74412
commit
ecd2f51386
1 changed files with 6 additions and 0 deletions
|
|
@ -427,6 +427,9 @@ static int flash_flexspi_hyperflash_write(const struct device *dev, off_t offset
|
|||
key = irq_lock();
|
||||
}
|
||||
|
||||
(void)memc_flexspi_update_clock(data->controller, &data->config,
|
||||
data->port, MEMC_FLEXSPI_CLOCK_42M);
|
||||
|
||||
while (len) {
|
||||
/* Writing between two page sizes crashes the platform so we
|
||||
* have to write the part that fits in the first page and then
|
||||
|
|
@ -466,6 +469,9 @@ static int flash_flexspi_hyperflash_write(const struct device *dev, off_t offset
|
|||
len -= i;
|
||||
}
|
||||
|
||||
(void)memc_flexspi_update_clock(data->controller, &data->config,
|
||||
data->port, MEMC_FLEXSPI_CLOCK_166M);
|
||||
|
||||
if (memc_flexspi_is_running_xip(data->controller)) {
|
||||
/* ==== EXIT CRITICAL SECTION ==== */
|
||||
irq_unlock(key);
|
||||
|
|
|
|||
Loading…
Reference in a new issue