| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: ncu_ssi_rw.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_NUCLEUS_ALSO |
| 39 | #define MAIN_PAGE_HV_ALSO |
| 40 | |
| 41 | #include "hboot.s" |
| 42 | #include "asi_s.h" |
| 43 | |
| 44 | .text |
| 45 | .global main |
| 46 | |
| 47 | |
| 48 | main: |
| 49 | ta T_CHANGE_HPRIV |
| 50 | |
| 51 | get_th_id: |
| 52 | ta T_RD_THID |
| 53 | |
| 54 | cmp %o1,0x0 |
| 55 | bne test_pass |
| 56 | nop |
| 57 | |
| 58 | !Write bytes to the SSI interface |
| 59 | setx 0x000000ffffff0000,%g7,%g1 |
| 60 | setx data_byte,%g7,%g2 |
| 61 | set 0x05,%g3 |
| 62 | loop1: |
| 63 | ldub [%g2],%g4 |
| 64 | stb %g4,[%g1] |
| 65 | add %g1,1,%g1 |
| 66 | add %g2,1,%g2 |
| 67 | sub %g3,1,%g3 |
| 68 | cmp %g3,%g0 |
| 69 | bne loop1 |
| 70 | nop |
| 71 | |
| 72 | !Read back and confirm |
| 73 | setx 0x000000ffffff0000,%g7,%g1 |
| 74 | setx data_byte,%g7,%g2 |
| 75 | set 0x05,%g3 |
| 76 | loop2: |
| 77 | ldub [%g1],%g4 |
| 78 | ldub [%g2],%g5 |
| 79 | cmp %g4,%g5 |
| 80 | bne %xcc,test_fail |
| 81 | nop |
| 82 | add %g1,1,%g1 |
| 83 | add %g2,1,%g2 |
| 84 | sub %g3,1,%g3 |
| 85 | cmp %g3,%g0 |
| 86 | bne loop2 |
| 87 | nop |
| 88 | |
| 89 | !Write half-words to the SSI interface |
| 90 | setx 0x000000ffffff0100,%g7,%g1 |
| 91 | setx data_half_word,%g7,%g2 |
| 92 | set 0x05,%g3 |
| 93 | loop3: |
| 94 | lduh [%g2],%g4 |
| 95 | sth %g4,[%g1] |
| 96 | add %g1,2,%g1 |
| 97 | add %g2,2,%g2 |
| 98 | sub %g3,1,%g3 |
| 99 | cmp %g3,%g0 |
| 100 | bne loop3 |
| 101 | nop |
| 102 | |
| 103 | !Read back and confirm |
| 104 | setx 0x000000ffffff0100,%g7,%g1 |
| 105 | setx data_half_word,%g7,%g2 |
| 106 | set 0x05,%g3 |
| 107 | loop4: |
| 108 | lduh [%g1],%g4 |
| 109 | lduh [%g2],%g5 |
| 110 | cmp %g4,%g5 |
| 111 | bne %xcc,test_fail |
| 112 | nop |
| 113 | add %g1,2,%g1 |
| 114 | add %g2,2,%g2 |
| 115 | sub %g3,1,%g3 |
| 116 | cmp %g3,%g0 |
| 117 | bne loop4 |
| 118 | nop |
| 119 | |
| 120 | !Write words to the SSI interface |
| 121 | setx 0x000000ffffff0200,%g7,%g1 |
| 122 | setx data_word,%g7,%g2 |
| 123 | set 0x05,%g3 |
| 124 | loop5: |
| 125 | lduw [%g2],%g4 |
| 126 | stw %g4,[%g1] |
| 127 | add %g1,4,%g1 |
| 128 | add %g2,4,%g2 |
| 129 | sub %g3,1,%g3 |
| 130 | cmp %g3,%g0 |
| 131 | bne loop5 |
| 132 | nop |
| 133 | |
| 134 | !Read back and confirm |
| 135 | setx 0x000000ffffff0200,%g7,%g1 |
| 136 | setx data_word,%g7,%g2 |
| 137 | set 0x05,%g3 |
| 138 | loop6: |
| 139 | lduw [%g1],%g4 |
| 140 | lduw [%g2],%g5 |
| 141 | cmp %g4,%g5 |
| 142 | bne %xcc,test_fail |
| 143 | nop |
| 144 | add %g1,4,%g1 |
| 145 | add %g2,4,%g2 |
| 146 | sub %g3,1,%g3 |
| 147 | cmp %g3,%g0 |
| 148 | bne loop6 |
| 149 | nop |
| 150 | |
| 151 | !Write double-words to the SSI interface |
| 152 | setx 0x000000ffffff0300,%g7,%g1 |
| 153 | setx data_xword,%g7,%g2 |
| 154 | set 0x05,%g3 |
| 155 | loop7: |
| 156 | ldx [%g2],%g4 |
| 157 | stx %g4,[%g1] |
| 158 | add %g1,8,%g1 |
| 159 | add %g2,8,%g2 |
| 160 | sub %g3,1,%g3 |
| 161 | cmp %g3,%g0 |
| 162 | bne loop7 |
| 163 | nop |
| 164 | |
| 165 | !Read back and confirm |
| 166 | setx 0x000000ffffff0300,%g7,%g1 |
| 167 | setx data_xword,%g7,%g2 |
| 168 | set 0x05,%g3 |
| 169 | loop8: |
| 170 | ldx [%g1],%g4 |
| 171 | ldx [%g2],%g5 |
| 172 | cmp %g4,%g5 |
| 173 | bne %xcc,test_fail |
| 174 | nop |
| 175 | add %g1,8,%g1 |
| 176 | add %g2,8,%g2 |
| 177 | sub %g3,1,%g3 |
| 178 | cmp %g3,%g0 |
| 179 | bne loop8 |
| 180 | nop |
| 181 | |
| 182 | ba test_pass |
| 183 | nop |
| 184 | |
| 185 | /****************************************************** |
| 186 | * Exit code |
| 187 | *******************************************************/ |
| 188 | |
| 189 | test_pass: |
| 190 | EXIT_GOOD |
| 191 | |
| 192 | test_fail: |
| 193 | EXIT_BAD |
| 194 | |
| 195 | .data |
| 196 | .align 0x100 |
| 197 | data_byte: |
| 198 | .byte 0x23 |
| 199 | .byte 0x39 |
| 200 | .byte 0x48 |
| 201 | .byte 0xa6 |
| 202 | .byte 0xab |
| 203 | .byte 0xc3 |
| 204 | .byte 0x8f |
| 205 | .byte 0xde |
| 206 | .byte 0xb2 |
| 207 | .byte 0x20 |
| 208 | .byte 0x99 |
| 209 | .byte 0x8a |
| 210 | .byte 0x33 |
| 211 | .byte 0x5b |
| 212 | .byte 0xbf |
| 213 | .byte 0xa0 |
| 214 | .byte 0x10 |
| 215 | .byte 0x02 |
| 216 | .byte 0xbc |
| 217 | .byte 0xad |
| 218 | .byte 0xae |
| 219 | .byte 0x92 |
| 220 | .byte 0x44 |
| 221 | .byte 0x3c |
| 222 | .byte 0xff |
| 223 | .byte 0xf1 |
| 224 | .byte 0x9f |
| 225 | .byte 0x6d |
| 226 | .byte 0xeb |
| 227 | .byte 0xda |
| 228 | .byte 0xd3 |
| 229 | .byte 0xa8 |
| 230 | |
| 231 | .align 0x100 |
| 232 | data_half_word: |
| 233 | .hword 0x34ad |
| 234 | .hword 0xfbac |
| 235 | .hword 0xd82c |
| 236 | .hword 0xa8d3 |
| 237 | .hword 0xffff |
| 238 | .hword 0xf238 |
| 239 | .hword 0x934d |
| 240 | .hword 0x92ab |
| 241 | .hword 0x4a87 |
| 242 | .hword 0x000a |
| 243 | .hword 0x100f |
| 244 | .hword 0x02aa |
| 245 | .hword 0xb3cc |
| 246 | .hword 0xc992 |
| 247 | .hword 0xef03 |
| 248 | .hword 0xad22 |
| 249 | .hword 0x0330 |
| 250 | .hword 0x2203 |
| 251 | .hword 0x2ffd |
| 252 | .hword 0xeddc |
| 253 | .hword 0xbbbb |
| 254 | .hword 0xa002 |
| 255 | .hword 0x4332 |
| 256 | .hword 0x98f2 |
| 257 | .hword 0x7761 |
| 258 | .hword 0x92cb |
| 259 | .hword 0xa00b |
| 260 | .hword 0xdd81 |
| 261 | .hword 0x977a |
| 262 | .hword 0x0001 |
| 263 | .hword 0x33b4 |
| 264 | .hword 0x7d82 |
| 265 | |
| 266 | .align 0x100 |
| 267 | data_word: |
| 268 | .word 0x2876adce |
| 269 | .word 0x9cb238af |
| 270 | .word 0xa8820fb7 |
| 271 | .word 0xaf9277cb |
| 272 | .word 0x32989782 |
| 273 | .word 0x987bdc43 |
| 274 | .word 0xba73c0fe |
| 275 | .word 0x2399dace |
| 276 | .word 0x000bed00 |
| 277 | .word 0x833bade2 |
| 278 | .word 0x92235456 |
| 279 | .word 0xbdceefda |
| 280 | .word 0xcb874bcd |
| 281 | .word 0x3248cbae |
| 282 | .word 0x933bcf26 |
| 283 | .word 0x74663bf7 |
| 284 | .word 0x6cb4ed6a |
| 285 | .word 0x7c7d7e7b |
| 286 | .word 0x88bd255c |
| 287 | .word 0x933bb265 |
| 288 | .word 0x8ccba634 |
| 289 | .word 0xaa433ccc |
| 290 | .word 0x911000bb |
| 291 | .word 0x4532bbcd |
| 292 | .word 0x822b3647 |
| 293 | .word 0xba7ce43e |
| 294 | .word 0x09990909 |
| 295 | .word 0x00000223 |
| 296 | .word 0xb00000a0 |
| 297 | .word 0xbbbc0073 |
| 298 | .word 0x337fe887 |
| 299 | .word 0x23bb3fee |
| 300 | |
| 301 | .align 0x100 |
| 302 | data_xword: |
| 303 | .xword 0xca038347023832d0 |
| 304 | .xword 0x9323bfecad638203 |
| 305 | .xword 0xabfec27356804bef |
| 306 | .xword 0x768fec687937cfea |
| 307 | .xword 0x823bfe253cdea397 |
| 308 | .xword 0xe2873fe836cd0984 |
| 309 | .xword 0xbf363fecda993bad |
| 310 | .xword 0xbaceefdefecadbce |
| 311 | .xword 0x987233b3fdce9723 |
| 312 | .xword 0x0003290432363bde |
| 313 | .xword 0xabd934793bdefacd |
| 314 | .xword 0xbfecce982734fed8 |
| 315 | .xword 0xafbeeedc897633de |
| 316 | .xword 0xaaaa0a0a00078389 |
| 317 | .xword 0x9283792332f23ede |
| 318 | .xword 0xababafecad5ef537 |
| 319 | .xword 0xabfe6353f3cd6354 |
| 320 | .xword 0xa87329876badfe09 |
| 321 | .xword 0x92733cf353fc0082 |
| 322 | .xword 0x982332cfedac3275 |
| 323 | .xword 0x2765454819238675 |
| 324 | .xword 0x932bf23932af639d |
| 325 | .xword 0x292364fed043689b |
| 326 | .xword 0x0650607211073674 |
| 327 | .xword 0xdfce893853cdeaf3 |
| 328 | .xword 0xdd04746852834fe9 |
| 329 | .xword 0x9232dfeaabbabdeb |
| 330 | .xword 0xababdfefdccceaab |
| 331 | .xword 0x7cbbe8e53ccefd57 |
| 332 | .xword 0x83b3385232dfec12 |
| 333 | .xword 0x7675373232f32d32 |
| 334 | .xword 0xf363583f35683f21 |
| 335 | .end |