| 1 | /* |
| 2 | * ========== Copyright Header Begin ========================================== |
| 3 | * |
| 4 | * OpenSPARC T2 Processor File: tso_n2_ncrdwr5_user.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 | #define JBI_CONFIG |
| 40 | #define ASI_SWVR_INTR_RECEIVE 0x72 |
| 41 | #define ASI_SWVR_UDB_INTR_W 0x73 |
| 42 | #define ASI_SWVR_UDB_INTR_R 0x74 |
| 43 | #define ENABLE_PCIE_LINK_TRAINING |
| 44 | |
| 45 | #define H_T0_Data_Access_Exception_0x30 |
| 46 | #define SUN_H_T0_Data_Access_Exception_0x30 \ |
| 47 | ta 0x90; \ |
| 48 | done; |
| 49 | |
| 50 | !!!#define H_HT0_Data_Access_Exception_0x30 data_access_exception_custom_trap |
| 51 | #define H_HT0_DAE_nc_page_0x16 |
| 52 | #define SUN_H_HT0_DAE_nc_page_0x16 \ |
| 53 | inc %l4;\ |
| 54 | done; nop |
| 55 | |
| 56 | #include "hboot.s" |
| 57 | .text |
| 58 | .global main |
| 59 | main: |
| 60 | |
| 61 | th_fork(th_main, %l0) |
| 62 | |
| 63 | th_main_0: |
| 64 | wr %g0, 0x4, %fprs /* make sure fef is 1 */ |
| 65 | |
| 66 | ! ta 0x30 |
| 67 | |
| 68 | setx user_data_start, %l0, %l1 ! user data start |
| 69 | setx ncdata_base, %l0, %g3 ! nc data base |
| 70 | setx 0x1000, %l0, %l3 ! nc datawork area |
| 71 | add %g3, %l3, %g3 |
| 72 | |
| 73 | !===================== |
| 74 | ! Now some forbidden NC operations |
| 75 | !===================== |
| 76 | mov %g0, %l4 |
| 77 | set 0x1, %g2 |
| 78 | |
| 79 | cas [%g3], %g0, %g2 |
| 80 | |
| 81 | ldstub [%g3], %g2 |
| 82 | |
| 83 | swap [%g3], %g2 |
| 84 | |
| 85 | prefetch [%g3], #n_writes |
| 86 | |
| 87 | sub %l4, 3, %l4 |
| 88 | brnz %l4, bad_end |
| 89 | nop |
| 90 | |
| 91 | normal_end: |
| 92 | ta T_GOOD_TRAP |
| 93 | bad_end: |
| 94 | ta T_BAD_TRAP |
| 95 | |
| 96 | user_text_end: |
| 97 | |
| 98 | /*********************************************************************** |
| 99 | Test case data start |
| 100 | ***********************************************************************/ |
| 101 | .data |
| 102 | user_data_start: |
| 103 | .skip 1000 |
| 104 | user_data_end: |
| 105 | |
| 106 | SECTION .NCDATA DATA_VA=0xd01ee000 |
| 107 | |
| 108 | attr_data { |
| 109 | Name = .NCDATA, |
| 110 | VA=0xd01ee000, |
| 111 | RA=0xcf00bee000, |
| 112 | PA=0xcf00bee000, |
| 113 | part_0_ctx_nonzero_tsb_config_0, |
| 114 | TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_SIZE_PTR=0, TTE_NFO=0, |
| 115 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, |
| 116 | TTE_L=0, TTE_CP=0, TTE_CV=0, TTE_E=1, TTE_P=0, TTE_W=1 |
| 117 | } |
| 118 | |
| 119 | .data |
| 120 | .global ncdata_base |
| 121 | ncdata_base: |
| 122 | .skip 1000 |
| 123 | |
| 124 | |