Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: tso_n2_ncrdwr6.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 | #include "hboot.s" | |
46 | ||
47 | .text | |
48 | .global main | |
49 | ||
50 | main: | |
51 | ||
52 | th_fork(th_main, %l0) | |
53 | ||
54 | th_main_0: | |
55 | ta T_CHANGE_HPRIV | |
56 | ||
57 | wr %g0, 0x4, %fprs /* make sure fef is 1 */ | |
58 | ||
59 | ||
60 | setx user_data_start, %l0, %l1 ! user data start | |
61 | setx ncdata_base, %l0, %l2 ! nc data base | |
62 | setx 0x1000, %l0, %l3 ! nc datawork area | |
63 | add %l2, %l3, %l2 | |
64 | ||
65 | mov %g0, %g4 | |
66 | set 0x1, %g2 | |
67 | set 0x10, %g5 | |
68 | ||
69 | st %g2, [%l2 + 0x100] ! NC store | |
70 | ||
71 | stloop0: | |
72 | stx %g2, [%l1 + %g4] ! a bunch of cacheable store. | |
73 | inc %g2 | |
74 | add 0x8, %g4, %g4 | |
75 | deccc %g5 | |
76 | bne stloop0 | |
77 | nop | |
78 | ||
79 | st %g2, [%l2] ! NC store | |
80 | ld [%l2 + 0x100], %l3 ! THIS LOAD SHOULD WAIT!!! | |
81 | ||
82 | mov 0x78, %g4 | |
83 | set 0x10, %g2 | |
84 | set 0x10, %g5 | |
85 | ||
86 | ldloop0: ! some checks | |
87 | ldx [%l1 + %g4], %g1 | |
88 | subcc %g2, %g1, %g0 | |
89 | bne bad_end | |
90 | nop | |
91 | dec %g2 | |
92 | sub %g4, 0x8, %g4 | |
93 | deccc %g5 | |
94 | bne ldloop0 | |
95 | nop | |
96 | ||
97 | normal_end: | |
98 | ta T_GOOD_TRAP | |
99 | bad_end: | |
100 | ta T_BAD_TRAP | |
101 | ||
102 | user_text_end: | |
103 | ||
104 | /*********************************************************************** | |
105 | Test case data start | |
106 | ***********************************************************************/ | |
107 | .data | |
108 | .align 0x40 | |
109 | user_data_start: | |
110 | .skip 1000 | |
111 | user_data_end: | |
112 | ||
113 | ||
114 | SECTION .NCDATA DATA_VA=0xd01ee000 | |
115 | ||
116 | attr_data { | |
117 | Name = .NCDATA, | |
118 | VA=0xd01ee000, | |
119 | RA=0xc100bee000, | |
120 | PA=0xc100bee000, | |
121 | part_0_ctx_nonzero_tsb_config_0, | |
122 | TTE_G=0, TTE_Context=PCONTEXT, TTE_V=1, TTE_Size=0, TTE_SIZE_PTR=0, TTE_NFO=0, | |
123 | TTE_IE=0, TTE_Soft2=0, TTE_Diag=0, TTE_Soft=0, | |
124 | TTE_L=0, TTE_CP=0, TTE_CV=0, TTE_E=1, TTE_P=0, TTE_W=1 | |
125 | } | |
126 | ||
127 | .data | |
128 | .global ncdata_base | |
129 | ncdata_base: | |
130 | .skip 1000 | |
131 | ||
132 | ||
133 | ||
134 |