Repository navigation
mfd: macsmc: T6050 power, reboot, RTC and sensors, and ac_power_mode - #941
Conversation
87e244a to
ae0ce64
Compare
DjDeveloperr
left a comment
There was a problem hiding this comment.
Works on the M5 Pro (MacBook Pro 14", J714sAP, T6050), bare metal. This head (ae0ce64), three boots:
- RTC: macsmc-rtc is rtc0, sets the system clock, and reads the right time.
- Reboot:
reboot -fgivesPreparing for reboot (rest),Preparing SMC for atomic modeandIssuing restart (phra), and the machine restarts (the debug link drops within a second). - ac_power_mode: present, since the T6050 DT gives the reboot node its pm_setting cell. It reads
off restore [always], and writingrestore, thenalways, reads back each time. I left it as found. - Power and sensors: macsmc-ac (online), macsmc-battery (Full, 100), 277 hwmon inputs, macsmc-gpio, and the lid/power input.
Not tested: poweroff (this rig can't power the machine back on).
Merge note: this head conflicts with current integration/aurora in apple,smc-pcio-gpio.yaml, apple,smc.yaml, gpio-macsmc.c and macsmc.c. Integration has d19e2e0's and 962c176's pcIO binding and newer macsmc changes. For the test I resolved them keeping both sides.
RyanTheTide
left a comment
There was a problem hiding this comment.
This conflicts with current integration/aurora in the apple,smc and apple,smc-pcio-gpio bindings, drivers/gpio/gpio-macsmc.c and drivers/mfd/macsmc.c (the T6050 compatibles added in e0b7106 and later). Could you rebase it? No CI has run on this branch yet; the push after the rebase will run dt-checks and the host tests.
Add the T6050 SMC consumer profile, described pcIO GPIO outputs, power-supply identity sizing, and charging policy. Preserve the newer shared SRAM accessor and metadata serialization. Source snapshot: t6050-gpu ee68abb105200e99636a5edfc647a5cfc1d89954 Integration base: 9cbdd07 Signed-off-by: Dj <hey@djdev.me> Signed-off-by: Erik Bourget <erik@ebourget.net>
The T6050 profile (Aurora's t6050/smc) registers input, power and hwmon only, so a T6050 kernel that owns the machine (J775D on bare metal) had no SMC restart or power-off and no RTC: poweroff halted Linux and left the machine on. Add macsmc-reboot and macsmc-rtc to the T6050 profile as cells that are registered only where the device tree has their child node, the rule the pcIO outputs and the second GPIO bank already follow; those two blocks become one table and one helper. A T6050 device tree without reboot or rtc children registers exactly what it did, and other SMCs are unchanged (same cells in the same order; the registration failure messages now name the cell). Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Erik Bourget <erik@ebourget.net>
apple,soc-die-keys adds a "SoC die <key>" channel per listed key for the macsmc_soc_die zone, and apple,discover-temperatures refuses to run once any temperature channel exists, so a machine that discovers its temperatures (T8142, J775D) could not have the zone: the probe failed with -EINVAL. With discovery, a listed key now adds no channel; the channel discovery creates for it (labelled with the key) is marked for the zone instead. Machines that set only one of the two properties are unchanged. Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Erik Bourget <erik@ebourget.net>
Expose the PMU's power-on policy byte as the ac_power_mode attribute Asahi's downstream driver had, with a third mode. The byte has two policy bits: bit 0 keeps the machine off when power returns after a loss, bit 5 keeps it off when power is connected. Asahi's driver wrote the whole byte (0x02 restore, 0x03 off), which clears bit 5: on machines whose PMU powers on at connect that write means "always", the opposite of "off". Change only the two bits and leave the rest to the PMU: off bit 0 and bit 5 set restore bit 5 set, bit 0 clear always bit 5 clear (bit 0 set) The pm_setting cell is optional; the attribute appears only with it. The binding takes it as a fifth cell, as the t600x/t602x device trees already list it. Based on Asahi's ac_power_mode (marcan). Signed-off-by: Jeff Queisser <funkzy@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Erik Bourget <erik@ebourget.net>
|
Rebased onto integration/aurora (8d98b7a), as asked in the review. The old head ae0ce64 is kept as What changed in the conflict resolution (
On this head, 🤖 Generated with Claude Code |
ae0ce64 to
4d11bfd
Compare
|
Retested before merging on the M5 Pro (J714sAP, bare metal, SSD boot), kernel 7.3.0-m5-merge: the M5's integration kernel with this round's rebased heads in place of the old ones (every PR's own patch identical to what is merged; logs in work/m5-pr-merge-20261109). CI green. Before merging, this round (these 14 PRs, #1323 and the rebased #1254/#1306/#938/#1316/#1199) was test-merged in order onto integration/aurora f9cf6f9 with no conflicts:
🤖 Generated with Claude Code |
On T6050 the SMC only registered input, power and hwmon, so a kernel that owns the machine had no restart, power-off or RTC: poweroff halted Linux and left the machine on.
macsmc-reboot'sac_power_modeattribute, changing only the PMU's two policy bits: off, restore, and on at connect.Commits by Dj and Jeff Queisser. On J716c (MacBook Pro 16-inch, M5 Max) this runs as part of the full T6050 stack (
j716c/t6050-platform): the machine boots to userspace from NVMe with all 18 CPUs, N1 Wi-Fi up and CPU frequency scaling active.Created with Claude Opus 5.5 in Claude Code.