Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[rstmgr] Port rstmgr_alert_info_test to DT #26422

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

jwnrt
Copy link
Contributor

@jwnrt jwnrt commented Feb 25, 2025

I've stolen two commits from here: #26418

@jwnrt jwnrt requested review from msfschaffner and a team as code owners February 25, 2025 17:16
@jwnrt jwnrt requested review from pamaury and removed request for a team and msfschaffner February 25, 2025 17:16
@jwnrt jwnrt force-pushed the rstmgr-alert-info branch from cca7664 to e5f538a Compare February 25, 2025 17:42
jwnrt and others added 8 commits February 25, 2025 17:44
The `all_escalation_resets_test` needs to know the number of alerts as a
compile-time value constant so that it can reason in a generic way over
the alerts. Expose this as an enum constant in the global DT API along
with other alert information.

Signed-off-by: Alex Jones <[email protected]>
(cherry picked from commit ffd84cd)
This was unused.

Signed-off-by: James Wainwright <[email protected]>
Remove this dependency by retrieving a pointer to the test utilities
from the Retention SRAM via the DT API rather than via a hardcoded
Earlgrey constant. This API call cannot happen at compile-time, so an
initialization function is introduced alongside corresponding NULL
(uninitialized checks) in relevant test utility functions.

The static assertions also depend on Earlgrey constants for the
Retention SRAM size, but this information is not yet available through
the DT API. Adds some conditional #ifdefs to handle this case whilst
this information is not yet available.

Signed-off-by: Alex Jones <[email protected]>
(cherry picked from commit e7b9861)
@jwnrt jwnrt force-pushed the rstmgr-alert-info branch from e5f538a to 76cfe31 Compare February 25, 2025 17:47
@jwnrt jwnrt requested a review from AlexJones0 February 25, 2025 18:04
@jwnrt jwnrt linked an issue Feb 25, 2025 that may be closed by this pull request
@jwnrt jwnrt requested a review from nbdd0121 February 26, 2025 09:49
Copy link
Contributor

@AlexJones0 AlexJones0 left a comment

Choose a reason for hiding this comment

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

This looks good to me, thanks @jwnrt! It'd be nice if #26418 was merged first so those commits could be pulled in, but if that doesn't get merged soon then maybe just go ahead and put this in.

Comment on lines +5 to +15
#include "dt/dt_alert_handler.h"
#include "dt/dt_aon_timer.h"
#include "dt/dt_flash_ctrl.h"
#include "dt/dt_i2c.h"
#include "dt/dt_kmac.h"
#include "dt/dt_otp_ctrl.h"
#include "dt/dt_pwrmgr.h"
#include "dt/dt_rstmgr.h"
#include "dt/dt_rv_core_ibex.h"
#include "dt/dt_rv_plic.h"
#include "dt/dt_spi_host.h"
Copy link
Contributor

@AlexJones0 AlexJones0 Feb 27, 2025

Choose a reason for hiding this comment

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

Nit: it would be nice to have the // Generated. comment by these, for the sake of consistency with other tests/imports. Also on the dt/dt_flash_ctrl.h header in the #ifdef OPENTITAN_IS_EARLGREY section below.

static_assert(kDtRvPlicCount > 0, "test requires a PLIC");
static_assert(kDtRvCoreIbexCount > 0, "how did you make a top without a core?");
static_assert(kDtAonTimerCount > 0, "test requires an AON timer");
static_assert(kDtPwrmgrCount > 0, "test requires an AON timer");
Copy link
Contributor

Choose a reason for hiding this comment

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

Bad copy/paste here: should be "test requires a pwrmgr".

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.

[Multitop, test] chip_sw_rstmgr_alert_info
3 participants