Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: n2_err_adv_mcu.s | |
5 | * Copyright (C) 1995-2007 Sun Microsystems, Inc. All Rights Reserved | |
6 | * 4150 Network Circle, Santa Clara, California 95054, U.S.A. | |
7 | * | |
8 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. | |
9 | * | |
10 | * This program is free software; you can redistribute it and/or modify | |
11 | * it under the terms of the GNU General Public License as published by | |
12 | * the Free Software Foundation; version 2 of the License. | |
13 | * | |
14 | * This program is distributed in the hope that it will be useful, | |
15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
17 | * GNU General Public License for more details. | |
18 | * | |
19 | * You should have received a copy of the GNU General Public License | |
20 | * along with this program; if not, write to the Free Software | |
21 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
22 | * | |
23 | * For the avoidance of doubt, and except that if any non-GPL license | |
24 | * choice is available it will apply instead, Sun elects to use only | |
25 | * the General Public License version 2 (GPLv2) at this time for any | |
26 | * software where a choice of GPL license versions is made | |
27 | * available with the language indicating that GPLv2 or any later version | |
28 | * may be used, or where a choice of which version of the GPL is applied is | |
29 | * otherwise unspecified. | |
30 | * | |
31 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, | |
32 | * CA 95054 USA or visit www.sun.com if you need additional information or | |
33 | * have any questions. | |
34 | * | |
35 | * | |
36 | * ========== Copyright Header End ============================================ | |
37 | */ | |
38 | #define MAIN_PAGE_NUCLEUS_ALSO | |
39 | #define MAIN_PAGE_HV_ALSO | |
40 | ||
41 | #define L2_ERR_STAT_REG 0xAB00000000 | |
42 | #define L2_ERR_ADDR_REG 0xAC00000000 | |
43 | ||
44 | #define TEST_DATA1 0x1000100081c3e008 | |
45 | #define TEST_DATA2 0x2000200081c3e008 | |
46 | #define L2_ES_W1C_VALUE 0xc03ffff800000000 | |
47 | #define DRAM_ES_W1C_VALUE 0xfe00000000000000 | |
48 | ||
49 | #define DRAM_ERR_INJ_REG 0x8400000290 | |
50 | #define DRAM_ERR_STAT_REG 0x8400000280 | |
51 | #define ERROR_ADDR 0x20200000 | |
52 | ||
53 | #define DRAM_SCRUB_FREQ_REG 0x8400000018 | |
54 | #define DRAM_SCRUB_ENB_REG 0x8400000040 | |
55 | ||
56 | #include "hboot.s" | |
57 | #include "asi_s.h" | |
58 | #include "err_defines.h" | |
59 | ||
60 | ||
61 | .text | |
62 | .global main | |
63 | ||
64 | ||
65 | main: | |
66 | ta T_CHANGE_HPRIV | |
67 | ||
68 | disable_l1: | |
69 | ldxa [%g0] ASI_LSU_CONTROL, %l0 | |
70 | ! Remove the lower 2 bits (I-Cache and D-Cache enables) | |
71 | andn %l0, 0x3, %l0 | |
72 | stxa %l0, [%g0] ASI_LSU_CONTROL | |
73 | ||
74 | ! begin | |
75 | clear_DRAM_ESR: | |
76 | clr %l0 | |
77 | clr %l1 | |
78 | setx DRAM_ES_W1C_VALUE, %l0, %g2 | |
79 | setx 0x8400000280, %l1, %g6 | |
80 | stx %g2, [%g6] | |
81 | clear_L2_ESR: | |
82 | clr %l0 | |
83 | clr %l1 | |
84 | setx L2_ES_W1C_VALUE, %l0, %g4 | |
85 | setx 0xbb00000000, %l1, %g7 | |
86 | stx %g4, [%g7] | |
87 | ||
88 | clr %g1 | |
89 | mov 0x1, %g1 | |
90 | sllx %g1, 32, %g1 | |
91 | clr %g2 | |
92 | mov 0x1, %g2 | |
93 | sllx %g2, 22, %g2 | |
94 | clr %g3 | |
95 | mov 100, %g3 | |
96 | ||
97 | ld_from_L2_bank0: | |
98 | ldx [%g1], %l1 | |
99 | membar 0x40 | |
100 | add %g1, %g2, %g1 | |
101 | sub %g3, 1, %g3 | |
102 | brnz %g3,ld_from_L2_bank0 | |
103 | nop | |
104 | ||
105 | check_DRAM_ESR_DAC_and_MEC: | |
106 | clr %l1 | |
107 | mov 0x1, %l1 | |
108 | sllx %l1, 61, %l1 | |
109 | clr %l2 | |
110 | mov 0x1, %l2 | |
111 | sllx %l2, 62, %l2 | |
112 | or %l1, %l2, %l1 | |
113 | clr %l3 | |
114 | set 0xffff, %l3 | |
115 | ldx [%g6], %l0 | |
116 | andn %l0, %l3, %l0 | |
117 | cmp %l0, %l1 | |
118 | bne %xcc, test_fail | |
119 | nop | |
120 | ||
121 | check_L2_ESR_DAC_and_MEC: | |
122 | clr %l1 | |
123 | mov 0x1, %l1 | |
124 | sllx %l1, 42, %l1 | |
125 | clr %l2 | |
126 | mov 0x1, %l2 | |
127 | sllx %l2, 62, %l2 | |
128 | or %l1, %l2, %l1 | |
129 | clr %l3 | |
130 | mov 0x1, %l3 | |
131 | sllx %l3, 36, %l3 | |
132 | or %l1, %l3, %l1 | |
133 | ldx [%g7], %l0 | |
134 | cmp %l0, %l1 | |
135 | bne %xcc, test_fail | |
136 | nop | |
137 | ||
138 | ba test_pass | |
139 | nop | |
140 | ||
141 | /******************************************************* | |
142 | * Exit code | |
143 | *******************************************************/ | |
144 | ||
145 | test_pass: | |
146 | ta T_GOOD_TRAP | |
147 | ||
148 | test_fail: | |
149 | ta T_BAD_TRAP | |
150 | ||
151 |