1 // SPDX-License-Identifier: GPL-2.0+
3 * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
5 * Generic reset driver for x86 processor
12 #include <asm/processor.h>
14 static int x86_sysreset_request(struct udevice *dev, enum sysreset_t type)
20 value = SYS_RST | RST_CPU;
23 value = SYS_RST | RST_CPU | FULL_RST;
29 outb(value, IO_PORT_RESET);
34 static const struct udevice_id x86_sysreset_ids[] = {
35 { .compatible = "x86,reset" },
39 static struct sysreset_ops x86_sysreset_ops = {
40 .request = x86_sysreset_request,
43 U_BOOT_DRIVER(x86_sysreset) = {
44 .name = "x86-sysreset",
45 .id = UCLASS_SYSRESET,
46 .of_match = x86_sysreset_ids,
47 .ops = &x86_sysreset_ops,
48 .flags = DM_FLAG_PRE_RELOC,