| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: tcu_regs_l2.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 | #define TEST_DATA0 0x4c3fdead4c3fbeef |
| 42 | #define tmp1 %l2 |
| 43 | #define tmp2 %l3 |
| 44 | |
| 45 | |
| 46 | #include "asi_s.h" |
| 47 | #include "mcu_defines.h" |
| 48 | #include "tcu_defines.h" |
| 49 | |
| 50 | /************************************************************************ |
| 51 | Test case code start |
| 52 | ************************************************************************/ |
| 53 | |
| 54 | #ifdef FAST_BOOT |
| 55 | #define RESET_VEC 0x0000000000000000 |
| 56 | #else |
| 57 | #define RESET_VEC 0xfffffffff0000000 |
| 58 | #endif |
| 59 | |
| 60 | SECTION .RED_SEC TEXT_VA = RESET_VEC |
| 61 | attr_text { |
| 62 | Name=.RED_SEC, |
| 63 | hypervisor |
| 64 | } |
| 65 | |
| 66 | .text |
| 67 | nop |
| 68 | nop |
| 69 | nop |
| 70 | nop |
| 71 | nop |
| 72 | nop |
| 73 | nop |
| 74 | nop |
| 75 | |
| 76 | |
| 77 | .global main |
| 78 | |
| 79 | |
| 80 | ! ASI_PARTITION_ID |
| 81 | L1: |
| 82 | wr %g0, 0x58, %asi |
| 83 | ldxa [%g0 + ASI_PARTITION_ID_VAL] %asi, %g7 |
| 84 | cmp %g7 , %g0 |
| 85 | bne bad_trap |
| 86 | membar #Sync |
| 87 | |
| 88 | ! ASI_CMP_CORE_INTR_ID |
| 89 | L2: |
| 90 | wr %g0, 0x63, %asi |
| 91 | ldxa [%g0 ] %asi, %g7 |
| 92 | cmp %g7 , %g0 |
| 93 | bne bad_trap |
| 94 | membar #Sync |
| 95 | |
| 96 | ! ASI_CMP_CORE_ID |
| 97 | L3: |
| 98 | setx 0x7003f0000, tmp1, tmp2 |
| 99 | wr %g0, 0x63, %asi |
| 100 | ldxa [%g0 + ASI_CMP_CORE_ID] %asi, %g7 |
| 101 | cmp tmp2, %g7 |
| 102 | bne bad_trap |
| 103 | membar #Sync |
| 104 | |
| 105 | ! ASI_INTR_RECEIVE |
| 106 | L4: |
| 107 | wr %g0, 0x72, %asi |
| 108 | ldxa [%g0 ] %asi, %g7 |
| 109 | cmp %g7 , %g0 |
| 110 | bne bad_trap |
| 111 | membar #Sync |
| 112 | |
| 113 | ! L2_ERROR_EN_REG |
| 114 | L5: |
| 115 | setx 0xAA00000000, %l5, %l6 |
| 116 | ldx [%l6], %g7 |
| 117 | cmp %g7, %g0 |
| 118 | bne bad_trap |
| 119 | membar #Sync |
| 120 | |
| 121 | ! L2_ERROR_STATUS_REG |
| 122 | L6: |
| 123 | setx 0xAB00000000, %l5, %l6 |
| 124 | ldx [%l6], %g7 |
| 125 | cmp %g7, %g0 |
| 126 | bne bad_trap |
| 127 | membar #Sync |
| 128 | |
| 129 | ! L2_ERROR_ADDRESS_REG |
| 130 | L7: |
| 131 | setx 0xAC00000000, %l5, %l6 |
| 132 | ldx [%l6], %g7 |
| 133 | cmp %g7, %g0 |
| 134 | bne bad_trap |
| 135 | membar #Sync |
| 136 | |
| 137 | ! L2_NOTDATA_ERROR_REG |
| 138 | L8: |
| 139 | setx 0xAE00000000, %l5, %l6 |
| 140 | ldx [%l6], %g7 |
| 141 | cmp %g7, %g0 |
| 142 | bne bad_trap |
| 143 | membar #Sync |
| 144 | |
| 145 | ! L2_ERROR_INJECT_REG |
| 146 | L9: |
| 147 | setx 0xAD00000000, %l5, %l6 |
| 148 | ldx [%l6], %g7 |
| 149 | cmp %g7, %g0 |
| 150 | bne bad_trap |
| 151 | membar #Sync |
| 152 | |
| 153 | |
| 154 | ! L2_MASK_REG |
| 155 | L10: |
| 156 | setx 0xAF00000000, %l5, %l6 |
| 157 | ldx [%l6], %g7 |
| 158 | cmp %g7, %g0 |
| 159 | bne bad_trap |
| 160 | membar #Sync |
| 161 | |
| 162 | ! L2_COMP_REG |
| 163 | L11: |
| 164 | setx 0xBF00000000, %l5, %l6 |
| 165 | ldx [%l6], %g7 |
| 166 | cmp %g7, %g0 |
| 167 | bne bad_trap |
| 168 | membar #Sync |
| 169 | |
| 170 | ! L2_BANK_AVAILABLE |
| 171 | L12: |
| 172 | setx 0xff, tmp1, tmp2 |
| 173 | setx 0x8000000000, %l5, %l6 |
| 174 | setx 0x1018, %l5, %g7 |
| 175 | add %l6, %g7, %g7 |
| 176 | ldx [%g7], %g3 |
| 177 | cmp %g3, %l3 |
| 178 | bne bad_trap |
| 179 | membar #Sync |
| 180 | |
| 181 | |
| 182 | ! L2_BANK_ENABLE |
| 183 | L13: |
| 184 | setx 0xff, tmp1, tmp2 |
| 185 | setx 0x8000000000, %l5, %l6 |
| 186 | setx 0x1020, %l5, %g7 |
| 187 | add %l6, %g7, %g7 |
| 188 | ldx [%g7], %g3 |
| 189 | cmp %g3, %l3 |
| 190 | bne bad_trap |
| 191 | membar #Sync |
| 192 | |
| 193 | ! L2_BANK_ENABLE_STATUS |
| 194 | L14: |
| 195 | setx 0xf0f, tmp1, tmp2 |
| 196 | setx 0x8000000000, %l5, %l6 |
| 197 | setx 0x1028, %l5, %g7 |
| 198 | add %l6, %g7, %g7 |
| 199 | ldx [%g7], %g3 |
| 200 | cmp %g3, %l3 |
| 201 | bne bad_trap |
| 202 | membar #Sync |
| 203 | |
| 204 | ! L2_INDEX_HASH_ENABLE |
| 205 | L15: |
| 206 | setx 0x8000000000, %l5, %l6 |
| 207 | setx 0x1030, %l5, %g7 |
| 208 | add %l6, %g7, %g7 |
| 209 | ldx [%g7], %g3 |
| 210 | cmp %g3, %g0 |
| 211 | bne bad_trap |
| 212 | membar #Sync |
| 213 | |
| 214 | ! L2_CONTROL_REG |
| 215 | L16: |
| 216 | set 0x1, %i3 |
| 217 | setx 0xA900000000, %l5, %l6 |
| 218 | ldx [%l6], %g7 |
| 219 | cmp %g7, %i3 |
| 220 | bne bad_trap |
| 221 | membar #Sync |
| 222 | |
| 223 | |
| 224 | |
| 225 | |
| 226 | good_trap: |
| 227 | ba good_trap |
| 228 | nop |
| 229 | nop |
| 230 | bad_trap: |
| 231 | ba bad_trap |
| 232 | nop |
| 233 | |
| 234 | |
| 235 | /************************************************************************ |
| 236 | Test case data start |
| 237 | ************************************************************************/ |
| 238 | .data |
| 239 | .xword 0x0 |
| 240 | user_data_start: |
| 241 | .end |
| 242 | |