Skip to content

[keymgr_dpe] Replace keymgr in EG - PR1 otp_ctrl#30615

Open
rroth-lowrisc wants to merge 3 commits into
lowRISC:masterfrom
rroth-lowrisc:keymgr_dpe_PR1_otp_ctrl
Open

[keymgr_dpe] Replace keymgr in EG - PR1 otp_ctrl#30615
rroth-lowrisc wants to merge 3 commits into
lowRISC:masterfrom
rroth-lowrisc:keymgr_dpe_PR1_otp_ctrl

Conversation

@rroth-lowrisc

@rroth-lowrisc rroth-lowrisc commented Jul 2, 2026

Copy link
Copy Markdown

PR1 - otp_ctrl

This PR is the first in a series which will replace the keymgr with the kemgr_dpe in earlgrey. The replacement was approved by this RFC.

Merge-Dependencies

None

Description

Currently, the creator_root_key, creator_seed and owner_seed are provided in a single struct from the otp_ctrl. Going forward, we want the top-level to decide which IP should provide which seed, therefore the ports of the keymgr_dpe and the otp_ctrl have been changed. Now each secret material can be provided from a independent IP. Additionally, the dependency between keymgr_dpe and otp_ctrl is reversed. The otp_ctrl depends now on the keymgr_dpe and not vice versa.

To avoid breaking the current earlgrey implementation with the keymgr, a fix is introduced on the top level to concatenate the signals back together for the original keymgr. The reason for not touching the keymgr's port list itself is to avoid unnecessary work as the keymgr will be deprecated after integrating the keymgr_dpe.

This PR also addresses issue #25159

@andreaskurth andreaskurth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thanks @rroth-lowrisc! The RTL changes look correct to me, but otp_ctrl's block-level DV needs to be updated because it now references things that no longer exist and will thus not build:

  • hw/ip_templates/otp_ctrl/dv/tb.sv.tpl:144 connects .otp_keymgr_key_o(otp_ctrl_if.keymgr_key_o) — that port was deleted from the module.
  • hw/ip_templates/otp_ctrl/dv/env/otp_ctrl_scoreboard.sv.tpl:156 uses otp_ctrl_pkg::KeyMgrKeyWidth — that parameter was removed from otp_ctrl_pkg (now keymgr_dpe_pkg::KeyMgrKeyWidth).
  • otp_ctrl_if.sv.tpl (keymgr_key_o + its stability/data assertions), otp_ctrl_env_cov.sv.tpl, and README.md.tpl still model the old single interface.

Also the docs could use a further small update:

  • hw/ip_templates/otp_ctrl/doc/interfaces.md.tpl:118,121 (and the two generated interfaces.md) still say the key manager interface outputs "via otp_keymgr_key_o" and to synchronize "the otp_keymgr_key_o signals." That signal no longer exists; it should describe keymgr_creator_root_key_o / keymgr_creator_seed_o / keymgr_owner_seed_o.

Comment thread hw/ip/keymgr_dpe/rtl/keymgr_dpe_pkg.sv
@rroth-lowrisc rroth-lowrisc force-pushed the keymgr_dpe_PR1_otp_ctrl branch from 072a07e to 09ff60e Compare July 3, 2026 11:36
Split the otp_keymgr_key interface into its respective components.
Future version of the keymgr(_dpe) may receive the information from
different IP's rather than combined from the otp_ctrl.

To avoid a circular dependencies the DevIdWidth instantiated
in keymgr_dpe_pkg replaces the otp_ctrl_pkg::DeviceIdWidth.

As the keymgr still expects the combined message the earlgrey top
manually combines the key material. This fix will be removed when
the keymgr is replaced by the keymgr_dpe.

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
This commit updates the `otp_ctrl` dv to reflect the new interface between
the `keymgr` and the `otp_ctrl`. The secret / seed verification inside the
otp_ctrl scoreboard template are no longer dynamically generated. The reason
is that the previously shared port signal has been split into its respective
components, which does not interacts well with the dynamic generation anymore.

However, adding a secret to the otp now results in a port-list change anyways the
resulting overhead is deemed acceptable.

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
This commit removes all otp_ctrl dependency in the keymgr_dpe dv.
This change ensures that the dv architecture accurately reflects
the dependency in the RTL implementation.

Signed-off-by: Raphael Roth <rroth@lowrisc.org>
@rroth-lowrisc rroth-lowrisc force-pushed the keymgr_dpe_PR1_otp_ctrl branch from 09ff60e to ea4d1ec Compare July 3, 2026 12:17
@rroth-lowrisc

Copy link
Copy Markdown
Author

To avoid introducing breaking commits all three commits should be squashed together before this PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants