Skip to content

Commit 57c9272

Browse files
committed
Merge tag 'microblaze-v6.1' of git://git.monstr.eu/linux-2.6-microblaze
Pull microblaze updates from Michal Simek: "This adds architecture support for error injection which can be done only via local memory (BRAM) with enabling path for recovery after reset. These patches targets Triple Modular Redundacy (TMR) configuration where 3 Microblazes are running in parallel with monitoring logic. When an error happens (or is injected) system goes to break handler with full CPU reset and system recovery back to origin context. More information can be found at [1]" Link: https://www.xilinx.com/content/dam/xilinx/support/documents/ip_documentation/tmr/v1_0/pg268-tmr.pdf [1] * tag 'microblaze-v6.1' of git://git.monstr.eu/linux-2.6-microblaze: microblaze: Add support for error injection microblaze: Add custom break vector handler for mb manager microblaze: Add xmb_manager_register function
2 parents ef688f8 + adc4cef commit 57c9272

File tree

4 files changed

+347
-1
lines changed

4 files changed

+347
-1
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: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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+
# ifndef __ASSEMBLY__
9+
10+
#include <linux/of_address.h>
11+
12+
/*
13+
* When the break vector gets asserted because of error injection, the break
14+
* signal must be blocked before exiting from the break handler, Below api
15+
* updates the manager address and control register and error counter callback
16+
* arguments, which will be used by the break handler to block the break and
17+
* call the callback function.
18+
*/
19+
void xmb_manager_register(uintptr_t phys_baseaddr, u32 cr_val,
20+
void (*callback)(void *data),
21+
void *priv, void (*reset_callback)(void *data));
22+
asmlinkage void xmb_inject_err(void);
23+
24+
# endif /* __ASSEMBLY__ */
25+
26+
/* Error injection offset */
27+
#define XMB_INJECT_ERR_OFFSET 0x200
28+
29+
#endif /* _XILINX_MB_MANAGER_H */

arch/microblaze/kernel/asm-offsets.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,5 +120,12 @@ int main(int argc, char *argv[])
120120
DEFINE(CC_FSR, offsetof(struct cpu_context, fsr));
121121
BLANK();
122122

123+
/* struct cpuinfo */
124+
DEFINE(CI_DCS, offsetof(struct cpuinfo, dcache_size));
125+
DEFINE(CI_DCL, offsetof(struct cpuinfo, dcache_line_length));
126+
DEFINE(CI_ICS, offsetof(struct cpuinfo, icache_size));
127+
DEFINE(CI_ICL, offsetof(struct cpuinfo, icache_line_length));
128+
BLANK();
129+
123130
return 0;
124131
}

0 commit comments

Comments
 (0)