Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / error / dmu / n2_err_dmu_pio_wr_eie.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: n2_err_dmu_pio_wr_eie.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_NUCLEUS_ALSO */ /* Access main in priviledge mode */
42#define MAIN_PAGE_HV_ALSO
43
44#include "err_defines.h"
45#include "hboot.s"
46#include "peu_defines.h"
47
48!#define IO_WR_ADDR mpeval(N2_PCIE_BASE_ADDR + IOCFG_OFFSET_BASE_REG_DATA)
49#define IO_WR_ADDR mpeval((N2_PCIE_BASE_ADDR + IOCFG_OFFSET_BASE_REG_DATA) | IO_ACCESS_PA)
50
51/************************************************************************
52 Test case code start
53 ************************************************************************/
54.text
55.global main
56.global My_Recoverable_Sw_error_trap
57
58main:
59 ta T_CHANGE_HPRIV
60 nop
61
62clear_esr_first:
63 setx SOC_ESR_REG, %l7, %i0
64 stx %g0, [%i0]
65
66set_ejr:
67 set 0x1, %i1
68 sllx %i1, ERR_FIELD, %i2
69 setx SOC_EJR_REG, %l7, %i3
70 stx %i2, [%i3]
71 membar 0x40
72
73 ! select a CFG address in PCI address range and transmit the command to NCU
74 setx IO_WR_ADDR, %g1, %g2
75 setx 0x7f7e7d7c, %g1, %l0
76 stw %l0, [%g2]
77
78 setx 0x40, %l1, %g4
79delay_loop:
80 nop
81 nop
82 nop
83 nop
84 dec %g4
85 brnz %g4, delay_loop
86 nop
87 nop
88
89check_esr:
90 setx SOC_ESR_REG, %l7, %i0
91 ldx [%i0], %i1
92 nop
93
94 setx 0x8000000000000000, %l7, %o3 !valid bit
95 set 0x1, %i2
96 sllx %i2, ERR_FIELD, %i3
97 or %i3, %o3, %i4
98 sub %i1, %i4, %i5
99 brnz %i5, test_failed
100 nop
101
102eie_reg_ones:
103 setx SOC_EIE_REG, %g3, %g2
104
105 set 0x1, %i1
106 sllx %i1, ERR_FIELD, %g1
107
108 stx %g1, [%g2]
109 membar 0x40
110
111 setx 0x40, %g7, %g6
112 set 0x1, %g1 ! 1 Trap
113err_trap_loop:
114 cmp %g6, %g0
115 be %xcc, test_failed
116 nop
117
118 cmp %g1, %i7
119 be %xcc, check_tt
120 nop
121
122 ba err_trap_loop
123 nop
124
125check_tt:
126 mov 0x40, %l0
127 cmp %o7, %l0
128 bne %xcc, test_failed
129 nop
130
131test_passed:
132 EXIT_GOOD
133
134test_failed:
135 EXIT_BAD
136
137/************************************************************************
138 RAS
139 Trap Handlers
140 ************************************************************************/
141My_Recoverable_Sw_error_trap:
142 ! Signal trap taken
143 setx EXECUTED, %l0, %o6
144 ! save trap type value
145 rdpr %tt, %o7
146
147 inc %i7
148
149check_desr_NcuTrap_tt40:
150 ldxa [%g0]0x4c, %g2
151 nop
152
153 setx 0xb300000000000000, %l0, %g3
154 subcc %g2, %g3, %g4
155 brnz %g4, test_failed
156 nop
157
158
159check_per_tt40:
160 setx SOC_PER_REG, %l7, %g1
161 ldx [%g1], %g2
162 setx 0x8000000000000000, %g7, %g1
163 set 0x1, %g3
164 sllx %g3, ERR_FIELD, %g4
165 or %g1, %g4, %g3
166 sub %g2, %g3, %g5
167 brnz %g5, test_failed
168 nop
169
170clear_per_tt40:
171 setx SOC_PER_REG, %l7, %g1
172 stx %g0, [%g1]
173 nop
174
175clear_ejr_tt40:
176 setx SOC_EJR_REG, %l7, %g1
177 stx %g0, [%g1]
178 nop
179
180clear_eie_tt40:
181 setx SOC_EIE_REG, %l7, %g1
182 stx %g0, [%g1]
183 nop
184
185trap_done_tt40:
186 done
187 nop
188
189/************************************************************************
190 Test case data start
191************************************************************************/
192
193SECTION .DATA DATA_VA=IO_WR_ADDR
194attr_data {
195 Name = .DATA,
196 hypervisor,
197 compressimage
198}
199
200.data
201.global PCIAddr9
202
203data0: .word 0xccccdddd
204data1: .word 0xeeeeffff
205/************************************************************************/