Add Goldfish Timer & RTC devices
The following was taken from AOSP emulator documentation :
<AOSP>/external/qemu/GOLDFISH-VIRTUAL-HARDWARE.TXT
$QEMU=qemu-android : new code base QEMU with ranchu machine
$KERNEL=https://android.googlesource.com/kernel/goldfish.git
Godlfish timer:
==================================
Relevant files:
$QEMU/hw/timer/goldfish_timer.c
$KERNEL/arch/mips/goldfish/goldfish-time.c
Device properties:
Name: goldfish_timer
Id: -1
IrqCount: 1
32-bit I/O registers
0x00 R TIME_LOW : Get current time, return low-order 32-bits.
0x04 R TIME_HIGH : Return high 32-bits from TIME_LOW read.
0x08 W ALARM_LOW : Set low 32-bit value of alarm, and arm it.
0x0c W ALARM_HIGH : Set high 32-bit value of alarm.
0x10 W CLEAR_INTERRUPT : Lower device's irq level.
0x14 W CLEAR_ALARM
This device is used to return the current host time to the kernel,
as a high-precision signed 64-bit nanoseconds value, starting from
a liberal point in time.
Goldfish real-time clock (RTC):
==================================
Relevant files:
$QEMU/hw/timer/goldfish_timer.c
$KERNEL/drivers/rtc/rtc-goldfish.c
This device is _very_ similar to the Goldfish timer one,
with the following important differences:
- Values reported are still 64-bit nanoseconds, but they
have a granularity of 1 second, and represent
host-specific values (really 'time() * 1e9')
- The alarm is non-functioning, i.e. writing to
ALARM_LOW / ALARM_HIGH will work, but will never
arm any alarm.
Change-Id: Ie548ae7e39d02fa6766b9ea89def26aa42ba1366
2 files changed