Commit | Line | Data |
---|---|---|
86530b38 AT |
1 | /* |
2 | * ========== Copyright Header Begin ========================================== | |
3 | * | |
4 | * OpenSPARC T2 Processor File: tso_n2_ncrdwr5.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_Trap_Instruction_0 | |
46 | #define My_T0_Trap_Instruction_0 \ | |
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 | ||
58 | .text | |
59 | .global main | |
60 | ||
61 | main: | |
62 | ta T_CHANGE_HPRIV | |
63 | nop | |
64 | ||
65 | wr %g0, 0x4, %fprs /* make sure fef is 1 */ | |
66 | mov %g0, %l4 | |
67 | setx 0xdeadbeefdeadbeef, %g1, %g2 | |
68 | setx 0xc100beef00, %g1, %g3 ! MEM32 address space | |
69 | stx %g2, [%g3] | |
70 | !===================== | |
71 | setx 0xdeadbeefdeadbeef, %g1, %g2 | |
72 | setx 0xc900beef00, %g1, %g3 ! MEM64 address space | |
73 | stx %g2, [%g3] | |
74 | !===================== | |
75 | ||
76 | ||
77 | !===================== | |
78 | ! Now some NC writes and reads | |
79 | !===================== | |
80 | mov %g0, %g4 | |
81 | set 0x1, %g2 | |
82 | set 0x10, %g5 | |
83 | ||
84 | cas [%g3], %g0, %g2 | |
85 | ldstub [%g3], %g2 | |
86 | swap [%g3], %g2 | |
87 | prefetch [%g3], #n_writes | |
88 | ||
89 | ba normal_end | |
90 | nop | |
91 | ||
92 | normal_end: | |
93 | ta T_GOOD_TRAP | |
94 | bad_end: | |
95 | ta T_BAD_TRAP | |
96 | ||
97 | user_text_end: | |
98 | ||
99 | /*********************************************************************** | |
100 | Test case data start | |
101 | ***********************************************************************/ | |
102 | .data | |
103 | user_data_start: | |
104 | .skip 1000 | |
105 | user_data_end: | |
106 | ||
107 | SECTION .MY_HYP_SEC TEXT_VA = 0x1100150000, DATA_VA = 0x1100160000 | |
108 | attr_text { | |
109 | Name=.MY_HYP_SEC, | |
110 | hypervisor | |
111 | } | |
112 | ||
113 | attr_data { | |
114 | Name=.MY_HYP_SEC, | |
115 | hypervisor | |
116 | } | |
117 | ||
118 | .global my_hyp_data | |
119 | .align 0x40 | |
120 | my_hyp_data: | |
121 | .skip 0x200 | |
122 | ||
123 | .end | |
124 | ||
125 | /******* | |
126 | Custom trap handlers | |
127 | *******/ | |
128 | .global data_access_exception_custom_trap | |
129 | data_access_exception_custom_trap: | |
130 | inc %l4 | |
131 | done | |
132 |