Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: n2_err_adv_ncuctague_wrmreset.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 H_HT0_Sw_Recoverable_Error_0x40 My_Recoverable_Sw_error_trap | |
39 | ||
40 | #define ENABLE_PCIE_LINK_TRAINING | |
41 | #define MAIN_PAGE_HV_ALSO | |
42 | #define SOC_EST_REG 0x9001041000 | |
43 | ||
44 | #define RESET_STAT_CHECK | |
45 | ||
46 | #include "err_defines.h" | |
47 | #include "hboot.s" | |
48 | #include "peu_defines.h" | |
49 | ||
50 | ||
51 | #define IO_RD_ADDR mpeval((N2_PCIE_BASE_ADDR + (IOCFG_OFFSET_BASE_REG_DATA & 0x7fffffffffffffff)) | IO_ACCESS_PA) | |
52 | ||
53 | #define MEM_LOC1 0x42400000 | |
54 | ||
55 | /************************************************************************ | |
56 | Test case code start | |
57 | ************************************************************************/ | |
58 | .text | |
59 | .global main | |
60 | .global My_Recoverable_Sw_error_trap | |
61 | ||
62 | ||
63 | main: | |
64 | ta T_CHANGE_HPRIV | |
65 | nop | |
66 | ||
67 | ||
68 | /************************************************************ | |
69 | Check if this is the first time thru here | |
70 | ************************************************************/ | |
71 | reset_decide: | |
72 | setx test_entered, %g1, %g2 | |
73 | ldx [%g2], %g3 | |
74 | brnz %g3, After_Warm_Reset | |
75 | nop | |
76 | ||
77 | ! First time thru, Store a non-zero value there | |
78 | dec %g3 | |
79 | stx %g3, [%g2] | |
80 | ||
81 | ||
82 | main_t0: | |
83 | nop | |
84 | setx MEM_LOC1, %g1, %g3 | |
85 | st %g0, [%g3] | |
86 | ||
87 | clear_esr_first: | |
88 | setx SOC_ESR_REG, %l7, %i0 | |
89 | stx %g0, [%i0] | |
90 | ||
91 | ||
92 | set_ejr_fee: | |
93 | set 0x1, %i1 | |
94 | sllx %i1, ERR_FIELD, %i2 | |
95 | setx SOC_EJR_REG, %l7, %i3 | |
96 | stx %i2, [%i3] | |
97 | ||
98 | setx SOC_FEE_REG, %l7, %i3 | |
99 | stx %i2, [%i3] | |
100 | ||
101 | pio_addr: | |
102 | ! select an IO address in PCI address range and transmit the command to NCU | |
103 | setx IO_RD_ADDR, %g1, %g2 | |
104 | ||
105 | st_mem1: | |
106 | set 0x1, %g4 | |
107 | st %g4, [%g3] | |
108 | ||
109 | pio: | |
110 | ! load byte - all byte offsets within an octlet | |
111 | ldub [%g2 + 1*8 + 0], %l0 | |
112 | nop ! ld hangs and not completes | |
113 | ||
114 | ba test_failed | |
115 | nop | |
116 | ||
117 | ||
118 | After_Warm_Reset: | |
119 | nop | |
120 | nop | |
121 | ||
122 | read_esr: | |
123 | setx SOC_ESR_REG, %g7, %g3 | |
124 | ldx [%g3], %g6 | |
125 | ||
126 | setx 0x8000000000000000, %g7, %g3 !valid bit | |
127 | set 0x1, %g2 | |
128 | sllx %g2, ERR_FIELD, %g4 | |
129 | or %g3, %g4, %g5 | |
130 | ||
131 | cmp %g6, %g5 | |
132 | bne %xcc, test_failed | |
133 | nop | |
134 | ||
135 | ||
136 | /********************************/ | |
137 | ||
138 | test_passed: | |
139 | EXIT_GOOD | |
140 | ||
141 | test_failed: | |
142 | EXIT_BAD | |
143 | ||
144 | ||
145 | /************************************************************************ | |
146 | RAS | |
147 | Trap Handlers | |
148 | ************************************************************************/ | |
149 | My_Recoverable_Sw_error_trap: | |
150 | ||
151 | ba test_failed | |
152 | nop | |
153 | ||
154 | ||
155 | .align 64 | |
156 | test_entered: | |
157 | .xword 0 | |
158 | ||
159 | /************************************************************************ | |
160 | Test case data start | |
161 | ************************************************************************/ | |
162 | ||
163 | SECTION .DATA DATA_VA=IO_RD_ADDR | |
164 | attr_data { | |
165 | Name = .DATA, | |
166 | hypervisor, | |
167 | compressimage | |
168 | } | |
169 | ||
170 | .data | |
171 | .xword 0xdeadbeefdeadbeef | |
172 | ||
173 | .xword 0x1101010101010101 | |
174 | .xword 0x0122010101010101 | |
175 | .xword 0x0101330101010101 | |
176 | .xword 0x0101014401010101 | |
177 | .xword 0x0101010155010101 | |
178 | .xword 0x0101010101660101 | |
179 | .xword 0x0101010101017701 | |
180 | .xword 0x0101010101010188 | |
181 | ||
182 | .xword 0x1122010101010101 | |
183 | .xword 0x0101334401010101 | |
184 | .xword 0x0101010155660101 | |
185 | .xword 0x0101010101017788 | |
186 | ||
187 | .xword 0x1122334401010101 | |
188 | .xword 0x0101010155667788 | |
189 | ||
190 | .xword 0xdeadbeefdeadbeef | |
191 | ||
192 | /************************************************************************/ |