Skip to content

Conversation

@pamaury
Copy link
Contributor

@pamaury pamaury commented Nov 20, 2025

This is a follow-up on #28794 which is a backport of #25975 where the misleading name lead to an error in the ROM. Since master uses the DT, the fix is a bit different but fundamentally achieves the exact same renaming.

@pamaury pamaury requested a review from a team as a code owner November 20, 2025 16:22
@pamaury pamaury requested review from a team, Razer6, sameo and timothytrippel and removed request for a team November 20, 2025 16:22
@pamaury pamaury force-pushed the dt_otp_rename_field branch from b68a064 to 2ca7d07 Compare November 20, 2025 16:29
The documentation was probably copy-paste: the digest is not
actually an OTP address but a CSR. Rename the field to make it
clearer.

Signed-off-by: Amaury Pouly <[email protected]>
@pamaury pamaury force-pushed the dt_otp_rename_field branch from 2ca7d07 to ac1955c Compare November 20, 2025 16:39
@pamaury pamaury requested a review from AlexJones0 November 21, 2025 13:06
name = self.OTP_PARTITION_INFO_STRUCT_DIGEST_ADDR_FIELD_NAME,
field_type = ScalarType("uint32_t"),
docstring = "The absolute OTP address at which this partition's digest starts",
docstring = "The OTP digest CSR (where the digest is buffered) offset for " +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: the new wording here suggests that the digest occupies one CSR but in actuality an OTP digest is 8 bytes and falls across 2 CSRs. Maybe this should just be "digest_offset" as a name and the wording should be more like "The OTP address (offset from this partition) at which this partition's digest starts."

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not an otp_ctrl expert but I think your phrasing is incorrect because this value is set to the offset of a CSR, e.g. https://opentitan.org/book/hw/top_earlgrey/ip_autogen/otp_ctrl/doc/registers.html#hw_cfg0_digest (you can see the content here).
The idea of using the word "register" is to make it clear that this is the offset of a CSR and not the offset within the OTP partition.

Maybe I could change the wording to "The first (_DIGEST_0) OTP digest CSR" ?

Copy link
Contributor

@AlexJones0 AlexJones0 Nov 21, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, I misunderstood this as the DAI digest offset rather than the buffered CSR digest (I forgot there was that duplication there and thought that the change was just absolute -> relative address completely 😅) I agree with your new wording.

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.

2 participants