Skip to content

Commit 5dbd4cc

Browse files
committed
Workaround for mltpan18
Signed-off-by: Maciej Meijer <[email protected]>
1 parent 9c961c0 commit 5dbd4cc

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

soc/nordic/common/vpr/Kconfig

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
# Copyright (c) 2024 Nordic Semiconductor ASA
22
# SPDX-License-Identifier: Apache-2.0
33

4+
config RISCV_CORE_NORDIC_VPR_USE_MLTPAN_18
5+
bool "Apply MLTPAN workaround"
6+
default y if SOC_SERIES_NRF54HX || SOC_SERIES_NRF54LX
7+
48
config RISCV_CORE_NORDIC_VPR
59
bool
610
select ATOMIC_OPERATIONS_C

soc/nordic/common/vpr/soc_idle.c

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
#include <zephyr/irq.h>
77
#include <zephyr/sys/barrier.h>
88
#include <zephyr/tracing/tracing.h>
9-
9+
#include "hal/nrf_vpr.h"
1010
/*
1111
* Due to a HW issue, VPR requires MSTATUS.MIE to be enabled when entering sleep.
1212
* Otherwise it would not wake up.
@@ -17,6 +17,11 @@ void arch_cpu_idle(void)
1717
barrier_dsync_fence_full();
1818
irq_unlock(MSTATUS_IEN);
1919
__asm__ volatile("wfi");
20+
21+
/* MLTPAN-18 workaround */
22+
#if defined(CONFIG_RISCV_CORE_NORDIC_VPR_USE_MLTPAN_18)
23+
nrf_vpr_cpurun_set(NRF_VPR, true);
24+
#endif
2025
}
2126

2227
void arch_cpu_atomic_idle(unsigned int key)
@@ -26,6 +31,11 @@ void arch_cpu_atomic_idle(unsigned int key)
2631
irq_unlock(MSTATUS_IEN);
2732
__asm__ volatile("wfi");
2833

34+
/* MLTPAN-18 workaround */
35+
#if defined(CONFIG_RISCV_CORE_NORDIC_VPR_USE_MLTPAN_18)
36+
nrf_vpr_cpurun_set(NRF_VPR, true);
37+
#endif
38+
2939
/* Disable interrupts if needed. */
3040
__asm__ volatile ("csrc mstatus, %0"
3141
:

0 commit comments

Comments
 (0)