diff --git a/Documentation/devicetree/bindings/cpu/apple,t8140-cpuidle.yaml b/Documentation/devicetree/bindings/cpu/apple,t8140-cpuidle.yaml index 2a66141be3187..9ffa89ece40cd 100644 --- a/Documentation/devicetree/bindings/cpu/apple,t8140-cpuidle.yaml +++ b/Documentation/devicetree/bindings/cpu/apple,t8140-cpuidle.yaml @@ -4,13 +4,13 @@ $id: http://devicetree.org/schemas/cpu/apple,t8140-cpuidle.yaml# $schema: http://devicetree.org/meta-schemas/core.yaml# -title: Apple T6040 and T8140 CPU idle controller +title: Apple T6040, T8132 and T8140 CPU idle controller maintainers: - Ryan Murray description: - Selects the Apple CPU idle driver on T6040 and T8140 systems. On these + Selects the Apple CPU idle driver on T6040, T8132 and T8140 systems. On these SoCs the hardware decides when an idle core is power-gated after WFI; software cannot request core or cluster power-down, so WFI is the only idle state. @@ -22,6 +22,7 @@ properties: compatible: enum: - apple,t6041-cpuidle + - apple,t8132-cpuidle - apple,t8140-cpuidle required: diff --git a/arch/arm64/boot/dts/apple/t8132-j713.dts b/arch/arm64/boot/dts/apple/t8132-j713.dts index d878b72fd39ba..5345eb9c56f50 100644 --- a/arch/arm64/boot/dts/apple/t8132-j713.dts +++ b/arch/arm64/boot/dts/apple/t8132-j713.dts @@ -65,6 +65,10 @@ status = "okay"; }; +&cpuidle { + status = "okay"; +}; + &qspi { status = "okay"; diff --git a/arch/arm64/boot/dts/apple/t8132.dtsi b/arch/arm64/boot/dts/apple/t8132.dtsi index c82816625efd0..56dfd12d88233 100644 --- a/arch/arm64/boot/dts/apple/t8132.dtsi +++ b/arch/arm64/boot/dts/apple/t8132.dtsi @@ -17,6 +17,11 @@ #address-cells = <2>; #size-cells = <2>; + cpuidle: cpuidle { + compatible = "apple,t8132-cpuidle"; + status = "disabled"; + }; + cpus { #address-cells = <2>; #size-cells = <0>; diff --git a/drivers/cpuidle/cpuidle-apple.c b/drivers/cpuidle/cpuidle-apple.c index 7a53c01792662..896b92440ec79 100644 --- a/drivers/cpuidle/cpuidle-apple.c +++ b/drivers/cpuidle/cpuidle-apple.c @@ -124,16 +124,19 @@ static struct cpuidle_driver apple_idle_driver = { static int apple_cpuidle_probe(struct platform_device *pdev) { - bool t604x = of_device_is_compatible(pdev->dev.of_node, "apple,t6041-cpuidle"); + struct device_node *np = pdev->dev.of_node; + bool wfi_only = of_device_is_compatible(np, "apple,t6041-cpuidle") || + of_device_is_compatible(np, "apple,t8132-cpuidle"); /* * CPU PD writes CYC_OVRD, which is an undefined instruction on - * T8140. Its WFI already lets the hardware power-gate idle - * secondary cores, so both entries must use WFI. Keep index 1: - * the generic s2idle selector skips fallback index 0, otherwise - * tick_freeze() and timekeeping suspension are never reached. + * T8140 and the M4 SoCs (T6041, T8132). Their WFI already lets + * the hardware power-gate idle cores, so both entries must use + * WFI. Keep index 1: the generic s2idle selector skips fallback + * index 0, otherwise tick_freeze() and timekeeping suspension are + * never reached. */ - if (of_machine_is_compatible("apple,t8140") || t604x) + if (of_machine_is_compatible("apple,t8140") || wfi_only) apple_idle_driver.states[STATE_PWRDOWN] = apple_idle_driver.states[STATE_WFI]; return cpuidle_register(&apple_idle_driver, NULL); @@ -141,6 +144,7 @@ static int apple_cpuidle_probe(struct platform_device *pdev) static const struct of_device_id apple_cpuidle_of_match[] = { { .compatible = "apple,t6041-cpuidle" }, + { .compatible = "apple,t8132-cpuidle" }, { .compatible = "apple,t8140-cpuidle" }, { } };