From e8a5ecc160a20944a23d76c41d6d4dbf0ac962b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Chru=C5=9Bci=C5=84ski?= Date: Tue, 3 Dec 2024 07:59:53 +0100 Subject: [PATCH] soc: nordic: common: mram_latency: Add option to auto request no latency MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add CONFIG_MRAM_LATENCY_AUTO_REQ. When option is enabled then module requests no latency during the initialization. This option might be useful for cases where we want to achieve maximum performance and want to avoid controlling MRAM in the code. Signed-off-by: Krzysztof Chruściński --- soc/nordic/common/Kconfig | 7 +++++++ soc/nordic/common/mram_latency.c | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/soc/nordic/common/Kconfig b/soc/nordic/common/Kconfig index 6ed44bdd8cb..f337358e30d 100644 --- a/soc/nordic/common/Kconfig +++ b/soc/nordic/common/Kconfig @@ -22,6 +22,13 @@ config MRAM_LATENCY_SYNC_TIMEOUT help Timeout is given in milliseconds. +config MRAM_LATENCY_AUTO_REQ + bool "Request MRAM without latency at start" + help + When enabled then MRAM configuration without latency is requested + during the initialization and is kept enabled until the mram_latency API user + calls mram_no_latency_sync_release(). + module = MRAM_LATENCY module-str = mram_latency source "subsys/logging/Kconfig.template.log_config" diff --git a/soc/nordic/common/mram_latency.c b/soc/nordic/common/mram_latency.c index 0bfc6d4bfe2..cba1b498d6c 100644 --- a/soc/nordic/common/mram_latency.c +++ b/soc/nordic/common/mram_latency.c @@ -168,6 +168,10 @@ static int init_nrfs(void) state = MRAM_LATENCY_ON; + if (IS_ENABLED(CONFIG_MRAM_LATENCY_AUTO_REQ)) { + mram_no_latency_sync_request(); + } + return rv; }