Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: PCIeIORw_dtm.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 MAIN_PAGE_HV_ALSO | |
39 | ||
40 | #include "peu_defines.h" | |
41 | ||
42 | #define IO_RD_ADDR mpeval((N2_PCIE_BASE_ADDR + (IOCFG_OFFSET_BASE_REG_DATA & 0x7fffffffffffffff)) | IO_ACCESS_PA) | |
43 | ||
44 | /************************************************************************ | |
45 | Test case code start | |
46 | ************************************************************************/ | |
47 | .text | |
48 | .global pio_rw_thru_ssi | |
49 | pio_rw_thru_ssi: | |
50 | ! ta T_CHANGE_HPRIV | |
51 | ! nop | |
52 | ||
53 | ! select an IO address in PCI address range and transmit the command to NCU | |
54 | setx IO_RD_ADDR, %g1, %g2 | |
55 | ||
56 | set 0x11, %o0 | |
57 | ! set 0x1122, %o1 | |
58 | ! set 0x2233, %o2 | |
59 | ! set 0x3344, %o3 | |
60 | ! set 0x4455, %o4 | |
61 | ! set 0x5566, %o5 | |
62 | ! set 0x778899aa, %o6 | |
63 | ! set 0xbbccddee, %o7 | |
64 | ! store byte - all byte offsets within an octlet | |
65 | stb %o0, [%g2 + 1*8 + 0] | |
66 | ! stb %o1, [%g2 + 2*8 + 1] | |
67 | ! stb %o2, [%g2 + 3*8 + 2] | |
68 | ! stb %o3, [%g2 + 4*8 + 3] | |
69 | ! stb %o4, [%g2 + 5*8 + 4] | |
70 | ! stb %o5, [%g2 + 6*8 + 5] | |
71 | ! stb %o6, [%g2 + 7*8 + 6] | |
72 | ! stb %o7, [%g2 + 8*8 + 7] | |
73 | ||
74 | ! store half-word - all half-word offsets within an octlet | |
75 | ! sth %o0, [%g2 + 8*9 + 0] | |
76 | ! sth %o1, [%g2 + 8*10 + 2] | |
77 | ! sth %o2, [%g2 + 8*11 + 4] | |
78 | ! sth %o3, [%g2 + 8*12 + 8] | |
79 | ||
80 | ! store word - all word offsets within an octlet | |
81 | ! stw %o4, [%g2 + 8*13 + 0] | |
82 | ! stw %o5, [%g2 + 8*14 + 4] | |
83 | ||
84 | !!! use the loads to verify the stores | |
85 | ||
86 | ! load byte - all byte offsets within an octlet | |
87 | ldub [%g2 + 13*8 + 0], %l0 | |
88 | ! ldub [%g2 + 13*8 + 1], %l1 | |
89 | ! ldub [%g2 + 13*8 + 2], %l2 | |
90 | ! ldub [%g2 + 13*8 + 3], %l3 | |
91 | ! ldub [%g2 + 14*8 + 4], %l4 | |
92 | ! ldub [%g2 + 14*8 + 5], %l5 | |
93 | ! ldub [%g2 + 14*8 + 6], %l6 | |
94 | ! ldub [%g2 + 14*8 + 7], %l7 | |
95 | ||
96 | ! load half-word - all half-word offsets within an octlet | |
97 | lduh [%g2 + 1*8 + 0], %o0 | |
98 | ! lduh [%g2 + 2*8 + 0], %o0 | |
99 | ! lduh [%g2 + 3*8 + 2], %o1 | |
100 | ! lduh [%g2 + 4*8 + 2], %o2 | |
101 | ! lduh [%g2 + 5*8 + 4], %o3 | |
102 | ! lduh [%g2 + 7*8 + 6], %o3 | |
103 | ||
104 | ! Load word - all word offsets within an octlet | |
105 | ! lduw [%g2 + 13*8 + 0], %o4 | |
106 | ! lduw [%g2 + 6*8 + 4], %o4 | |
107 | ! lduw [%g2 + 8*8 + 4], %o5 | |
108 | ||
109 | ! test_passed: | |
110 | ! EXIT_GOOD | |
111 | ||
112 | ! test_failed: | |
113 | ! EXIT_BAD | |
114 | ||
115 | /************************************************************************ | |
116 | Test case data start | |
117 | ************************************************************************/ | |
118 | ||
119 | SECTION .DATA DATA_VA=IO_RD_ADDR | |
120 | attr_data { | |
121 | Name = .DATA, | |
122 | hypervisor, | |
123 | compressimage | |
124 | } | |
125 | ||
126 | .data | |
127 | .xword 0xdeadbeefdeadbeef | |
128 | ||
129 | .xword 0x0101010101010101 | |
130 | .xword 0x0101010101010101 | |
131 | .xword 0x0101010101010101 | |
132 | .xword 0x0101010101010101 | |
133 | ||
134 | .xword 0x0202020202020202 | |
135 | .xword 0x0202020202020202 | |
136 | .xword 0x0202020202020202 | |
137 | .xword 0x0202020202020202 | |
138 | ||
139 | .xword 0x0303030303030303 | |
140 | .xword 0x0303030303030303 | |
141 | .xword 0x0303030303030303 | |
142 | .xword 0x0303030303030303 | |
143 | ||
144 | .xword 0x0404040404040404 | |
145 | .xword 0x0404040404040404 | |
146 | .xword 0x0404040404040404 | |
147 | .xword 0x0404040404040404 | |
148 | ||
149 | .xword 0xdeadbeefdeadbeef | |
150 | ||
151 | /************************************************************************/ |