| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: memop_l2_vuad_access.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 | #define L2_VUAD_ARRAY_BASE_ADDR 0xa600000000 |
| 41 | |
| 42 | #include "hboot.s" |
| 43 | #include "asi_s.h" |
| 44 | |
| 45 | /************************************************************************ |
| 46 | Test case code start |
| 47 | ************************************************************************/ |
| 48 | |
| 49 | .text |
| 50 | .global main |
| 51 | |
| 52 | main: |
| 53 | ta T_CHANGE_HPRIV |
| 54 | |
| 55 | ! Check first word in each bank of the L2 VUAD array. |
| 56 | |
| 57 | setx L2_VUAD_ARRAY_BASE_ADDR, %g1, %g2 |
| 58 | setx 0x400000, %g1, %g3 ! Selects VD or UA bits. |
| 59 | mov %g2, %g7 |
| 60 | bank0: |
| 61 | ldx [%g2], %l0 |
| 62 | or %g2, %g3, %g6 |
| 63 | ldx [%g6], %l1 |
| 64 | membar #Sync |
| 65 | stx %l0, [%g2] |
| 66 | stx %l1, [%g6] |
| 67 | membar #Sync |
| 68 | bank1: |
| 69 | add %g2, 0x40, %g2 |
| 70 | ldx [%g2], %l0 |
| 71 | or %g2, %g3, %g6 |
| 72 | ldx [%g6], %l1 |
| 73 | membar #Sync |
| 74 | stx %l0, [%g2] |
| 75 | stx %l1, [%g6] |
| 76 | membar #Sync |
| 77 | bank2: |
| 78 | add %g2, 0x40, %g2 |
| 79 | ldx [%g2], %l0 |
| 80 | or %g2, %g3, %g6 |
| 81 | ldx [%g6], %l1 |
| 82 | membar #Sync |
| 83 | stx %l0, [%g2] |
| 84 | stx %l1, [%g6] |
| 85 | membar #Sync |
| 86 | bank3: |
| 87 | add %g2, 0x40, %g2 |
| 88 | ldx [%g2], %l0 |
| 89 | or %g2, %g3, %g6 |
| 90 | ldx [%g6], %l1 |
| 91 | membar #Sync |
| 92 | stx %l0, [%g2] |
| 93 | stx %l1, [%g6] |
| 94 | membar #Sync |
| 95 | bank4: |
| 96 | add %g2, 0x40, %g2 |
| 97 | ldx [%g2], %l0 |
| 98 | or %g2, %g3, %g6 |
| 99 | ldx [%g6], %l1 |
| 100 | membar #Sync |
| 101 | stx %l0, [%g2] |
| 102 | stx %l1, [%g6] |
| 103 | membar #Sync |
| 104 | bank5: |
| 105 | add %g2, 0x40, %g2 |
| 106 | ldx [%g2], %l0 |
| 107 | or %g2, %g3, %g6 |
| 108 | ldx [%g6], %l1 |
| 109 | membar #Sync |
| 110 | stx %l0, [%g2] |
| 111 | stx %l1, [%g6] |
| 112 | membar #Sync |
| 113 | bank6: |
| 114 | add %g2, 0x40, %g2 |
| 115 | ldx [%g2], %l0 |
| 116 | or %g2, %g3, %g6 |
| 117 | ldx [%g6], %l1 |
| 118 | membar #Sync |
| 119 | stx %l0, [%g2] |
| 120 | stx %l1, [%g6] |
| 121 | membar #Sync |
| 122 | bank7: |
| 123 | add %g2, 0x40, %g2 |
| 124 | ldx [%g2], %l0 |
| 125 | or %g2, %g3, %g6 |
| 126 | ldx [%g6], %l1 |
| 127 | membar #Sync |
| 128 | stx %l0, [%g2] |
| 129 | stx %l1, [%g6] |
| 130 | membar #Sync |
| 131 | |
| 132 | ! Check first word in each set of bank 0 of the L2 VUAD array. |
| 133 | sets: |
| 134 | setx L2_VUAD_ARRAY_BASE_ADDR, %g1, %g2 |
| 135 | setx 0x400000, %g1, %g7 ! Selects VD or UA bits. |
| 136 | setx 0x00200, %g1, %g3 ! increment to get next set |
| 137 | setx 0x3fe00, %g1, %g4 |
| 138 | add %g2, %g4, %g4 ! addr for last set in bank 0 |
| 139 | setloop: |
| 140 | ldx [%g2], %l1 |
| 141 | or %g2, %g7, %g6 |
| 142 | ldx [%g6], %l2 |
| 143 | membar #Sync |
| 144 | stx %l1, [%g2] |
| 145 | stx %l2, [%g6] |
| 146 | cmp %g2, %g4 |
| 147 | bne setloop |
| 148 | add %g2, %g3, %g2 |
| 149 | |
| 150 | test_passed: |
| 151 | EXIT_GOOD |
| 152 | |
| 153 | test_failed: |
| 154 | EXIT_BAD |
| 155 | |
| 156 | |
| 157 | /************************************************************************ |
| 158 | Test case data start |
| 159 | ************************************************************************/ |
| 160 | .data |
| 161 | user_data_start: |
| 162 | .xword 0x0 |
| 163 | .end |
| 164 | |
| 165 | |
| 166 | |