Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: PCIeDMAWr.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 | #include "hboot.s" | |
43 | #include "peu_defines.h" | |
44 | ||
45 | #define DMA_DATA_ADDR 0x0000000123456700 | |
46 | #define DMA_DATA_BYP_ADDR1 0xfffc000123456700 | |
47 | #define DMA_DATA_BYP_ADDR2 0xfffc000123456780 | |
48 | #define DMA_DATA_BYP_ADDR3 0xfffc000123456800 | |
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 | ! enable bypass in IOMMU | |
61 | setx FIRE_DLC_MMU_CSR_A_CTL_ADDR, %g1, %g2 | |
62 | setx FIRE_DLC_MMU_CSR_A_CTL__BYPASS_EN, %g1, %g3 | |
63 | stx %g3, [%g2] | |
64 | ldx [%g2], %g3 | |
65 | ||
66 | XmtUsrEvnt1: nop; | |
67 | ! $EV trig_pc_d(1, @VA(.MAIN.XmtUsrEvnt1)) -> EnablePCIeIgCmd ("DMAWR", DMA_DATA_BYP_ADDR1, DMA_DATA_BYP_ADDR1, "64'h20", 1 ) | |
68 | ldx [%g2], %g3 | |
69 | ldx [%g2], %g3 | |
70 | ldx [%g2], %g3 | |
71 | ldx [%g2], %g3 | |
72 | ||
73 | XmtUsrEvnt2: nop; | |
74 | ! $EV trig_pc_d(1, @VA(.MAIN.XmtUsrEvnt2)) -> EnablePCIeIgCmd ("DMAWR", DMA_DATA_BYP_ADDR2, DMA_DATA_BYP_ADDR2, "64'h40", 1 ) | |
75 | ldx [%g2], %g3 | |
76 | ldx [%g2], %g3 | |
77 | ldx [%g2], %g3 | |
78 | ldx [%g2], %g3 | |
79 | ||
80 | XmtUsrEvnt3: nop; | |
81 | ! $EV trig_pc_d(1, @VA(.MAIN.XmtUsrEvnt3)) -> EnablePCIeIgCmd ("DMAWR", DMA_DATA_BYP_ADDR3, DMA_DATA_BYP_ADDR3, "64'h80", 1 ) | |
82 | ldx [%g2], %g3 | |
83 | ldx [%g2], %g3 | |
84 | ldx [%g2], %g3 | |
85 | ldx [%g2], %g3 | |
86 | ||
87 | ! select a CSR in the PIU and transmit the command to NCU | |
88 | ||
89 | setx FIRE_PLC_TLU_CTB_TLR_CSR_A_TLU_CTL_ADDR, %g1, %g2 | |
90 | setx 0x020, %g1, %g4 | |
91 | ||
92 | delay_loop: | |
93 | ldx [%g2], %g5 | |
94 | nop | |
95 | nop | |
96 | nop | |
97 | nop | |
98 | dec %g4 | |
99 | brnz %g4, delay_loop | |
100 | nop | |
101 | ||
102 | test_passed: | |
103 | EXIT_GOOD | |
104 | ||
105 | test_failed: | |
106 | EXIT_BAD | |
107 | ||
108 | ||
109 | /************************************************************************ | |
110 | Test case data start | |
111 | ************************************************************************/ | |
112 | ||
113 | SECTION .DATA DATA_VA=DMA_DATA_ADDR | |
114 | attr_data { | |
115 | Name = .DATA, | |
116 | hypervisor, | |
117 | compressimage | |
118 | } | |
119 | ||
120 | .data | |
121 | .global PCIAddr9 | |
122 | .xword 0x0001020304050607 | |
123 | .xword 0x08090a0b0c0d0e0f | |
124 | .xword 0x1011121314151617 | |
125 | .xword 0x18191a1b1c1d1e1f | |
126 | .xword 0x2021222324252627 | |
127 | .xword 0x28292a2b2c2d2e2f | |
128 | .xword 0x3031323334353637 | |
129 | .xword 0x38393a3b3c3d3e3f | |
130 | ||
131 | .xword 0x4041424344454647 | |
132 | .xword 0x48494a4b4c4d4e4f | |
133 | .xword 0x5051525354555657 | |
134 | .xword 0x58595a5b5c5d5e5f | |
135 | .xword 0x6061626364656667 | |
136 | .xword 0x68696a6b6c6d6e6f | |
137 | .xword 0x7071727374757677 | |
138 | .xword 0x78797a7b7c7d7e7f | |
139 | ||
140 | .xword 0x8081828384858687 | |
141 | .xword 0x88898a8b8c8d8e8f | |
142 | .xword 0x9091929394959697 | |
143 | .xword 0x98999a9b9c9d9e9f | |
144 | .xword 0xa0a1a2a3a4a5a6a7 | |
145 | .xword 0xa8a9aaabacadaeaf | |
146 | .xword 0xb0b1b2b3b4b5b6b7 | |
147 | .xword 0xb8b9babbbcbdbebf | |
148 | ||
149 | .xword 0xc0c1c2c3c4c5c6c7 | |
150 | .xword 0xc8c9cacbcccdcecf | |
151 | .xword 0xd0d1d2d3d4d5d6d7 | |
152 | .xword 0xd8d9dadbdcdddedf | |
153 | .xword 0xe0e1e2e3e4e5e6e7 | |
154 | .xword 0xe8e9eaebecedeeef | |
155 | .xword 0xf0f1f2f3f4f5f6f7 | |
156 | .xword 0xf8f9fafbfcfdfeff | |
157 | ||
158 | .xword 0x0001020304050607 | |
159 | .xword 0x08090a0b0c0d0e0f | |
160 | .xword 0x1011121314151617 | |
161 | .xword 0x18191a1b1c1d1e1f | |
162 | .xword 0x2021222324252627 | |
163 | .xword 0x28292a2b2c2d2e2f | |
164 | .xword 0x3031323334353637 | |
165 | .xword 0x38393a3b3c3d3e3f | |
166 | ||
167 | .xword 0x4041424344454647 | |
168 | .xword 0x48494a4b4c4d4e4f | |
169 | .xword 0x5051525354555657 | |
170 | .xword 0x58595a5b5c5d5e5f | |
171 | .xword 0x6061626364656667 | |
172 | .xword 0x68696a6b6c6d6e6f | |
173 | .xword 0x7071727374757677 | |
174 | .xword 0x78797a7b7c7d7e7f | |
175 | ||
176 | .xword 0x8081828384858687 | |
177 | .xword 0x88898a8b8c8d8e8f | |
178 | .xword 0x9091929394959697 | |
179 | .xword 0x98999a9b9c9d9e9f | |
180 | .xword 0xa0a1a2a3a4a5a6a7 | |
181 | .xword 0xa8a9aaabacadaeaf | |
182 | .xword 0xb0b1b2b3b4b5b6b7 | |
183 | .xword 0xb8b9babbbcbdbebf | |
184 | ||
185 | .xword 0xc0c1c2c3c4c5c6c7 | |
186 | .xword 0xc8c9cacbcccdcecf | |
187 | .xword 0xd0d1d2d3d4d5d6d7 | |
188 | .xword 0xd8d9dadbdcdddedf | |
189 | .xword 0xe0e1e2e3e4e5e6e7 | |
190 | .xword 0xe8e9eaebecedeeef | |
191 | .xword 0xf0f1f2f3f4f5f6f7 | |
192 | .xword 0xf8f9fafbfcfdfeff | |
193 | ||
194 | /************************************************************************/ |