aboutsummaryrefslogtreecommitdiffstats
path: root/arch/mips/kernel/traps.c
diff options
context:
space:
mode:
authorLeonid Yegoshin <Leonid.Yegoshin@imgtec.com>2013-11-14 11:12:31 -0500
committerRalf Baechle <ralf@linux-mips.org>2014-01-22 14:19:00 -0500
commit75b5b5e0a262790fa11043fe45700499c7e3d818 (patch)
tree3c5af9caa9c5478668159ff34db0ab34b51d7511 /arch/mips/kernel/traps.c
parent601cfa7b6fb657cff9e8f77bbcce79f75dd7ab74 (diff)
MIPS: Add support for FTLBs
The Fixed Page Size TLB (FTLB) is a set-associative dual entry TLB. Its purpose is to reduce the number of TLB misses by increasing the effective TLB size and keep the implementation complexity to minimum levels. A supported core can have both VTLB and FTLB. Reviewed-by: James Hogan <james.hogan@imgtec.com> Reviewed-by: Paul Burton <paul.burton@imgtec.com> Signed-off-by: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com> Signed-off-by: Markos Chandras <markos.chandras@imgtec.com> Signed-off-by: John Crispin <blogic@openwrt.org> Patchwork: http://patchwork.linux-mips.org/patch/6139/
Diffstat (limited to 'arch/mips/kernel/traps.c')
-rw-r--r--arch/mips/kernel/traps.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
index e98f3ab2a018..39370e1d4362 100644
--- a/arch/mips/kernel/traps.c
+++ b/arch/mips/kernel/traps.c
@@ -78,6 +78,7 @@ extern asmlinkage void handle_cpu(void);
78extern asmlinkage void handle_ov(void); 78extern asmlinkage void handle_ov(void);
79extern asmlinkage void handle_tr(void); 79extern asmlinkage void handle_tr(void);
80extern asmlinkage void handle_fpe(void); 80extern asmlinkage void handle_fpe(void);
81extern asmlinkage void handle_ftlb(void);
81extern asmlinkage void handle_mdmx(void); 82extern asmlinkage void handle_mdmx(void);
82extern asmlinkage void handle_watch(void); 83extern asmlinkage void handle_watch(void);
83extern asmlinkage void handle_mt(void); 84extern asmlinkage void handle_mt(void);
@@ -1460,6 +1461,34 @@ asmlinkage void cache_parity_error(void)
1460 panic("Can't handle the cache error!"); 1461 panic("Can't handle the cache error!");
1461} 1462}
1462 1463
1464asmlinkage void do_ftlb(void)
1465{
1466 const int field = 2 * sizeof(unsigned long);
1467 unsigned int reg_val;
1468
1469 /* For the moment, report the problem and hang. */
1470 if (cpu_has_mips_r2 &&
1471 ((current_cpu_data.processor_id && 0xff0000) == PRID_COMP_MIPS)) {
1472 pr_err("FTLB error exception, cp0_ecc=0x%08x:\n",
1473 read_c0_ecc());
1474 pr_err("cp0_errorepc == %0*lx\n", field, read_c0_errorepc());
1475 reg_val = read_c0_cacheerr();
1476 pr_err("c0_cacheerr == %08x\n", reg_val);
1477
1478 if ((reg_val & 0xc0000000) == 0xc0000000) {
1479 pr_err("Decoded c0_cacheerr: FTLB parity error\n");
1480 } else {
1481 pr_err("Decoded c0_cacheerr: %s cache fault in %s reference.\n",
1482 reg_val & (1<<30) ? "secondary" : "primary",
1483 reg_val & (1<<31) ? "data" : "insn");
1484 }
1485 } else {
1486 pr_err("FTLB error exception\n");
1487 }
1488 /* Just print the cacheerr bits for now */
1489 cache_parity_error();
1490}
1491
1463/* 1492/*
1464 * SDBBP EJTAG debug exception handler. 1493 * SDBBP EJTAG debug exception handler.
1465 * We skip the instruction and return to the next instruction. 1494 * We skip the instruction and return to the next instruction.
@@ -2009,6 +2038,7 @@ void __init trap_init(void)
2009 if (cpu_has_fpu && !cpu_has_nofpuex) 2038 if (cpu_has_fpu && !cpu_has_nofpuex)
2010 set_except_vector(15, handle_fpe); 2039 set_except_vector(15, handle_fpe);
2011 2040
2041 set_except_vector(16, handle_ftlb);
2012 set_except_vector(22, handle_mdmx); 2042 set_except_vector(22, handle_mdmx);
2013 2043
2014 if (cpu_has_mcheck) 2044 if (cpu_has_mcheck)