Skip to content

Commit 0704918

Browse files
svenpeter42alexandrebelloni
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> Link: https://patch.msgid.link/20251112-macsmc-subdevs-v5-1-728e4b91fe81@gmail.com Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
1 parent 40d8123 commit 0704918

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
@@ -46,6 +46,9 @@ properties:
4646
reboot:
4747
$ref: /schemas/power/reset/apple,smc-reboot.yaml
4848

49+
rtc:
50+
$ref: /schemas/rtc/apple,smc-rtc.yaml
51+
4952
additionalProperties: false
5053

5154
required:
@@ -80,5 +83,11 @@ examples:
8083
nvmem-cell-names = "shutdown_flag", "boot_stage",
8184
"boot_error_count", "panic_count";
8285
};
86+
87+
rtc {
88+
compatible = "apple,smc-rtc";
89+
nvmem-cells = <&rtc_offset>;
90+
nvmem-cell-names = "rtc_offset";
91+
};
8392
};
8493
};
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
@@ -2435,6 +2435,7 @@ F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml
24352435
F: Documentation/devicetree/bindings/power/apple*
24362436
F: Documentation/devicetree/bindings/power/reset/apple,smc-reboot.yaml
24372437
F: Documentation/devicetree/bindings/pwm/apple,s5l-fpwm.yaml
2438+
F: Documentation/devicetree/bindings/rtc/apple,smc-rtc.yaml
24382439
F: Documentation/devicetree/bindings/spi/apple,spi.yaml
24392440
F: Documentation/devicetree/bindings/spmi/apple,spmi.yaml
24402441
F: Documentation/devicetree/bindings/watchdog/apple,wdt.yaml

0 commit comments

Comments
 (0)