Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / error / adv / n2_err_adv_ncuctagce.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: n2_err_adv_ncuctagce.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_Hw_Corrected_Error_0x63 My_Corrected_ECC_error_trap
39#define H_HT0_Sw_Recoverable_Error_0x40 My_Recoverable_Sw_error_trap
40
41#define ENABLE_PCIE_LINK_TRAINING
42#define MAIN_PAGE_HV_ALSO
43#define SOC_EST_REG 0x9001041000
44
45#include "err_defines.h"
46#include "hboot.s"
47#include "peu_defines.h"
48
49
50#define IO_RD_ADDR mpeval((N2_PCIE_BASE_ADDR + (IOCFG_OFFSET_BASE_REG_DATA & 0x7fffffffffffffff)) | IO_ACCESS_PA)
51
52#define MEM_LOC1 0x42400000
53
54/************************************************************************
55 Test case code start
56 ************************************************************************/
57.text
58.global main
59.global My_Recoverable_Sw_error_trap
60.global My_Corrected_ECC_error_trap
61
62
63main:
64 ta T_CHANGE_HPRIV
65 nop
66
67
68 /**************************************
69 THREAD 0
70 **************************************/
71main_t0:
72 nop
73 setx MEM_LOC1, %g1, %g3
74 st %g0, [%g3]
75
76clear_esr_first:
77 setx SOC_ESR_REG, %l7, %i0
78 stx %g0, [%i0]
79
80
81set_ejr:
82 set 0x1, %i1
83 sllx %i1, ERR_FIELD, %i2
84 setx SOC_EJR_REG, %l7, %i3
85 stx %i2, [%i3]
86
87set_eie:
88 set 0x1, %i1
89 sllx %i1, ERR_FIELD, %i2
90 setx SOC_EIE_REG, %l7, %i3
91 stx %i2, [%i3]
92
93pio_addr:
94 setx IO_RD_ADDR, %g1, %g2
95
96pio:
97 ldub [%g2], %l0
98
99 setx 0x30, %o5, %g6
100 set 0x1, %g7 ! 1 Trap
101err_trap_loop:
102 cmp %g6, %g0
103 be %xcc, test_failed
104 nop
105
106 cmp %i7, %g7
107 be %xcc, check_tt
108 nop
109
110 ba err_trap_loop
111 nop
112
113check_tt:
114 mov 0x63, %l0
115 cmp %o7, %l0
116 bne %xcc, test_failed
117 nop
118
119clear_eie:
120 set 0x1, %i1
121 sllx %i1, ERR_FIELD, %i2
122 setx SOC_EIE_REG, %l7, %i3
123 stx %g0, [%i3]
124
125
126clean_pios:
127 setx IO_RD_ADDR, %g1, %g2
128 ldub [%g2], %l0
129 ldub [%g2 + 1*8 + 0], %l0
130 ldub [%g2 + 2*8 + 0], %l0
131 ldub [%g2 + 3*8 + 0], %l0
132 ldub [%g2 + 4*8 + 0], %l0
133 ldub [%g2 + 5*8 + 0], %l0
134 ldub [%g2 + 6*8 + 0], %l0
135 ldub [%g2 + 7*8 + 0], %l0
136
137check_esr:
138 setx SOC_ESR_REG, %l7, %i0
139 ldx [%i0], %i1
140 cmp %g0, %i1
141 bne %xcc, test_failed
142 nop
143
144 /********************************/
145
146test_passed:
147 EXIT_GOOD
148
149test_failed:
150 EXIT_BAD
151
152
153
154/************************************************************************
155 RAS
156 Trap Handlers
157 ************************************************************************/
158My_Recoverable_Sw_error_trap:
159 ba test_failed
160 nop
161
162
163My_Corrected_ECC_error_trap:
164 ! Signal trap taken
165 setx EXECUTED, %l0, %o6
166 ! save trap type value
167 rdpr %tt, %o7
168
169 inc %i7
170
171check_desr_tt63:
172 ldxa [%g0]0x4c, %g2
173 nop
174 setx 0x8b00000000000000, %l0, %g3
175 subcc %g2, %g3, %g4
176 brnz %g4, test_failed
177
178check_per_tt63:
179 setx SOC_PER_REG, %l7, %i0
180 ldx [%i0], %i1
181 setx 0x8000000000000000, %l7, %o3 !valid bit
182 set 0x1, %i2
183 sllx %i2, ERR_FIELD, %i3
184 or %i3, %o3, %i4
185 sub %i1, %i4, %i5
186 brnz %i5, test_failed
187 nop
188
189clear_per_ejr_tt63:
190 setx SOC_PER_REG, %l7, %i0
191 stx %g0, [%i0]
192
193 setx SOC_EJR_REG, %l7, %i0
194 stx %g0, [%i0]
195
196 nop
197 done
198 nop
199
200
201check_DSFSR_tt63:
202 set 0x18, %g1
203 ldxa [%g1]0x58, %g5
204
205
206trap_done_tt40:
207 done
208 nop
209
210
211/************************************************************************
212 Test case data start
213************************************************************************/
214
215SECTION .DATA DATA_VA=IO_RD_ADDR
216attr_data {
217 Name = .DATA,
218 hypervisor,
219 compressimage
220}
221
222.data
223 .xword 0xdeadbeefdeadbeef
224
225 .xword 0x1101010101010101
226 .xword 0x0122010101010101
227 .xword 0x0101330101010101
228 .xword 0x0101014401010101
229 .xword 0x0101010155010101
230 .xword 0x0101010101660101
231 .xword 0x0101010101017701
232 .xword 0x0101010101010188
233
234 .xword 0x1122010101010101
235 .xword 0x0101334401010101
236 .xword 0x0101010155660101
237 .xword 0x0101010101017788
238
239 .xword 0x1122334401010101
240 .xword 0x0101010155667788
241
242 .xword 0xdeadbeefdeadbeef
243
244/************************************************************************/