2 * Copyright (C) 2017 Masahiro Yamada <yamada.masahiro@socionext.com>
4 * SPDX-License-Identifier: GPL-2.0+
10 #include <linux/errno.h>
11 #include <linux/psci.h>
13 static int psci_sysreset_request(struct udevice *dev, enum sysreset_t type)
15 unsigned long function_id;
20 function_id = PSCI_0_2_FN_SYSTEM_RESET;
23 function_id = PSCI_0_2_FN_SYSTEM_OFF;
29 invoke_psci_fn(function_id, 0, 0, 0);
34 static struct sysreset_ops psci_sysreset_ops = {
35 .request = psci_sysreset_request,
38 U_BOOT_DRIVER(psci_sysreset) = {
39 .name = "psci-sysreset",
40 .id = UCLASS_SYSRESET,
41 .ops = &psci_sysreset_ops,