cache_err_handler.S
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:2k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * Copyright (C) 2001 Broadcom Corporation
  3.  *
  4.  * This program is free software; you can redistribute it and/or
  5.  * modify it under the terms of the GNU General Public License
  6.  * as published by the Free Software Foundation; either version 2
  7.  * of the License, or (at your option) any later version.
  8.  *
  9.  * This program is distributed in the hope that it will be useful,
  10.  * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11.  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12.  * GNU General Public License for more details.
  13.  *
  14.  * You should have received a copy of the GNU General Public License
  15.  * along with this program; if not, write to the Free Software
  16.  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
  17.  */
  18. #include <linux/config.h>
  19. #include <asm/asm.h>
  20. #include <asm/regdef.h>
  21. #include <asm/mipsregs.h>
  22. #include <asm/sibyte/board.h>
  23. .text
  24. /* Special Cache Error handler for SB1 for now */
  25. LEAF(except_vec2_sb1)
  26. .set noat
  27. .set mips0
  28. /*
  29.  * This is a very bad place to be.  Our cache error detection has
  30.  * triggered.  If we have write-back data in the cache, we may not be
  31.  * able to recover.  As a first-order desperate measure, turn off KSEG0
  32.  * cacheing.
  33.  */
  34. .set push
  35. #.set mips64
  36. .set mips4
  37. .set reorder
  38. #ifdef CONFIG_SB1_CERR_IGNORE_RECOVERABLE
  39. mfc0 k1, $26 # mfc0 k1, $26, 0
  40. # check if error was recoverable
  41. # XXXKW - count them
  42. bltz k1, leave_cerr
  43. #endif
  44. #ifdef CONFIG_SB1_PASS_1_WORKAROUNDS
  45. # look for signature of spurious CErr
  46. lui k0, 0x4000
  47. bne k0, k1, real_cerr
  48. .word 0x401Bd801 # mfc0 k1, $27, 1
  49. lui k0, 0xffe0
  50. and k1, k0, k1
  51. lui k0, 0x0200
  52. beq k0, k1, leave_cerr
  53. # XXXKW - count them
  54. #endif
  55. real_cerr:
  56. #ifdef CONFIG_SB1_CERR_SPIN
  57.         setleds(k0,k1,'C','E','R','R')
  58. 1: b 1b
  59. #else
  60. mfc0 k0,CP0_CONFIG
  61. li k1,~CONF_CM_CMASK
  62. and k0,k0,k1
  63. ori k0,k0,CONF_CM_UNCACHED
  64. mtc0 k0,CP0_CONFIG
  65. SSNOP
  66. SSNOP
  67. SSNOP
  68. SSNOP
  69. bnezl $0, 1f
  70. 1:
  71. j sb1_cache_error
  72. #endif
  73. #if defined(CONFIG_SB1_PASS_1_WORKAROUNDS) || defined(CONFIG_SB1_CERR_IGNORE_RECOVERABLE)
  74. leave_cerr:
  75. # clear/unlock the registers
  76. mtc0 zero, $26 # mtc0 zero, $26, 0
  77. mtc0 zero, $27 # mtc0 zero, $27, 0
  78. .word 0x4080d801 # mtc0 zero, $27, 1
  79. .word 0x4080d803 # mtc0 zero, $27, 3
  80. eret
  81. #endif
  82. .set pop
  83. END(except_vec2_sb1)