Commit 4cdf854f authored by David Brownell's avatar David Brownell Committed by Linus Torvalds

rtc: at91sam9 RTC support (RTT and/or RTC)

AT91sam9 RTC support, primarily in the form of an RTT-as-RTC driver that was
extracted from 2.6.23-at91 patch and updated:

 - Relies on now-merged platform updates, which associate the RTT
   hardware address with each RTT and use the "at91_rtt" name.

 - RTC framework related fixes and cleanups, notably:
    * removed now-needless suspend/resume clock offset logic
    * alarm read/write now respects the "enabled" flag
    * suspend always disables update irqs
    * shutdown (and startup) disables all irqs

 - Misc cleanup:
    * use dev_*() messaging
    * add comments
    * remove globals,
    * ... etc

 - Don't force use of RTT0 and GPBR0.  Either resource may need
   to be used for other purposes (like NO_HZ support).

 - Update "AT91RM9200 RTC" Kconfig to allow it on SAM9RL chips
   (it has both RTT and RTC).

Driver binding uses bus_find_device() to avoid needing any kind of "timer
library" code when there's more than one RTT module.  (This timer can be used
as an RTC, to support NO_HZ operation, or potentially for other stuff.  The
choice is a per-system policy.)
Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
Cc: Michel Benoit <murpme@gmail.com>
Cc: Nicolas Ferre <nicolas.ferre@rfo.atmel.com>
Cc: Andrew Victor <linux@maxim.org.za>
Cc: Russell King <rmk@arm.linux.org.uk>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f618258a
...@@ -469,10 +469,47 @@ config RTC_DRV_AT32AP700X ...@@ -469,10 +469,47 @@ config RTC_DRV_AT32AP700X
AT32AP700x family processors. AT32AP700x family processors.
config RTC_DRV_AT91RM9200 config RTC_DRV_AT91RM9200
tristate "AT91RM9200" tristate "AT91RM9200 or AT91SAM9RL"
depends on ARCH_AT91RM9200 depends on ARCH_AT91RM9200 || ARCH_AT91SAM9RL
help help
Driver for the Atmel AT91RM9200's internal RTC (Realtime Clock). Driver for the internal RTC (Realtime Clock) module found on
Atmel AT91RM9200's and AT91SAM9RL chips. On SAM9RL chips
this is powered by the backup power supply.
config RTC_DRV_AT91SAM9
tristate "AT91SAM9x"
depends on ARCH_AT91 && !(ARCH_AT91RM9200 || ARCH_AT91X40)
help
RTC driver for the Atmel AT91SAM9x internal RTT (Real Time Timer).
These timers are powered by the backup power supply (such as a
small coin cell battery), but do not need to be used as RTCs.
(On AT91SAM9rl chips you probably want to use the dedicated RTC
module and leave the RTT available for other uses.)
config RTC_DRV_AT91SAM9_RTT
int
range 0 1
default 0
prompt "RTT module Number" if ARCH_AT91SAM9263
depends on RTC_DRV_AT91SAM9
help
More than one RTT module is available. You can choose which
one will be used as an RTC. The default of zero is normally
OK to use, though some systems use that for non-RTC purposes.
config RTC_DRV_AT91SAM9_GPBR
int
range 0 3 if !ARCH_AT91SAM9263
range 0 15 if ARCH_AT91SAM9263
default 0
prompt "Backup Register Number"
depends on RTC_DRV_AT91SAM9
help
The RTC driver needs to use one of the General Purpose Backup
Registers (GPBRs) as well as the RTT. You can choose which one
will be used. The default of zero is normally OK to use, but
on some systems other software needs to use that register.
config RTC_DRV_BFIN config RTC_DRV_BFIN
tristate "Blackfin On-Chip RTC" tristate "Blackfin On-Chip RTC"
......
...@@ -19,6 +19,7 @@ rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o ...@@ -19,6 +19,7 @@ rtc-core-$(CONFIG_RTC_INTF_SYSFS) += rtc-sysfs.o
obj-$(CONFIG_RTC_DRV_AT32AP700X)+= rtc-at32ap700x.o obj-$(CONFIG_RTC_DRV_AT32AP700X)+= rtc-at32ap700x.o
obj-$(CONFIG_RTC_DRV_AT91RM9200)+= rtc-at91rm9200.o obj-$(CONFIG_RTC_DRV_AT91RM9200)+= rtc-at91rm9200.o
obj-$(CONFIG_RTC_DRV_AT91SAM9) += rtc-at91sam9.o
obj-$(CONFIG_RTC_DRV_BFIN) += rtc-bfin.o obj-$(CONFIG_RTC_DRV_BFIN) += rtc-bfin.o
obj-$(CONFIG_RTC_DRV_CMOS) += rtc-cmos.o obj-$(CONFIG_RTC_DRV_CMOS) += rtc-cmos.o
obj-$(CONFIG_RTC_DRV_DS1216) += rtc-ds1216.o obj-$(CONFIG_RTC_DRV_DS1216) += rtc-ds1216.o
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment