blob: f57423a611d2c0ae0d0bd6338e6372796f517c84 [file] [log] [blame]
Bin Menged0efdf2018-07-19 03:07:30 -07001// SPDX-License-Identifier: GPL-2.0+
2/*
3 * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
4 *
5 * Reset driver for tangier processor
6 */
7
Bin Menged0efdf2018-07-19 03:07:30 -07008#include <dm.h>
9#include <sysreset.h>
10#include <asm/scu.h>
11
12static int tangier_sysreset_request(struct udevice *dev, enum sysreset_t type)
13{
14 int value;
15
16 switch (type) {
17 case SYSRESET_WARM:
18 value = IPCMSG_WARM_RESET;
19 break;
20 case SYSRESET_COLD:
21 value = IPCMSG_COLD_RESET;
22 break;
23 default:
24 return -ENOSYS;
25 }
26
27 scu_ipc_simple_command(value, 0);
28
29 return -EINPROGRESS;
30}
31
32static const struct udevice_id tangier_sysreset_ids[] = {
33 { .compatible = "intel,reset-tangier" },
34 { }
35};
36
37static struct sysreset_ops tangier_sysreset_ops = {
38 .request = tangier_sysreset_request,
39};
40
41U_BOOT_DRIVER(tangier_sysreset) = {
42 .name = "tangier-sysreset",
43 .id = UCLASS_SYSRESET,
44 .of_match = tangier_sysreset_ids,
45 .ops = &tangier_sysreset_ops,
Bin Menged0efdf2018-07-19 03:07:30 -070046};