Skip to content

[fuse_ctrl,dv] Improvements to wait_dai_op_idle#751

Merged
ekarabu merged 10 commits intomainfrom
lowrisc_wait_dai_op_idle
Sep 30, 2025
Merged

[fuse_ctrl,dv] Improvements to wait_dai_op_idle#751
ekarabu merged 10 commits intomainfrom
lowrisc_wait_dai_op_idle

Conversation

@rswarbrick
Copy link
Contributor

This PR builds on top of #750. Only the last commit is unique. It has the following commit message:


Carefully work through the logic in wait_dai_op_idle and document
exactly what it is doing.

This changes behaviour slightly if status_mask is nonzero. To look at
all sites where this might have an effect, I grepped for the following
regex: "wait_dai_op_idle([^0)]"

There are a couple of places where this function is copy-pasted:

  • cptra_uds_prog.c
  • cptra_zeroization

Tidying these up to use the (now correct!) version of this function
should be a separate change.

This avoids fuse_ctrl_mmap.h defining something that actually gets
instantiated (and defines a symbol). Without fixing that, if more than
one compilation unit includes the header then link will fail because
more than one object file defines "partitions" and various fuse index
arrays.
No functional change (but hopefully it makes things a bit clearer: I
found these ranges a bit hard to reason about).
The value in caliptra_ss_fuse_ctrl_manuf_prod_prov hadn't yet been
updated for the change in 275521b. This change should make it so
that test and also caliptra_ss_fuse_ctrl_init_fail get a magic number
from a single (documented) place.

Apply the same change to caliptra_ss_fuse_ctrl_test_unlocked0_prov.
This is a bit fiddly to do properly, because you end up needing to map
from a partition with a read lock to that partition's read lock
address (which depends on soc_mmap.h).

My solution is to have a template generate that map (which will
contain actual addresses that get pulled from soc_mmap.h at compile
time).
@rswarbrick rswarbrick marked this pull request as ready for review September 24, 2025 14:49
@rswarbrick rswarbrick force-pushed the lowrisc_wait_dai_op_idle branch from 89adb72 to 8bdde5e Compare September 24, 2025 14:50
@rswarbrick rswarbrick requested a review from ekarabu September 24, 2025 15:18
Carefully work through the logic in wait_dai_op_idle and document
exactly what it is doing.

This changes behaviour slightly if status_mask is nonzero. To look at
all sites where this might have an effect, I grepped for the following
regex: "wait_dai_op_idle([^0)]"

This commit tidies up the obvious matches. There are a couple of
places where this function is copy-pasted:

  - `cptra_uds_prog.c`
  - `cptra_zeroization`

Tidying these up to use the (now correct!) version of this function
should be a separate change.
This test injects an error and then reads the status register to check
it shows a bus integrity error.

The preceding dai_wr transaction is wrong though: *that* should report
the error (by reading the same register). Apparently, that check
wasn't working before but we've just tweaked wait_dai_op_idle to check
more sensibly and that now fails because we're calling it with no
expected error.

Expect the error, which fixes that failure and also makes the
following read redundant.
@rswarbrick rswarbrick force-pushed the lowrisc_wait_dai_op_idle branch from 8bdde5e to 88e35fe Compare September 25, 2025 13:46
…pdated timestamp and hash after successful run
@ekarabu
Copy link
Collaborator

ekarabu commented Sep 30, 2025

Started the promote-pipeline for this PR

…pdated timestamp and hash after successful run
@ekarabu ekarabu merged commit 4252d58 into main Sep 30, 2025
8 checks passed
@ekarabu ekarabu deleted the lowrisc_wait_dai_op_idle branch September 30, 2025 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[fuse_ctrl,regression] The caliptra_ss_fuse_ctrl_integrity_check fails in the nightly regression

2 participants