From: Sven Peter <sven@kernel.org>
To: Sven Peter <sven@kernel.org>, Janne Grunau <j@jannau.net>,
Alyssa Rosenzweig <alyssa@rosenzweig.io>,
Neal Gompa <neal@gompa.dev>, Hector Martin <marcan@marcan.st>,
Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <brgl@bgdev.pl>,
Rob Herring <robh@kernel.org>,
Krzysztof Kozlowski <krzk+dt@kernel.org>,
Conor Dooley <conor+dt@kernel.org>,
Sebastian Reichel <sre@kernel.org>, Lee Jones <lee@kernel.org>,
Marc Zyngier <maz@kernel.org>,
"Russell King (Oracle)" <rmk+kernel@armlinux.org.uk>
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,
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Sebastian Reichel <sebastian.reichel@collabora.com>
Subject: [PATCH v7 00/10] Apple Mac System Management Controller
Date: Tue, 10 Jun 2025 15:29:41 +0000 [thread overview]
Message-ID: <20250610-smc-6-15-v7-0-556cafd771d3@kernel.org> (raw)
Hi,
This series adds support for the System Management Controller found in
Apple Silicon devices which we model as a mfd. It also includes support
for the GPIO block and the power/reset block as sub-devices.
Changes between v6 and v7:
- Rebased on 6.16-rc1
- Dropped mfd- prefix from the macsmc driver name
- Removed the check if the MBSE key exists in the reboot driver since
we can rely on the device tree now
- Changed my mail address to kernel.org
Changes between v5 and v6:
- Actually reorder struct members this time, start comments with an
uppercase letter, and use devm_ for mfd_register_devices instead of
dropping those fixup commits by accident
- Stefan's comment: Renamed ret to bfr in the reboot driver
- Sebastian's comments on the reboot driver:
- Moved Kconfig dependencies to MFD device and made reboot only
depend on that one
- Removed sysfs file to configure "reboot after power loss" for now
since this probably belongs in a userspace tool that directly
writes to nvmem instead
- Dropped setting pdev->dev.of_node since that's already done
automatically and adjusted #include to linux/mod_devicetable.h
- Dropped MODULE_ALIAS which was probably a leftover from a previous
version that did not use of_match_table
- Rob's comments to the dt-bindings
- Removed examples from sub-devices and added them to the main smc
binding
- Removed a spurious |
Changes between v4 and v5:
- Alyssa's comments:
- Made the WARN_ON in the reboot driver more obvious
- Added missing brackets around a for loop in the reboot driver
- Used min instead of open-coded variant inside the gpio driver
- Reoder struct memebers to prevent padding inside the mfd driver
- Lee's comments:
- All comments now start with an uppercase letter
- Removed apple_smc_read_ioft_scaled and apple_smc_read_f32_scaled
since these are not yet used and likely don't belong into
drivers/mfd
- Relaced if (ret != 0) with if (ret) when possible
- Used devm_platform_get_and_ioremap_resource to get and map the
SRAM resource
- Used reverse Christmas-tree formating when declaring variables
- Dropped _platform left-overs from probe and remove functions
- Removed dev_dbg prints which are no long required after
development
- Reworked is_alive/is_initialized so that it's obvious how errors
during boot are propagated from the callback to the probe function
- Used dev_warn instead of dev_err in a few places
- Removed no-op apple_smc_rtkit_shmem_destroy; this required an
additional change in rtkit.c because we had a check there that's a
bit too strict
- Removed struct resource in apple_smc_rtkit_shmem_setup and
open-coded resource_contains instead
- Unwrapped lines with less than 100 chars
- Made sure to compile with W=1 and ran scripts/kernel-doc -v
on macsmc.h once and fixed any fallout
- Removed first_key/last_key from struct smc and moved
apple_smc_find_first_key_index to the gpio driver since it's only
used there anyway to find the index of the first GPIO key (gP00)
- Return -EIO when a command fails instead of whatever SMC returns
which does not map to Linux errnos on errors
Changes between v3 and v4:
- Added documentation for all functions and structs
- Fixed dt-bindings and re-ordered commits so that the mfd one comes
last and can include the gpio subdevice
- Added the reset driver and corresponding bindings
- Reworked the atomic mode inside SMC since the previous implementation
called mutex_lock from atomic context
- Removed the backend split for now which lead to a quite intense discussion
for the previous versions which hadn't been solved as far as I could tell
from the old threads.
It's also been 2+ years and I haven't heard of any backend implementation
for T2 or even older macs. It's also unclear to me which sub-devices
are actually useful there because at least GPIO and shutdown/reboot
from this series will not work as-is there.
I'd rather have this initial version which only supports M1+ macs upstream
and then iterate there if any other backend is developed.
I'll gladly help to re-introduce backend support if it's ever required.
v6: https://lore.kernel.org/asahi/20250515-smc-6-15-v6-0-c47b1ef4b0ae@svenpeter.dev/
v5: https://lore.kernel.org/asahi/20250511-smc-6-15-v5-0-f5980bdb18bd@svenpeter.dev/
v4: https://lore.kernel.org/asahi/20250503-smc-6-15-v4-0-500b9b6546fc@svenpeter.dev/
v3: https://lore.kernel.org/asahi/Y2qEpgIdpRTzTQbN@shell.armlinux.org.uk/
v2: https://lore.kernel.org/asahi/YxdInl2qzQWM+3bs@shell.armlinux.org.uk/
v1: https://lore.kernel.org/asahi/YxC5eZjGgd8xguDr@shell.armlinux.org.uk/
Best,
Sven
---
Hector Martin (5):
gpio: Add new gpio-macsmc driver for Apple Macs
power: reset: macsmc-reboot: Add driver for rebooting via Apple SMC
arm64: dts: apple: t8103: Add SMC node
arm64: dts: apple: t8112: Add SMC node
arm64: dts: apple: t600x: Add SMC node
Russell King (Oracle) (2):
dt-bindings: gpio: Add Apple Mac SMC GPIO block
dt-bindings: mfd: Add Apple Mac System Management Controller
Sven Peter (3):
dt-bindings: power: reboot: Add Apple Mac SMC Reboot Controller
soc: apple: rtkit: Make shmem_destroy optional
mfd: Add Apple Silicon System Management Controller
.../devicetree/bindings/gpio/apple,smc-gpio.yaml | 29 ++
.../devicetree/bindings/mfd/apple,smc.yaml | 79 ++++
.../bindings/power/reset/apple,smc-reboot.yaml | 40 ++
MAINTAINERS | 7 +
arch/arm64/boot/dts/apple/t600x-die0.dtsi | 35 ++
arch/arm64/boot/dts/apple/t8103.dtsi | 35 ++
arch/arm64/boot/dts/apple/t8112.dtsi | 35 ++
drivers/gpio/Kconfig | 10 +
drivers/gpio/Makefile | 1 +
drivers/gpio/gpio-macsmc.c | 292 ++++++++++++
drivers/mfd/Kconfig | 18 +
drivers/mfd/Makefile | 1 +
drivers/mfd/macsmc.c | 498 +++++++++++++++++++++
drivers/power/reset/Kconfig | 9 +
drivers/power/reset/Makefile | 1 +
drivers/power/reset/macsmc-reboot.c | 290 ++++++++++++
drivers/soc/apple/rtkit.c | 3 +-
include/linux/mfd/macsmc.h | 279 ++++++++++++
18 files changed, 1660 insertions(+), 2 deletions(-)
---
base-commit: 19272b37aa4f83ca52bdf9c16d5d81bdd1354494
change-id: 20250304-smc-6-15-f0ed619e31d4
Best regards,
--
Sven Peter <sven@kernel.org>
next reply other threads:[~2025-06-10 16:10 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-10 15:29 Sven Peter [this message]
2025-06-10 15:29 ` [PATCH v7 01/10] dt-bindings: gpio: Add Apple Mac SMC GPIO block Sven Peter
2025-06-10 15:29 ` [PATCH v7 02/10] dt-bindings: power: reboot: Add Apple Mac SMC Reboot Controller Sven Peter
2025-06-10 15:29 ` [PATCH v7 03/10] dt-bindings: mfd: Add Apple Mac System Management Controller Sven Peter
2025-06-10 15:29 ` [PATCH v7 04/10] soc: apple: rtkit: Make shmem_destroy optional Sven Peter
2025-06-10 15:29 ` [PATCH v7 05/10] mfd: Add Apple Silicon System Management Controller Sven Peter
2025-06-19 11:49 ` Lee Jones
2025-06-21 15:51 ` Sven Peter
2025-06-22 0:50 ` Sebastian Reichel
2025-06-24 15:53 ` Lee Jones
2025-07-19 12:57 ` Sven Peter
2025-06-10 15:29 ` [PATCH v7 06/10] gpio: Add new gpio-macsmc driver for Apple Macs Sven Peter
2025-07-19 12:59 ` Sven Peter
2025-07-19 15:41 ` Linus Walleij
2025-07-19 15:52 ` Bartosz Golaszewski
2025-07-20 12:11 ` Sven Peter
2025-06-10 15:29 ` [PATCH v7 07/10] power: reset: macsmc-reboot: Add driver for rebooting via Apple SMC Sven Peter
2025-06-16 4:13 ` Nick Chan
2025-06-21 15:47 ` Sven Peter
2025-07-23 8:06 ` Lee Jones
2025-07-23 8:09 ` Lee Jones
2025-07-24 6:08 ` Sven Peter
2025-06-10 15:29 ` [PATCH v7 08/10] arm64: dts: apple: t8103: Add SMC node Sven Peter
2025-06-10 15:29 ` [PATCH v7 09/10] arm64: dts: apple: t8112: " Sven Peter
2025-06-10 15:29 ` [PATCH v7 10/10] arm64: dts: apple: t600x: " Sven Peter
2025-07-19 12:54 ` (subset) [PATCH v7 00/10] Apple Mac System Management Controller Sven Peter
2025-07-24 8:48 ` Lee Jones
2025-07-24 10:25 ` [GIT PULL] Immutable branch between MFD, GPIO, Power and SoC due for the v6.17 merge window Lee Jones
2025-08-10 18:25 ` (subset) [PATCH v7 00/10] Apple Mac System Management Controller Sven Peter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250610-smc-6-15-v7-0-556cafd771d3@kernel.org \
--to=sven@kernel.org \
--cc=alyssa@rosenzweig.io \
--cc=asahi@lists.linux.dev \
--cc=brgl@bgdev.pl \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=j@jannau.net \
--cc=krzk+dt@kernel.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=lee@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=marcan@marcan.st \
--cc=maz@kernel.org \
--cc=neal@gompa.dev \
--cc=rmk+kernel@armlinux.org.uk \
--cc=robh@kernel.org \
--cc=sebastian.reichel@collabora.com \
--cc=sre@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®