Lines Matching +full:psci +full:- +full:1
1 // SPDX-License-Identifier: GPL-2.0-only
7 #define pr_fmt(fmt) "psci: " fmt
10 #include <linux/arm-smccc.h>
18 #include <linux/psci.h>
23 #include <uapi/linux/psci.h>
33 * While a 64-bit OS can make calls with SMC32 calling conventions, for some
34 * calls it is necessary to use SMC64 to pass or return 64-bit values.
36 * (native-width) function ID.
47 * a Trusted OS even if it claims to be capable of migration -- doing so will
50 static int resident_cpu = -1;
140 return -EOPNOTSUPP; in psci_to_linux_errno()
143 return -EINVAL; in psci_to_linux_errno()
145 return -EPERM; in psci_to_linux_errno()
148 return -EINVAL; in psci_to_linux_errno()
153 return PSCI_VERSION(0, 1); in psci_0_1_get_version()
281 WARN(1, "Unexpected PSCI conduit %d\n", conduit); in set_conduit()
295 return -ENXIO; in get_set_conduit_method()
304 return -EINVAL; in get_set_conduit_method()
319 invoke_psci_fn(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2), 0, 0, 0); in psci_sys_reset()
350 invoke_psci_fn(PSCI_FN_NATIVE(1_3, SYSTEM_OFF2), 0, 0, 0); in psci_sys_hibernate()
388 PSCI_ID(1_0, CPU_FREEZE),
389 PSCI_ID_NATIVE(1_0, CPU_DEFAULT_SUSPEND),
390 PSCI_ID_NATIVE(1_0, NODE_HW_STATE),
391 PSCI_ID_NATIVE(1_0, SYSTEM_SUSPEND),
392 PSCI_ID(1_0, SET_SUSPEND_MODE),
393 PSCI_ID_NATIVE(1_0, STAT_RESIDENCY),
394 PSCI_ID_NATIVE(1_0, STAT_COUNT),
395 PSCI_ID_NATIVE(1_1, SYSTEM_RESET2),
396 PSCI_ID(1_1, MEM_PROTECT),
397 PSCI_ID_NATIVE(1_1, MEM_PROTECT_CHECK_RANGE),
398 PSCI_ID_NATIVE(1_3, SYSTEM_OFF2),
412 if (PSCI_VERSION_MAJOR(ver) < 1) in psci_debugfs_read()
432 (feature & BIT(1)) ? "Extended" : "Original"); in psci_debugfs_read()
484 return PTR_ERR_OR_ZERO(debugfs_create_file("psci", 0444, NULL, NULL, in psci_debugfs_init()
535 err = invoke_psci_fn(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND), in psci_system_suspend()
554 ret = psci_features(PSCI_FN_NATIVE(1_1, SYSTEM_RESET2)); in psci_init_system_reset2()
564 ret = psci_features(PSCI_FN_NATIVE(1_3, SYSTEM_OFF2)); in psci_init_system_off2()
579 ret = psci_features(PSCI_FN_NATIVE(1_0, SYSTEM_SUSPEND)); in psci_init_system_suspend()
600 int type, cpu = -1; in psci_init_migrate()
628 resident_cpu = cpu >= 0 ? cpu : -1; in psci_init_migrate()
650 * Conveniently, the SMCCC and PSCI versions are encoded the in psci_init_smccc()
660 pr_info("Using standard PSCI v0.2 function IDs\n"); in psci_0_2_set_functions()
678 * Probe function for PSCI firmware versions >= 0.2
689 pr_err("Conflicting PSCI version detected.\n"); in psci_probe()
690 return -EINVAL; in psci_probe()
697 if (PSCI_VERSION_MAJOR(ver) >= 1) { in psci_probe()
712 * PSCI init function for PSCI versions >=0.2
714 * Probe based on PSCI PSCI_VERSION function
725 * Starting with v0.2, the PSCI specification introduced a call in psci_0_2_init()
727 * that PSCI function IDs and version specific initialization in psci_0_2_init()
735 * PSCI < v0.2 get PSCI Function IDs via DT.
746 pr_info("Using PSCI v0.1 Function IDs from DT\n"); in psci_0_1_init()
792 { .compatible = "arm,psci", .data = psci_0_1_init},
793 { .compatible = "arm,psci-0.2", .data = psci_0_2_init},
794 { .compatible = "arm,psci-1.0", .data = psci_1_0_init},
808 return -ENODEV; in psci_dt_init()
810 init_fn = (psci_initcall_t)matched_np->data; in psci_dt_init()
819 * We use PSCI 0.2+ when ACPI is deployed on ARM64 and it's
826 return -EOPNOTSUPP; in psci_acpi_init()