From patchwork Thu May 15 06:21:14 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sven Peter via B4 Relay X-Patchwork-Id: 890527 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BFB671CEAD6; Thu, 15 May 2025 06:22:14 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747290134; cv=none; b=uCfxXlHBMb+1rEUj5S/bK9cdJxQ5cgGDptUlKNrVoiWOC/kxCX0+7NxBkqNWYDzE+wtcXeHc8bVGQZLsJVwt+m4/l/Dx3zkwF6TBYyZPSmfPKWIHPoeNMQcjdYoUVOZQADFFJlzzIaXVk1bETRu+hIaWHs7Q6uTNyh0/SaT4r+Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1747290134; c=relaxed/simple; bh=L6jU3HkPzKiDD4GWaH3v8fxk1+c8tmtCkEiqjegdW4o=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=r4gCxLbdmFnbaq89LPwSWbXp1kzHG8xwBFOuwnmxFfHWz1+oUtStS7yUjQZP63a1puyrpEEZF9QmgE9d3JgUu/IwC9pU9/M4Fd8Elyh0CHtD6DFutV7+6X14YJavJLTt1bRE+7R4EJIPUCxMuoSFjjEQLE8Y7riDHyCIr5Yy0Ok= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=otz16wV5; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="otz16wV5" Received: by smtp.kernel.org (Postfix) with ESMTPS id 42165C4CEE9; Thu, 15 May 2025 06:22:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1747290134; bh=L6jU3HkPzKiDD4GWaH3v8fxk1+c8tmtCkEiqjegdW4o=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=otz16wV5TeiPdznWoarn0mILd4xc4YfpVO4bnNtgqmEwfIsDuPeC+ZFYldfrwx6eI FEJGwXLpZeKOPBGuWxn4RDgOONMOQPyTgDALcwEqLX7LOllopsN6fh6SccwDXpJyY1 QhoJFmVeupEnInBqluEf2ELtSJmdcBHCSxOqwoojdZn+1httuXT/fqgquX4SY+NBLE rPOeCgo6i6JYlPD4VuV6an+bRimv73JEVMnVTAJh4pYSyp5/SmrOPPaVNm32UzZM4a 3NgzhJ2Ax8cLqEbv0darKnwLzoLTRHfCyp7Ew8Ypbn55A9eSFj9U4WF0DqA0tTLflJ JhmNUztB+bDhg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 371D7C3DA6D; Thu, 15 May 2025 06:22:14 +0000 (UTC) From: Sven Peter via B4 Relay Date: Thu, 15 May 2025 06:21:14 +0000 Subject: [PATCH v6 02/10] dt-bindings: power: reboot: Add Apple Mac SMC Reboot Controller Precedence: bulk X-Mailing-List: linux-pm@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-Id: <20250515-smc-6-15-v6-2-c47b1ef4b0ae@svenpeter.dev> References: <20250515-smc-6-15-v6-0-c47b1ef4b0ae@svenpeter.dev> In-Reply-To: <20250515-smc-6-15-v6-0-c47b1ef4b0ae@svenpeter.dev> To: Sven Peter , Janne Grunau , Alyssa Rosenzweig , Neal Gompa , Hector Martin , Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Sebastian Reichel , Lee Jones , Marc Zyngier , "Russell King (Oracle)" Cc: asahi@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=2771; i=sven@svenpeter.dev; h=from:subject:message-id; bh=EZJ1MbR9nhGPRqj24o+bpu4vy+PDYAUMdMkr9TwOKZU=; b=owGbwMvMwCHmIlirolUq95LxtFoSQ4ZqB+fMf047oq43XepX5+vU07hgELOdfe+dFbaKWcXdx nan5O51lLIwiHEwyIopsmzfb2/65OEbwaWbLr2HmcPKBDKEgYtTACYiqs/IcE6j4qNU4JYVU+29 PGqj9y+4f3vhQrGPDSuurfxhoPvvlC/D//SAnK+rm7w7onN7Kqa+WWSokbaHL+TilBWm8381vX9 6kgUA X-Developer-Key: i=sven@svenpeter.dev; a=openpgp; fpr=A1E3E34A2B3C820DBC4955E5993B08092F131F93 X-Endpoint-Received: by B4 Relay for sven@svenpeter.dev/default with auth_id=167 X-Original-From: Sven Peter Reply-To: sven@svenpeter.dev From: Sven Peter On Apple Silicon machines a clean shutdown or reboot requires talking to SMC and writing to NVMEM cells. Add a binding for this MFD sub-device. Reviewed-by: Alyssa Rosenzweig Reviewed-by: Neal Gompa Reviewed-by: Rob Herring (Arm) Signed-off-by: Sven Peter --- .../bindings/power/reset/apple,smc-reboot.yaml | 40 ++++++++++++++++++++++ MAINTAINERS | 1 + 2 files changed, 41 insertions(+) diff --git a/Documentation/devicetree/bindings/power/reset/apple,smc-reboot.yaml b/Documentation/devicetree/bindings/power/reset/apple,smc-reboot.yaml new file mode 100644 index 0000000000000000000000000000000000000000..38d1b6ac9b813f278e1d6c25667cc7b4b0a56c57 --- /dev/null +++ b/Documentation/devicetree/bindings/power/reset/apple,smc-reboot.yaml @@ -0,0 +1,40 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/power/reset/apple,smc-reboot.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Apple SMC Reboot Controller + +description: + The Apple System Management Controller (SMC) provides reboot functionality + on Apple Silicon SoCs. It uses NVMEM cells to store and track various + system state information related to boot, shutdown, and panic events. + +maintainers: + - Sven Peter + +properties: + compatible: + const: apple,smc-reboot + + nvmem-cells: + items: + - description: Flag indicating shutdown (as opposed to reboot) + - description: Stage at which the boot process stopped (0x30 for normal boot) + - description: Counter for boot errors + - description: Counter for system panics + + nvmem-cell-names: + items: + - const: shutdown_flag + - const: boot_stage + - const: boot_error_count + - const: panic_count + +required: + - compatible + - nvmem-cells + - nvmem-cell-names + +additionalProperties: false diff --git a/MAINTAINERS b/MAINTAINERS index b53f3929b06006f9f38f5cda048516891c18c7ab..3f32d028ab49994a0da9f3882f37b9c3b183f5b4 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2281,6 +2281,7 @@ F: Documentation/devicetree/bindings/nvmem/apple,efuses.yaml F: Documentation/devicetree/bindings/pci/apple,pcie.yaml 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/spi/apple,spi.yaml F: Documentation/devicetree/bindings/watchdog/apple,wdt.yaml