Skip to content

Commit

Permalink
[nrf noup] platform: nordic_nrf: 54l15: clean up RRAM write buffer si…
Browse files Browse the repository at this point in the history
…ze setting

CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE is not passed to TF-M, so it cannot
be used.
Moreover, it seems that it's not even defined on the NS image when
using TF-M.

As a bonus, do not run the COMMIT_WRITEBUF task when using unbuffered writing.

Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no>
(cherry picked from commit 910bdc9)
  • Loading branch information
tomi-font authored and rlubos committed Nov 5, 2024
1 parent 837e890 commit 9f9b4fc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,7 @@
#elif defined(NRF_RRAMC_S)
#include <nrfx_rramc.h>

#if CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE > 0
#define WRITE_BUFFER_SIZE CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE
#else
#define WRITE_BUFFER_SIZE 0
#endif

#else
#error "Unrecognized platform"
Expand Down Expand Up @@ -164,9 +160,10 @@ static int32_t ARM_Flash_ProgramData(uint32_t addr, const void *data,

#ifdef NRF_NVMC_S
nrfx_nvmc_words_write(addr, data, cnt);
#else
#else /* NRF_RRAMC_S */
nrfx_rramc_words_write(addr, data, cnt);

#if WRITE_BUFFER_SIZE != 0
/* At time of writing, the Zephyr driver commits writes, but the
* nrfx driver does not, so we commit here using the HAL to align
* Zephyr and TF-M behaviour.
Expand All @@ -177,6 +174,8 @@ static int32_t ARM_Flash_ProgramData(uint32_t addr, const void *data,
nrf_rramc_task_trigger(NRF_RRAMC, NRF_RRAMC_TASK_COMMIT_WRITEBUF);
#endif

#endif /* NRF_NVMC_S */

return cnt;
}

Expand Down
4 changes: 0 additions & 4 deletions platform/ext/target/nordic_nrf/common/core/target_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@
#include <nrfx_rramc.h>
#include <hal/nrf_rramc.h>

#if CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE > 0
#define WRITE_BUFFER_SIZE CONFIG_NRF_RRAM_WRITE_BUFFER_SIZE
#else
#define WRITE_BUFFER_SIZE 0
#endif

#endif

Expand Down

0 comments on commit 9f9b4fc

Please sign in to comment.