| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: rst_csrs.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 then read data of RSET_STAT |
| 59 | setx 0x0000008900000810,%g7,%g1 |
| 60 | setx reset_stat,%g7,%g2 |
| 61 | set 0x06,%g3 |
| 62 | |
| 63 | loop2: |
| 64 | ldx [%g2],%g4 |
| 65 | stx %g4,[%g1] |
| 66 | |
| 67 | ldx [%g1], %g5 |
| 68 | |
| 69 | cmp %g4, %g5 |
| 70 | |
| 71 | bne %xcc, test_fail |
| 72 | |
| 73 | |
| 74 | add %g2,8,%g2 |
| 75 | sub %g3,1,%g3 |
| 76 | cmp %g3,%g0 |
| 77 | bne loop2 |
| 78 | nop |
| 79 | |
| 80 | !Write then read data of RESET_FEE |
| 81 | setx 0x0000008900000820,%g7,%g1 |
| 82 | setx reset_fee,%g7,%g2 |
| 83 | set 0x06,%g3 |
| 84 | |
| 85 | loop3: |
| 86 | ldx [%g2],%g4 |
| 87 | stx %g4,[%g1] |
| 88 | |
| 89 | ldx [%g1], %g5 |
| 90 | |
| 91 | cmp %g4, %g5 |
| 92 | |
| 93 | bne %xcc, test_fail |
| 94 | |
| 95 | |
| 96 | add %g2,8,%g2 |
| 97 | sub %g3,1,%g3 |
| 98 | cmp %g3,%g0 |
| 99 | bne loop3 |
| 100 | nop |
| 101 | |
| 102 | |
| 103 | !Write then read data of CCU_TIME |
| 104 | setx 0x0000008900000860,%g7,%g1 |
| 105 | setx ccu_time,%g7,%g2 |
| 106 | set 0x06,%g3 |
| 107 | |
| 108 | loop4: |
| 109 | ldx [%g2],%g4 |
| 110 | stx %g4,[%g1] |
| 111 | |
| 112 | ldx [%g1], %g5 |
| 113 | |
| 114 | cmp %g4, %g5 |
| 115 | |
| 116 | bne %xcc, test_fail |
| 117 | |
| 118 | |
| 119 | add %g2,8,%g2 |
| 120 | sub %g3,1,%g3 |
| 121 | cmp %g3,%g0 |
| 122 | bne loop4 |
| 123 | nop |
| 124 | /* |
| 125 | |
| 126 | !Write then read data of LOCK_TIME |
| 127 | setx 0x0000008900000870,%g7,%g1 |
| 128 | setx ccu_time,%g7,%g2 |
| 129 | set 0x06,%g3 |
| 130 | |
| 131 | loop5: |
| 132 | ldx [%g2],%g4 |
| 133 | stx %g4,[%g1] |
| 134 | |
| 135 | ldx [%g1], %g5 |
| 136 | |
| 137 | cmp %g4, %g5 |
| 138 | |
| 139 | bne %xcc, test_fail |
| 140 | |
| 141 | |
| 142 | add %g2,8,%g2 |
| 143 | sub %g3,1,%g3 |
| 144 | cmp %g3,%g0 |
| 145 | bne loop5 |
| 146 | nop |
| 147 | |
| 148 | !Write then read data of PROP_TIME |
| 149 | setx 0x0000008900000880,%g7,%g1 |
| 150 | setx ccu_time,%g7,%g2 |
| 151 | set 0x06,%g3 |
| 152 | |
| 153 | loop6: |
| 154 | ldx [%g2],%g4 |
| 155 | stx %g4,[%g1] |
| 156 | |
| 157 | ldx [%g1], %g5 |
| 158 | |
| 159 | cmp %g4, %g5 |
| 160 | |
| 161 | bne %xcc, test_fail |
| 162 | |
| 163 | |
| 164 | add %g2,8,%g2 |
| 165 | sub %g3,1,%g3 |
| 166 | cmp %g3,%g0 |
| 167 | bne loop6 |
| 168 | nop |
| 169 | |
| 170 | !Write then read data of NIU_TIME |
| 171 | setx 0x0000008900000890,%g7,%g1 |
| 172 | setx ccu_time,%g7,%g2 |
| 173 | set 0x06,%g3 |
| 174 | |
| 175 | loop7: |
| 176 | ldx [%g2],%g4 |
| 177 | stx %g4,[%g1] |
| 178 | |
| 179 | ldx [%g1], %g5 |
| 180 | |
| 181 | cmp %g4, %g5 |
| 182 | |
| 183 | bne %xcc, test_fail |
| 184 | |
| 185 | |
| 186 | add %g2,8,%g2 |
| 187 | sub %g3,1,%g3 |
| 188 | cmp %g3,%g0 |
| 189 | bne loop7 |
| 190 | nop |
| 191 | |
| 192 | */ |
| 193 | |
| 194 | |
| 195 | |
| 196 | /****************************************************** |
| 197 | * Exit code |
| 198 | *******************************************************/ |
| 199 | |
| 200 | test_pass: |
| 201 | EXIT_GOOD |
| 202 | |
| 203 | test_fail: |
| 204 | EXIT_BAD |
| 205 | |
| 206 | |
| 207 | .data |
| 208 | .align 0x100 |
| 209 | ssys_reset_data: |
| 210 | .xword 0x0000000000000073 |
| 211 | .xword 0x0000000000000022 |
| 212 | .xword 0x0000000000000051 |
| 213 | .xword 0x0000000000000000 |
| 214 | .xword 0x0000000000000043 |
| 215 | .xword 0x0000000000000031 |
| 216 | |
| 217 | .align 0x100 |
| 218 | reset_stat: |
| 219 | .xword 0x0000000000000e0e |
| 220 | .xword 0x0000000000000a0a |
| 221 | .xword 0x0000000000000404 |
| 222 | .xword 0x0000000000000000 |
| 223 | .xword 0x0000000000000808 |
| 224 | .xword 0x0000000000000202 |
| 225 | |
| 226 | .align 0x100 |
| 227 | reset_fee: |
| 228 | .xword 0x000000000000ff00 |
| 229 | .xword 0x000000000000aa00 |
| 230 | .xword 0x0000000000005500 |
| 231 | .xword 0x0000000000000000 |
| 232 | .xword 0x0000000000008800 |
| 233 | .xword 0x0000000000002200 |
| 234 | |
| 235 | .align 0x100 |
| 236 | ccu_time: |
| 237 | .xword 0x000000000000ffff |
| 238 | .xword 0x000000000000aaaa |
| 239 | .xword 0x0000000000005555 |
| 240 | .xword 0x0000000000000000 |
| 241 | .xword 0x0000000000008888 |
| 242 | .xword 0x0000000000002222 |
| 243 | |
| 244 | |
| 245 | .end |
| 246 | |