Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <appana.durga.rao@xilinx.com>
Link: https://lore.kernel.org/r/20220627064024.771037-2-appana.durga.rao@xilinx.com
Signed-off-by: Michal Simek <michal.simek@amd.com>

authored by

Appana Durga Kedareswara rao and committed by
Michal Simek
a5e3aaa6 568035b0

+75
+10
arch/microblaze/Kconfig
··· 204 204 hex "Size of user task space" if TASK_SIZE_BOOL 205 205 default "0x80000000" 206 206 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 + 207 217 endmenu 208 218 209 219 menu "Bus Options"
+21
arch/microblaze/include/asm/xilinx_mb_manager.h
··· 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 */
+44
arch/microblaze/kernel/entry.S
··· 957 957 rtsd r15, 8 958 958 nop 959 959 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 + 960 1004 ENTRY(_reset) 961 1005 VM_OFF 962 1006 brai 0; /* Jump to reset vector */