RFC: Initial ROM vendor hooks implementation #25642
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR implements an initial framework for allowing vendors to customize OpenTitan ROMs with external , potentially closed-source hooks. See #25633 for more details on the problem statement and the proposed solution.
This pull request is made of three commits:
[sw,silicon_creator,rom] Add a ROM state API
is the main ROM vendor hooks implementation. It provides a set of C macros for defining ROM states and binding them with a run callback implementation. It also provides a simple API for walking through all defined states.[sw,silicon_creator,rom] Add dummy ROM state hooks
expands thehooks_setup
bazel rules for supporting external ROM hooks repository. It also provides a dummy example of such a repository, with basic documentation on how to replicate that setup to actually implement custom ROM hooks[sw,silicon_creator,rom] Convert the OpenTitan ROM to the ROM state API
is really just a PoC as it converts the existing Earlgrey ROM to this new framework. In this commit, the ROM state definitions are wrapper around the existing high level functions of the Earlgrey ROM. A real conversion would split those functions into more granular ones and map those to a finer ROM state machine. This is not done in this commit to keep it as little intrusive as possible, mostly for readability purposes.Fixes #25633