Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3a00be19 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
Pull RTC updates from Alexandre Belloni:
 "Here is the pull-request for the RTC subsystem for 4.13.

  Subsystem:

   - expose non volatile RAM using nvmem instead of open coding in many
     drivers. Unfortunately, this option has to be enabled by default to
     not break existing users.

   - rtctest can now test for cutoff dates, showing when an RTC will
     start failing to properly save time and date.

   - new RTC registration functions to remove race conditions in drivers

  Newly supported RTCs:

   - Broadcom STB wake-timer

   - Epson RX8130CE

   - Maxim IC DS1308

   - STMicroelectronics STM32H7

  Drivers:

   - ds1307: use regmap, use nvmem, more cleanups

   - ds3232: temperature reading support

   - gemini: renamed to ftrtc010

   - m41t80: use CCF to expose the clock

   - rv8803: use nvmem

   - s3c: many cleanups

   - st-lpc: fix y2106 bug"

* tag 'rtc-4.13' of git://git.kernel.org/pub/scm/linux/kernel/git/abelloni/linux: (51 commits)
  rtc: Remove wrong deprecation comment
  nvmem: include linux/err.h from header
  rtc: st-lpc: make it robust against y2038/2106 bug
  rtc: rtctest: add check for problematic dates
  tools: timer: add rtctest_setdate
  rtc: ds1307: remove ds1307_remove
  rtc: ds1307: use generic nvmem
  rtc: ds1307: switch to rtc_register_device
  rtc: rv8803: remove rv8803_remove
  rtc: rv8803: use generic nvmem support
  rtc: rv8803: switch to rtc_register_device
  rtc: add generic nvmem support
  rtc: at91rm9200: remove race condition
  rtc: introduce new registration method
  rtc: class separate id allocation from registration
  rtc: class separate device allocation from registration
  rtc: stm32: add STM32H7 RTC support
  dt-bindings: rtc: stm32: add support for STM32H7
  rtc: ds1307: add ds1308 variant
  rtc: ds3232: add temperature support
  ...
parents b5e16170 40bf6a35
Loading
Loading
Loading
Loading
+22 −0
Original line number Diff line number Diff line
Broadcom STB wake-up Timer

The Broadcom STB wake-up timer provides a 27Mhz resolution timer, with the
ability to wake up the system from low-power suspend/standby modes.

Required properties:
- compatible     : should contain "brcm,brcmstb-waketimer"
- reg            : the register start and length for the WKTMR block
- interrupts     : The TIMER interrupt
- interrupt-parent: The phandle to the Always-On (AON) Power Management (PM) L2
                    interrupt controller node
- clocks	 : The phandle to the UPG fixed clock (27Mhz domain)

Example:

waketimer@f0411580 {
	compatible = "brcm,brcmstb-waketimer";
	reg = <0xf0411580 0x14>;
	interrupts = <0x3>;
	interrupt-parent = <&aon_pm_l2_intc>;
	clocks = <&upg_fixed>;
};
+0 −14
Original line number Diff line number Diff line
* Cortina Systems Gemini RTC

Gemini SoC real-time clock.

Required properties:
- compatible : Should be "cortina,gemini-rtc"

Examples:

rtc@45000000 {
	compatible = "cortina,gemini-rtc";
	reg = <0x45000000 0x100>;
	interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
};
+28 −0
Original line number Diff line number Diff line
* Faraday Technology FTRTC010 Real Time Clock

This RTC appears in for example the Storlink Gemini family of
SoCs.

Required properties:
- compatible : Should be one of:
  "faraday,ftrtc010"
  "cortina,gemini-rtc", "faraday,ftrtc010"

Optional properties:
- clocks: when present should contain clock references to the
  PCLK and EXTCLK clocks. Faraday calls the later CLK1HZ and
  says the clock should be 1 Hz, but implementers actually seem
  to choose different clocks here, like Cortina who chose
  32768 Hz (a typical low-power clock).
- clock-names: should name the clocks "PCLK" and "EXTCLK"
  respectively.

Examples:

rtc@45000000 {
	compatible = "cortina,gemini-rtc";
	reg = <0x45000000 0x100>;
	interrupts = <17 IRQ_TYPE_LEVEL_HIGH>;
	clocks = <&foo 0>, <&foo 1>;
	clock-names = "PCLK", "EXTCLK";
};
+27 −5
Original line number Diff line number Diff line
STM32 Real Time Clock

Required properties:
- compatible: "st,stm32-rtc".
- compatible: can be either "st,stm32-rtc" or "st,stm32h7-rtc", depending on
  the device is compatible with stm32(f4/f7) or stm32h7.
- reg: address range of rtc register set.
- clocks: reference to the clock entry ck_rtc.
- clocks: can use up to two clocks, depending on part used:
  - "rtc_ck": RTC clock source.
    It is required on stm32(f4/f7) and stm32h7.
  - "pclk": RTC APB interface clock.
    It is not present on stm32(f4/f7).
    It is required on stm32h7.
- clock-names: must be "rtc_ck" and "pclk".
    It is required only on stm32h7.
- interrupt-parent: phandle for the interrupt controller.
- interrupts: rtc alarm interrupt.
- st,syscfg: phandle for pwrcfg, mandatory to disable/enable backup domain
  (RTC registers) write protection.

Optional properties (to override default ck_rtc parent clock):
- assigned-clocks: reference to the ck_rtc clock entry.
- assigned-clock-parents: phandle of the new parent clock of ck_rtc.
Optional properties (to override default rtc_ck parent clock):
- assigned-clocks: reference to the rtc_ck clock entry.
- assigned-clock-parents: phandle of the new parent clock of rtc_ck.

Example:

@@ -25,3 +33,17 @@ Example:
		interrupts = <17 1>;
		st,syscfg = <&pwrcfg>;
	};

	rtc: rtc@58004000 {
		compatible = "st,stm32h7-rtc";
		reg = <0x58004000 0x400>;
		clocks = <&rcc RTCAPB_CK>, <&rcc RTC_CK>;
		clock-names = "pclk", "rtc_ck";
		assigned-clocks = <&rcc RTC_CK>;
		assigned-clock-parents = <&rcc LSE_CK>;
		interrupt-parent = <&exti>;
		interrupts = <17 1>;
		interrupt-names = "alarm";
		st,syscfg = <&pwrcfg>;
		status = "disabled";
	};
+25 −21
Original line number Diff line number Diff line

=======================================
Real Time Clock (RTC) Drivers for Linux
=======================================

@@ -136,35 +136,39 @@ a high functionality RTC is integrated into the SOC. That system might read
the system clock from the discrete RTC, but use the integrated one for all
other tasks, because of its greater functionality.

SYSFS INTERFACE
SYSFS interface
---------------

The sysfs interface under /sys/class/rtc/rtcN provides access to various
rtc attributes without requiring the use of ioctls. All dates and times
are in the RTC's timezone, rather than in system time.

date:  	   	 RTC-provided date
hctosys:   	 1 if the RTC provided the system time at boot via the
================ ==============================================================
date  	   	 RTC-provided date
hctosys   	 1 if the RTC provided the system time at boot via the
		 CONFIG_RTC_HCTOSYS kernel option, 0 otherwise
max_user_freq:	 The maximum interrupt rate an unprivileged user may request
max_user_freq	 The maximum interrupt rate an unprivileged user may request
		 from this RTC.
name:		 The name of the RTC corresponding to this sysfs directory
since_epoch:	 The number of seconds since the epoch according to the RTC
time:		 RTC-provided time
wakealarm:	 The time at which the clock will generate a system wakeup
name		 The name of the RTC corresponding to this sysfs directory
since_epoch	 The number of seconds since the epoch according to the RTC
time		 RTC-provided time
wakealarm	 The time at which the clock will generate a system wakeup
		 event. This is a one shot wakeup event, so must be reset
		 after wake if a daily wakeup is required. Format is seconds since
		 the epoch by default, or if there's a leading +, seconds in the
		 future, or if there is a leading +=, seconds ahead of the current
		 alarm.
offset:		 The amount which the rtc clock has been adjusted in firmware.
		 after wake if a daily wakeup is required. Format is seconds
		 since the epoch by default, or if there's a leading +, seconds
		 in the future, or if there is a leading +=, seconds ahead of
		 the current alarm.
offset		 The amount which the rtc clock has been adjusted in firmware.
		 Visible only if the driver supports clock offset adjustment.
		 The unit is parts per billion, i.e. The number of clock ticks
		 which are added to or removed from the rtc's base clock per
		 billion ticks. A positive value makes a day pass more slowly,
		 longer, and a negative value makes a day pass more quickly.
*/nvmem		 The non volatile storage exported as a raw file, as described
		 in Documentation/nvmem/nvmem.txt
================ ==============================================================

IOCTL INTERFACE
IOCTL interface
---------------

The ioctl() calls supported by /dev/rtc are also supported by the RTC class
Loading