Skip to content

Commit 2973479

Browse files
degjorvarlubos
authored andcommitted
nrf_security: cracen: Add workaround kconfig
Make the CRACEN lite IKG workaround not depend on CRACEN_HW_VERSION_LITE Add Kconfig for the workaround instead This allows for CRACEN LITE variants that do not use the workaround Signed-off-by: Dag Erik Gjørvad <[email protected]>
1 parent 4240341 commit 2973479

File tree

3 files changed

+9
-4
lines changed

3 files changed

+9
-4
lines changed

subsys/nrf_security/src/drivers/cracen/Kconfig

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ config CRACEN_HW_VERSION_LITE
1616
config CRACEN_USE_MULTIPART_WORKAROUNDS
1717
def_bool SOC_NRF54LM20A
1818

19+
config CRACEN_NEED_IKG_INTERRUPT_WORKAROUND
20+
def_bool SOC_NRF54LM20A || SOC_NRF54LV10A
21+
1922
# Configure CRACEN_LOG_LEVEL
2023
module = CRACEN
2124
module-str = CRACEN

subsys/nrf_security/src/drivers/cracen/silexpk/target/baremetal_ba414e_with_ik/pk_baremetal.c

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ int read_status(sx_pk_req *req)
106106
int sx_pk_wait(sx_pk_req *req)
107107
{
108108
do {
109-
if (!IS_ENABLED(CONFIG_CRACEN_HW_VERSION_LITE) &&
109+
if (!IS_ENABLED(CONFIG_CRACEN_NEED_IKG_INTERRUPT_WORKAROUND) &&
110110
IS_ENABLED(CONFIG_CRACEN_USE_INTERRUPTS)) {
111111
/* In CRACEN Lite the PKE-IKG interrupt is only active when in PK mode.
112112
* This is to work around a hardware issue where the interrupt is never
@@ -125,6 +125,8 @@ int sx_pk_wait(sx_pk_req *req)
125125
if (sx_pk_rdreg(&req->regs, IK_REG_STATUS) == IK_ENTROPY_ERROR) {
126126
return SX_ERR_RETRY;
127127
}
128+
} else {
129+
/* For compliance */
128130
}
129131

130132
} while (is_busy(req));
@@ -228,7 +230,7 @@ struct sx_pk_acq_req sx_pk_acquire_req(const struct sx_pk_cmd_def *cmd)
228230
req.req->cnx = &silex_pk_engine;
229231

230232
cracen_acquire();
231-
if (!IS_ENABLED(CONFIG_CRACEN_HW_VERSION_LITE) &&
233+
if (!IS_ENABLED(CONFIG_CRACEN_NEED_IKG_INTERRUPT_WORKAROUND) &&
232234
IS_ENABLED(CONFIG_CRACEN_USE_INTERRUPTS)) {
233235
/* In CRACEN Lite the PKE-IKG interrupt is only active when in PK mode.
234236
* This is to work around a hardware issue where the interrupt is never cleared.
@@ -239,7 +241,7 @@ struct sx_pk_acq_req sx_pk_acquire_req(const struct sx_pk_cmd_def *cmd)
239241

240242
/* Wait until initialized. */
241243
while (ba414ep_is_busy(req.req) || ik_is_busy(req.req)) {
242-
if (!IS_ENABLED(CONFIG_CRACEN_HW_VERSION_LITE) &&
244+
if (!IS_ENABLED(CONFIG_CRACEN_NEED_IKG_INTERRUPT_WORKAROUND) &&
243245
IS_ENABLED(CONFIG_CRACEN_USE_INTERRUPTS)) {
244246

245247
cracen_wait_for_pke_interrupt();

subsys/nrf_security/src/drivers/cracen/silexpk/target/hw/ba414/pkhardware_ba414e.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ static void run_ik_cmd(sx_pk_req *req)
295295
sx_pk_wrreg(&req->regs, IK_REG_PK_CONTROL,
296296
IK_PK_CONTROL_START_OP | IK_PK_CONTROL_CLEAR_IRQ);
297297

298-
if (IS_ENABLED(CONFIG_CRACEN_HW_VERSION_LITE)) {
298+
if (IS_ENABLED(CONFIG_CRACEN_NEED_IKG_INTERRUPT_WORKAROUND)) {
299299
/* Workaround to handle IKG freezing on CRACEN lite.
300300
* THE PKE-IKG interrupt can not be cleared from software, but can
301301
* be cleared by hardware when in PK mode.

0 commit comments

Comments
 (0)