Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / verif / diag / assembly / peu / PCIeCFGRd.s
CommitLineData
86530b38
AT
1/*
2* ========== Copyright Header Begin ==========================================
3*
4* OpenSPARC T2 Processor File: PCIeCFGRd.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_NUCLEUS_ALSO */ /* Access main in priviledge mode */
40#define MAIN_PAGE_HV_ALSO
41
42#include "hboot.s"
43#include "peu_defines.h"
44
45!#define CFG0_RD_ADDR mpeval(N2_PCIE_BASE_ADDR + (IOCFG_OFFSET_BASE_REG_DATA & 0x7fffffffffffffff),16,16)
46#define CFG0_RD_ADDR N2_PCIE_BASE_ADDR
47!#define CFG1_RD_ADDR mpeval(CFG0_RD_ADDR + CFG1_ACCESS_PA,16,16)
48#define CFG1_RD_ADDR mpeval(CFG0_RD_ADDR + CFG1_ACCESS_PA)
49
50/************************************************************************
51 Test case code start
52 ************************************************************************/
53.text
54.global main
55
56main:
57 ta T_CHANGE_HPRIV
58 nop
59
60XmtCmd:
61 ! select a CFG0 address in PCI address range and transmit the command to NCU
62/**************************
63 ! load byte
64 setx CFG0_RD_ADDR, %g1, %g2
65 ldub [%g2], %l0
66
67 ! load half-word
68 setx CFG0_RD_ADDR, %g1, %g2
69 lduh [%g2], %l0
70
71 ! Load word
72 setx CFG0_RD_ADDR, %g1, %g2
73 lduw [%g2], %l1
74***************************/
75 ! select a CFG1 address in PCI address range and transmit the command to NCU
76 setx CFG1_RD_ADDR, %g1, %g2
77
78 ! load byte - all byte offsets within an octlet
79 ldub [%g2 + 1*8 + 0], %l0
80 ldub [%g2 + 2*8 + 1], %l1
81 ldub [%g2 + 3*8 + 2], %l2
82 ldub [%g2 + 4*8 + 3], %l3
83 ldub [%g2 + 5*8 + 4], %l4
84 ldub [%g2 + 6*8 + 5], %l5
85 ldub [%g2 + 7*8 + 6], %l6
86 ldub [%g2 + 8*8 + 7], %l7
87
88 ! load half-word - all half-word offsets within an octlet
89 lduh [%g2 + 9*8 + 0], %o0
90 lduh [%g2 + 10*8 + 2], %o1
91 lduh [%g2 + 11*8 + 4], %o2
92 lduh [%g2 + 12*8 + 6], %o3
93
94 ! Load word - all word offsets within an octlet
95 lduw [%g2 + 13*8 + 0], %o4
96 lduw [%g2 + 14*8 + 4], %o5
97
98
99test_passed:
100 EXIT_GOOD
101
102test_failed:
103 EXIT_BAD
104
105
106/************************************************************************
107 Test case data start
108************************************************************************/
109
110SECTION .DATA1 DATA_VA=CFG0_RD_ADDR
111attr_data {
112 Name = .DATA1,
113 hypervisor,
114 compressimage
115}
116
117.data
118 .word 0xaabbccdd
119 .word 0x66778899
120
121SECTION .DATA2 DATA_VA=CFG1_RD_ADDR
122attr_data {
123 Name = .DATA2,
124 hypervisor,
125 compressimage
126}
127
128.data
129 .xword 0xdeadbeefdeadbeef
130
131 .xword 0x1101010101010101
132 .xword 0x0122010101010101
133 .xword 0x0101330101010101
134 .xword 0x0101014401010101
135 .xword 0x0101010155010101
136 .xword 0x0101010101660101
137 .xword 0x0101010101017701
138 .xword 0x0101010101010188
139
140 .xword 0x1122010101010101
141 .xword 0x0101334401010101
142 .xword 0x0101010155660101
143 .xword 0x0101010101017788
144
145 .xword 0x1122334401010101
146 .xword 0x0101010155667788
147
148 .xword 0xdeadbeefdeadbeef
149
150/************************************************************************/