Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / include / mcu_init.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: mcu_init.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 H_HT0_Watchdog_Reset_0x02
39#define My_HT0_Watchdog_Reset_0x02 \
40 ta T_BAD_TRAP; \
41 nop
42#define My_RED_Mode_Other_Reset \
43 ta T_BAD_TRAP; \
44 nop
45
46#define H_HT0_Hw_Corrected_Error_0x63
47#define SUN_H_HT0_Hw_Corrected_Error_0x63 \
48 setx My_H_HT0_Hw_Corrected_Error_0x63, %g1, %g2;\
49 jmp %g2;\
50 nop
51
52#define H_HT0_Sw_Recoverable_Error_0x40
53#define SUN_H_HT0_Sw_Recoverable_Error_0x40 \
54 setx My_H_HT0_Sw_Recoverable_Error_0x40, %g1, %g2;\
55 jmp %g2;\
56 nop
57
58#define H_HT0_Instruction_access_error_0x0a
59#define SUN_H_HT0_Instruction_access_error_0x0a \
60 setx My_H_HT0_Instruction_access_error_0x0a, %g1, %g2;\
61 jmp %g2;\
62 nop
63
64#define H_HT0_Data_access_error_0x32
65#define SUN_H_HT0_Data_access_error_0x32 \
66 setx My_H_HT0_Data_access_error_0x32, %g1, %g2;\
67 jmp %g2;\
68 nop
69
70!#define H_HT0_Instruction_Access_MMU_Error_0x71
71!#define SUN_H_HT0_Instruction_Access_MMU_Error_0x71 \
72! setx My_H_HT0_Instruction_Access_MMU_Error_0x71, %g1, %g2;\
73! jmp %g2;\
74! nop
75!
76!#define H_HT0_Data_Access_MMU_Error_0x72
77!#define SUN_H_HT0_Data_Access_MMU_Error_0x72 \
78! setx My_H_HT0_Data_Access_MMU_Error_0x72, %g1, %g2;\
79! jmp %g2;\
80! nop
81
82
83#define MAIN_PAGE_NUCLEUS_ALSO
84#define MAIN_PAGE_HV_ALSO
85
86#define L2_ESR_WRITE_1_TO_CLEAR 0xc03ffffc00000000
87#define L2_NOTDATA_REGISTER_WRITE_1_TO_CLEAR 0x000b000000000000
88#define L2_CONTROL_REGISTER 0xa900000000
89#define L2_ERROR_ENABLE_REGISTER 0xaa00000000
90#define L2_ERROR_STATUS_REGISTER 0xab00000000
91#define L2_LAST_ERROR_STATUS_REGISTER 0xab000001c0
92#define L2_ERROR_ADDRESS_REGISTER 0xac00000000
93#define L2_NOTDATA_REGISTER 0xae00000000
94
95#define DRAM_ESR_WRITE_1_TO_CLEAR 0xffc0000000000000
96#define DRAM_SCRUB_FREQ_REG 0x8400000018
97#define DRAM_SCRUB_ENABLE_REG 0x8400000040
98#define DRAM_ERROR_STATUS_REGISTER 0x8400000280
99#define DRAM_ERROR_ADDRESS_REGISTER 0x8400000288
100#define DRAM_ERROR_INJECTION_REG 0x8400000290
101#define DRAM_ERROR_RETRY_REGISTER 0x84000002a8
102#define DRAM_FBD_ERROR_SYNDROME_REGISTER 0x8400000c00
103
104#define PREFETCH_ICE_BASE_ADDRESS 0x6000000000
105#define VALID_BIT 0x8000000000
106#define MYDATA 0xdeadbeefdeadbeef
107
108
109#include "hboot.s"
110#include "asi_s.h"
111#include "err_defines.h"
112
113
114.text
115.global main
116
117.global My_H_HT0_Hw_Corrected_Error_0x63
118.global My_H_HT0_Sw_Recoverable_Error_0x40
119.global My_H_HT0_Instruction_access_error_0x0a
120.global My_H_HT0_Data_access_error_0x32
121!.global My_H_HT0_Instruction_Access_MMU_Error_0x71
122!.global My_H_HT0_Data_Access_MMU_Error_0x72
123
124
125
126!******************* BEGIN OF TEST ********************
127
128main:
129 ta T_CHANGE_HPRIV
130
131disable_L1_d_cache:
132 ldxa [%g0] 0x45, %l0
133 andn %l0, 0x2, %l0
134 stxa %l0, [%g0] 0x45
135
136L2_direct_mapped_mode:
137 setx L2_CONTROL_REGISTER, %l0, %g3
138 mov 2, %g1
139 mov 8, %g2
1401:
141 stx %g1, [%g3]
142 add %g3, 0x40, %g3
143 dec %g2
144 brnz %g2,1b
145 nop
146
147report_error_from_L2_to_core:
148 setx L2_ERROR_ENABLE_REGISTER, %l0, %g3
149 mov 3, %g1
150 mov 8, %g2
1511:
152 ldx [%g3], %g4
153 or %g4, %g1, %g4
154 stx %g4, [%g3]
155 add %g3, 0x40, %g3
156 dec %g2
157 brnz %g2,1b
158 nop
159
160start_diag:
161 clr %o7
162