Skip to content

Commit 6be0d41

Browse files
committed
arch: microblaze: Weak sys_arch_reboot implementation
Internal references: FWRIVERHD-4554 Signed-off-by: Alp Sayin <alpsayin@gmail.com>
1 parent 1f4dc80 commit 6be0d41

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

arch/microblaze/core/reboot.c

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/*
2+
* Copyright (c) 2023 Advanced Micro Devices, Inc. (AMD)
3+
* Copyright (c) 2023 Alp Sayin <alpsayin@gmail.com>
4+
*
5+
* SPDX-License-Identifier: Apache-2.0
6+
*/
7+
8+
#include <zephyr/arch/cpu.h>
9+
#include <zephyr/kernel.h>
10+
#include <zephyr/sys/util.h>
11+
12+
/**
13+
* @brief Reset the system
14+
*
15+
* This is stub function to avoid build error with CONFIG_REBOOT=y
16+
* MicroBlaze, being a soft core cannot define a reboot routine.
17+
* Each SoC designer should implement their own reboot if needed.
18+
*/
19+
20+
void __weak sys_arch_reboot(int type)
21+
{
22+
printk("__weak reboot called with %d in %s\n", type, __FILE__);
23+
__asm__ volatile("\tbraid _start\n"
24+
"\tmts rmsr, r0\n");
25+
}

0 commit comments

Comments
 (0)