Skip to content

Conversation

@nordic-krch
Copy link
Contributor

…ister access

Speed up execution of the interrupt handler and sys_clock_set_timeout(). Sys_clock_set_timeout() can be called in two scenarios: from previous timeout expiration handler or freely. If the former case fast path can be used since CC value in the GRTC register just expired and it can be used as a reference for CCADD setting. This is only a single register write so it's much faster. In the latter a longer procedure is applied which also happens in two variants. If value which is set in CC is further in the future (e.g. K_FOREVER was set before) then CC can be safely overwritten with a new value without a risk of triggering unexpected COMPARE event. If value in CC is earlier than the new CC value (if earlier timeout was aborted) then there is a risk of COMPARE event happening while it is being overwritten. That case requires long and safer procedure of setting CC.

Update hal_nordic with changes in the nrfx_grtc driver which are needed for nrf_grtc_timer changes.

Upstream PR #: 87944

@nordic-krch
Copy link
Contributor Author

DNM as it requires alignment in SDFW.

@nordic-krch nordic-krch removed the DNM label Oct 3, 2025
@nordic-krch
Copy link
Contributor Author

Removing DNM as cpusec is already aligned so next ironside release will be ready and it should cooperate fine with existing ironside which is using GRTC driver without those changes.

@nordic-krch
Copy link
Contributor Author

It is another attempt to get those optimizations in after #3059 got reverted. It was reverted because it broke GRTC on cpusec which is not fixed.

@nordic-krch nordic-krch requested a review from anangl October 13, 2025 09:44
@nordic-krch nordic-krch force-pushed the ncs/grtc_opt branch 2 times, most recently from e811edb to 4ce6e81 Compare November 17, 2025 05:57
nordic-krch and others added 2 commits November 17, 2025 13:43
…ister access

Speed up execution of the interrupt handler and sys_clock_set_timeout().
Sys_clock_set_timeout() can be called in two scenarios: from previous
timeout expiration handler or freely. If the former case fast path
can be used since CC value in the GRTC register just expired and it
can be used as a reference for CCADD setting. This is only a single
register write so it's much faster. In the latter a longer procedure
is applied which also happens in two variants. If value which is
set in CC is further in the future (e.g. K_FOREVER was set before) then
CC can be safely overwritten with a new value without a risk of
triggering unexpected COMPARE event. If value in CC is earlier than
the new CC value (if earlier timeout was aborted) then there is a
risk of COMPARE event happening while it is being overwritten.
That case requires long and safer procedure of setting CC.

Update hal_nordic with changes in the nrfx_grtc driver which are
needed for nrf_grtc_timer changes.

Signed-off-by: Krzysztof Chruściński <[email protected]>
(cherry picked from commit d6fb9384ebfbb46a3cb65213257a61651a76fd7c)
…20 PPR

Adjusting CONFIG_SYS_CLOCK_TICKS_PER_SEC as core is to slow too run
the test with the default system clock frequency.

Signed-off-by: Paweł Pelikan <[email protected]>
(cherry picked from commit fddce23e03021bfb6cac6e259c58b64ecc6b5775)
@anangl anangl merged commit c118168 into nrfconnect:main Nov 18, 2025
14 checks passed
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.

5 participants