Skip to content
Commit 536ee2a9 authored by Jaeden Amero's avatar Jaeden Amero
Browse files

ticker: Avoid SecureFault when running in NS mode



HAL implementations run in NS mode when TF-M is enabled; this is the
only case when HAL code would run in NS mode. TF-M itself requires the
system counter (SYSCOUNTER) to be configured, so we can trust that the
counter has been initialized and enabled. This means it is correct for
us to skip initialization of the system counter when running with TF-M.

Applications can now set DOMAIN_NS when building the HAL to make the HAL
only initialize the system counter (SYSCOUNTER) if we are not running in
NS mode. NS mode does not have write access to the SYSCNTR register
(SYSCNTR_CNTRL_BASE_S), and only has read access to some of the bits of
the SYSCNTR register via the SYSCNTR_READ_BASE_NS alias. This avoids a
secure fault when using ticker from NS code.

Signed-off-by: Jaeden Amero's avatarJaeden Amero <jaeden.amero@arm.com>
parent 882ec1a4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment