Merge pull request #44 from plundstr/master

New plugin bootreasonlogger
Do not modify RTC time while dsme is running

RTC time adjustments interfere with book keeping during suspend/resume
cycles and can cause clock drift. RTC alarms are programmed at
current_rtc_time + alarm_time - current_system time and thus the RTC
time does not need to be in sync with system time.

[iphb] Do not modify RTC time while dsme is running
Sync RTC and system time on dsme startup/exit

Enable RTC update interrupts on dsme startup and set the system time
on the first RTC interrupt.

Store system time to RTC on dsme exit, if the delta is large enough.

[iphb] Sync RTC and system time on dsme startup/exit
Do not apply obviously wrong RTC time as system time

If RTC gets reset, or the RTC time is otherwise earlier than
  * default time built in to dsme
  * sw release / image creation time
  * last known system time
  * current system time
use the latest of the above mentioned times instead.

[iphb] Do not apply obviously wrong RTC time as system time
Cache alarm queue state over dsme/device restarts

Alarm queue state is available only as signals sent by timed. If dsme
is restarted for any reason, the alarm state is lost, RTC wakeups do not
get programmed and alarms can be missed due to suspend or power off.

This is fixed by writing alarms state to a file on dsme exit and reading
it back in on dsme startup.

[iphb] Cache alarm queue state over dsme/device restarts
Fix debug log formatting
Set system time from RTC without delay

Get the system time roughly in sync with rtc as soon as possible
and do fine tuning later.
Merge pull request #45 from spiiroin/time_drifting

Fixes to clock drifting issues
Bump dsme version to 0.64.3
[dsmetool] Added --clear-rtc parameter to dsmetool

Signed-off-by: Pekka Lundstrom <pekka.lundstrom@jollamobile.com>