gtimer: allow impdef registers of system counter to be programmed
The system counter control register frame allows integration of
implementation defined registers (CNTControlBase register frame). The
register offsets range 0x0C0-0x0FC is designated for this use as defined
by the Arm architecture reference manual.
Platforms often use the implementation defined register space to
implement platform specific controls on the system counter. An example
of additional control is the platform specific increment value that is
applied to the timer count value on each tick (on platforms that do not
support FEAT_CNTSC).
As these registers are implementation specific and can vary across
different platforms, it becomes imperative to extend the gtimer module
to allow these impdef registers to be configured as well. But, adding
various plaform specific handlers in gtimer module to configure impdef
registers is neither scalable nor desirable.
So, extend the gtimer module to accept a table of impdef register offset
and value pairs as part of the module config data. The gtimer module
will configure the impdef registers with its corresponding value listed
in this table. These registers are configured before the system counter
is enabled.
While at it, it was noticed that gtimer module context is not zero
intialized. So update these module to use calloc instead of alloc.
Signed-off-by:
Thomas Abraham <thomas.abraham@arm.com>
Change-Id: I015bb93d56617ce253a85b5320636f3bd19f53a0
Loading
Please register or sign in to comment