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 <jaeden.amero@arm.com>
Loading
Please register or sign in to comment