Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / error / adv / n2_err_adv_pio_err.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: n2_err_adv_pio_err.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 ENABLE_PCIE_LINK_TRAINING
39/* #define MAIN_PAGE_NUCLEUS_ALSO */ /* Access main in priviledge mode */
40#define MAIN_PAGE_HV_ALSO
41
42#define H_HT0_Hw_Corrected_Error_0x63 My_Corrected_ECC_error_trap
43
44#include "err_defines.h"
45#include "hboot.s"
46#include "peu_defines.h"
47#include "err_defines.h"
48
49#define MEM64_BASE mpeval(N2_PCIE_BASE_ADDR + (MEM64_OFFSET_BASE_REG_DATA & 0x7fffffffffffffff))
50
51#define MEM64_RD_ADDR0 MEM64_BASE
52!!#define MEM64_RD_ADDR0 mpeval(MEM64_BASE + 0x0000000000000000)
53!!#define MEM64_RD_ADDR1 mpeval(MEM64_BASE + 0x0000000100000000)
54!!#define MEM64_RD_ADDR2 mpeval(MEM64_BASE + 0x0000000200000000)
55!!#define MEM64_RD_ADDR4 mpeval(MEM64_BASE + 0x0000000400000000)
56
57!! Keep bit 39 set so that the data section gets read into gMem by vera
58
59#define MEM64_OFFSET 0xaabbcc8000000000
60!!#define MEM64_OFFSET_PLUS_GARBAGE mpeval(MEM64_OFFSET + 0x0000000000112233, 16, 16)
61#define MEM64_OFFSET_PLUS_GARBAGE 0xaabbcc8000112233
62
63!!#define MEM64_RD_ADDR0_PLUS_OFFSET mpeval(MEM64_OFFSET | MEM64_RD_ADDR0, 16, 16)
64#define MEM64_RD_ADDR0_PLUS_OFFSET 0xaabbcc8000000000
65
66#ifndef NO_SELF_CHECK
67#define BNE_TEST_FAIL bne test_failed
68#else
69#define BNE_TEST_FAIL nop
70#endif
71
72/************************************************************************
73 Test case code start
74 ************************************************************************/
75.text
76.global main
77.global My_Corrected_ECC_error_trap
78
79main:
80 ta T_CHANGE_HPRIV
81 nop
82
83 ! Load the PCIE MEM64 OFFSET Register
84
85 setx FIRE_DLC_IMU_ICS_CSR_A_MEM_64_PCIE_OFFSET_REG_ADDR, %g1, %g2
86 setx MEM64_OFFSET_PLUS_GARBAGE, %g1, %g3
87 stx %g3, [%g2]
88 ldx [%g2], %g4
89
90 ! select a MEM address in PCI address range and
91 ! set up the data area using stores, because Midas does not seem to
92 ! allow a .data section to be set up with an address > 2**39
93
94 setx MEM64_RD_ADDR0, %g1, %g2
95 setx 0x1011121314151617, %g1, %g3
96 stx %g3,[%g2 + 0]
97 setx 0x18191a1b1c1d1e1f, %g1, %g3
98 stx %g3,[%g2 + 8]
99 setx 0x2021222324252627, %g1, %g3
100 stx %g3,[%g2 + 16]
101 setx 0x28292a2b2c2d2e2f, %g1, %g3
102 stx %g3,[%g2 + 24]
103 setx 0x3031323334353637, %g1, %g3
104 stx %g3,[%g2 + 32]
105 setx 0x38393a3b3c3d3e3f, %g1, %g3
106 stx %g3,[%g2 + 40]
107 setx 0x4041424344454647, %g1, %g3
108 stx %g3,[%g2 + 48]
109 setx 0x48494a4b4c4d4e4f, %g1, %g3
110 stx %g3,[%g2 + 56]
111
112 /*******************************************************
113 RDD from DMU
114 ********************************************************/
115set_eie_rdd:
116 mov 0x1, %g1
117 sllx %g1, ERR_FIELD, %l2
118 setx SOC_EIE_REG, %g7, %g3
119 stx %l2, [%g3]
120 membar 0x40
121
122
123set_ejr_1:
124 setx SOC_EJR_REG, %g7, %g6
125 stx %l2, [%g6]
126 membar 0x40
127
128
129 ! 1 byte loads, all 16 offsets
130
131byte_os0:
132 nop ! $EV trig_pc_d(1, @VA(.MAIN.byte_os0)) -> printf("\n byte_os0 \n")
133 ldub [%g2 + 0], %l0
134 cmp %l0, 0x10
135 BNE_TEST_FAIL
136 nop
137
138
139 set 0x40, %i2
140 set 0x1, %i1
141checks_traptaken:
142 cmp %i7, %i1
143 be %xcc, check_tt
144 nop
145
146 dec %i2
147 cmp %i2, %g0
148 be test_failed
149 nop
150
151check_tt:
152 mov 0x63, %l0
153 cmp %o7, %l0
154 bne %xcc, test_failed
155 nop
156
157test_passed:
158 EXIT_GOOD
159
160test_failed:
161 EXIT_BAD
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 nop
178
179check_per_tt63:
180 mov 0x1, %g1
181 sllx %g1, ERR_FIELD, %g2
182 setx 0x8000000000000000, %g7, %g3
183 or %g2, %g3, %g1
184
185 setx SOC_PER_REG, %g7, %g2
186 ldx [%g2], %g3
187
188 cmp %g1, %g3
189 bne %xcc, test_failed
190 nop
191
192clear_per_tt63:
193 setx SOC_PER_REG, %l7, %i0
194 stx %g0, [%i0]
195 nop
196 done
197 nop
198
199