Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions drivers/pmdomain/apple/pmgr-pwrstate.c
Original file line number Diff line number Diff line change
Expand Up @@ -854,12 +854,14 @@ static int apple_pmgr_ps_probe(struct platform_device *pdev)

t8132 = of_device_is_compatible(node, "apple,t8132-pmgr-pwrstate");
/*
* On the M4 firmware path some domains are the firmware's, which Linux
* cannot access. The early compatibility adapter supplies the explicit
* status and ownership before population; fail closed if it was not
* enabled. Other firmware keeps the tree's own domain descriptions.
* Some T8132 power states are the firmware's, which Linux cannot
* access. The platform handoff supplies the explicit status and
* ownership of every one before population, on any firmware: fail
* closed on a state it did not mark. A kernel built without the
* handoff keeps the tree's own domain descriptions.
*/
if (t8132 && apple_t8132_firmware_path() && !of_property_present(node, "status"))
if (t8132 && IS_ENABLED(CONFIG_APPLE_T8132_PLATFORM_HANDOFF) &&
!of_property_present(node, "status"))
return dev_err_probe(dev, -ENODEV, "missing M4 power-domain policy\n");

tvm = of_parse_phandle(node, "power-domains", 0);
Expand Down
12 changes: 7 additions & 5 deletions drivers/soc/apple/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -285,11 +285,13 @@ config APPLE_T8132_PLATFORM_HANDOFF
depends on OF_DYNAMIC && OF_FLATTREE
default y if APPLE_PMP
help
Supply missing cache and PMC descriptions, and the J713 board's PMGR
availability/ownership policy, for the original loader tree before devices
are populated. Native memory-controller descriptions take precedence.
Required for that legacy tree to keep inaccessible PMGR domains from
probing; kernels using the complete J713 DT do not require this adapter.
Supply missing cache and PMC descriptions for the original J713
loader tree, and the T8132 PMGR availability/ownership policy for
every T8132 tree, before devices are populated. Native
memory-controller descriptions take precedence. Required to keep
PMGR domains the firmware owns from being switched. With it, a T8132
power state it could not mark is not registered; without it every
T8132 power state is registered as the tree describes it.

config APPLE_T8132_PLATFORM_KUNIT_TEST
tristate "KUnit tests for T8132 platform descriptions" if !KUNIT_ALL_TESTS
Expand Down
6 changes: 3 additions & 3 deletions drivers/soc/apple/t8132-platform-handoff.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only OR MIT
/* Supply missing platform descriptions for the original J713 loader ABI,
* which the J715 shares, and the M4 PMGR ownership policy on the qualified
* firmware for every M4 Mac.
* which the J715 shares, and the M4 PMGR ownership policy for every T8132
* tree: the policy describes the SoC's power manager, whatever the firmware.
* Keep the shared m1n1 payload usable by the stable kernel. Hardware control
* remains in the ordinary MCC, PMC and CLPC drivers, with one DTS data source.
* J713 PMGR ownership/status also comes from its board DTS, before any domain
Expand Down Expand Up @@ -319,7 +319,7 @@ static int __init t8132_platform_handoff(void)
unsigned int added = 0, changed = 0;
int root, node, ret;

if (!apple_t8132_firmware_path() || !of_machine_is_compatible("apple,t8132"))
if (!of_machine_is_compatible("apple,t8132"))
return 0;
if (fdt_check_header(data))
return -EINVAL;
Expand Down
7 changes: 4 additions & 3 deletions include/linux/soc/apple/t8132.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,10 @@ static inline bool apple_t8132_pro_mini_imac(void)
}

/*
* The OS firmware the M4 PMP, PMGR ownership, display and GPU paths are
* qualified on, as the boot loader reports it: macOS 26.6.2 (iBoot
* mBoot-18000.161.10). These paths depend on the firmware, not the board.
* The OS firmware the M4 PMP, display and GPU paths are qualified on, as
* the boot loader reports it: macOS 26.6.2 (iBoot mBoot-18000.161.10).
* These paths depend on the firmware, not the board. The PMGR ownership
* policy does not: the platform handoff applies it on any firmware.
*/
static inline bool apple_t8132_qualified_firmware(void)
{
Expand Down
Loading