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

sedi: hpet: keep waiting if main counter value is invalid #45

Merged
merged 1 commit into from
Jun 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions bsp_sedi/drivers/hpet/sedi_hpet.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ SEDI_REG_DEFINE(HPET, MCV, 0x0f0, RW, (uint64_t)-1, (uint64_t)0x0);
SEDI_RBFM(HPET, HPET_CTRL_STS, HPET_CTRL_STS8))
#define CTRL_STS_TIMER1_COMPARATOR SEDI_RBFM(HPET, HPET_CTRL_STS, HPET_CTRL_STS9)
#define CTRL_STS_TIMER2_COMPARATOR SEDI_RBFM(HPET, HPET_CTRL_STS, HPET_CTRL_STS10)
#define CTRL_STS_MAIN_COUNTER_VALUE_INVALID SEDI_RBFM(HPET, HPET_CTRL_STS, HPET_CTRL_STS13)

/*Macro for interrupt routing*/
#define TIMER2_INT_ROUTE (0x0b)
Expand Down Expand Up @@ -157,6 +158,7 @@ uint64_t sedi_hpet_get_main_counter(void)
uint32_t highBits;
uint32_t lowBits;

wait_for_idle(CTRL_STS_MAIN_COUNTER_VALUE_INVALID);
do {
highBits = SEDI_REG_GET(HPET, MCV_HIGH);
lowBits = SEDI_REG_GET(HPET, MCV_LOW);
Expand Down