Lines Matching +full:idle +full:- +full:wait +full:- +full:delay
1 // SPDX-License-Identifier: GPL-2.0-only
8 * Gregory Clement <gregory.clement@free-electrons.com>
9 * Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
16 #define pr_fmt(fmt) "mvebu-pmsu: " fmt
20 #include <linux/delay.h>
25 #include <linux/mvebu-pmsu.h>
73 /* PMSU delay registers */
104 { .compatible = "marvell,armada-370-pmsu", },
105 { .compatible = "marvell,armada-370-xp-pmsu", },
106 { .compatible = "marvell,armada-380-pmsu", },
130 u32 code_len = mvebu_boot_wa_end - mvebu_boot_wa_start; in mvebu_setup_boot_addr_wa()
139 return -ENOMEM; in mvebu_setup_boot_addr_wa()
151 sram_virt_base + code_len - 4); in mvebu_setup_boot_addr_wa()
172 ret = -ENOENT; in mvebu_v7_pmsu_init()
176 if (of_device_is_compatible(np, "marvell,armada-370-xp-pmsu")) { in mvebu_v7_pmsu_init()
178 res.start = res.start - PMSU_BASE_OFFSET; in mvebu_v7_pmsu_init()
179 res.end = res.start + PMSU_REG_SIZE - 1; in mvebu_v7_pmsu_init()
183 np->full_name)) { in mvebu_v7_pmsu_init()
185 ret = -EBUSY; in mvebu_v7_pmsu_init()
195 ret = -ENOMEM; in mvebu_v7_pmsu_init()
211 /* Enable L2 & Fabric powerdown in Deep-Idle mode - Fabric */ in mvebu_v7_pmsu_enable_l2_powerdown_onidle()
223 /* No locking is needed because we only access per-CPU registers */
230 return -EINVAL; in mvebu_v7_pmsu_idle_prepare()
233 * Adjust the PMSU configuration to wait for WFI signal, enable in mvebu_v7_pmsu_idle_prepare()
234 * IRQ and FIQ as wakeup events, set wait for snoop queue empty in mvebu_v7_pmsu_idle_prepare()
256 /* Disable snoop disable by HW - SW is taking care of it */ in mvebu_v7_pmsu_idle_prepare()
294 ".arch armv7-a\n\t" in armada_370_xp_pmsu_idle_enter()
338 /* No locking is needed because we only access per-CPU registers */
381 if (of_property_read_bool(np, "broken-idle")) { in broken_idle()
382 pr_warn("CPU idle is currently broken: disabling\n"); in broken_idle()
394 np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"); in armada_370_cpuidle_init()
396 return -ENODEV; in armada_370_cpuidle_init()
403 * idle state due to heavy L1/L2 cache cleanup operations in armada_370_cpuidle_init()
416 mvebu_v7_cpuidle_device.name = "cpuidle-armada-370"; in armada_370_cpuidle_init()
429 pr_warn("CPU idle is currently broken on Armada 38x: disabling\n"); in armada_38x_cpuidle_init()
433 "marvell,armada-380-coherency-fabric"); in armada_38x_cpuidle_init()
435 return -ENODEV; in armada_38x_cpuidle_init()
443 "marvell,armada-380-mpcore-soc-ctrl"); in armada_38x_cpuidle_init()
445 return -ENODEV; in armada_38x_cpuidle_init()
456 /* Set up delay */ in armada_38x_cpuidle_init()
465 mvebu_v7_cpuidle_device.name = "cpuidle-armada-38x"; in armada_38x_cpuidle_init()
476 np = of_find_compatible_node(NULL, NULL, "marvell,coherency-fabric"); in armada_xp_cpuidle_init()
478 return -ENODEV; in armada_xp_cpuidle_init()
485 mvebu_v7_cpuidle_device.name = "cpuidle-armada-xp"; in armada_xp_cpuidle_init()
503 * Currently the CPU idle support for Armada 38x is broken, as in mvebu_v7_cpu_pm_init()
504 * the CPU hotplug uses some of the CPU idle functions it is in mvebu_v7_cpu_pm_init()
543 /* Prepare to enter idle */ in mvebu_pmsu_dfs_request_local()
555 /* The fact of entering idle will trigger the DFS transition */ in mvebu_pmsu_dfs_request_local()
559 * We're back from idle, the DFS transition has completed, in mvebu_pmsu_dfs_request_local()
560 * clear the idle wait indication. in mvebu_pmsu_dfs_request_local()
599 return -ETIME; in mvebu_pmsu_dfs_request()