From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f169.google.com (mail-pf1-f169.google.com [209.85.210.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 902D62D9EE4 for ; Tue, 7 Oct 2025 11:17:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.169 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759835849; cv=none; b=aOd3SepPas1pcB5WrcbNHVsCfQ7NgzGMRUaYUKHXS8LenKJfMooNzI7Bmg+rMEKOnyFw/drcECss8qnt1P7ODuUmi2RhXXxwdmqhMx+NKR2SmL8pMJH+qjnLzKPnpOgkLp45rvotvu2MuGtenEK13uw1KwVjo3rP3DTYqXVjNJI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759835849; c=relaxed/simple; bh=doc6D/qsvutmJbzXvdZDYSYz0ZxXLQM+iyKROYiaouk=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=Ki05SHAPERMvmB01vFEh5TtJiMA3qGuIaOggqmI+wCzsa7GFILr0elgDwC64OdNjOBVPQUpitHvyM3udWyXf7cdqRVbY0Lrpnp7IhQoxwyEx++lxY6mHhnX4XbZlh6/E7aVRAjzrWnUix8gOTHyXT9ppwmcbxYVqB9rAOGP4bTk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=KYBH3HH+; arc=none smtp.client-ip=209.85.210.169 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="KYBH3HH+" Received: by mail-pf1-f169.google.com with SMTP id d2e1a72fcca58-76e4fc419a9so5669725b3a.0 for ; Tue, 07 Oct 2025 04:17:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1759835847; x=1760440647; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=Wae5anKN9hvFHOBxJWNDxfF+UZ1MN51bIQyhwDOYr8M=; b=KYBH3HH+7C+9XtJq+ei87qEBhzeYDF1fyjlcZv1D9vKzLp5uVNT8kqe3aX4XYphBw0 B19bNN2uHydat7igSwa1S+NXKVgStZm5agyCZaWlVTcac9vgUUxLxhNZ6aZVtg0/bief gWFOYZYWfUA4HvQX/goAwCPeBZQuSLv5aw5DK0nivchfIpo+y4rEOYK1rH9LJPEktiZf REovMpnQYIuhSbdjtuHhoiHQZn0CksKqzerF0yhOinAjX6uYnFcUblI3fulX5SNNaBhP sya/BdfbomccBzw3i7VUizL93Sxnhp+KVEeaJE4ZZ+JhubYtNXMBcNlLs46Uohd+iMrx m82w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1759835847; x=1760440647; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Wae5anKN9hvFHOBxJWNDxfF+UZ1MN51bIQyhwDOYr8M=; b=IXA3SdNoWGY6u7ZUdxowzcJ80X6CyTL4/IPaKxfw3hGAD7tmWGfn2+/s8D3zLDyNsu hObVoTqyT6PrDyr5foexxraNudiZxCRljPxuzUIO7P21OrnCq/VWln5N+kpUI9xOX+eJ z2Dha2+7EP7Nop87OJmip+c0T5eeKhB/Fnl/bH9Rf8BmS3KrW6SAFL6JHDGomAtnfgz5 RqXZW53F1Js0flhRrV9X6CRCo8gPKbzKYQFp7CLyY/OWIGzQbIkknFmqm3Gt8fpxknu0 nFM1CiQg3oyi4lljPvhIVP1nsJRBpPHdpoM3gYWzWlrQDdBSQOprre0elJJ41VWJkyw5 wSpw== X-Forwarded-Encrypted: i=1; AJvYcCXevOTYkO+ePhJURDehOnfeCraCNuhY+tfBHpGzQXJC3u3/sWHzm5eQIO0tbFtvBZKvTmk1SnJ9LopqUA==@vger.kernel.org X-Gm-Message-State: AOJu0YyITtCJcHNNFi/eCdU6G545OmLcSPTpfBHt1tdRoyg0V4ox6QBd 9v+lsNOOmlGoBtEKokCQHlZ3eMvo/Rhsu1xgtiDtoxu6Kx+5ov+T9BX3 X-Gm-Gg: ASbGncv+VAdx+ik8EydjlnVCGLIegJjhLgeihtd8GTH2z3ngr7bGQEYrhFqNl36bQQK JohetWxbZ1RmrVeuDoV5ZU2y3sqISs+tb95hrT3vAw1ZlPuAOFdOgwvnP6nvGAaZraRpABt1arr OCWhYjuchKmP+85pWxpgd8uPeaFqD2TZ/1lzQBizwhcqSOlNtDz0bKcKDbVZ7YcBjYAJdk/0+0M cKGk0Cfw45rORAc6WxSiU0rDL/2UTeXe8HLwzfDbzTpFEPKicBq3K3xSSddAZa2BA1eXoi9aGT7 ZTi36SEtb2Fn/0HDszfYhl2r21MvmVTj5WIguoH+2STPh30sBcfYVPy9y4IskLKIGHlJqqULbAR W6ijxhHMMh/sUi71Txm2DXtVYTGzMWSHIRF/oIdDUAmixxfCzghDrWtw7KnOxWRNUeqqil6ybns VcsaEcbLT7qIAbcL75wuGtEGaLpRqeIJqikmGk1Krfm2eA06AFW2e4 X-Google-Smtp-Source: AGHT+IG1/90ALl9Mh5f9pXLacMmG46KttwU7NHyQlkZh6ZDWb9gcUbDfJoG6/1tlU82jvfGzXcd/lA== X-Received: by 2002:a17:903:2409:b0:27e:e96a:4c3 with SMTP id d9443c01a7336-28e9a54423bmr206081935ad.14.1759835846628; Tue, 07 Oct 2025 04:17:26 -0700 (PDT) Received: from [192.168.2.3] (2403-580a-80ed-0-4835-5a07-49e7-f115.ip6.aussiebb.net. [2403:580a:80ed:0:4835:5a07:49e7:f115]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-28e8d1d31bdsm162509045ad.94.2025.10.07.04.17.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 Oct 2025 04:17:26 -0700 (PDT) From: James Calligeros Date: Tue, 07 Oct 2025 21:16:42 +1000 Subject: [PATCH v3 01/13] dt-bindings: rtc: Add Apple SMC RTC Precedence: bulk X-Mailing-List: linux-hwmon@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20251007-macsmc-subdevs-v3-1-d7d3bfd7ae02@gmail.com> References: <20251007-macsmc-subdevs-v3-0-d7d3bfd7ae02@gmail.com> In-Reply-To: <20251007-macsmc-subdevs-v3-0-d7d3bfd7ae02@gmail.com> To: Sven Peter , Janne Grunau , Alyssa Rosenzweig , Neal Gompa , Lee Jones , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Alexandre Belloni , Jean Delvare , Guenter Roeck , Dmitry Torokhov , Jonathan Corbet , James Calligeros Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rtc@vger.kernel.org, linux-hwmon@vger.kernel.org, linux-input@vger.kernel.org, linux-doc@vger.kernel.org, Mark Kettenis X-Mailer: b4 0.14.3 X-Developer-Signature: v=1; a=openpgp-sha256; l=3352; i=jcalligeros99@gmail.com; h=from:subject:message-id; bh=mFOSrinm6mR52T1DXQZDpIdEAeTd/TshZKSbr4XqCgw=; b=owGbwMvMwCV2xczoYuD3ygTG02pJDBlPvm1xdA/gnmZ+44Kh2IUJTdH+HyTemF9jmuURksUgv miFAfe/jlIWBjEuBlkxRZYNTUIes43YbvaLVO6FmcPKBDKEgYtTACbiv5zhD8+iukt/cr9KVxVI f541I+h7vctLgXnBV0/e/eRWMmvKiUuMDF/LG37N9Xz0pudB47fOyN/J/A5Fzhu93opzNfzgT09 1ZgcA X-Developer-Key: i=jcalligeros99@gmail.com; a=openpgp; fpr=B08212489B3206D98F1479BDD43632D151F77960 From: Sven Peter 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 Reviewed-by: Neal Gompa Reviewed-by: Rob Herring (Arm) Signed-off-by: Sven Peter Signed-off-by: James Calligeros --- .../bindings/mfd/apple,smc.yaml | 9 +++++++ .../bindings/rtc/apple,smc-rtc.yaml | 35 +++++++++++++++++++++++++ MAINTAINERS | 1 + 3 files changed, 45 insertions(+) diff --git a/Documentation/devicetree/bindings/mfd/apple,smc.yaml b/Documentation/devicetree/bindings/mfd/apple,smc.yaml index 5429538f7e2e..0410e712c900 100644 --- a/Documentation/devicetree/bindings/mfd/apple,smc.yaml +++ b/Documentation/devicetree/bindings/mfd/apple,smc.yaml @@ -46,6 +46,9 @@ properties: reboot: $ref: /schemas/power/reset/apple,smc-reboot.yaml + rtc: + $ref: /schemas/rtc/apple,smc-rtc.yaml + additionalProperties: false required: @@ -80,5 +83,11 @@ examples: nvmem-cell-names = "shutdown_flag", "boot_stage", "boot_error_count", "panic_count"; }; + + rtc { + compatible = "apple,smc-rtc"; + nvmem-cells = <&rtc_offset>; + nvmem-cell-names = "rtc_offset"; + }; }; }; diff --git a/Documentation/devicetree/bindings/rtc/apple,smc-rtc.yaml b/Documentation/devicetree/bindings/rtc/apple,smc-rtc.yaml new file mode 100644 index 000000000000..607b610665a2 --- /dev/null +++ b/Documentation/devicetree/bindings/rtc/apple,smc-rtc.yaml @@ -0,0 +1,35 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/rtc/apple,smc-rtc.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SMC RTC + +description: + 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. + +maintainers: + - Sven Peter + +properties: + compatible: + const: apple,smc-rtc + + nvmem-cells: + items: + - description: 48bit RTC offset, specified in 32768 (2^15) Hz clock ticks + + nvmem-cell-names: + items: + - const: rtc_offset + +required: + - compatible + - nvmem-cells + - nvmem-cell-names + +additionalProperties: false diff --git a/MAINTAINERS b/MAINTAINERS index b45db73e55df..745d85b66365 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2435,6 +2435,7 @@ F: Documentation/devicetree/bindings/pinctrl/apple,pinctrl.yaml F: Documentation/devicetree/bindings/power/apple* F: Documentation/devicetree/bindings/power/reset/apple,smc-reboot.yaml F: Documentation/devicetree/bindings/pwm/apple,s5l-fpwm.yaml +F: Documentation/devicetree/bindings/rtc/apple,smc-rtc.yaml F: Documentation/devicetree/bindings/spi/apple,spi.yaml F: Documentation/devicetree/bindings/spmi/apple,spmi.yaml F: Documentation/devicetree/bindings/watchdog/apple,wdt.yaml -- 2.51.0