Add Goldfish RTC DT enabled device driver
authorMiodrag Dinic <miodrag.dinic@imgtec.com>
Wed, 3 Dec 2014 10:53:17 +0000 (11:53 +0100)
committerMiodrag Dinic <miodrag.dinic@imgtec.com>
Fri, 5 Dec 2014 10:40:30 +0000 (11:40 +0100)
commit8d31bf60c0adfd803d702eec63fd604e330401b6
treed6a0795e68ebb55c9c46408da7579ed346ae4de3
parent77559b0f7df9c7b81cb2500f4fe07b4dbbaf239a
Add Goldfish RTC DT enabled device driver

Goldfish real-time clock (RTC) device

Taken from
<AOSP>/external/qemu/docs/GOLDFISH-VIRTUAL-HARDWARE.TXT

Relevant files:
$QEMU/hw/timer/goldfish_timer.c
$KERNEL/drivers/rtc/rtc-goldfish.c

Device properties:
Name: goldfish_rtc
Id: -1
IrqCount: 1
I/O Registers:

0x00 R TIME_LOW        - Get current time low-order 32-bits.
0x04 R TIME_HIGH       - Return current time high 32-bits.
0x08 W ALARM_LOW       - Set low 32-bit value or alarm and arm it.
0x0c W ALARM_HIGH      - Set high 32-bit value of alarm.
0x10 W CLEAR_INTERRUPT - Lower device's irq level.

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.

Device tree initialisation example:

  goldfish_rtc@1f006000 {
    interrupts = <0xe>;
    reg = <0x1f006000 0x1000>;
    compatible = "generic,goldfish-rtc";
  };

Signed-off-by: Miodrag Dinic <miodrag.dinic@imgtec.com>
Change-Id: I724c35508ba65dae526c3b05229629cb9f81559f
drivers/rtc/Kconfig
drivers/rtc/Makefile
drivers/rtc/rtc-goldfish.c [new file with mode: 0644]