Skip to content

Conversation

@rivos-eblot
Copy link

Make it faster to avoid ROM initialization timeout.

Also add a property for fine-grained control of the pace delay.

Copy link

@loiclefort loiclefort left a comment

Choose a reason for hiding this comment

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

LGTM

((((_reg_) < REGS_COUNT) && REG_NAMES[_reg_]) ? REG_NAMES[_reg_] : "?")

#define INIT_TIMER_CHUNK_NS 100000 /* 100 us */
#define INIT_TIMER_CHUNK_US 10u /* us */

Choose a reason for hiding this comment

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

Nit: the comment feels redundant given the suffix (very minor nit, feel free not to change 😅)

Copy link
Author

Choose a reason for hiding this comment

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

very true :)

timer_mod(s->init_timer, (int64_t)(now + INIT_TIMER_CHUNK_NS));
int64_t now = qemu_clock_get_ns(OT_VIRTUAL_CLOCK);
timer_mod(s->init_timer,
(int64_t)(now + ((int64_t)s->init_pace_us) * 1000u));

Choose a reason for hiding this comment

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

Nit: the explicit cast of the result of the addition to (int64_t) here is now redundant given the changed type of now.

Copy link
Author

Choose a reason for hiding this comment

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

removed.

DEFINE_PROP_UINT32("wci_size", OtSramCtrlState, init_chunk_words, 0u),
DEFINE_PROP_UINT32("init-pace-us", OtSramCtrlState, init_pace_us,

Choose a reason for hiding this comment

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

Aside: It's not necessary to change in this PR, but it is still not clear to me: should we be using - or _ (or both) in property names?

Copy link
Author

Choose a reason for hiding this comment

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

I now try to use - for properties; however properties that are managed by readconfig file may not follow this rule.
I guess a project-wide clean up would be required at some point.

@rivos-eblot rivos-eblot force-pushed the dev/ebl/sram_init_pace branch from 5c00540 to 28a30d1 Compare December 5, 2025 11:11
…tialization.

Make it faster to avoid ROM initialization timeout.

Also add a property for fine-grained control of the pace delay.

Signed-off-by: Emmanuel Blot <eblot@rivosinc.com>
@rivos-eblot rivos-eblot force-pushed the dev/ebl/sram_init_pace branch from 28a30d1 to 308b8bf Compare December 5, 2025 12:31
@rivos-eblot rivos-eblot merged commit 0f72b63 into lowRISC:ot-10.1.0 Dec 5, 2025
9 of 10 checks passed
@rivos-eblot rivos-eblot deleted the dev/ebl/sram_init_pace branch December 5, 2025 12:50
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.

3 participants