Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 5 additions & 4 deletions soc/nordic/ironside/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ config NRF_IRONSIDE_DVFS_SERVICE

if NRF_IRONSIDE_DVFS_SERVICE

config NRF_IRONSIDE_DVFS_OPPOINT_CHANGE_MUTEX_TIMEOUT_MS
int "IRONSside DVFS change oppoint mutex timeout"
default 100
config NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS
int "IRONSside DVFS ABB analog status check maximum attempts"
range 0 255
default 50
help
Maximum tiemout when waiting for DVFS oppoint change mutex lock.
Maximum attempts with 10us intervals before busy status will be reported.

endif # NRF_IRONSIDE_DVFS_SERVICE

Expand Down
10 changes: 10 additions & 0 deletions soc/nordic/ironside/dvfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ static enum ironside_dvfs_oppoint current_dvfs_oppoint = IRONSIDE_DVFS_OPP_HIGH;
#error "Unsupported SoC series for IronSide DVFS"
#endif

#define ABB_STATUSANA_CHECK_MAX_ATTEMPTS (CONFIG_NRF_IRONSIDE_ABB_STATUSANA_CHECK_MAX_ATTEMPTS)
#define ABB_STATUSANA_CHECK_INTERVAL_US (10U)

struct dvfs_hsfll_data_t {
uint32_t new_f_mult;
uint32_t new_f_trim_entry;
Expand Down Expand Up @@ -129,6 +132,13 @@ static inline bool ironside_dvfs_is_abb_locked(NRF_ABB_Type *abb)
/* Temporary workaround until STATUSANA register is visible. */
volatile const uint32_t *statusana = (uint32_t *)abb + ABB_STATUSANA_REG_OFFSET;

uint8_t status_read_attempts = ABB_STATUSANA_CHECK_MAX_ATTEMPTS;

while ((*statusana & ABB_STATUSANA_LOCKED_L_Msk) == 0 && status_read_attempts > 0) {
k_busy_wait(ABB_STATUSANA_CHECK_INTERVAL_US);
status_read_attempts--;
}

return ((*statusana & ABB_STATUSANA_LOCKED_L_Msk) != 0);
}

Expand Down