Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / arch / error / ncu / n2_err_ncu_peu_piord.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: n2_err_ncu_peu_piord.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 ENABLE_PCIE_LINK_TRAINING
39#define MAIN_PAGE_HV_ALSO
40
41#include "err_defines.h"
42#include "hboot.s"
43#include "peu_defines.h"
44
45
46#define IO_RD_ADDR mpeval((N2_PCIE_BASE_ADDR + (IOCFG_OFFSET_BASE_REG_DATA & 0x7fffffffffffffff)) | IO_ACCESS_PA)
47
48/************************************************************************
49 Test case code start
50 ************************************************************************/
51.text
52.global main
53
54main:
55 ta T_CHANGE_HPRIV
56 nop
57
58clear_esr_first:
59 setx SOC_ESR_REG, %l7, %i0
60 stx %g0, [%i0]
61
62set_ejr:
63 set 0x1, %i1
64 sllx %i1, ERR_FIELD, %i2
65 setx SOC_EJR_REG, %l7, %i3
66 stx %i2, [%i3]
67 membar 0x40
68
69pio:
70 ! select an IO address in PCI address range and transmit the command to NCU
71 setx IO_RD_ADDR, %g1, %g2
72
73 ! load byte - all byte offsets within an octlet
74 ldub [%g2 + 1*8 + 0], %l0
75
76 setx 0x40, %l1, %g4
77delay_loop:
78 nop
79 nop
80 nop
81 nop
82 dec %g4
83 brnz %g4, delay_loop
84 nop
85
86
87
88 /******************************
89 Error Check
90 ******************************/
91read_esr:
92 setx SOC_ESR_REG, %l7, %i0
93 ldx [%i0], %i1
94 nop
95
96 setx 0x8000000000000000, %l7, %o3 !valid bit
97 set 0x1, %i2
98 sllx %i2, ERR_FIELD, %i3
99 or %i3, %o3, %i4
100 sub %i1, %i4, %i5
101 brnz %i5, test_failed
102 nop
103 /********************************/
104
105test_passed:
106 EXIT_GOOD
107
108test_failed:
109 EXIT_BAD
110
111/************************************************************************
112 Test case data start
113************************************************************************/
114
115SECTION .DATA DATA_VA=IO_RD_ADDR
116attr_data {
117 Name = .DATA,
118 hypervisor,
119 compressimage
120}
121
122.data
123 .xword 0xdeadbeefdeadbeef
124
125 .xword 0x1101010101010101
126 .xword 0x0122010101010101
127 .xword 0x0101330101010101
128 .xword 0x0101014401010101
129 .xword 0x0101010155010101
130 .xword 0x0101010101660101
131 .xword 0x0101010101017701
132 .xword 0x0101010101010188
133
134 .xword 0x1122010101010101
135 .xword 0x0101334401010101
136 .xword 0x0101010155660101
137 .xword 0x0101010101017788
138
139 .xword 0x1122334401010101
140 .xword 0x0101010155667788
141
142 .xword 0xdeadbeefdeadbeef
143
144/************************************************************************/