2018-07-13 15:00:13 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
|
|
|
/*
|
|
|
|
* Copyright (C) 2018 Xilinx, Inc. - Michal Simek
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <common.h>
|
|
|
|
#include <dm.h>
|
|
|
|
#include <errno.h>
|
|
|
|
#include <sysreset.h>
|
|
|
|
#include <linux/err.h>
|
2021-11-30 16:33:57 +00:00
|
|
|
#include <linux/stringify.h>
|
2018-07-13 15:00:13 +00:00
|
|
|
|
|
|
|
static int microblaze_sysreset_request(struct udevice *dev,
|
|
|
|
enum sysreset_t type)
|
|
|
|
{
|
|
|
|
puts("Microblaze soft reset sysreset\n");
|
2021-11-30 16:33:57 +00:00
|
|
|
__asm__ __volatile__ (
|
|
|
|
"mts rmsr, r0;" \
|
|
|
|
"brai " __stringify(CONFIG_XILINX_MICROBLAZE0_VECTOR_BASE_ADDR));
|
2018-07-13 15:00:13 +00:00
|
|
|
|
|
|
|
return -EINPROGRESS;
|
|
|
|
}
|
|
|
|
|
|
|
|
static struct sysreset_ops microblaze_sysreset = {
|
|
|
|
.request = microblaze_sysreset_request,
|
|
|
|
};
|
|
|
|
|
|
|
|
U_BOOT_DRIVER(sysreset_microblaze) = {
|
|
|
|
.id = UCLASS_SYSRESET,
|
|
|
|
.name = "mb_soft_reset",
|
|
|
|
.ops = µblaze_sysreset,
|
|
|
|
};
|