08 Nov, 2015

1 commit

  • As said in the SAMA5D2 datasheet, "Prior to instructing the device
    to enter ULP mode 1, ... and the internal sources of wake-up must
    be cleared."

    This patch is to clear the RTC alarm status flag prior to suspending
    to avoid the erroneous wake-up activity, as it is often used as
    the wake-up source for the ULP mode 1.

    Signed-off-by: Wenyou Yang
    Signed-off-by: Alexandre Belloni

    Wenyou Yang
     

05 Sep, 2015

2 commits


17 Apr, 2015

1 commit

  • Change the __raw IO calls to readl/write_relaxed which makes the driver
    endian agnostic to run properly on big endian systems.

    Signed-off-by: Ben Dooks
    Cc: Alessandro Zummo
    Cc: Andrew Victor
    Acked-by: Nicolas Ferre
    Acked-by: Jean-Christophe PLAGNIOL-VILLARD
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Ben Dooks
     

18 Mar, 2015

1 commit


05 Mar, 2015

1 commit

  • The IRQ line used by the RTC device is usually shared with the system
    timer (PIT) on at91 platforms.

    Since timers are registering their handlers with IRQF_NO_SUSPEND, we
    should expect being called in suspended state, and properly wake the
    system up when this is the case.

    Set IRQF_COND_SUSPEND flag when registering the IRQ handler to inform
    irq core that it can safely be called while the system is suspended.

    Signed-off-by: Boris Brezillon
    Reviewed-by: Alexandre Belloni
    Acked-by: Nicolas Ferre
    Acked-by: Mark Rutland
    Signed-off-by: Rafael J. Wysocki

    Boris BREZILLON
     

20 Oct, 2014

1 commit


07 Jun, 2014

1 commit

  • The rtc user must wait at least 1 sec between each time/calandar update
    (see atmel's datasheet chapter "Updating Time/Calendar").

    Use the 1Hz interrupt to update the at91_rtc_upd_rdy flag and wait for
    the at91_rtc_wait_upd_rdy event if the rtc is not ready.

    This patch fixes a deadlock in an uninterruptible wait when the RTC is
    updated more than once every second. AFAICT the bug is here from the
    beginning, but I think we should at least backport this fix to 3.10 and
    the following longterm and stable releases.

    Signed-off-by: Boris BREZILLON
    Reported-by: Bryan Evenson
    Tested-by: Bryan Evenson
    Cc: Andrew Victor
    Cc: Nicolas Ferre
    Cc: Jean-Christophe Plagniol-Villard
    Cc: Alessandro Zummo
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Boris BREZILLON
     

13 Dec, 2013

1 commit


22 Nov, 2013

1 commit

  • Make sure RTC-interrupts are disabled at shutdown.

    As the RTC is generally powered by backup power (VDDBU), its interrupts
    are not disabled on wake-up, user, watchdog or software reset. This
    could cause troubles on other systems (e.g. older kernels) if an
    interrupt occurs before a handler has been installed at next boot.

    Let us be well-behaved and disable them on clean shutdowns at least (as
    do the RTT-based rtc-at91sam9 driver).

    Signed-off-by: Johan Hovold
    Acked-by: Nicolas Ferre
    Cc: Jean-Christophe Plagniol-Villard
    Cc: Andrew Victor
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johan Hovold
     

13 Nov, 2013

1 commit


04 Jul, 2013

2 commits


13 Jun, 2013

5 commits

  • Add support for the at91sam9x5-family which must use the shadow
    interrupt mask due to a hardware issue (causing RTC_IMR to always be
    zero).

    Signed-off-by: Johan Hovold
    Acked-by: Nicolas Ferre
    Cc: Douglas Gilbert
    Cc: Jean-Christophe PLAGNIOL-VILLARD
    Cc: Ludovic Desroches
    Cc: Robert Nelson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johan Hovold
     
  • Add shadow interrupt-mask register which can be used on SoCs where the
    actual hardware register is broken.

    Note that some care needs to be taken to make sure the shadow mask
    corresponds to the actual hardware state. The added overhead is not an
    issue for the non-broken SoCs due to the relatively infrequent
    interrupt-mask updates. We do, however, only use the shadow mask value
    as a fall-back when it actually needed as there is still a theoretical
    possibility that the mask is incorrect (see the code for details).

    Signed-off-by: Johan Hovold
    Acked-by: Nicolas Ferre
    Cc: Douglas Gilbert
    Cc: Jean-Christophe PLAGNIOL-VILLARD
    Cc: Ludovic Desroches
    Cc: Robert Nelson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johan Hovold
     
  • Add accessors for the interrupt register.

    This will allow us to easily add a shadow interrupt-mask register to use
    on SoCs where the interrupt-mask register cannot be used.

    Signed-off-by: Johan Hovold
    Acked-by: Nicolas Ferre
    Cc: Douglas Gilbert
    Cc: Jean-Christophe PLAGNIOL-VILLARD
    Cc: Ludovic Desroches
    Cc: Robert Nelson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johan Hovold
     
  • Add configuration support which can be used to implement SoC-specific
    workarounds for broken hardware.

    Signed-off-by: Johan Hovold
    Acked-by: Nicolas Ferre
    Cc: Douglas Gilbert
    Cc: Jean-Christophe PLAGNIOL-VILLARD
    Cc: Ludovic Desroches
    Cc: Robert Nelson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johan Hovold
     
  • The members of Atmel's at91sam9x5 family (9x5) have a broken RTC
    interrupt mask register (AT91_RTC_IMR). It does not reflect enabled
    interrupts but instead always returns zero.

    The kernel's rtc-at91rm9200 driver handles the RTC for the 9x5 family.
    Currently when the date/time is set, an interrupt is generated and this
    driver neglects to handle the interrupt. The kernel complains about the
    un-handled interrupt and disables it henceforth. This not only breaks
    the RTC function, but since that interrupt is shared (Atmel's SYS
    interrupt) then other things break as well (e.g. the debug port no
    longer accepts characters).

    Tested on the at91sam9g25. Bug confirmed by Atmel.

    This patch (of 5):

    Add missing match-table compile guard.

    Signed-off-by: Johan Hovold
    Acked-by: Nicolas Ferre
    Cc: Douglas Gilbert
    Cc: Jean-Christophe PLAGNIOL-VILLARD
    Cc: Ludovic Desroches
    Cc: Robert Nelson
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Johan Hovold
     

30 Apr, 2013

4 commits


06 Apr, 2013

1 commit

  • This reverts commit 0ef1594c017521ea89278e80fe3f80dafb17abde.

    This patch introduced a few races which cannot be easily fixed with a
    small follow-up patch. Furthermore, the SoC with the broken hardware
    register, which this patch intended to add support for, can only be used
    with device trees, which this driver currently does not support.

    [ Here is the discussion that led to this "revert" patch:
    https://lkml.org/lkml/2013/4/3/176 ]

    Cc: stable
    Signed-off-by: Johan Hovold
    Signed-off-by: Nicolas Ferre
    Signed-off-by: Linus Torvalds

    Johan Hovold
     

23 Mar, 2013

1 commit

  • On some revisions of AT91 SoCs, the RTC IMR register is not working.
    Instead of elaborating a workaround for that specific SoC or IP version,
    we simply use a software variable to store the Interrupt Mask Register
    and modify it for each enabling/disabling of an interrupt. The overhead
    of this is negligible anyway.

    The interrupt mask register (IMR) for the RTC is broken on the AT91SAM9x5
    sub-family of SoCs (good overview of the members here:
    http://www.eewiki.net/display/linuxonarm/AT91SAM9x5 ). The "user visible
    effect" is the RTC doesn't work.

    That sub-family is less than two years old and only has devicetree (DT)
    support and came online circa lk 3.7 . The dust is yet to settle on the
    DT stuff at least for AT91 SoCs (translation: lots of stuff is still
    broken, so much that it is hard to know where to start).

    The fix in the patch is pretty simple: just shadow the silicon IMR
    register with a variable in the driver. Some older SoCs (pre-DT) use the
    the rtc-at91rm9200 driver (e.g. obviously the AT91RM9200) and they should
    not be impacted by the change. There shouldn't be a large volume of
    interrupts associated with a RTC.

    Signed-off-by: Nicolas Ferre
    Reported-by: Douglas Gilbert
    Cc: Jean-Christophe PLAGNIOL-VILLARD
    Cc: Ludovic Desroches
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Nicolas Ferre
     

22 Feb, 2013

1 commit


06 Nov, 2012

1 commit


04 Jul, 2012

1 commit

  • MULTI_IRQ_HANDLER and SPARSE_IRQ are now required everywhere because
    mach/irqs.h and mach/entry-macros.S are gone but the symbols are
    only selected for AT91SAM9, not for the NOMMU parts.

    A few files now need to include linux/io.h directly, which used to
    be included through other headers that have changed.

    The new at91_aic_irq_priorities variable is only used with CONFIG_OF
    enabled and should not be visible otherwise.

    Signed-off-by: Arnd Bergmann
    Acked-by: Ludovic Desroches
    Acked-by: Nicolas Ferre

    Arnd Bergmann
     

28 Nov, 2011

1 commit


31 Mar, 2011

1 commit


10 Mar, 2011

1 commit

  • With the generic RTC rework, the UIE mode irqs are handled
    in the generic layer, and only hardware specific ioctls
    get passed down to the rtc driver layer.

    So this patch removes the UIE mode ioctl handling in the rtc
    driver layer, which never get used.

    CC: Thomas Gleixner
    CC: Alessandro Zummo
    CC: Marcelo Roberto Jimenez
    CC: rtc-linux@googlegroups.com
    Signed-off-by: John Stultz

    John Stultz
     

04 Feb, 2011

1 commit

  • Some rtc drivers use the ioctl method instead of the alarm_irq_enable
    method for enabling alarm interupts. With the new virtualized RTC
    rework, its important for drivers to use the alarm_irq_enable instead.

    This patch converts the drivers that use the AIE ioctl method to
    use the alarm_irq_enable method. Other ioctl cmds are left untouched.

    I have not been able to test or even compile most of these drivers.
    Any help to make sure this change is correct would be appreciated!

    CC: Alessandro Zummo
    CC: Thomas Gleixner
    CC: Marcelo Roberto Jimenez
    Reported-by: Marcelo Roberto Jimenez
    Tested-by: Marcelo Roberto Jimenez
    Signed-off-by: John Stultz

    John Stultz
     

23 Sep, 2009

1 commit

  • Fix two new-ish runtime warnings in the at91rm9200 (etc) RTC:

    Platform driver 'at91_rtc' needs updating - please use dev_pm_ops
    ... by just switching

    IRQ 1/at91_rtc: IRQF_DISABLED is not guaranteed on shared IRQs
    ... no longer needed now that rtc_update_irq() changed

    Signed-off-by: David Brownell
    Acked-by: Alessandro Zummo
    Cc: Andrew Victor
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

20 Oct, 2008

1 commit

  • Change drivers/rtc/ to use the new bcd2bin/bin2bcd functions instead of
    the obsolete BCD_TO_BIN/BIN_TO_BCD/BCD2BIN/BIN2BCD macros.

    Signed-off-by: Adrian Bunk
    Acked-by: Alessandro Zummo
    Cc: David Brownell
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Adrian Bunk
     

17 Oct, 2008

1 commit

  • The non-functional periodic IRQ support was previously removed from the
    AT91RM9200 RTC driver. Remove the remaining AT91_RTC_FREQ definition.

    Signed-off-by: Andrew Victor
    Cc: David Brownell:
    Cc: Alessandro Zummo:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Victor
     

07 Aug, 2008

1 commit


25 Jul, 2008

1 commit

  • This fixes kernel http://bugzilla.kernel.org/show_bug.cgi?id=11112 (bogus
    RTC update IRQs reported) for rtc-at91rm9200 by scrubbing old IRQ status
    before enabling IRQs.

    It also removes nonfunctional periodic IRQ support from this driver;
    only update IRQs are reported, or provided by the hardware.

    I suspect some other RTCs probably have versions of #11112; it's easy to
    overlook, since most non-RTC drivers don't care about spurious IRQs:
    they're not reported to userspace.

    Signed-off-by: David Brownell
    Report-by: W Unruh
    Cc: Andrew Victor
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Brownell
     

22 May, 2008

2 commits

  • On ARM, asm/rtc.h only contains definitions for the predecessor to
    the RTC class support. RTC class drivers should not be including
    this include.

    Build tested on at91sam9rl and s3c2410 configurations.

    Acked-by: Alessandro Zummo
    Signed-off-by: Russell King

    Russell King
     
  • asm/mach/time.h is the ARM header file for setting up kernel ticker
    timekeeping (be that the old jiffy interrupt or the new clocksource.)
    RTC drivers have no business using this header file, and in fact do
    not require it.

    Build tested on at91sam9rl, omap and s3c2410 configurations.

    Acked-by: Alessandro Zummo
    Acked-by: Andrew Victor
    Signed-off-by: Russell King

    Russell King
     

28 Apr, 2008

1 commit


11 Apr, 2008

1 commit

  • Since 43cc71eed1250755986da4c0f9898f9a635cb3bf, the platform modalias is
    prefixed with "platform:". Add MODULE_ALIAS() to the hotpluggable RTC
    platform drivers, to re-enable module auto loading.

    [dbrownell@users.sourceforge.net: more drivers, minor fix]
    Signed-off-by: Kay Sievers
    Signed-off-by: David Brownell
    Cc: Greg KH
    Cc: Alessandro Zummo
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Kay Sievers