Skip to content

Commit a5e3aaa

Browse files
kedareswararaomichalsimek
authored andcommitted
microblaze: Add xmb_manager_register function
Triple Modular Redundancy (TMR) Microblaze solution provides soft error injection, detection, correction and recovery for Microblaze cores in the system. The Xilinx/AMD Triple Modular Redundancy (TMR) solution in Vivado provides all the necessary building blocks to implement a redundant triplicated MicroBlaze subsystem. This processing subsystem is fault-tolerant and continues to operate nominally after encountering an error. Together with the capability to detect and recover from errors, the implementation ensures the reliability of the entire subsystem. When the break vector gets asserted because of error injection, the break signal must be blocked before exiting from the break handler, This commit adds support for xmb_manager_register api which updates the TMR manager address and control register and error count and reset callback function arguments, which will be used by the break handler to block the break and call the error count callback function and reset callback function. Signed-off-by: Appana Durga Kedareswara rao <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Michal Simek <[email protected]>
1 parent 568035b commit a5e3aaa

File tree

3 files changed

+75
-0
lines changed

3 files changed

+75
-0
lines changed

arch/microblaze/Kconfig

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,16 @@ config TASK_SIZE
204204
hex "Size of user task space" if TASK_SIZE_BOOL
205205
default "0x80000000"
206206

207+
config MB_MANAGER
208+
bool "Support for Microblaze Manager"
209+
depends on ADVANCED_OPTIONS
210+
help
211+
This option enables API for configuring the MicroBlaze manager
212+
control register, which is consumed by the break handler to
213+
block the break.
214+
215+
Say N here unless you know what you are doing.
216+
207217
endmenu
208218

209219
menu "Bus Options"
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
/*
3+
* Copyright (C) 2022 Xilinx, Inc.
4+
*/
5+
#ifndef _XILINX_MB_MANAGER_H
6+
#define _XILINX_MB_MANAGER_H
7+
8+
#include <linux/of_address.h>
9+
10+
/*
11+
* When the break vector gets asserted because of error injection, the break
12+
* signal must be blocked before exiting from the break handler, Below api
13+
* updates the manager address and control register and error counter callback
14+
* arguments, which will be used by the break handler to block the break and
15+
* call the callback function.
16+
*/
17+
void xmb_manager_register(uintptr_t phys_baseaddr, u32 cr_val,
18+
void (*callback)(void *data),
19+
void *priv, void (*reset_callback)(void *data));
20+
21+
#endif /* _XILINX_MB_MANAGER_H */

arch/microblaze/kernel/entry.S

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -957,6 +957,50 @@ ENTRY(_switch_to)
957957
rtsd r15, 8
958958
nop
959959

960+
#ifdef CONFIG_MB_MANAGER
961+
.section .data
962+
.global xmb_manager_dev
963+
.global xmb_manager_baseaddr
964+
.global xmb_manager_crval
965+
.global xmb_manager_callback
966+
.global xmb_manager_reset_callback
967+
.align 4
968+
xmb_manager_dev:
969+
.long 0
970+
xmb_manager_baseaddr:
971+
.long 0
972+
xmb_manager_crval:
973+
.long 0
974+
xmb_manager_callback:
975+
.long 0
976+
xmb_manager_reset_callback:
977+
.long 0
978+
979+
/*
980+
* When the break vector gets asserted because of error injection,
981+
* the break signal must be blocked before exiting from the
982+
* break handler, Below api updates the manager address and
983+
* control register and error count callback arguments,
984+
* which will be used by the break handler to block the
985+
* break and call the callback function.
986+
*/
987+
.global xmb_manager_register
988+
.section .text
989+
.align 2
990+
.ent xmb_manager_register
991+
.type xmb_manager_register, @function
992+
xmb_manager_register:
993+
swi r5, r0, xmb_manager_baseaddr
994+
swi r6, r0, xmb_manager_crval
995+
swi r7, r0, xmb_manager_callback
996+
swi r8, r0, xmb_manager_dev
997+
swi r9, r0, xmb_manager_reset_callback
998+
999+
rtsd r15, 8;
1000+
nop;
1001+
.end xmb_manager_register
1002+
#endif
1003+
9601004
ENTRY(_reset)
9611005
VM_OFF
9621006
brai 0; /* Jump to reset vector */

0 commit comments

Comments
 (0)