Skip to content

Commit 5b1173b

Browse files
svenpeter42jannau
authored andcommitted
dt-bindings: rtc: Add Apple SMC RTC
Apple Silicon Macs (M1, etc.) have an RTC that is part of the PMU IC, but most of the PMU functionality is abstracted out by the SMC. An additional RTC offset stored inside NVMEM is required to compute the current date/time. Reviewed-by: Mark Kettenis <kettenis@openbsd.org> Reviewed-by: Neal Gompa <neal@gompa.dev> Reviewed-by: Rob Herring (Arm) <robh@kernel.org> Signed-off-by: Sven Peter <sven@kernel.org> Signed-off-by: James Calligeros <jcalligeros99@gmail.com> Reviewd-by: Mark Kettenis <kettenis@openbsd.org>
1 parent e5f0a69 commit 5b1173b

3 files changed

Lines changed: 45 additions & 0 deletions

File tree

Documentation/devicetree/bindings/mfd/apple,smc.yaml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,9 @@ properties:
4141
reboot:
4242
$ref: /schemas/power/reset/apple,smc-reboot.yaml
4343

44+
rtc:
45+
$ref: /schemas/rtc/apple,smc-rtc.yaml
46+
4447
additionalProperties: false
4548

4649
required:
@@ -75,5 +78,11 @@ examples:
7578
nvmem-cell-names = "shutdown_flag", "boot_stage",
7679
"boot_error_count", "panic_count";
7780
};
81+
82+
rtc {
83+
compatible = "apple,smc-rtc";
84+
nvmem-cells = <&rtc_offset>;
85+
nvmem-cell-names = "rtc_offset";
86+
};
7887
};
7988
};
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2+
%YAML 1.2
3+
---
4+
$id: http://devicetree.org/schemas/rtc/apple,smc-rtc.yaml#
5+
$schema: http://devicetree.org/meta-schemas/core.yaml#
6+
7+
title: Apple SMC RTC
8+
9+
description:
10+
Apple Silicon Macs (M1, etc.) have an RTC that is part of the PMU IC,
11+
but most of the PMU functionality is abstracted out by the SMC.
12+
An additional RTC offset stored inside NVMEM is required to compute
13+
the current date/time.
14+
15+
maintainers:
16+
- Sven Peter <sven@kernel.org>
17+
18+
properties:
19+
compatible:
20+
const: apple,smc-rtc
21+
22+
nvmem-cells:
23+
items:
24+
- description: 48bit RTC offset, specified in 32768 (2^15) Hz clock ticks
25+
26+
nvmem-cell-names:
27+
items:
28+
- const: rtc_offset
29+
30+
required:
31+
- compatible
32+
- nvmem-cells
33+
- nvmem-cell-names
34+
35+
additionalProperties: false

MAINTAINERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2395,6 +2395,7 @@ F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml
23952395
F: Documentation/devicetree/bindings/power/apple*
23962396
F: Documentation/devicetree/bindings/power/reset/apple,smc-reboot.yaml
23972397
F: Documentation/devicetree/bindings/pwm/apple,s5l-fpwm.yaml
2398+
F: Documentation/devicetree/bindings/rtc/apple,smc-rtc.yaml
23982399
F: Documentation/devicetree/bindings/spi/apple,spi.yaml
23992400
F: Documentation/devicetree/bindings/spmi/apple,spmi.yaml
24002401
F: Documentation/devicetree/bindings/watchdog/apple,wdt.yaml

0 commit comments

Comments
 (0)