blob: 514c95817f2f2d167039589ebad0033afbce7607 [file] [log] [blame]
Michal Simekd1c6d422018-07-13 17:00:13 +02001// SPDX-License-Identifier: GPL-2.0
2/*
3 * Copyright (C) 2018 Xilinx, Inc. - Michal Simek
4 */
5
6#include <common.h>
7#include <dm.h>
8#include <errno.h>
9#include <sysreset.h>
10#include <linux/err.h>
11
12static int microblaze_sysreset_request(struct udevice *dev,
13 enum sysreset_t type)
14{
15 puts("Microblaze soft reset sysreset\n");
16 __asm__ __volatile__ (" mts rmsr, r0;" \
17 "bra r0");
18
19 return -EINPROGRESS;
20}
21
22static struct sysreset_ops microblaze_sysreset = {
23 .request = microblaze_sysreset_request,
24};
25
26U_BOOT_DRIVER(sysreset_microblaze) = {
27 .id = UCLASS_SYSRESET,
28 .name = "mb_soft_reset",
29 .ops = &microblaze_sysreset,
30};