| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: niu_tx_gen_hboot.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 "hboot.s" |
| 41 | #include "niu_defines.h" |
| 42 | |
| 43 | #define TX_LOG_PAGE_VLD_ADDR mpeval(FZC_DMC_ADDRESS_RANGE+0x40000) |
| 44 | #define TX_LOG_PAGE_VLD_DATA 0x1 |
| 45 | |
| 46 | /************************************************************************ |
| 47 | Test case code start |
| 48 | ************************************************************************/ |
| 49 | .text |
| 50 | .global main |
| 51 | |
| 52 | main: |
| 53 | ta T_CHANGE_HPRIV |
| 54 | nop |
| 55 | |
| 56 | #include "niu_init.h" |
| 57 | ! |
| 58 | ! Thread 0 Start |
| 59 | ! |
| 60 | ! |
| 61 | thread_0: |
| 62 | |
| 63 | Init_flow: |
| 64 | nop ! $EV trig_pc_d(1, @VA(.MAIN.Init_flow)) -> pktGenConfig() |
| 65 | nop |
| 66 | |
| 67 | setx TXC_PORT0_DMA_ENABLE_ADDR, %g1, %g2 |
| 68 | setx TXC_PORT0_DMA_ENABLE_DATA, %g1, %g3 |
| 69 | stxa %g3, [%g2]ASI_PRIMARY_LITTLE |
| 70 | SetActive: |
| 71 | nop ! $EV trig_pc_d(1, @VA(.MAIN.SetActive)) -> DMAActivate(3) |
| 72 | |
| 73 | Gen_Packet: |
| 74 | nop ! $EV trig_pc_d(1, @VA(.MAIN.Gen_Packet)) -> pktgen(0,8) |
| 75 | |
| 76 | |
| 77 | tx_begin: |
| 78 | SetTxLPValid: |
| 79 | setx TX_LOG_PAGE_VLD_ADDR, %g1, %g2 |
| 80 | setx TX_LOG_PAGE_VLD_DATA, %g1, %g3 |
| 81 | stxa %g3, [%g2]ASI_PRIMARY_LITTLE |
| 82 | nop |
| 83 | |
| 84 | setTxRingConfig: |
| 85 | setx 0x100000000, %g1, %g2 |
| 86 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g3 ! $EV trig_pc_d(1, @VA(.MAIN.setTxRingConfig)) -> printf("Triggering setTxRingConfig",*,1) |
| 87 | nop |
| 88 | setx TX_RNG_CFIG, %g1, %g2 |
| 89 | ! setx TxRingConfig_data, %g1, %g3 |
| 90 | stxa %g3, [%g2]ASI_PRIMARY_LITTLE |
| 91 | nop |
| 92 | setTxRingKick: |
| 93 | setx 0x100000100, %g1, %g2 |
| 94 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g3 ! $EV trig_pc_d(1, @VA(.MAIN.setTxRingKick)) -> printf("Triggering setTxRingKick",*,1) |
| 95 | nop |
| 96 | setx TX_RING_KICK, %g1, %g2 |
| 97 | stxa %g3, [%g2]ASI_PRIMARY_LITTLE |
| 98 | nop |
| 99 | setTxCs: |
| 100 | setx TX_CS, %g1, %g2 |
| 101 | setx SetTxCs_data, %g1, %g3 |
| 102 | stxa %g3, [%g2]ASI_PRIMARY_LITTLE |
| 103 | nop |
| 104 | |
| 105 | nop |
| 106 | nop |
| 107 | stxa %g0, [%g2]ASI_PRIMARY_LITTLE ! Unstall the dma Engine |
| 108 | nop |
| 109 | |
| 110 | setx loop_count, %g1, %g4 |
| 111 | delay_loop: |
| 112 | ldxa [%g2]ASI_PRIMARY_LITTLE, %g5 |
| 113 | nop |
| 114 | nop |
| 115 | nop |
| 116 | nop |
| 117 | dec %g4 |
| 118 | brnz %g4, delay_loop |
| 119 | nop |
| 120 | |
| 121 | |
| 122 | test_passed: |
| 123 | nop ! $EV trig_pc_d(1, @VA(.MAIN.test_passed)) -> NIU_EXIT_chk() |
| 124 | EXIT_GOOD |
| 125 | |
| 126 | test_failed: |
| 127 | EXIT_BAD |
| 128 | |
| 129 | |
| 130 | /************************************************************************ |
| 131 | Test case data start |
| 132 | ************************************************************************/ |
| 133 | SECTION descriptor data_va=0x100000000 |
| 134 | |
| 135 | attr_data { |
| 136 | Name = descriptor, |
| 137 | hypervisor, |
| 138 | compressimage |
| 139 | } |
| 140 | .data |
| 141 | .align 0x10000 |
| 142 | descriptor: |
| 143 | .xword 0x0060452301000484 |
| 144 | .xword 0x0068452301000484 |
| 145 | .xword 0x0070452301000484 |
| 146 | .xword 0x0078452301000484 |
| 147 | .xword 0x0080452301000484 |
| 148 | .xword 0x0088452301000484 |
| 149 | .xword 0x0090452301000484 |
| 150 | .xword 0x0098452301000484 |
| 151 | |
| 152 | .xword 0x0060452301000484 |
| 153 | .xword 0x0068452301000484 |
| 154 | .xword 0x0070452301000484 |
| 155 | .xword 0x0078452301000484 |
| 156 | .xword 0x0080452301000484 |
| 157 | .xword 0x0088452301000484 |
| 158 | .xword 0x0090452301000484 |
| 159 | .xword 0x0098452301000484 |
| 160 | .xword 0x0060452301000484 |
| 161 | .xword 0x0068452301000484 |
| 162 | .xword 0x0070452301000484 |
| 163 | .xword 0x0078452301000484 |
| 164 | .xword 0x0080452301000484 |
| 165 | .xword 0x0088452301000484 |
| 166 | .xword 0x0090452301000484 |
| 167 | .xword 0x0098452301000484 |
| 168 | |
| 169 | .xword 0x0060452301000484 |
| 170 | .xword 0x0064452301000484 |
| 171 | .xword 0x0068452301000484 |
| 172 | .xword 0x006c452301000484 |
| 173 | .xword 0x0070452301000484 |
| 174 | .xword 0x0074452301000484 |
| 175 | .xword 0x0078452301000484 |
| 176 | .xword 0x007c452301000484 |
| 177 | .xword 0x8404000123456400 |
| 178 | .xword 0x8404000123456000 |
| 179 | .xword 0x8404000123456c00 |
| 180 | .xword 0x8404000123456800 |
| 181 | .xword 0x8404000123457400 |
| 182 | .xword 0x8404000123457000 |
| 183 | .xword 0x8404000123457c00 |
| 184 | .xword 0x8404000123457800 |
| 185 | |
| 186 | /************************************************************************/ |