1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2017 Masahiro Yamada <yamada.masahiro@socionext.com>
9 #include <linux/errno.h>
10 #include <linux/psci.h>
12 static int psci_sysreset_request(struct udevice *dev, enum sysreset_t type)
14 unsigned long function_id;
19 function_id = PSCI_0_2_FN_SYSTEM_RESET;
22 function_id = PSCI_0_2_FN_SYSTEM_OFF;
28 invoke_psci_fn(function_id, 0, 0, 0);
33 static struct sysreset_ops psci_sysreset_ops = {
34 .request = psci_sysreset_request,
37 U_BOOT_DRIVER(psci_sysreset) = {
38 .name = "psci-sysreset",
39 .id = UCLASS_SYSRESET,
40 .ops = &psci_sysreset_ops,