clocksource: dw_apb_timer: infrastructure to handle quirks

The dw_apb_timer as Synopsis-Designware component is prone to
the licensees modifying the IP to their needs.

Therefore add infrastructure to handle notifying the driver of
hardware-quirks.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
clocksource: dw_apb_timer: flexible register addresses

There exists variants of the apb-timer that use slightly different
register positions. To accomodate this, add elements to the timer struct
to hold the actual register offsets.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
clocksource: dw_apb_timer: add quirk for variant with 64bit counter

This adds a quirk for IP variants containing two load_count and value
registers that are used to provide 64bit accuracy on 32bit systems.

The added accuracy is currently not used, the driver is only adapted to
handle the different register layout and make it work on affected devices.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
clocksource: dw_apb_timer: use the eoi callback to clear pending interrupts

Some timer variants have different mechanisms to clear a pending timer
interrupt. Therefore don't hardcode the reading of the eoi register to
clear them, but instead use the already existing eoi callback for this.

Signed-off-by: Ulrich Prinz <ulrich.prinz@googlemail.com>
clocksource: dw_apb_timer: quirk for variants without EOI register

Some variants of the dw_apb_timer don't have an eoi register but instead expect a
one to be written to the int_status register at eoi time.

Signed-off-by: Ulrich Prinz <ulrich.prinz@googlemail.com>
clocksource: dw_apb_timer: handle inverted int mask settings

Some timer variants use an inverted setting to mask the timer interrupt.
Therefore add a quirk to handle these variants.

Signed-off-by: Ulrich Prinz <ulrich.prinz@googlemail.com>
clocksource: dw_apb_timer: added quirk for inverted timer mode handling

Some variants of SOCs using dw_apb_timer have inverted logic for the
bit that sets one-shot / periodic mode or free running timer. This
commit adds the new APBTMR_QUIRK_INVERSE_PERIODIC.

Signed-off-by: Ulrich Prinz <ulrich.prinz@googlemail.com>
clocksource: dw_apb_timer_of: add quirk handling

timer_get_base_and_rate now also can extract informations about present
hardware-quirks from the devicetree node and transmit it to the
clocksource / clockevent init function.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>
clocksource: dw_apb_timer: add special variant for rockchip rk3188 timers

The rk3188 uses a variant of the timer containing two registers for load_count
and current_values.

Signed-off-by: Heiko Stuebner <heiko@sntech.de>