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