fc7220f0c4
Current code assumes that the vector base address is always at 0x0. However, this value is configurable for MicroBlaze using the CONFIG_XILINX_MICROBLAZE0_VECTOR_BASE_ADDR Kconfig option. Update the reset routines to branch to this location instead. Signed-off-by: Ovidiu Panait <ovidiu.panait@windriver.com> Link: https://lore.kernel.org/r/20211130163358.2531677-10-ovidiu.panait@windriver.com Signed-off-by: Michal Simek <michal.simek@xilinx.com>
33 lines
724 B
C
33 lines
724 B
C
// 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>
|
|
#include <linux/stringify.h>
|
|
|
|
static int microblaze_sysreset_request(struct udevice *dev,
|
|
enum sysreset_t type)
|
|
{
|
|
puts("Microblaze soft reset sysreset\n");
|
|
__asm__ __volatile__ (
|
|
"mts rmsr, r0;" \
|
|
"brai " __stringify(CONFIG_XILINX_MICROBLAZE0_VECTOR_BASE_ADDR));
|
|
|
|
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,
|
|
};
|