-
Notifications
You must be signed in to change notification settings - Fork 8k
soc: nordic: common: CONFIG_SOC_NRF_FORCE_CONSTLAT
#96948
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
soc: nordic: common: CONFIG_SOC_NRF_FORCE_CONSTLAT
#96948
Conversation
} | ||
|
||
/* Immediately after the SoC init functions */ | ||
SYS_INIT(nrf_const_lat, PRE_KERNEL_1, 1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couldn't this code actually be in one of the hooks, to avoid yet another SYS_INIT
? Or perhaps in soc.c
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had a look around for an appropriate place and couldn't find one. For soc.c
it would need to duplicated for each Nordic SoC. If that is preferred I can do that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We need to use on-off service and port Bluetooth Controllers to use them. Otherwise, low power mode would get set after radio events.
1d29606
Added Bluetooth controller change to address @cvinayak comment. |
#if defined(CONFIG_NRF_SYS_EVENT) | ||
(void)nrf_sys_event_request_global_constlat(); | ||
#else /* !CONFIG_NRF_SYS_EVENT */ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no expertise here, but the changes look reasonable.
soc/nordic/common/Kconfig
Outdated
bool "nRF system event support" | ||
select NRFX_POWER if !NRF_PLATFORM_HALTIUM | ||
|
||
config NRF_FORCE_CONSTANT_LATENCY |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is already a feature like that in nRF54L familiy.
zephyr/soc/nordic/nrf54l/Kconfig
Line 79 in 9ae10ea
config SOC_NRF_FORCE_CONSTLAT |
Can you rename it to SOC_NRF_FORCE_CONSTLAT here and remove the Kconfig from nrf54l/Kconfig.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did not know that existed, and based on comments from @cvinayak the option is probably broken when used with a Bluetooth controller
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Dupilicate code from nrf54l/soc.c would need to be removed:
zephyr/soc/nordic/nrf54l/soc.c
Line 142 in 9ae10ea
nrf_power_task_trigger(NRF_POWER, NRF_POWER_TASK_CONSTLAT); |
soc/nordic/common/Kconfig
Outdated
|
||
config NRF_FORCE_CONSTANT_LATENCY | ||
bool "Force constant latency mode in system ON" | ||
depends on NRF_SYS_EVENT |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imo it should be a select.
There should be depends on !SOC_NRF54H20 && !RISCV
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NRF_SYS_EVENT
is available to the NRF54H20 app and radio cores, so only !RISCV
would be helpful.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
!RISCV
? I have this being changed in the register directly from the flpr core and it doesn't seem to cause problems so that condition seems wrong:
/* Switch to constant latency */
//NRF_POWER_NS_BASE
NRF_POWER->TASKS_LOWPWR = 0;
NRF_POWER->TASKS_CONSTLAT = 1;
k_sleep(K_SECONDS(2));
Ah becuase of sys event
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If CONSTLAT is supported on RISCV cores, we should probably extend SYS_EVENT?
Move the option to force constant latency mode outside of nRF54l, since it is an option applicable to most Nordic SoCs. Signed-off-by: Jordan Yates <[email protected]>
Validate that `CONFIG_SOC_NRF_FORCE_CONSTLAT=y` compiles. Signed-off-by: Jordan Yates <[email protected]>
When `CONFIG_NRF_SYS_EVENT` is enabled, route constant latency requests through the reference counted API. Signed-off-by: Jordan Yates <[email protected]>
88a5a53
1d29606
to
88a5a53
Compare
CONSTLAT
kconfigCONFIG_SOC_NRF_FORCE_CONSTLAT
Updated PR to pull the already existing option out to the common level, so current users on nRF54L won't see any changes. |
|
Move the option to force constant latency mode outside of nRF54l, since it is an option applicable to most Nordic SoCs.
This is a quality-of-life option to prevent boards/applications from needing to implement the calls themselves.