Skip to content
Merged
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
Original file line number Diff line number Diff line change
Expand Up @@ -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 <ryan@aurorasilicon.org>

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.
Expand All @@ -22,6 +22,7 @@ properties:
compatible:
enum:
- apple,t6041-cpuidle
- apple,t8132-cpuidle
- apple,t8140-cpuidle

required:
Expand Down
4 changes: 4 additions & 0 deletions arch/arm64/boot/dts/apple/t8132-j713.dts
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,10 @@
status = "okay";
};

&cpuidle {
status = "okay";
};

&qspi {
status = "okay";

Expand Down
5 changes: 5 additions & 0 deletions arch/arm64/boot/dts/apple/t8132.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
Expand Down
16 changes: 10 additions & 6 deletions drivers/cpuidle/cpuidle-apple.c
Original file line number Diff line number Diff line change
Expand Up @@ -124,23 +124,27 @@ 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);
}

static const struct of_device_id apple_cpuidle_of_match[] = {
{ .compatible = "apple,t6041-cpuidle" },
{ .compatible = "apple,t8132-cpuidle" },
{ .compatible = "apple,t8140-cpuidle" },
{ }
};
Expand Down